Trying to stop or delay scene based on tripped sensor (open window)

Hi, first post, be gentle, I hope you guys can help me. I’ve spent hours and hours trawling sites and testing scripts and I’m yet to have any success. Here’s what I’m trying to do, basically I have electric window blinds that close at dusk based. If a window is open then the blind catches on the window lever and the blind gets curled up etc. I have a timed scene on my Vera Lite that closes the blinds at dusk but I want to put a check in place to see if the windows are closed first. If they are not closed I’d like the Vera to check again every 5 minutes for say, 2 hours, and then if closed, continue with the scene (and close the blind). I have Fibaro window sensors on the windows. t I’m struggling to get the very first part of this working let alone the time delay and recheck. So, any pointers very gratefully received. Here’s my simple code. It doesn’t error but when I run it the blind closes regardless of the Tripped setting.

if (luup.variable_get(“urn:schemas-micasaverde-com:device:MotionSensor:1”, “Tripped”, 21) == “1” ) then
return false
else
return true
end

Have had a look at PLEG and can’t fathom it.

Welcome.

The first string to luup.variable_get should be a service Id not a device reference.

Good to work up to the complexity you need in steps. In the end, a scheduled scene which checks it’s after dusk and the window is closed and the blind is not down could do the trick.

A search of the forum should find that this service Id issue is not an unusual mistake… don’t feel bad!

Thanks for the advice. I parked this for a bit during the Winter. In the meantime I’ve become familiar with PLEG so will give it a go on there.

Thanks

Tony