Page 1 of 1

dual triggering

Posted: Wednesday 11 September 2024 9:46
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
}

Re: dual triggering

Posted: Wednesday 11 September 2024 10:00
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?