MQTT State not updating

I’ve just been through a fresh install of Hassio 64bit on a Pi3 B+. I had my YAML files from before and have got HA to a similar state to where it was before. The issue i’m having is with my existing Tasmota devices, the device state is not being updated after HA reboot. This is not the case for my Espurna devices so i’m wondering if it’s a QOS type of issue. Has anyone experienced this problem?

Edit: sentence structure and wording.

Do your tasmota devices publish with the retain flag set?

If you have reinstalled the mosquitto broker, it will have a new database, so any retained messages will have been lost.

I wish i could tell you but i don’t know. I’m presuming not though? Can you point me to some literature for me please.

Here’s my switches.yaml setting, each switch is configured the same;

- platform: mqtt
  name: "Office_Lights"
  state_topic: "stat/sonoff/Office_Lights/POWER"
  command_topic: "cmnd/sonoff/Office_Lights/POWER"
  payload_on: "ON"
  payload_off: "OFF"
  optimistic: false
  qos: 0
  retain: true

I will have a look to see if the sonoff needs a configuration change to allow it to retain the state.

reading through this at the moment which looks to answer the question;

http://www.thesmarthomehookup.com/end-random-ghost-switching-for-good-by-fixing-your-retain-settings-in-tasmota-and-home-assistant/

1 Like