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