I’m having an issue when reloading manually configured MQTT entities that is, if an entity was previously on
, it will go from on
→ unavailable
(expected during the reload) → off
(for less than a second) → on
(state before the reload).
This is causing me an issue since I have automations that trigger based on the transition from off
to on
of these entities and the reload always trigger those automations.
This happens both with Shelly with stock firmware as well as some led strips flashed with Tasmota.
Example:
I have an automation that triggers on restarts and reloads that forces Shellies and Tasmotas to publish their current state:
- id: 'mqtt_discovery'
alias: 'MQTT Discovery'
trigger:
- platform: homeassistant
event: start
- platform: event
event_type: event_mqtt_reloaded
- platform: time
at: '21:00:00'
action:
- service: mqtt.publish
data: # Shellies Publish State
topic: 'shellies/command'
payload: 'update'
- service: mqtt.publish
data: # Shellies Publish Attributes
topic: 'shellies/command'
payload: 'announce'
- service: mqtt.publish
data: # Tasmotas Publish State
topic: 'cmnd/tasmotas/POWER0'
- service: mqtt.publish
data: # Tasmotas Publish Attributes
topic: 'cmnd/tasmotas/STATUS0'
I’ve also confirmed manually via mosquitto_sub
that I’m not receiving any off
message on the entity topic, so this must be Home Assistant that is assuming this off
state.