Hi I need help to setup my automation for opening the blinds.
I want them to open on sunrise, but only if it happens past 8H.
If sunrise happens before 8H, I would want to open the blinds at 8H.
But I don’t want to open them at 8. In winter when sun rises at @9h I want the blinds to open then.
The problem seems to be delay the opening to 8 if sunrise happens before. But not always trigger at 8.
Any suggestions?
- alias: open blinds at sunrise but not before 8
trigger:
- platform: sun
event: sunrise
- platform: time
at: '00:08:00'
condition:
- condition: state
entity_id: yourblindsentity
state: 'closed'
- condition: time
after: '00:08:00'
action:
...
It triggers at sunrise or 08:00 (what happens first), if sunrise is before 08:00 it will do nothing because of the time condition.
If sunrise is past eight the state condition will prevent running the automation triggered by sunrise (replace it with your blinds entity and your state when blinds are closed)
The part to open at 09:00 is even more tricky, untested but i think it will work:
- alias: open blinds at sunrise but not before 8
trigger:
- platform: sun
event: sunrise
- platform: template
value_template: "{{ now().hour == 8 if (3,21) <= (now().month, now().day) <= (12,21) else now().hour == 9 }}"
condition:
- condition: state
entity_id: yourblindsentity
state: 'down'
- condition: template
value_template: "{{ now().hour == 8 if (3,21) <= (now().month, now().day) <= (12,21) else now().hour == 9 }}"
action:
...
The template renders true at eight from 21.3. to 21.12, the rest (in winter) it renders true at nine o clock.
What I want to do would be:
Trigger:
Sunrise → If it’s before 8:00 do nothing, else open blinds.
8:00 → If sunrise was happened before, open blinds, else do nothing.
So effectively I always want to trigger by sunrise, but delay the opening to 8h if before. But for doing the action at 8, it must have happened sunrise before.
@SeRiusRod sorry, my fault, i didn’t read exactly and did it the other way round. Take Taras example, his templates and automations are always cutting the edge. Just to mention the date template i used is also by him.
Doesn’t it have to check if the blinds are closed? Now the action only runs if the state of the covers is open, aren’t they closed in the moment the automation runs in the morning?
And is the condition really needed? As i understand the template condition it can only run once a day…
Nothing to be sorry! I’m always so grateful for all your help
About the open condition: yes, I implemented it the inverted way and it works, but perhaps would be better if one could check every blind one by one if it’s completely closed and try to open only the ones that are in that state. I know there’s some loop functionality into automations, but I never used it.
One checks if it’s completely closed because the sibling automation that closes them at night if temperature drops below 16 deg leaves them in that state.
If someone wants to leave one out that cycle just should leave the blind adjusted at some position.
@Taras, I’ve already implemented your solution and this morning it worked. Thank your sir.
One last thing, In my country we use to have the “textile” or venetian style of blinds on the inside but also aluminium outside blinds that are integrated in the windows.
Those later are what I’m trying to automate, and are meant to protect from sun, but also from cold and offer more security when out of home.
I’m clarifying because I recently realized that those are not common in other countries and in fact we are an exception in Europe.
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title signaling to other users that this topic has been resolved. This helps users find answers to similar questions.