Page 1 of 1

best practise setpoint thermostat synchronizing

Posted: Monday 30 September 2024 12:27
by Hencor
Hello all,

I recently migrated from deconz to zigbee2mqtt and I'm right now struggeling with synchronizing my 3 danfoss-popp ally thermostats in the dining room.
From time to time my dzvents script creates a endless loop.The setpoint then jumbs from the old to the new value and never settle to one.
I think this appears when a mqtt message is published from z2m the same time when the script is executed.

The script is executed if one of the 3 setpoints change. I use the .silent() option then updating the other setpoints, to prevent domoticz from looping itself and also have a "if" when the setpoints are the same.
I'm now trying with the z2m device debounce function. But I'm not sure if this will solve the problem.

The main question is, what is the best practise or solution to synchronize (3) mqtt setpoint thermostats?

If you like to discuss my script, here is the mainfunction (the rest is only getting the values and logging):

Code: Select all

	if valueL ~= valueM or valueL ~= valueR or valueM ~= valueR then
	    
	    domoticz.log("Links:" .. valueL .. " / " .. updateL .. " Mitte:" .. valueM .. " / " .. updateM .." Rechts:" .. valueR .. " / " .. updateR, domoticz.LOG_INFO)
		
		if device.name == "Esszimmer L" then
		        domoticz.devices("Esszimmer M").updateSetPoint(valueL).silent()
		        domoticz.devices("Esszimmer R").updateSetPoint(valueL).silent()
		    
        elseif device.name == "Esszimmer M" then
		        domoticz.devices("Esszimmer R").updateSetPoint(valueM).silent()
		        domoticz.devices("Esszimmer L").updateSetPoint(valueM).silent()
		    
		elseif device.name == "Esszimmer R" then
		        domoticz.devices("Esszimmer L").updateSetPoint(valueR).silent()
		        domoticz.devices("Esszimmer M").updateSetPoint(valueR).silent()
	    end
		    
    end	

Re: best practise setpoint thermostat synchronizing

Posted: Monday 30 September 2024 12:37
by waltervl
This worked before with the deconz plugin?
As changing 3 devices based on changing 1 of these 3 will be difficult as what device is the master.

Or is one of these 3 already the master and the other 2 should follow?

Re: best practise setpoint thermostat synchronizing

Posted: Monday 30 September 2024 12:52
by Hencor
Yes this worked before with deconz. Even without the .silent() option. There the script of course was executed several times because the first device that was set triggered the script again. It only stops if all 3 setpoints were the same.

For the use with frontend and homebridge etc. the left one is the master. But the allys have the possibility to also be changed on the device itself and this also needs to be synced.
So in the script: If the triggered device is the left one then the setpoint is send to the middle and right one. If the triggered device is the middle one then the setpoint is send to the right and left one.

Re: best practise setpoint thermostat synchronizing

Posted: Monday 30 September 2024 14:21
by waltervl
Ok, I understand. As I do not use Z2M I have no idea what the influence of MQTT and Z2M is in this use case. It could be that some delay in messaging is disturbing the script. I hope someone else can assist on this.