Page 1 of 1

Blinder and DarkSky

Posted: Sunday 14 July 2019 19:49
by Varazir
Helo,

I have been searching for a simple blinder script but couldn't find any simple one.
To start with, I have one blinder facing West and one facing East. Both controlled by a Qubino ZMNHOD1
One is sadly setup as a reversed blinder and the other normal.

0% = Open
100% = Closed


I want the east side to stay down if it's sunny outside until 11:00 else open to 60% at 0600

West side to go down to 80% if it's sunny between 1400 and 30 min after sundown.
After sundown I want it to at 0% ( open)

This was my first take on it but it's not working as I thought it would

Code: Select all

return {
	on = {
		timer = 
		{
		    'between 13:45 and 60 minutes after sunset',
        },
	    logging =
	    { 
            level           = domoticz.LOG_DEBUG, 
            marker          = "BlinderVardagsrum" 
        },
    },
	execute = function(dz, timer)
	    
	    local cloudCover = dz.devices(92)
	    local blindDevice = dz.devices(83)
	    
	    local function logWrite(str,level)
            dz.log(tostring(str),level or dz.LOG_DEBUG)
        end
        
        if cloudCover.percentage < 60 then
            blindDevice.dimTo(80)
            logWrite("Sänker rullgardinen i vardsgasrummet till 80%")
	    end
	    
	end
}