I’ve been pondering with code and automations since I installed HA a week ago. Quite happy with the progress so far! I have however been avoiding what I suppose might be the most normal place to start, general light automation, as I haven’t been sure how to proceed. I might just want too much. And my current lack of coding skills (templates etc) I just don’t see how I can solve this without a lot of messy code. I would really appreciate any help at all in the form of links, strategy, logic or code proposal. Feel free to tell me if it’s a horrible way of thinking due to lack of knowledge…
What I have already configured I consider likely to use in my light automation (unless I have had bad ideas all along):
- Lights grouped per room.
- Five different scenes named after time of day.
- An automated input_select listing states like home, away, vacation and sleeping. Can be used manually if automation based on presence is disabled through an input_boolean.
- An automated input_select listing time of day (5 entries) corresponding to the light scenes. Can be used manually if automation based on time of day is disabled through an input_boolean.
- A sensor that monitor light from outside.
- Motion sensors at a couple of locations inside.
What I ideally want to achieve:
- Change of time of day (5 states, automated input select) while someone is home: change to correct scene with long transition unless light from outside is above a set threshold. Two rooms shall have light activated regardless of threshold.
- When someone arrive home to an otherwise empty house: set correct scene based on time of day unless light from outside is above a set threshold. Short transition. Two rooms shall have light activated regardless of threshold
- Possibly lights adjusted on/off with long transition and correct scene if significant change of outside light while someone is at home. (Through checking at regular intervals, using average values or something similar. I want to avoid lights going haywire with a moving cloudcover.)
- Turn off all lights when everyone leave. Not an issue.
- Turn off most lights when general state change to “sleep”. Not an issue.
- Some lights are turned off in the event and at night through scenes. Turn on if movement. Not an issue.
(7. Vacation mode with simulated lighting. To be done at a later time.)
Not sure how to proceed regarding 1, 2 and 3 without creating a lot of messy automations for the different scenarios and time of day. Back to square one to do something easier? Wondering about creating one more set of scenes for use when light from outside is above threshold. That way I could predefine correct light for the rooms where I always want lighting inside regardless of light from outside.
Sorry about a confusing post. I honestly don’t expect a lot of assistance for something this messy and perhaps just wrong. A simplification or different approach to achieve the same goals would not hurt. I need to see the light