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.