Script for Blinds

Easy to use, 100% Lua-based event scripting framework.
Post Reply
Tonio16
Posts: 24
Joined: Friday 23 February 2018 21:38
Target OS: Raspberry Pi
Domoticz version: 4.9700
Location: France
Contact:

Script for Blinds

Post by Tonio16 » Friday 14 September 2018 19:02

Hello

I want to use DZevents to manage my blinds but I have not enough background to start from zero.

So, it would be nice if some of you could share their own script in oder to me to start how it's working.

Regards

Antoine

User avatar
waaren
Posts: 923
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Script for Blinds

Post by waaren » Saturday 15 September 2018 0:37

I use this very simple script for my two blinds. ("Slaapkamer rolluik" and "Kastenkamer rolluik")
before I close them I check the state of the windows in these rooms ("Slaapkamer raam" and "Kastenkamer raam")

Code: Select all

return { 
            on =        {   timer = { "at 10:00", "at 20:00-02:00 every 15 minutes" } },

    execute = function(dz)
      
        if  dz.time.matchesRule("at nighttime") then
            if (dz.devices("Slaapkamer rolluik").state ~= "Closed" and dz.devices("Slaapkamer raam").state == "Closed") then
                dz.devices("Slaapkamer rolluik").switchOn()
            end
            
            if (dz.devices("Kastenkamer rolluik").state ~= "Closed" and dz.devices("Kastenkamer raam").state == "Closed") then
                dz.devices("Kastenkamer rolluik").switchOn()
            end
        elseif dz.time.matchesRule("at 10:00-11:00") then
            dz.devices("Slaapkamer rolluik").switchOff()
            dz.devices("Kastenkamer rolluik").switchOff()
        end      
	end
}
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

Tonio16
Posts: 24
Joined: Friday 23 February 2018 21:38
Target OS: Raspberry Pi
Domoticz version: 4.9700
Location: France
Contact:

Re: Script for Blinds

Post by Tonio16 » Wednesday 19 September 2018 7:31

Thanks Waaren

I will have a look this week-end.

Antoine

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests