Automation working for a year stops

Racking my brain on this one. Had the below automation working for literally a year with NO problems.

  1. The sensor triggers, automation sees the trigger
  2. Condition passes
  3. Lights not triggered.

I check traces it shows “stopped because only a single execution”. Immediately after I can trigger the lights with my dashboard or with my ZHA wireless button with no problem. No long running execution.

The only thing I can think of is one of the updates borked something, but I have no idea what.

alias: Action - Patio lights Slide Door Open
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.lumi_lumi_sensor_magnet_aq2_opening
    from: null
    to: "on"
condition:
  - condition: sun
    before: sunrise
    after: sunset
action:
  - type: turn_on
    device_id: c3da17062f27d5ecac4bb21bd0b36869
    entity_id: 4965649777d6ac3bc35b07831a7a8979
    domain: light
mode: single

The’s a long thread about broken automations that seems to point to Zigbee / ZHA:

Ignore the title - I believe it wasn’t affected by mode: restart

1 Like
1 Like

I guess I’m more glad it’s likely a bug than me not understanding why this simple automation is broken :wink:

Not sure if it’s simply Zigbee/ZHA as my wireless button is Zigbee/ZHA and it works fine. It’s simply this automation specifically.

It’s not just zigbee/ZHA.

One of the threads was focused on zwave. Other than they both start with “Z” they are very different integrations.

After some extensive troubleshooting there is definitely something going on with, at least, ZHA “devices”. If you see from my original script, I was setting the trigger using “device” methodology and that wasn’t working even though the trigger was showing.

I then “disabled” that trigger and added another one but looking for the ZHA event using manual listening. The script still failed, but after reading the logs it stated the automation contained an unavailable entity and wouldn’t run even though that trigger was disabled.

So I then removed that trigger entirely and found it still didn’t work, but the logs updated with the same message. Something was “sticking”.

I then restarted the containers and now everything is working, using my manual ZHA listening trigger. While this works as a workaround, I shouldn’t have had to do it at all.

Post the problem as a new Issue in Home Assistant’s GitHub Core repository. That’s where suspected software bugs are reported and (often) resolved by the development team.

Done! If anyone is curious here’s the link: https://github.com/home-assistant/core/issues/98428