enesbcs / shellyteacher4domo

Shelly device teacher for Domoticz MQTT Autodiscovery hardware
Apache License 2.0
10 stars 4 forks source link

Retain #25

Closed Jacobsentertainment closed 1 year ago

Jacobsentertainment commented 1 year ago

Hello all,

Currently, I am not quite convinced that this upgrade is better than the previous shelly mqtt. But I definitely want to give it a try! I have added shelly devices and they work. In the trainer4domoticz settings.py "retain = true". And in the mosquitto "persistence true" & "persistence_location /var/lib/mosquitto/" So this should all be fine.

After a reboot, the devices are still available in domoticz, but not functional. I certainly cannot control a switch or get data from my shelly em3 which is crucial for my home heating.

And power failures do happen sometimes and so does a reboot of me raspberyy pi. What can I do about this.

enesbcs commented 1 year ago

I am using MQTT Autodiscovery since its appeared in 2022 to handle every Tasmota, zigbe2mqtt and Shelly devices on my network, and i haven't got any problem. Its the simplest and fastest solution as shelly devices communicates directly with Domoticz, without the need of a python plugin.

About domo python plugins: they are running inside a limited and modified python interpreter by Domoticz in a limited memory pool handled by Domo... it was never been stable, and it was a major headache to me. https://www.domoticz.com/forum/viewtopic.php?p=288333#p288333 https://www.domoticz.com/forum/viewtopic.php?p=265591#p265591 https://www.domoticz.com/forum/viewtopic.php?p=225213#p225213

For the autodiscovery method there can only be one barrier between the enduser and the shelly devices: understanding the importance of retain, and setup it.

If your discovery MQTT prefix is "homeassistant/" please check if "homeassistant/" topic exists after a restart, with MQTT Explorer for example. If this topic does not exists, than retain is not working for some reason, advanced debugging needed on your installation.

Ensure that mosquitto has rights to write /var/lib/mosquitto, if the directory exists and isn't it a tmpfs partition - which will never be saved. Some people uses containers/snaps other virtualized stuff to run services: they have to consult with the documentation of the specific container about mosquitto database settings, as it is possible that the specific container runs entirely from memory and does not save anything to disk...

Jacobsentertainment commented 1 year ago

Hi and thanks for the reply.

today, I took the time to make a completely new installation. Everything new and on a new sd card and now it works fine! I do still have the old sd card and could go trouble shooting but now that everything is working there is no point anymore to it. No idea, the old install was on "buster" and now on "bullseye" maybe that makes a difference.

Again thanks!