I would like to share with you my current Blueprint for shutters.
The Blueprint takes into account:
the shutter itself (input: blind)
a door or window sensor (input: window_sensor) optional
the ventilation position when a window is opened (input: ventilate_position) optional
the distinction between door and window (input: door)
a brightness sensor (input: brightness_sensor)
brightness for opening (input: brightness_up)
brightness for closing (input: brightness_down)
an resident of the room (input: resident) optionally
a workday sensor (input: workday_sensor)
different time for opening for workday and non-workday (input: time_up_early and time_up_early_non_workday)
earliest and latest time for open and close aka time window
I intentionally do NOT use a calculated sun position, but simply the real brightness provided by a sensor.
What does this mean?
Basically the shutter closes when within time_down_early and time_down_late the brightness falls below the defined value of brightness_down. At the latest when time_down_late is reached, the shutter is lowered.
In the morning it is a little different. There as well the shutter is basically opened if within time_up_early or time_up_early_non_workday and time_up_late the brightness rises above brightness_up.
BUT: if a resident is defined, then the shutter does not go up as long as the corresponding input_boolean is TRUE. This is also true beyond time_up_late. In that case the shutter will be opened as soon as resident changes to false again.
With the window_sensor you can define that the shutter opens automatically when you open the corresponding window (or door). Then the position of ventilate_position is used.
This applies both if the shutter is already closed, but also if the shutter is closing automatically. Exception: if door is set, then ventilate_position is NOT driven to when the shutter closes automatically, but the closing is ignored for the time being - lockout protection.
With adv_blind you can set an additional switch (input_boolean). If this is true, the shutter will not be closed automatically in the evening. This is used by myself e.g. for the christmas time to “show” the illuminated windows in the evening. The automatic closing will NOT be executed in that case. You have to take care of it yourself!
With auto_up and auto_down you can switch off the automatic opening and closing.
I hope it works so far for you.
And maybe someone has an idea how to simplify the code.
Oh, two people with the same idea.
Thank you for your blueprint. Complex cover automations are very rare in HA.
I am currently developing a blueprint to fulfill my requirements from the FHEM module in Home Assistant.
I created the whole thing very generically, so that all kinds of blockers are possible.
Maybe I’ll get around to publishing my blueprint soon too.
I still have to proofread the descriptions.
So far it has been running very stably for a few weeks.
@Eimeel Class. That’s exactly what I was looking for. I will test it myself and report. Thanks in advance for making it available. What device do you use to determine if there is someone else in the room?
What do you mean with “if there is someone else in the room”? Is it two people who are sleeping in the same room? I use an input_boolean “adults_sleeping” which is going to true if one adult is sleeping and changes to false if both adults are awake again. So I have input_booleans for every person in the house and some combined.
Maybe I don’t quite understand what you’re trying to achieve.
For me it doesn’t matter for the shutters whether someone is in the room or not, does it? Because the shutters move automatically.
The only case in which it interests me is the morning opening in bedrooms. And for this I have an input_boolean per person, in which this is stored. It’s simply controlled by a switch that everyone has at their bedside. Basically the switch makes a toggle between awake and asleep.
I’m not actively tracking the room resident or if the corresponding room resident is inside the room. Cause I just want to know if currently someone is sleeping in the room or not.