Tasmota SetOption19 works as expected... until docker is restarted

Tags: #<Tag:0x00007f739584f7c8> #<Tag:0x00007f739584f688>

Hello,

I am running HA along with an MQTT broker on an Ubuntu server via docker, and have recently flashed a number of Tuya based lights over to Tasmota. All the lights are running correctly, and I have run SetOption19 on from the console to make each one discoverable by HA.

This all works great… until I restart docker.

Restarting docker brings everything back up and running, but all the toggle switches for the lights are ‘greyed out’ and I can’t change their states in HA. However, if I power the lights on and off, they will appear again. Same result if I go back to the console and run SetOption19 on again (effectively re-sending the config payload).

I’m hoping that I’ve just overlooked something in the setup and someone can point out what the issue might be… otherwise, I know that setting up the each of light configurations manually works, so that’s always an option I guess.

Thanks for any ideas or help in advance!

Let me guess. You use the ubuntu mosquitto snap as broker ?

I’m running the eclipse-mosquitto docker image.

The broker seems to be running fine after all the docker containers start - I would have thought that once HA had received the initial config from the bulb, that it would remember this on restart (as lights running off manual configs don’t have this issue).

Did you config mosquitto to save the database between restarts ?

Configuration can be changed to:

  • persist data to /mosquitto/data
  • log to /mosquitto/log/mosquitto.log

i.e. add the following to mosquitto.conf :

persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log

Thanks @francisp - I did have the folders mapped correctly, but there was a permissions issue and neither the log or database were being created. Fixed that, and it’s working as expected.

Cheers.