Open door, airco off dos not work

Hello! I have door contacts on the interior doors. There is an air conditioner in the room behind the door. Everything is neatly integrated into HA and works separately.

I would like to have the air conditioning/heating turn off when I open the door and it has been open for a certain period of time.

When I press the play button to test it, it works. But when I open the door it doesn’t. Not even when I take the time off. Can anyone see what’s going wrong? See the YAML code below:

alias: Binnendeur ouders >1 min open - airco uit
description: “”
trigger:

  • type: opened
    platform: device
    device_id: 954ccb5bb9433403e0fefe07485f048e
    entity_id: 5e770a054f7d76c44beae4b5f38d4f77
    domain: binary_sensor
  • type: opened
    platform: device
    device_id: 954ccb5bb9433403e0fefe07485f048e
    entity_id: a47f828d631ab1ef7a37e634836bd1d3
    domain: binary_sensor
    condition:
  • condition: device
    device_id: a1cd4104ee61e00f5e653248a88d5b5c
    domain: fan
    entity_id: b198085dc0ca722524b0964844b20510
    type: is_on
  • condition: device
    device_id: a1cd4104ee61e00f5e653248a88d5b5c
    domain: climate
    entity_id: 2e75c56b8ea7c50a972011d53c1f7caf
    type: is_hvac_mode
    hvac_mode: cool
  • condition: device
    device_id: a1cd4104ee61e00f5e653248a88d5b5c
    domain: climate
    entity_id: 2e75c56b8ea7c50a972011d53c1f7caf
    type: is_hvac_mode
    hvac_mode: auto
  • condition: device
    device_id: a1cd4104ee61e00f5e653248a88d5b5c
    domain: climate
    entity_id: 2e75c56b8ea7c50a972011d53c1f7caf
    type: is_hvac_mode
    hvac_mode: dry
  • condition: device
    device_id: a1cd4104ee61e00f5e653248a88d5b5c
    domain: climate
    entity_id: 2e75c56b8ea7c50a972011d53c1f7caf
    type: is_hvac_mode
    hvac_mode: heat
  • condition: device
    device_id: a1cd4104ee61e00f5e653248a88d5b5c
    domain: climate
    entity_id: 2e75c56b8ea7c50a972011d53c1f7caf
    type: is_hvac_mode
    hvac_mode: fan_only
    action:
  • type: turn_off
    device_id: a1cd4104ee61e00f5e653248a88d5b5c
    entity_id: b198085dc0ca722524b0964844b20510
    domain: fan
  • device_id: a1cd4104ee61e00f5e653248a88d5b5c
    domain: climate
    entity_id: 2e75c56b8ea7c50a972011d53c1f7caf
    type: set_hvac_mode
    hvac_mode: “off”
    mode: restart

Hi Tim,
Not sure why you have so many devices, triggers and conditions listed, ignoring that, you need a trigger and then you need an action you want the automation to do… The below should turn off the A/C after the door is opened for one minute. Build or duplicate off that, and if you want to turn off multiple devices, you could add a and if condition. ie when the door is opened for more than 1 min AND IF the A/C is ON, turn it off… and then you could do a OR IF the heater is on turn that off…

That said, for you the easiest would probably to just make duplicate automation for both the heater and the A/C. Visual editor is also your friend if YAML ain’t your cup of tea… Good luck. :smiley:

alias: Binnendeur ouders >1 min open - airco uit
description: Turn off A/C after door is open for 1 minute
trigger:
  - type: opened
    platform: device
    device_id: 954ccb5bb9433403e0fefe07485f048e
    entity_id: 5e770a054f7d76c44beae4b5f38d4f77
    domain: binary_sensor
    for:
      hours: 0
      minutes: 1
      seconds: 0
condition: []
action:
  - action: climate.set_hvac_mode
    metadata: {}
    data:
      hvac_mode: "off"
    target:
      device_id: 2e75c56b8ea7c50a972011d53c1f7caf

Please format your configuration block properly, unformatted configuration obscures possible issues and makes copying, editing, and pasting more difficult and prone to errors.

I use the excellent blueprint HVAC-pause by raffy-ops for that:

It doesn’t simply turn it off, but saves a snapshot of the current settings, then “pauses” the airco by turning it off, and after the door is closed and timer run out, it restores the original settings.

If you have multiple doors and/or windows, simply group them and use that as the trigger for the blueprint.

Hello! This looks great! But…, it doesn’t work for me. Can you see from the YAML code what I am doing wrong?

alias: "TEST "
description: “”
use_blueprint:
path: raffy-ops/hvac_pause.yaml
input:
climate_device: climate.142936511725411_climate
doors_windows: binary_sensor.binnendeur_ouders_openen
pause_delay:
hours: 0
minutes: 0
seconds: 10
action_first: true

Since you pasted your automation as basic text instead of preformatted, I cannot see whether you maybe made mistakes in indention. Please check according to my example:

alias: Bedroom - AC pause on door/window open
description: ""
use_blueprint:
  path: raffy-ops/hvac_pause.yaml
  input:
    climate_device: climate.daikin_slaapkamer
    doors_windows: binary_sensor.doors_windows_open_bedroom
    pause_delay:
      hours: 0
      minutes: 1
      seconds: 30
    action_first: false

I think during set-up you clicked on an action that he has to perform before pause, but then no action seems to be defined. Furthermore I’d say you need at least 1 minute delay so you can enter and leave the room without the AC stopping.

Oh and fully unrelated to functioning or not, but to keep it all a bit more logical also please check your naming scheme.

Since it is a binary sensor that detects some kind of state the door is in, it shouldn’t be “binnendeur_ouders_openen”. It most likely only detects whether the door is closed or not closed, so make the sensor name binary_sensor.binnendeur_ouders

If you really feel the need to add the state you’re detecting, then make sure you check the screenshot at Binary sensor - Home Assistant for the way HA sees a door and at the entity level check the that device_class / show as states “door”. As you can see in the sheet, a door that has state “ON” is open.