Hi everybody,
I just recently switched from using my tasmota
flashed devices via mqtt
to their native Home Assistant protocol.
I did so by typing SetOption19 1
in the terminal; each of those devices is running tasmota v > 7
, so this should be fine (I believe the feature was introduced in version 6.3 or similar). All the devices show up in Home Assistant and I can control them (switch on/off) and read their stats (i.e. energy consumption).
However, it seems like those devices are gone when I restart Home Assistant. I restarted last night (home server reboot due to unrelated problems with another app) and at first, things went fine. For example, I started the bedroom fan when going to bed and set a timer. The fan was still on this morning, so I investigated. I was not able to control the fan via alexa, and it was gone in lovelace (I use custom:button-cards
for my main homeview lovelace, and in the place where the fan would be was just an empty card). It gets weirder. I was able to control the fan just fine via tasmota webUI (toggle on/off).
The console showed that the device was still using the correct topic for Home Assistant discovery, for example tasmota-9B8A3/tele/HASS_STATE
. So no problem there. I could also not detect anything wrong with mqtt. So I typed SetOption19 1
once more into the console - and the device was right back in Home Assistant.
How is this possible? I have this problem with almost all tasmota devices at the moment. When I just type SetOption19
, it will return SetOption19 1
(or ON), indicating that, indeed, Home Assistant discovery is still enabled. However, until I re-enabled this already enabled feature manually, they will not show up in Home Assistant.
I can think of three options:
- go back to manual mqtt for each device; while this should work, it is a big pain, for example, all energy measuring devices need multiple sensors that I’d have to set up per device, which is a lot of woring even when using yaml anchords
- try restarting Home Assistant less, then always manually re-enabling SetOption19 (obviously very annoying option)
- I have an existing automation prompting all tasmota devices for their status upon starting Home Assistant; I could alter this script so that it would send payload
1
totasmota/cmnd/setoption19
(which is the group topic for all tasmota devices) upon (re)starting Home Assistant
While option 3 seems the most sensible to me at the moment, I don’t like it. This should work, and I believe it did work just fine until recently, so sending repetitive payloads is something I’d like to avoid. My Home Assistant configuration is not at the point where everything works as I want it to (meaning I constantly add new features, which I have to test multiple times in the process), which means that there are days where I restart Home Assistant multiple times per hour. I am not quite sure, but I believe the tasmota devices restart when you enable SetOption19
, which would mean that each device would restart multiple times per day when I am testing and therefore constantly restarting Home Assistant.
Until just recently, I had sleep 0
on all my tasmota devices, which means they don’t go into deep sleep mode, which is supposed to conserve some energy. Now that I had the native Home Assistant support enabled, I also tested sleep 50
, which means all devices go to sleep for 50 milliseconds constantly. This is, however, a value that should work just fine (I believe 50 is even the value set when using the pre-build binaries), so it should not do any harm. I will revert back to sleep 0
for now, but I doubt (or hope?) that this has nothing to do with the problem described above.
Any advice how I can fix this? Excepts for some LEDs, all my Christmas automations are done by tasmota relays as well, and currently none of them work due to this problem.
Thank you for your ideas