Unusual Automation Behaviour

I’ve had an automation running for the last 7 months that notifies me via Telegram when an Air Conditioner is activated via an ESPHome ESP32 unit. Here’s the automation yaml code…

alias: Studio AirCon Status
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.studio_ac_climate
    to: "on"
    from: null
condition: []
action:
  - service: telegram_bot.send_message
    data:
      message: The Studio Air Conditioner is now ON
  - wait_for_trigger:
      - platform: state
        entity_id:
          - binary_sensor.studio_ac_climate
        to: "off"
        from: null
  - service: telegram_bot.send_message
    data:
      message: The Studio Air Conditioner is now OFF
mode: single

So the automation literally stopped working after the recent updates… not sure if there is something I missed?

I have a grid card on my main dashboard, and it seems to be working… so I am unsure why the automation is not activating?

Here’s the status…

Any advice on where I might diagnose is appreciated. I’d say it’s something I’ve missed, so keen to get it solved.

Start by checking the automation trace.

Hey, thanks for the advice. I looked at the trace first up, and it hadn’t been triggered for some days. So I ended up creating a new automation, which solved the issue.

If you see the code below… I am pretty sure it is identical to the other automation that doesn’t work.

alias: Studio AirCon Status
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.studio_ac_climate
    to: "on"
    from: null
condition: []
action:
  - service: telegram_bot.send_message
    data:
      message: The Studio Air Conditioner is now ON
  - wait_for_trigger:
      - platform: state
        entity_id:
          - binary_sensor.studio_ac_climate
        to: "off"
        from: null
  - service: telegram_bot.send_message
    data:
      message: The Studio Air Conditioner is now OFF
mode: single

Strange, very strange.

1 Like