Blinder and DarkSky

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
User avatar
Varazir
Posts: 487
Joined: Friday 20 February 2015 22:23
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Blinder and DarkSky

Post 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
}
Raspberry PI 4 with RaZberry Controller 2016 ZWave+ and CC2531(zigbee)
Several IKEA devices/z-wave devices
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest