Updating setpoint in dzVents
Posted: Thursday 04 July 2019 14:39
I don't know if this has been asked before (I have had a look), but I want to use dzVents to trigger a script when I update a setpoint device in Domoticz - but only when I click on 'Set'. I'm currently reading current and setpoint temperatures from my (Wiser) heating system, and I want to write the latter to the Domoticz setpoint device if I change it on the physical thermostat, but I don't want it to trigger the script.
This is the dzVents script I'm currently using to trigger a second script (but it will also trigger the second script if I write a new value to the Domoticz device):
Thanks in anticipation.
This is the dzVents script I'm currently using to trigger a second script (but it will also trigger the second script if I write a new value to the Domoticz device):
Code: Select all
-- dzVents script to pass setpoint value to python script
return {
on = { devices = { "Setpoint" }},
execute = function(dz)
local setpoint = dz.devices("Setpoint").setPoint
local py_script = 'python /home/pi/devices/hive_setpoint_new.py '
print(setpoint)
local cmd = py_script .. setpoint .. ' &'
--print(cmd)
os.execute(cmd)
end
}