Updating setpoint in dzVents  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
MikeF
Posts: 350
Joined: Sunday 19 April 2015 0:36
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.2
Location: UK
Contact:

Updating setpoint in dzVents

Post 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.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Updating setpoint in dzVents

Post 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.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
MikeF
Posts: 350
Joined: Sunday 19 April 2015 0:36
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.2
Location: UK
Contact:

Re: Updating setpoint in dzVents  [Solved]

Post by MikeF »

Many thanks for such a quick reply - I'll give it a try.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest