From 1ff49f94aff7ee7bcbb968a7855eb51cd3d676ae Mon Sep 17 00:00:00 2001 From: Phill Kelley <34226495+Paraphraser@users.noreply.github.com> Date: Tue, 17 Mar 2026 20:00:13 +1100 Subject: [PATCH] 2026-03-17 GoSungrow default_entity_id for HA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Home Assistant has been logging errors with the following pattern: ``` The configuration for entity «thing» uses the deprecated option 'object_id' to set the default entity id. Replace the "object_id": "«value»"' option with "default_entity_id": "«value»" in your published discovery configuration to fix this issue, or contact the maintainer of the integration that published this config to fix this. This will stop working in Home Assistant Core 2026.4 ``` [This post](https://community.home-assistant.io/t/mqtt-discovery-information-not-correctly-interpreted/976459/9) says that, rather than **replacing** `object_id`, one way to deal with this problem is to **add** the `default_entity_id` key to the MQTT JSON. My testing shows this is correct. Adding the key has the desired effect of silencing the log messages from Home Assistant, whilst maintaining compatibility for anyone else who may be using GoSungrow in other contexts where downstream processing may assume that `object_id` just won't up and vanish someday to suit the whim of another ecosystem. I have a simple Sungrow environment (SG5.0RS plus meter plus comms) so I can't claim that the patches proposed in this PR, which do work for me, will necessarily work in all environments. The approach I adopted was to observe that, whenever the 'object_id' key was present in an MQTT message, the `unique_id` key was also present, and the two had the same value. I augmented each such instance with the `default_entity_id` key. If anyone comes across situations where Home Assistant is still complaining then please comment on this PR and I will endeavour to nail the sucker. I have updated [the gist](https://gist.github.com/Paraphraser/cad3b0aa6428c58ee87bc835ac12ed37) to remove part 2 (the triamazikamno binaries and associated Docker images won't work post Home Assistant Core 2026.4). I have rewritten part 5 accordingly. Fixes: #142 #143 Signed-off-by: Phill Kelley <34226495+Paraphraser@users.noreply.github.com> --- cmdHassio/alarm_control_panel.go | 4 ++++ cmdHassio/alarm_control_panel.txt | 3 +++ cmdHassio/binary_sensor.go | 4 ++++ cmdHassio/binary_sensor.txt | 3 +++ cmdHassio/button.go | 4 ++++ cmdHassio/button.txt | 3 +++ cmdHassio/camera.go | 4 ++++ cmdHassio/camera.txt | 3 +++ cmdHassio/climate.go | 4 ++++ cmdHassio/climate.txt | 3 +++ cmdHassio/cover.go | 4 ++++ cmdHassio/cover.txt | 3 +++ cmdHassio/device_tracker.go | 4 ++++ cmdHassio/device_tracker.txt | 3 +++ cmdHassio/fan.go | 4 ++++ cmdHassio/fan.txt | 3 +++ cmdHassio/humidifier.go | 4 ++++ cmdHassio/humidifier.txt | 3 +++ cmdHassio/lights.go | 4 ++++ cmdHassio/lights.txt | 3 +++ cmdHassio/lock.go | 4 ++++ cmdHassio/lock.txt | 3 +++ cmdHassio/number.go | 4 ++++ cmdHassio/number.txt | 3 +++ cmdHassio/scene.go | 4 ++++ cmdHassio/scene.txt | 3 +++ cmdHassio/select.go | 4 ++++ cmdHassio/select.txt | 3 +++ cmdHassio/sensors.go | 4 ++++ cmdHassio/sensors.txt | 3 +++ cmdHassio/siren.go | 4 ++++ cmdHassio/siren.txt | 3 +++ cmdHassio/switch.go | 4 ++++ cmdHassio/switch.txt | 3 +++ cmdHassio/text.go | 4 ++++ cmdHassio/text.txt | 3 +++ cmdHassio/update.go | 4 ++++ cmdHassio/update.txt | 3 +++ cmdHassio/vacuum.go | 4 ++++ cmdHassio/vacuum.txt | 3 +++ 40 files changed, 140 insertions(+) diff --git a/cmdHassio/alarm_control_panel.go b/cmdHassio/alarm_control_panel.go index a74df1da1..12428f40d 100644 --- a/cmdHassio/alarm_control_panel.go +++ b/cmdHassio/alarm_control_panel.go @@ -29,6 +29,7 @@ func (m *Mqtt) AlarmControlPanelPublishConfig(config EntityConfig) error { // StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"), CommandTopic: String(JoinStringsForTopic(m.Prefix, LabelAlarmControlPanel, m.ClientId, id, "cmd")), ObjectId: String(id), + DefaultEntityID: String(id), UniqueId: String(id), Qos: 0, Retain: true, @@ -157,6 +158,9 @@ type AlarmControlPanel struct { // Used instead of name for automatic generation of entity_id ObjectId String `json:"object_id,omitempty"` + // Alternate for ObjectId required by Home Assistant + DefaultEntityID String `json:"default_entity_id,omitempty"` + // The payload to set armed-away mode on your Alarm Panel. PayloadArmAway String `json:"payload_arm_away,omitempty" default:"ARM_AWAY"` diff --git a/cmdHassio/alarm_control_panel.txt b/cmdHassio/alarm_control_panel.txt index 30339b611..cc987df27 100644 --- a/cmdHassio/alarm_control_panel.txt +++ b/cmdHassio/alarm_control_panel.txt @@ -97,6 +97,9 @@ The name of the alarm. object_id string (optional) Used instead of name for automatic generation of entity_id +default_entity_id string (optional) +Used instead of name for automatic generation of entity_id - alternate for homeassistant + payload_arm_away string (optional, default: ARM_AWAY) The payload to set armed-away mode on your Alarm Panel. diff --git a/cmdHassio/binary_sensor.go b/cmdHassio/binary_sensor.go index 70e316112..4c8332640 100644 --- a/cmdHassio/binary_sensor.go +++ b/cmdHassio/binary_sensor.go @@ -50,6 +50,7 @@ func (m *Mqtt) BinarySensorPublishConfig(config EntityConfig) error { StateTopic: String(JoinStringsForTopic(m.Prefix, LabelBinarySensor, m.ClientId, id, "state")), // StateClass: config.StateClass, ObjectId: String(id), + DefaultEntityID: String(id), UniqueId: String(id), // UnitOfMeasurement: config.Units, DeviceClass: DeviceClass(config.DeviceClass), @@ -179,6 +180,9 @@ type BinarySensor struct { // Used instead of name for automatic generation of entity_id ObjectId String `json:"object_id,omitempty"` + // Alternate for ObjectId required by Home Assistant + DefaultEntityID String `json:"default_entity_id,omitempty"` + // For sensors that only send on state updates (like PIRs), this variable sets a delay in seconds after which the sensor’s state will be updated back to off. OffDelay Integer `json:"off_delay,omitempty"` diff --git a/cmdHassio/binary_sensor.txt b/cmdHassio/binary_sensor.txt index e5c633cdf..76999aecf 100644 --- a/cmdHassio/binary_sensor.txt +++ b/cmdHassio/binary_sensor.txt @@ -88,6 +88,9 @@ The name of the binary sensor. object_id string (optional) Used instead of name for automatic generation of entity_id +default_entity_id string (optional) +Used instead of name for automatic generation of entity_id - alternate for homeassistant + off_delay integer (optional) For sensors that only send on state updates (like PIRs), this variable sets a delay in seconds after which the sensor’s state will be updated back to off. diff --git a/cmdHassio/button.go b/cmdHassio/button.go index ed2a275f5..edc1b4fba 100644 --- a/cmdHassio/button.go +++ b/cmdHassio/button.go @@ -29,6 +29,7 @@ func (m *Mqtt) ButtonPublishConfig(config EntityConfig) error { // StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"), CommandTopic: String(JoinStringsForTopic(m.Prefix, LabelButton, m.ClientId, id, "cmd")), ObjectId: String(id), + DefaultEntityID: String(id), UniqueId: String(id), Qos: 0, Retain: true, @@ -127,6 +128,9 @@ type Button struct { // Used instead of name for automatic generation of entity_id ObjectId String `json:"object_id,omitempty"` + // Alternate for ObjectId required by Home Assistant + DefaultEntityID String `json:"default_entity_id,omitempty"` + // The payload that represents the available state. PayloadAvailable String `json:"payload_available,omitempty" default:"online"` diff --git a/cmdHassio/button.txt b/cmdHassio/button.txt index c6fd1ed07..379c1b61c 100644 --- a/cmdHassio/button.txt +++ b/cmdHassio/button.txt @@ -88,6 +88,9 @@ The name to use when displaying this button. object_id string (optional) Used instead of name for automatic generation of entity_id +default_entity_id string (optional) +Used instead of name for automatic generation of entity_id - alternate for homeassistant + payload_available string (optional, default: online) The payload that represents the available state. diff --git a/cmdHassio/camera.go b/cmdHassio/camera.go index e0505d7c7..60fb2fdd6 100644 --- a/cmdHassio/camera.go +++ b/cmdHassio/camera.go @@ -29,6 +29,7 @@ func (m *Mqtt) CameraPublishConfig(config EntityConfig) error { // StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"), // CommandTopic: String(JoinStringsForTopic(m.switchPrefix, id, "cmd")), ObjectId: String(id), + DefaultEntityID: String(id), UniqueId: String(id), // Qos: 0, // Retain: true, @@ -127,6 +128,9 @@ type Camera struct { // Used instead of name for automatic generation of entity_id ObjectId String `json:"object_id,omitempty"` + // Alternate for ObjectId required by Home Assistant + DefaultEntityID String `json:"default_entity_id,omitempty"` + // The MQTT topic to subscribe to. Topic String `json:"topic,omitempty" required:"true"` diff --git a/cmdHassio/camera.txt b/cmdHassio/camera.txt index 167b08bcb..9d40912ec 100644 --- a/cmdHassio/camera.txt +++ b/cmdHassio/camera.txt @@ -82,6 +82,9 @@ The name of the camera. object_id string (optional) Used instead of name for automatic generation of entity_id +default_entity_id string (optional) +Used instead of name for automatic generation of entity_id - alternate for homeassistant + topic string REQUIRED The MQTT topic to subscribe to. diff --git a/cmdHassio/climate.go b/cmdHassio/climate.go index 5220189da..2bec7656b 100644 --- a/cmdHassio/climate.go +++ b/cmdHassio/climate.go @@ -29,6 +29,7 @@ func (m *Mqtt) ClimatePublishConfig(config EntityConfig) error { // StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"), // CommandTopic: String(JoinStringsForTopic(m.switchPrefix, id, "cmd")), ObjectId: String(id), + DefaultEntityID: String(id), UniqueId: String(id), Qos: 0, Retain: true, @@ -185,6 +186,9 @@ type Climate struct { // Used instead of name for automatic generation of entity_id ObjectId String `json:"object_id,omitempty"` + // Alternate for ObjectId required by Home Assistant + DefaultEntityID String `json:"default_entity_id,omitempty"` + // The payload that represents the available state. PayloadAvailable String `json:"payload_available,omitempty" default:"online"` diff --git a/cmdHassio/climate.txt b/cmdHassio/climate.txt index 812ea190b..a12bdf161 100644 --- a/cmdHassio/climate.txt +++ b/cmdHassio/climate.txt @@ -141,6 +141,9 @@ The name of the HVAC. object_id string (optional) Used instead of name for automatic generation of entity_id +default_entity_id string (optional) +Used instead of name for automatic generation of entity_id - alternate for homeassistant + payload_available string (optional, default: online) The payload that represents the available state. diff --git a/cmdHassio/cover.go b/cmdHassio/cover.go index 357518fdd..d4e01948b 100644 --- a/cmdHassio/cover.go +++ b/cmdHassio/cover.go @@ -30,6 +30,7 @@ func (m *Mqtt) CoverPublishConfig(config EntityConfig) error { // StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"), CommandTopic: String(JoinStringsForTopic(m.Prefix, LabelCover, m.ClientId, id, "cmd")), ObjectId: String(id), + DefaultEntityID: String(id), UniqueId: String(id), Qos: 0, Retain: true, @@ -130,6 +131,9 @@ type Cover struct { // Used instead of name for automatic generation of entity_id ObjectId String `json:"object_id,omitempty"` + // Alternate for ObjectId required by Home Assistant + DefaultEntityID String `json:"default_entity_id,omitempty"` + // Flag that defines if switch works in optimistic mode. Optimistic Boolean `json:"optimistic,omitempty"` diff --git a/cmdHassio/cover.txt b/cmdHassio/cover.txt index b5acbd63b..0b5d3a817 100644 --- a/cmdHassio/cover.txt +++ b/cmdHassio/cover.txt @@ -85,6 +85,9 @@ The name of the cover. object_id string (optional) Used instead of name for automatic generation of entity_id +default_entity_id string (optional) +Used instead of name for automatic generation of entity_id - alternate for homeassistant + optimistic boolean (optional) Flag that defines if switch works in optimistic mode. diff --git a/cmdHassio/device_tracker.go b/cmdHassio/device_tracker.go index 5edb5004b..26a40401b 100644 --- a/cmdHassio/device_tracker.go +++ b/cmdHassio/device_tracker.go @@ -29,6 +29,7 @@ func (m *Mqtt) DeviceTrackerPublishConfig(config EntityConfig) error { // StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"), // CommandTopic: String(JoinStringsForTopic(m.switchPrefix, id, "cmd")), ObjectId: String(id), + DefaultEntityID: String(id), UniqueId: String(id), Qos: 0, // Retain: true, @@ -114,6 +115,9 @@ type DeviceTracker struct { // Used instead of name for automatic generation of entity_id ObjectId String `json:"object_id,omitempty"` + // Alternate for ObjectId required by Home Assistant + DefaultEntityID String `json:"default_entity_id,omitempty"` + // The payload that represents the available state. PayloadAvailable String `json:"payload_available,omitempty" default:"online"` diff --git a/cmdHassio/device_tracker.txt b/cmdHassio/device_tracker.txt index 31e41bb65..12b7260b5 100644 --- a/cmdHassio/device_tracker.txt +++ b/cmdHassio/device_tracker.txt @@ -70,6 +70,9 @@ The name of the MQTT device_tracker. object_id string (optional) Used instead of name for automatic generation of entity_id +default_entity_id string (optional) +Used instead of name for automatic generation of entity_id - alternate for homeassistant + payload_available string (optional, default: online) The payload that represents the available state. diff --git a/cmdHassio/fan.go b/cmdHassio/fan.go index 607a37722..68e1915e2 100644 --- a/cmdHassio/fan.go +++ b/cmdHassio/fan.go @@ -29,6 +29,7 @@ func (m *Mqtt) FanPublishConfig(config EntityConfig) error { // StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"), CommandTopic: String(JoinStringsForTopic(m.Prefix, LabelFan, m.ClientId, id, "cmd")), ObjectId: String(id), + DefaultEntityID: String(id), UniqueId: String(id), Qos: 0, Retain: true, @@ -129,6 +130,9 @@ type Fan struct { // Used instead of name for automatic generation of entity_id ObjectId String `json:"object_id,omitempty"` + // Alternate for ObjectId required by Home Assistant + DefaultEntityID String `json:"default_entity_id,omitempty"` + // Flag that defines if fan works in optimistic mode Optimistic Boolean `json:"optimistic,omitempty"` diff --git a/cmdHassio/fan.txt b/cmdHassio/fan.txt index 6b947afc3..e1b2aa8e5 100644 --- a/cmdHassio/fan.txt +++ b/cmdHassio/fan.txt @@ -85,6 +85,9 @@ The name of the fan. object_id string (optional) Used instead of name for automatic generation of entity_id +default_entity_id string (optional) +Used instead of name for automatic generation of entity_id - alternate for homeassistant + optimistic boolean (optional) Flag that defines if fan works in optimistic mode diff --git a/cmdHassio/humidifier.go b/cmdHassio/humidifier.go index 181fc94ec..684bf230c 100644 --- a/cmdHassio/humidifier.go +++ b/cmdHassio/humidifier.go @@ -29,6 +29,7 @@ func (m *Mqtt) HumidifierPublishConfig(config EntityConfig) error { // StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"), CommandTopic: String(JoinStringsForTopic(m.Prefix, LabelHumidifier, m.ClientId, id, "cmd")), ObjectId: String(id), + DefaultEntityID: String(id), UniqueId: String(id), Qos: 0, Retain: true, @@ -138,6 +139,9 @@ type Humidifier struct { // Used instead of name for automatic generation of entity_id ObjectId String `json:"object_id,omitempty"` + // Alternate for ObjectId required by Home Assistant + DefaultEntityID String `json:"default_entity_id,omitempty"` + // Flag that defines if humidifier works in optimistic mode Optimistic Boolean `json:"optimistic,omitempty"` diff --git a/cmdHassio/humidifier.txt b/cmdHassio/humidifier.txt index 5923cdd52..93a978339 100644 --- a/cmdHassio/humidifier.txt +++ b/cmdHassio/humidifier.txt @@ -94,6 +94,9 @@ The name of the humidifier. object_id string (optional) Used instead of name for automatic generation of entity_id +default_entity_id string (optional) +Used instead of name for automatic generation of entity_id - alternate for homeassistant + optimistic boolean (optional) Flag that defines if humidifier works in optimistic mode diff --git a/cmdHassio/lights.go b/cmdHassio/lights.go index ab01774c0..7509c9a71 100644 --- a/cmdHassio/lights.go +++ b/cmdHassio/lights.go @@ -29,6 +29,7 @@ func (m *Mqtt) PublishLightConfig(config EntityConfig) error { StateTopic: String(JoinStringsForTopic(m.Prefix, LabelLight, m.ClientId, id, "state")), UniqueId: String(id), ObjectId: String(id), + DefaultEntityID: String(id), // StateClass: config.StateClass, // UniqueId: id, @@ -193,6 +194,9 @@ type Light struct { // Used instead of name for automatic generation of entity_id ObjectId String `json:"object_id,omitempty"` + // Alternate for ObjectId required by Home Assistant + DefaultEntityID String `json:"default_entity_id,omitempty"` + // Defines when on the payload_on is sent. Using last (the default) will send any style (brightness, color, etc) topics first and then a payload_on to the command_topic. Using first will send the payload_on and then any style topics. Using brightness will only send brightness commands instead of the payload_on to turn the light on. OnCommandType String `json:"on_command_type,omitempty"` diff --git a/cmdHassio/lights.txt b/cmdHassio/lights.txt index 1bc8ecaf0..cac7af982 100644 --- a/cmdHassio/lights.txt +++ b/cmdHassio/lights.txt @@ -145,6 +145,9 @@ The name of the light. object_id string (optional) Used instead of name for automatic generation of entity_id +default_entity_id string (optional) +Used instead of name for automatic generation of entity_id - alternate for homeassistant + on_command_type string (optional) Defines when on the payload_on is sent. Using last (the default) will send any style (brightness, color, etc) topics first and then a payload_on to the command_topic. Using first will send the payload_on and then any style topics. Using brightness will only send brightness commands instead of the payload_on to turn the light on. diff --git a/cmdHassio/lock.go b/cmdHassio/lock.go index 08b0df66f..a4c098868 100644 --- a/cmdHassio/lock.go +++ b/cmdHassio/lock.go @@ -29,6 +29,7 @@ func (m *Mqtt) LockPublishConfig(config EntityConfig) error { // StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"), CommandTopic: String(JoinStringsForTopic(m.Prefix, LabelLock, m.ClientId, id, "cmd")), ObjectId: String(id), + DefaultEntityID: String(id), UniqueId: String(id), Qos: 0, Retain: true, @@ -126,6 +127,9 @@ type Lock struct { // Used instead of name for automatic generation of entity_id ObjectId String `json:"object_id,omitempty"` + // Alternate for ObjectId required by Home Assistant + DefaultEntityID String `json:"default_entity_id,omitempty"` + // Flag that defines if lock works in optimistic mode. Optimistic Boolean `json:"optimistic,omitempty"` diff --git a/cmdHassio/lock.txt b/cmdHassio/lock.txt index c0c79567e..c9279cfe3 100644 --- a/cmdHassio/lock.txt +++ b/cmdHassio/lock.txt @@ -82,6 +82,9 @@ The name of the lock. object_id string (optional) Used instead of name for automatic generation of entity_id +default_entity_id string (optional) +Used instead of name for automatic generation of entity_id - alternate for homeassistant + optimistic boolean (optional) Flag that defines if lock works in optimistic mode. diff --git a/cmdHassio/number.go b/cmdHassio/number.go index 0d7f5d6da..14ada6d3c 100644 --- a/cmdHassio/number.go +++ b/cmdHassio/number.go @@ -29,6 +29,7 @@ func (m *Mqtt) NumberPublishConfig(config EntityConfig) error { // StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"), CommandTopic: String(JoinStringsForTopic(m.Prefix, LabelNumber, m.ClientId, id, "cmd")), ObjectId: String(id), + DefaultEntityID: String(id), UniqueId: String(id), Qos: 0, Retain: true, @@ -138,6 +139,9 @@ type Number struct { // Used instead of name for automatic generation of entity_id ObjectId String `json:"object_id,omitempty"` + // Alternate for ObjectId required by Home Assistant + DefaultEntityID String `json:"default_entity_id,omitempty"` + // Flag that defines if number works in optimistic mode. Optimistic Boolean `json:"optimistic,omitempty"` diff --git a/cmdHassio/number.txt b/cmdHassio/number.txt index d9f2126fd..ddcc6a572 100644 --- a/cmdHassio/number.txt +++ b/cmdHassio/number.txt @@ -91,6 +91,9 @@ The name of the Number. object_id string (optional) Used instead of name for automatic generation of entity_id +default_entity_id string (optional) +Used instead of name for automatic generation of entity_id - alternate for homeassistant + optimistic boolean (optional) Flag that defines if number works in optimistic mode. diff --git a/cmdHassio/scene.go b/cmdHassio/scene.go index 49256d599..61a85634c 100644 --- a/cmdHassio/scene.go +++ b/cmdHassio/scene.go @@ -29,6 +29,7 @@ func (m *Mqtt) ScenePublishConfig(config EntityConfig) error { // StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"), CommandTopic: String(JoinStringsForTopic(m.Prefix, LabelScene, m.ClientId, id, "cmd")), ObjectId: String(id), + DefaultEntityID: String(id), UniqueId: String(id), Qos: 0, Retain: true, @@ -114,6 +115,9 @@ type Scene struct { // Used instead of name for automatic generation of entity_id ObjectId String `json:"object_id,omitempty"` + // Alternate for ObjectId required by Home Assistant + DefaultEntityID String `json:"default_entity_id,omitempty"` + // The payload that represents the available state. PayloadAvailable String `json:"payload_available,omitempty" default:"online"` diff --git a/cmdHassio/scene.txt b/cmdHassio/scene.txt index 26fe2a47b..e4edd8a56 100644 --- a/cmdHassio/scene.txt +++ b/cmdHassio/scene.txt @@ -40,6 +40,9 @@ The name to use when displaying this scene. object_id string (optional) Used instead of name for automatic generation of entity_id +default_entity_id string (optional) +Used instead of name for automatic generation of entity_id - alternate for homeassistant + payload_available string (optional, default: online) The payload that represents the available state. diff --git a/cmdHassio/select.go b/cmdHassio/select.go index 3cc6e60d3..d7082b3b5 100644 --- a/cmdHassio/select.go +++ b/cmdHassio/select.go @@ -34,6 +34,7 @@ func (m *Mqtt) SelectPublishConfig(config EntityConfig, fn mqtt.MessageHandler) CommandTemplate: Template(fmt.Sprintf(`{{ value }}`)), CommandTopic: String(cmdTopic), ObjectId: String(id), + DefaultEntityID: String(id), UniqueId: String(id), Qos: 0, Retain: true, @@ -140,6 +141,9 @@ type Select struct { // Used instead of name for automatic generation of entity_id ObjectId String `json:"object_id,omitempty"` + // Alternate for ObjectId required by Home Assistant + DefaultEntityID String `json:"default_entity_id,omitempty"` + // Flag that defines if the select works in optimistic mode. Optimistic Boolean `json:"optimistic,omitempty"` diff --git a/cmdHassio/select.txt b/cmdHassio/select.txt index 6912fbda5..067f57324 100644 --- a/cmdHassio/select.txt +++ b/cmdHassio/select.txt @@ -85,6 +85,9 @@ The name of the Select. object_id string (optional) Used instead of name for automatic generation of entity_id +default_entity_id string (optional) +Used instead of name for automatic generation of entity_id - alternate for homeassistant + optimistic boolean (optional) Flag that defines if the select works in optimistic mode. diff --git a/cmdHassio/sensors.go b/cmdHassio/sensors.go index f424e10b0..f620c1e81 100644 --- a/cmdHassio/sensors.go +++ b/cmdHassio/sensors.go @@ -30,6 +30,7 @@ func (m *Mqtt) SensorPublishConfig(config EntityConfig) error { StateTopic: String(JoinStringsForTopic(m.Prefix, LabelSensor, m.ClientId, id, "state")), StateClass: String(config.StateClass), ObjectId: String(id), + DefaultEntityID: String(id), UniqueId: String(id), UnitOfMeasurement: String(config.Units), DeviceClass: DeviceClass(config.DeviceClass), @@ -145,6 +146,9 @@ type Sensor struct { // Used instead of name for automatic generation of entity_id ObjectId String `json:"object_id,omitempty"` + // Alternate for ObjectId required by Home Assistant + DefaultEntityID String `json:"default_entity_id,omitempty"` + // The payload that represents the available state. PayloadAvailable String `json:"payload_available,omitempty" Default:"online"` diff --git a/cmdHassio/sensors.txt b/cmdHassio/sensors.txt index aa9f03add..02ded8ec6 100644 --- a/cmdHassio/sensors.txt +++ b/cmdHassio/sensors.txt @@ -91,6 +91,9 @@ The name of the MQTT sensor. object_id string (optional) Used instead of name for automatic generation of entity_id +default_entity_id string (optional) +Used instead of name for automatic generation of entity_id - alternate for homeassistant + payload_available string (optional, default: online) The payload that represents the available state. diff --git a/cmdHassio/siren.go b/cmdHassio/siren.go index 8575d1247..1f9ee9132 100644 --- a/cmdHassio/siren.go +++ b/cmdHassio/siren.go @@ -29,6 +29,7 @@ func (m *Mqtt) SirenPublishConfig(config EntityConfig) error { // StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"), CommandTopic: String(JoinStringsForTopic(m.Prefix, LabelSiren, m.ClientId, id, "cmd")), ObjectId: String(id), + DefaultEntityID: String(id), UniqueId: String(id), Qos: 0, Retain: true, @@ -135,6 +136,9 @@ type Siren struct { // Used instead of name for automatic generation of entity_id ObjectId String `json:"object_id,omitempty"` + // Alternate for ObjectId required by Home Assistant + DefaultEntityID String `json:"default_entity_id,omitempty"` + // Flag that defines if siren works in optimistic mode. Optimistic Boolean `json:"optimistic,omitempty"` diff --git a/cmdHassio/siren.txt b/cmdHassio/siren.txt index a28c8926a..672bcddcc 100644 --- a/cmdHassio/siren.txt +++ b/cmdHassio/siren.txt @@ -91,6 +91,9 @@ The name to use when displaying this siren. object_id string (optional) Used instead of name for automatic generation of entity_id +default_entity_id string (optional) +Used instead of name for automatic generation of entity_id - alternate for homeassistant + optimistic boolean (optional) Flag that defines if siren works in optimistic mode. diff --git a/cmdHassio/switch.go b/cmdHassio/switch.go index 120ddc5e1..6400a40c5 100644 --- a/cmdHassio/switch.go +++ b/cmdHassio/switch.go @@ -29,6 +29,7 @@ func (m *Mqtt) SwitchPublishConfig(config EntityConfig) error { StateTopic: String(JoinStringsForTopic(m.Prefix, LabelSwitch, m.ClientId, id, "state")), CommandTopic: String(JoinStringsForTopic(m.Prefix, LabelSwitch, m.ClientId, id, "cmd")), ObjectId: String(id), + DefaultEntityID: String(id), UniqueId: String(id), Qos: 0, Retain: true, @@ -130,6 +131,9 @@ type Switch struct { // Used instead of name for automatic generation of entity_id ObjectId String `json:"object_id,omitempty"` + // Alternate for ObjectId required by Home Assistant + DefaultEntityID String `json:"default_entity_id,omitempty"` + // Flag that defines if switch works in optimistic mode. Optimistic Boolean `json:"optimistic,omitempty"` diff --git a/cmdHassio/switch.txt b/cmdHassio/switch.txt index b7b261dba..bf1770792 100644 --- a/cmdHassio/switch.txt +++ b/cmdHassio/switch.txt @@ -85,6 +85,9 @@ The name to use when displaying this switch. object_id string (optional) Used instead of name for automatic generation of entity_id +default_entity_id string (optional) +Used instead of name for automatic generation of entity_id - alternate for homeassistant + optimistic boolean (optional) Flag that defines if switch works in optimistic mode. diff --git a/cmdHassio/text.go b/cmdHassio/text.go index bebb596c3..f6726d91b 100644 --- a/cmdHassio/text.go +++ b/cmdHassio/text.go @@ -30,6 +30,7 @@ func (m *Mqtt) TextPublishConfig(config EntityConfig) error { // StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"), CommandTopic: String(JoinStringsForTopic(m.Prefix, LabelText, m.ClientId, id, "cmd")), ObjectId: String(id), + DefaultEntityID: String(id), UniqueId: String(id), Qos: 0, Retain: true, @@ -136,6 +137,9 @@ type Text struct { // Used instead of name for automatic generation of entity_id ObjectId String `json:"object_id,omitempty"` + // Alternate for ObjectId required by Home Assistant + DefaultEntityID String `json:"default_entity_id,omitempty"` + // A valid regular expression the text being set or received must match with. Pattern String `json:"pattern,omitempty"` diff --git a/cmdHassio/text.txt b/cmdHassio/text.txt index d13bafd1c..ab0c152ac 100644 --- a/cmdHassio/text.txt +++ b/cmdHassio/text.txt @@ -91,6 +91,9 @@ The name of the text entity. object_id string (optional) Used instead of name for automatic generation of entity_id +default_entity_id string (optional) +Used instead of name for automatic generation of entity_id - alternate for homeassistant + pattern string (optional) A valid regular expression the text being set or received must match with. diff --git a/cmdHassio/update.go b/cmdHassio/update.go index 7b503e017..69f31814d 100644 --- a/cmdHassio/update.go +++ b/cmdHassio/update.go @@ -30,6 +30,7 @@ func (m *Mqtt) UpdatePublishConfig(config EntityConfig) error { // StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"), CommandTopic: String(JoinStringsForTopic(m.Prefix, LabelUpdate, m.ClientId, id, "cmd")), ObjectId: String(id), + DefaultEntityID: String(id), UniqueId: String(id), Qos: 0, Retain: true, @@ -139,6 +140,9 @@ type Update struct { // Used instead of name for automatic generation of entity_id ObjectId String `json:"object_id,omitempty"` + // Alternate for ObjectId required by Home Assistant + DefaultEntityID String `json:"default_entity_id,omitempty"` + // The MQTT payload to start installing process. PayloadInstall String `json:"payload_install,omitempty"` diff --git a/cmdHassio/update.txt b/cmdHassio/update.txt index 7ccaefb8c..6b86633ff 100644 --- a/cmdHassio/update.txt +++ b/cmdHassio/update.txt @@ -94,6 +94,9 @@ The name of the Select. object_id string (optional) Used instead of name for automatic generation of entity_id +default_entity_id string (optional) +Used instead of name for automatic generation of entity_id - alternate for homeassistant + payload_install string (optional) The MQTT payload to start installing process. diff --git a/cmdHassio/vacuum.go b/cmdHassio/vacuum.go index 90e583fbd..ea52eda80 100644 --- a/cmdHassio/vacuum.go +++ b/cmdHassio/vacuum.go @@ -29,6 +29,7 @@ func (m *Mqtt) VacuumPublishConfig(config EntityConfig) error { // StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"), CommandTopic: String(JoinStringsForTopic(m.Prefix, LabelVacuum, m.ClientId, id, "cmd")), ObjectId: String(id), + DefaultEntityID: String(id), UniqueId: String(id), Qos: 0, Retain: true, @@ -130,6 +131,9 @@ type Vacuum struct { // Used instead of name for automatic generation of entity_id ObjectId String `json:"object_id,omitempty"` + // Alternate for ObjectId required by Home Assistant + DefaultEntityID String `json:"default_entity_id,omitempty"` + // The payload that represents the available state. PayloadAvailable String `json:"payload_available,omitempty" default:"online"` diff --git a/cmdHassio/vacuum.txt b/cmdHassio/vacuum.txt index e8665bd33..270873914 100644 --- a/cmdHassio/vacuum.txt +++ b/cmdHassio/vacuum.txt @@ -76,6 +76,9 @@ The name of the vacuum. object_id string (optional) Used instead of name for automatic generation of entity_id +default_entity_id string (optional) +Used instead of name for automatic generation of entity_id - alternate for homeassistant + payload_available string (optional, default: online) The payload that represents the available state.