1 dzVents script takes over form 4 Blockly events and 2 dummy switches.

Moderator: leecollings

Post Reply
User avatar
KroontjesPen
Posts: 43
Joined: Thursday 03 November 2016 15:46
Target OS: Windows
Domoticz version: 4.10717
Location: Spijkenisse NL
Contact:

1 dzVents script takes over form 4 Blockly events and 2 dummy switches.

Post by KroontjesPen »

 
Tests in the afternoon where OK .
It working in shadow mode and if there are no problems tomorrow then it can take over the job.

Code: Select all

return {
        on = {
    		devices = {
    		
                Dev = "Lichtsensor " .. "Binnen"
    		
    		},
    	},
    	execute = function(domoticz, Dev )

            local Doel = domoticz.devices('Kamer Schoorsteen Links')             -- nog wijzingen in 'Kamer Keukenzijde'
            
    		if (Dev.state == 'Off') then
				Doel.cancelQueuedCommands()
				Doel.switchOff().afterMin(4)
			   
		   elseif (Dev.state == 'On') then
				Doel.cancelQueuedCommands()
				Doel.switchOn().afterMin(1)

    		end       
    	end
}
The KaKu/COCO light-censor can switched on/off 5 times in 1 minutes.
Therefore is the delay putting in. The old delay had to be cancelled to start the new one.
 
Bear with me, English is not my native language.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest