Hi. I use Ikea blinds. One of them is mounted over my patio door.
I have an automation for closing all blinds at sunset (or at 20:00 if sunset later).
I want to modify the automation to not close the blind over the door, if the door is open.
When the door is closed, the blind should also close. I have a door sensor at the door.
So any idea how to configure this?
I’m not sure if the automation is the right place to put the code in, sine I think the automation will only be triggered once. So maybe it won’t close the blind when door closes.
- alias: 'Fyrtur sunset'
trigger:
- platform: sun
event: sunset
offset: '+00:10:00'
- platform: time
at: '20:00:00'
condition:
condition: state # door must be closed
entity_id: binary_sensor.your_door_sensor_here
state: 'off'
action:
service: cover.close_cover
entity_id: group.covers_fyrtur
You can use a second automation for this.
- alias: 'Fyrtur sunset door close'
trigger:
platform: state # when door closes
entity_id: binary_sensor.your_door_sensor_here
to: 'off'
condition:
condition: or # only after 8pm or 10 minutes after sunset
conditions:
- condition: time
after: '19:59:59'
- condition: sun
after: sunset
after_offset: '+00:10:00'
action:
service: cover.close_cover
entity_id: group.covers_fyrtur
Or you can combine them all in the one automation:
- alias: 'Fyrtur sunset and door close'
trigger:
- platform: sun
event: sunset
offset: '+00:10:00'
- platform: time
at: '20:00:00'
- platform: state
entity_id: binary_sensor.your_door_sensor_here
to: 'off'
condition:
- condition: state
entity_id: binary_sensor.your_door_sensor_here
state: 'off'
- condition: or
conditions:
- condition: time
after: '19:59:59'
- condition: sun
after: sunset
after_offset: '+00:10:00'
action:
service: cover.close_cover
entity_id: group.covers_fyrtur
- alias: 'Fyrtur sunset'
trigger:
- platform: sun
event: sunset
offset: '+00:10:00'
- platform: time
at: '20:00:00'
- platform: state
entity_id: binary_sensor.aeon_labs_zw112_door_window_sensor_6_sensor
to: 'off'
condition:
- condition: state
entity_id: binary_sensor.aeon_labs_zw112_door_window_sensor_6_sensor
state: 'off'
- condition: or
conditions:
- condition: time
after: '19:59:59'
- condition: sun
after: sunset
after_offset: '+00:10:00'
action:
service: cover.close_cover
entity_id: group.covers_fyrtur
Think the or might be wrong.
The blinds should go down after sunset or 20:00 if sunset is later.
BUT if the door is open at sunset or after 20:00 the blinds should not go down
until the door is shut.
The way I have written it, the automation will be triggered by any of the following:
the door closing,
sunset + 10 minutes,
and at 8pm
but to perform the actions all the following conditions must be met.
The conditions work like this, always. No matter which of the three triggers start the automation.
The door must be closed. If it’s not the automation wont run.
AND
It must be 8pm or later, OR after sunset + 10minutes.
Which should do what you want.
I believe you when you say it is not working that way. I just don’t see how. Can you check the developer tools states menu and make sure the door sensor is off when the door is closed, and on when the door is open.
the sensor is correct. I have no other automation closing the blinds.
I have reloaded the automation.
Automation closes the blinds at 20:00 as supposed (sunset is later than 20 for now),
but it closes blinds even if the door is open (the state on sensor is on)
One thought, the trigger as written now shouldn’t the blind close if
sunset or
20:00 or
door close ?
So it would close blinds when door changes state to off even if its not 20:00 or sunset?
If you are sure you have exactly this condition including lack of capitalisation of the state ‘off’, correct spelling of everything including sensor and the same indentation then I’m sorry, I don’t know how to help you. You seem to have a very special install of home assistant, unlike any other, that ignores simple conditions like:
condition:
- condition: state
entity_id: binary_sensor.aeon_labs_zw112_door_window_sensor_6_sensor
state: 'off'
Just a thought, is this door sensor battery powered?
Does it’s state go ‘unavailable’ when it goes to sleep?
Never mind that’s still not ‘off’ which it should have to be for the automation to run. If the above were true it might never close the blinds, opposite to what you are seeing (always closing the blinds).