I am quite new to OpenHAB but i have now played and tried to setup my own environment for some time and has succeed quite well i think but i still have some trouble to design some rules.
I mainly want to use OpenHAB (for now) to automatically control lights in my house. The turning on and off should be based on:
- time of the day
- when i am home
- when the sun is down
I already have one switch that is ON when someone is at home and OFF when nobody is home. Another switch that is ON during daytime and OFF during night. This is based on example code i have found on this site + some modifications.
Now to my problem, how do i control my lights/group of lights in a simple way? This is how I want it to work:
Weekdays turn on the light between 7 AM and 10PM if I/someone is at home and the sun is down but on weekends (and holidays?) it should be between 9AM and 23PM.
I want the rule to be generic so i can have different time for different groups of lights in a simple way.
Is this possible to do in a simple way in OpenHAB using rules and scripts? Currently i am using SwitchKing and this is basically what that tools is doing but now i want to migrate to OpenHAB.
Is there anyone that has a some code like this or could help me design the code? If possible please provide some example code or link to examples.
I hope i can get some help here and that its not to hard to solve.
I am using OpenHAB 1.7.1 on a Pi2 with tellstick Duo but will probably expand to Z-wave also when i get satisfied with my solution.