SetOption19 On… that enables MQTT discovery. It’s a once off.
Setting it again no doubt prompts the status command to be sent.
Try these commands…
SwitchRetain 0
ButtonRetain 0
PowerOnState 3
PowerRetain 1
SensorRetain 1
They will be remembered and only need executing once.
Also if you use MQTT explorer, you should see the messages in the broker.
I also have this automation:
- id: '1532478833428'
alias: Power State Tasmota on HA Start-Up
trigger:
- event: start
platform: homeassistant
action:
- service: script.turn_on
data:
entity_id: script.startupalltasmota
And the script
startupalltasmota:
alias: Tasmota Restore State at Startup
sequence:
- data:
payload: ''
topic: sonoffs/cmnd/state
service: mqtt.publish
Which makes Tasmota send the state to HA on HA startup. In my case for my Temperature/pressure/humidity sensors I needed SensorRetain On as per above otherwise it took a while to publish to HA…
Are you sending any other commands or anything to your devices that might cause discovery to be disabled?
Even those automations and scripts won’t help if it’s wifi issue but the retain settings should fix that anyway.