dual triggering

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

Moderator: leecollings

Post Reply
PeterRozenveld
Posts: 38
Joined: Sunday 15 October 2023 18:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

dual triggering

Post by PeterRozenveld »

I used two triggers, but apparently that doesn't work ? Or I'm doing something wrong. Why doesn't the switch turn off after 20 minutes? OBad.switchOn().forMin(20) see:

Code: Select all

return {
	on = {
		devices = {
			'Badk_1_Switch',
			'Zolder_CV_Q2',
		    'CV_Q2_OverrulledbyBad'
		},
        timer = {'every 5 minutes' }
	},
	
	logging = {
    level = domoticz.LOG_DEBUG,
    marker = "Badk_1_Switch"
    },
	execute = function(domoticz, device, timer)
	    local Bdk1 = domoticz.devices('Badk_1_Switch') --  De Wallmote switch 1
	    local Zld2 = domoticz.devices('Zolder_CV_Q2') --  De Ketel
	    local OBad = domoticz.devices('CV_Q2_OverrulledbyBad') -- Overrulled Bad zorgt dat de CV aan blijft
	    
	    if Bdk1.state == 'On' then 
	        Zld2.switchOn()
	        OBad.switchOn().forMin(20)
	        Bdk1.switchOff()
		end
end
}
FlyingDomotic
Posts: 356
Joined: Saturday 27 February 2016 0:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Re: dual triggering

Post by FlyingDomotic »

With the 5 minutes timer, you're executing these commands every 5 minutes, in particular, you're turning "OBad.switchOn().forMin(20)" for 20 minutes ... every 5 minutes. No chance to see it off ;-)

Could you explain us what you want to do with this script?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest