Door open automation doesn't fire, not sure why

I have the following configuration:

alias: '[Badkamer]Deur open: Verwarming uit'
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.badkamerdeur
    to: 'on'
    for: '0:05:00'
  - platform: state
    entity_id: climate.badkamer
    attribute: hvac_action
    to: heating
condition:
  - condition: state
    entity_id: binary_sensor.badkamerdeur
    state: 'on'
    for: '05:00'
  - condition: state
    entity_id: climate.badkamer
    state: heating
    attribute: hvac_action
  - condition: time
    after: '06:30'
    before: '23:59'
action:
  - service: script.turn_off_badkamer_heating
  - device_id: 621869ba5dd715a0989efa6d994c05e3
    domain: mobile_app
    type: notify
    message: Verwarming uitgezet
    title: Badkamerdeur staat open en de verwarming stond aan.
mode: single

But for some reason it never fires. To verify; the bathroom door (badkamerdeur) is left open quite often, so it should fire quite often when it tries to heat, right?
Manually firing it does work, so the script it’s calling is fine.

Your configuration looks correct, how try to change the format of the for time in the condition block to be the same as the trigger ``00:05:00`.

You probably dont need the condition and the trigger to be the same. Drop the repeated condition (leave the last one, the time one).

Are you sure that heating is the state of the attribute hvac_action of the clinate entity and not the state of the climate entity itself?

@Burningstone

alias: '[Badkamer]Deur open: Verwarming uit'
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.badkamerdeur
    to: 'on'
    for: '0:05:00'
  - platform: state
    entity_id: climate.badkamer
    attribute: hvac_action
    to: heating
condition:
  - condition: state
    entity_id: binary_sensor.badkamerdeur
    state: 'on'
  - condition: time
    after: '06:30'
    before: '23:59'
action:
  - service: script.turn_off_badkamer_heating
  - device_id: 621869ba5dd715a0989efa6d994c05e3
    domain: mobile_app
    type: notify
    message: Verwarming uitgezet
    title: Badkamerdeur staat open en de verwarming stond aan.
mode: single

Could it be that the bathroom door has been open for HOURS already, and not 5 min?

EDIT: Not sure how, but i had the TADO smart app still setup for a smart-heating scheme.It now overwrites that if the heating is on with the same action.

That doesn’t matter, it just checks if it has been open for at least 5 minutes.

I see you’ve already corrected part of the automation where there is a “for” in a condition.
This is not currently possible. Nor is it likely to be due to the data overheads to checking something that happened in the past. And the simple step of checking - last_triggered or last_changed etc. Should suffice (though does require some templating skills).

Edit: See Burningstone’s post below

It is, or at least the docs say it’s valid → see here.

1 Like

Wow !
I did not expect that.
I’m gonna have to do some testing.
Does anyone know when that crept in ?

That’s there since a long time, quickly checked the commits and at least in October 2018 this was already in the docs.