Configuration to open curtains when door opens

Hi all,

I have two curtains at my front door; they close when nightfall and open when sun comes up. However, when I come home late, covers are closed. When I open the door, I can’t get through because of the curtains are closed :slight_smile:

I’m trying to put automation that whenever the door opens (using the sensor), the curtains should open.

Somehow, it doesn’t work… Can anyone help ?

- alias: "[Curtain] - Open Curtain when door open"
  mode: restart
  trigger:
  - platform: state
    entity_id: binary_sensor.openclose_34
    to: 'on'
  - condition: or
    conditions:
      - condition: state
        entity_id: cover.gordijnlinks
        state: "closed"
      - condition: state
        entity_id: cover.gordijnrechts
        state: "closed"
  action:
  - service: cover.open_cover
    target:
      entity_id: cover.gordijnlinks
  - service: cover.open_cover
    target:
      entity_id: cover.gordijnrechts
  - service: input_boolean.turn_off
    target:
      entity_id: input_boolean.gordijnen_dicht

- alias: "[Curtain] - Close Curtain when door closed"
  mode: restart
  trigger:
  - platform: state
    entity_id: input_boolean.gordijnen_dicht
    to: 'off'

  - condition: or
    conditions:
      - condition: state
        entity_id: cover.gordijnlinks
        state: "open"
      - condition: state
        entity_id: cover.gordijnrechts
        state: "open"
      - condition: state
        entity_id: binary_sensor.openclose_34
        state: 'off'
  action:
  - wait_template: >-
        {{ is_state('binary_sensor.openclose_34', 'off') }}
  - service: cover.close_cover
    target:
      entity_id: cover.gordijnlinks
  - service: cover.close_cover
    target:
      entity_id: cover.gordijnrechts
  - service: input_boolean.turn_on
    target:
      entity_id: input_boolean.gordijnen_dicht
      

Thanks a lot !

Kr,

Bart

you are missing the “condition:” part.

- alias: "[Curtain] - Open Curtain when door open"
  mode: restart
  trigger:
  - platform: state
    entity_id: binary_sensor.openclose_34
    to: 'on'
  condition:  ## <-- add this here and in the next automation too.
  - condition: or
    conditions:
      - condition: state
        entity_id: cover.gordijnlinks
        state: "closed"
      - condition: state
        entity_id: cover.gordijnrechts
        state: "closed"
  action:
  - service: cover.open_cover
    target:
      entity_id: cover.gordijnlinks
  - service: cover.open_cover
    target:
      entity_id: cover.gordijnrechts
  - service: input_boolean.turn_off
    target:
      entity_id: input_boolean.gordijnen_dicht