Page 1 of 1
Domoticz auto reconnect to slave domoticz
Posted: Sunday 17 September 2023 23:58
by saper2
Hi,
Is there some option for domoticz to automatically reconnect to salve-domoticz?
I have 2 installation:
- master on my main server (PC based that have UPS and run 24/7/365)
- and slave on RPi (which is hidden on wardrobe with RFLink - because of good location for rflink).
The issue popup when I have power outage at home (shorter/longer), the master-domoticz won't reconnect to slave-domoticz (so I'm losing RF sensors updates).
For now to fix this when I notice it, I have to hit on main server via ssh
sudo systemctl restart domoticz, but it can be even few days for me to notice this

Re: Domoticz auto reconnect to slave domoticz
Posted: Monday 18 September 2023 13:10
by waltervl
If you restart the slave domoticz it will not reconnect?
Then there seems to be an order in startup, first the slave and then the main. If that is the case (I am not aware of this, not using Master/slave Domoticz) then you can put a domoticz startup delay on the main system with command line parameter -startupdelay (seconds (default=0)).
Command line parameters can be added as DEAMON_ARGS in /etc/init.d/domoticz.sh for automatic startup.
See also
https://www.domoticz.com/wiki/Command_line_parameters
Short term solution is to send a notification from the master if a slave sensor device is not responding for x time (use last seen option in Notification dialog). That will indicate that the slave is not connected.
Re: Domoticz auto reconnect to slave domoticz
Posted: Monday 18 September 2023 14:31
by Kedi
Strange. I have a master/slave combination for 8 years now and never seen any issue between those 2, there is always an automatic reconnect between the master/slave. May be there is an timeout on the reconnect if a slave is too long down.
Re: Domoticz auto reconnect to slave domoticz
Posted: Tuesday 03 October 2023 22:58
by saper2
I just unplugged for a moment PSU from wall outlet that powering Rpi (slave) domoticz, and I see on it's web there is sensor data (in log) but on master domoticz there is nothing new(updated) (in log)

.
Which side connects (initialize connection) to each one? master->slave or slave->master ?
The one thing that I can think of is that slave is running older version (2020), while on main server I have 2023.2 build 15531 (git-cloned).
Upgrading slave install is pointless for me because it's only works as relay for RFLink and it get job done (when works), and compiling domoticz on RPi is PITA
waltervl wrote: ↑Monday 18 September 2023 13:10
If you restart the slave domoticz it will not reconnect?
Then there seems to be an order in startup, first the slave and then the main. If that is the case (I am not aware of this, not using Master/slave Domoticz) then you can put a domoticz startup delay on the main system with command line parameter -startupdelay (seconds (default=0)).
Command line parameters can be added as DEAMON_ARGS in /etc/init.d/domoticz.sh for automatic startup.
See also
https://www.domoticz.com/wiki/Command_line_parameters
Short term solution is to send a notification from the master if a slave sensor device is not responding for x time (use last seen option in Notification dialog). That will indicate that the slave is not connected.
Well, Main (master) server is up in 99,9% so start-up "delay" is pointless for master because domoticz service is always up&running. (unless ups run-out of juice).

Maybe I should just build RFLink bridge to MQTT on ESP and stop wasting time on this setup.
Re: Domoticz auto reconnect to slave domoticz
Posted: Wednesday 04 October 2023 7:22
by Kedi
saper2 wrote: ↑Tuesday 03 October 2023 22:58

Maybe I should just build RFLink bridge to MQTT on ESP and stop wasting time on this setup.
That is what I did also and works perfect. Currently still stuck on my slave due to the P1 meter connected to it.
I already have Tasmota ready for the P1 meter, waiting to be implemented.