Our house has pre-existing landscape lighting that relys on a 2-wire photo sensor to come on at dusk. I am trying to understand how I could go about integrating this system with openhab2, I am currently most familiar with the zwave.
Is there something I could replace the light sensor with to simulate the “it’s dark now” signal that the sensor is sending?
I too grew very frustrated with the photo sensors and mechanical timers that typically control outdoor landscape lighting.
@binderth pointed you in the exact direction of what I choose to move forward with and has been rock solid ever since I deployed it.
I changed the electrical outlets where my landscape lighting transformers are plugged into AC power to Zwave outlets - this is the model that I used but any will do:
Once the outlets were included into my Z-Wave network I removed the analog timers and photo cells and created the following rules.
The rule utilizes the ASTRO BINDING to get SUNSET and SUNRISE times which I use to turn the lights on and off.
rule "turn landscape lighting on"
Channel 'astro:sun:home:set#event' triggered START
rule "turn landscape lighting off"
Channel 'astro:sun:home:rise#event' triggered START
I also have used an alternate version of this rule utilizing CRON to turn the lights on and off at specific times rather than at SUNSET and SUNRISE.
Your “rule” is quite straightforward, and works fine…
But what if my raspberry goes down for whatever reason (power outage, etc.) and comes up again past SUNSET, is there any way we can turn the lights automatically although we’ve “missed” the trigger?
PD: Sorry @dbadia for hijacking the thread, but I think this might be useful for you too!
I really haven’t had issues with stability so your suggested scenario had not been considered.
I guess you look at implementing a timer that lasts for X number of hours after the light has been turned on and then save that information into one of the persistence databases. You could then have another rule check to see if those timers had expired upon restart and turn off what’s needed.
I’m sure some of the great maintainers and experts could help you out with some code suggestions if needed. If you come up with a solution please post it here for others to use.