Page 1 of 1

Qouad WallMote

Posted: Friday 06 September 2024 18:46
by PeterRozenveld
I created a script, which has a trigger as a device. Now I want the Wallmote to turn off after 1 sec. If I give a direct off command in the script , when that Wall mote turns on, a 2nd script is not executed !
De reset:

Code: Select all

return {
	on = {
		devices = {
			'Badk_1_Switch'
		}

	},
	execute = function(domoticz, device)
	    local Bdk1 = domoticz.devices('Badk_1_Switch') --  De Wallmote switch 1
	    
	    if Bdk1.state == 'On' then 
	    domoticz.devices('Badk_1_Switch').switchOn.forSec(2)
		end
end
}
And the 2 the script , which needs to be started:

Code: Select all

return {
	on = {
		timer = {
			'every minute',				-- causes the script to be called every minute
		}
	},
	execute = function(domoticz, timer)
	    local Bdk1 = domoticz.devices('Badk_1_Switch') --  De Wallmote switch 1
	    local Zld2 = domoticz.devices('Zolder_CV-Q2') --  De Ketel
        
        if Bdk1.state == 'On' then
        domoticz.devices('Zolder_CV-Q2').switchOn().forMin(2)
    end
end
}
Renaming the switch to a simple one also fails me for Zld2, but that's another concern
The 2nd script , the time should be 20 minutes, but this is for testing
Hopefully someone can point the way
Peter

Re: Qouad WallMote

Posted: Friday 06 September 2024 23:45
by waltervl
The second script is run every minute and not triggered by a device change. Chances are small it will find the wallmote on if you switch it off after 2 seconds...
Put some log statement in the script to see if it is running.

Re: Qouad WallMote is een van de volgende

Posted: Wednesday 11 September 2024 9:42
by PeterRozenveld
I changed it a bit too much, thanks for your help.
Since it's been a while , I'll make a new topic.
I also bought different remote switch. I have also been working on that for a while.