Page 1 of 1

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

Posted: Tuesday 08 October 2019 19:50
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.