Tasmota (Mqtt) not update state after HA restart

Hi

I have tasmota switches using mqtt to HA,

if the state of the switch was ON and i reset the HA the HA go up without updating the switch state
so the switch is ON and in HA is OFF.

how i can update switch state each restart ?

1 Like

Does your tasmota send the retain flag?
More infos here: https://github.com/arendst/Tasmota/wiki/PowerOnState-Configuration

Test this automation:

## https://tasmota.github.io/docs/#/integrations/Home-Assistant?id=useful-automations
- alias: "Tasmota power state on HA start-up"
  initial_state: true
  trigger:
    platform: homeassistant
    event: start
  action:
## For manually configured devices
    - service: mqtt.publish
      data:
        topic: "cmnd/tasmotas/state"
        payload: ""
    - service: mqtt.publish
      data:
        topic: cmnd/tasmotas/POWER
## For autodiscovered devices
    - service: mqtt.publish
      data:
        topic: "tasmotas/cmnd/state"
        payload: ""
    - service: mqtt.publish
      data:
        topic: tasmotas/cmnd/POWER

For Tasmota devices running vs 7 and up.

1 Like

I feel like I’m doing something wrong here… I don’t have the tasmotas topic ( I changed it to the name if the switches) but each one is different, and If I make the topic the same for all 3 switches they turn on and off together.
Using Autodiscovery… they work and function fine, just still disappear after reboot, using Tasmota 8.1
Should I be adding a shared “category” of sorts to the “Full Topic”?
Any help would be appreciated.
06 AM
23 AM

grouptopic :

https://tasmota.github.io/docs/#/MQTT?id=grouptopic

Thank you, link doesn’t seem to work but I found the section

For me I ended with cmnd/tasmotas/Restart command with payload 1 sent on HA restart. This makes all tasmota devices restart and update their state in HA. Thanks for pointing to group topic

This kind of automation could be created via UI

1 Like