Page 1 of 1

Updating setpoint in dzVents

Posted: Thursday 04 July 2019 14:39
by MikeF
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):

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
}
Thanks in anticipation.

Re: Updating setpoint in dzVents

Posted: Thursday 04 July 2019 15:37
by waaren
MikeF wrote: 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.
Not a straight forward solution available because the updateSetpoint has no silent() method in domoticz. What you could do is change the python script is such a way that it also update a variable. That variable can be red by dzVents to see if something needs to done or that the updated setpoint must be ignored.

Re: Updating setpoint in dzVents  [Solved]

Posted: Thursday 04 July 2019 16:19
by MikeF
Many thanks for such a quick reply - I'll give it a try.