Hello all,
I would like to run a scene that is triggered by opening the front door - but only if it is after sunset and before sunrise.
Does anyone know the best way of going about this?
Thanks
Hello all,
I would like to run a scene that is triggered by opening the front door - but only if it is after sunset and before sunrise.
Does anyone know the best way of going about this?
Thanks
When creating the scene and adding the trigger to for when the door is open, add return luup.is_night() to the luup section of the door trigger. This will only trigger after sunset and before sunrise.
Amazing - thanks Garrett.
I already have this code in the luup section which sends a notification to my Prowl iPhone app - and when I add in your line I get an error “error in luua for scenes and events”
luup.inet.wget("http://www.prowlapp.com/publicapi/add?apikey=1a2b3c4d5e6f&application=Vera&event=Front+Door&description=Opened&priority=-1")
return true
return luup.is_night()
Do you know how I can integrate in your line for both scripts to be executed successfully?
Kindest regards
Try the following (with the proper [tt]apikey=[/tt] part).
luup.inet.wget("http://www.prowlapp.com/publicapi/add?apikey=1a2b3c4d5e6f&application=Vera&event=Front+Door&description=Opened&priority=-1")
return luup.is_night()
Thanks v much oTi@
Seems to have worked - I’ll confirm at Sunset (UK GMT!)!!
Hi - it’s working great, thanks.
luup.inet.wget(“http://www.prowlapp.com/publicapi/add?apikey=d38345f3693f8629d63bb89bd09cf745aa0&application=Vera&event=Front+Door&description=Opened&priority=-1”)
return luup.is_night()
One more question… !
Is there a line of code that I can add to say - only execute the scene once per day and between 3pm and 10:30 pm? ( I would need the Prowl code to always run every time the switch is tripped though)
Thanks very much
[quote=“mrsdoubtfire, post:6, topic:170416”]Hi - it’s working great, thanks.
luup.inet.wget(“http://www.prowlapp.com/publicapi/add?apikey=d38345f3693f8629d63bb89bd09cf745aa0&application=Vera&event=Front+Door&description=Opened&priority=-1”)
return luup.is_night()
One more question… !
Is there a line of code that I can add to say - only execute the scene once per day and between 3pm and 10:30 pm? ( I would need the Prowl code to always run every time the switch is tripped though)
Thanks very much[/quote]
Not with a single line of code, that I can think of easily.
You could create a virtual switch, and turn it “on” at 3 PM. When the trigger happens, you check if the switch is on and fire of the additional command and turn if off. If the switch is off, you don’t.
You’d need an additional timed scene that turns the switch on at 3 and off at 10:30.
Best Home Automation shopping experience. Shop at Ezlo!
© 2024 Ezlo Innovation, All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules