Qouad WallMote

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:

Qouad WallMote

Post 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
User avatar
waltervl
Posts: 5851
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Qouad WallMote

Post 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.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
PeterRozenveld
Posts: 38
Joined: Sunday 15 October 2023 18:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Qouad WallMote is een van de volgende

Post 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.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest