best practise setpoint thermostat synchronizing

For devices supporting the Auto Discovery feature. Like ZWaveJS2MQTT, Zigbee2MQTT.

Moderator: leecollings

Post Reply
Hencor
Posts: 48
Joined: Sunday 01 September 2019 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: DE
Contact:

best practise setpoint thermostat synchronizing

Post 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	
User avatar
waltervl
Posts: 5397
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: best practise setpoint thermostat synchronizing

Post 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?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Hencor
Posts: 48
Joined: Sunday 01 September 2019 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: DE
Contact:

Re: best practise setpoint thermostat synchronizing

Post 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.
User avatar
waltervl
Posts: 5397
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: best practise setpoint thermostat synchronizing

Post 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.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest