Automations Stop Triggering

Pretty new to HA so sorry if I’m missing / no sharing something obvious.

I have a few simple automations that work when I set them up but then randomly stop for no apparent reason.

Here is one specific example of a zigbee button triggering an if to effectivly turn it in to a light switch toggle.

alias: Equipment Room Lights Button Press
description: ""
trigger:
  - device_id: 094e4c3d5c8899b1d5325ba210b94bb3
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: remote_button_short_press
condition: []
action:
  - if:
      - condition: device
        type: is_off
        device_id: b99f4a5b4a19231fed92f6e90724cf0b
        entity_id: light.ceiling_lights
        domain: light
    then:
      - type: turn_on
        device_id: b99f4a5b4a19231fed92f6e90724cf0b
        entity_id: light.ceiling_lights
        domain: light
      - type: turn_on
        device_id: 69dc7b04f7c1c1ec6d1e436a013c5521
        entity_id: light.rack_lights
        domain: light
    else:
      - type: turn_off
        device_id: b99f4a5b4a19231fed92f6e90724cf0b
        entity_id: light.ceiling_lights
        domain: light
      - type: turn_off
        device_id: 69dc7b04f7c1c1ec6d1e436a013c5521
        entity_id: light.rack_lights
        domain: light
mode: restart

What should I be doing to troubleshoot here? I can see the button push registering in the device logbook, there is no new entry in the automation trace and I can’t see anything relevenet in the logs. TIA

Do you mean you pushed the button but the automation didn’t detect it so no trace was generated?

I assume thats the case. The button presses show in the log book like this…

26 March 2023

Equipment Room Button Remote Button Short Press event was fired

22:48:25 - 18 minutes ago

Equipment Room Button Remote Button Short Press event was fired

22:48:23 - 18 minutes ago

Equipment Room Button Remote Button Short Press event was fired

22:48:21 - 18 minutes ago

Equipment Room Button Remote Button Short Press event was fired

22:47:53 - 19 minutes ago

However the last date/time at he top of the trace page on the automation was 3 days ago when it last ran normally.

Sounds like the automation’s Device Trigger has ceased to detect the Remote Button Device’s events. Did anything change in your system’s configuration three days ago? For example, is it possible that the value of the device’s device_id had changed and is no longer 094e4c3d5c8899b1d5325ba210b94bb3 ?

Device id still the same and nothing changed that I know about.

It’s happening frequently and on a number of automations, but confusingly not all and at different times. So hard to track down what on earth is going on.

Try this version.

alias: Equipment Room Lights Button Press
description: ""
trigger:
  - device_id: 094e4c3d5c8899b1d5325ba210b94bb3
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: remote_button_short_press
condition: []
action:
  - service: "light.turn_{{ iif(is_state('light.ceiling_lights', 'off'), 'on', 'off') }}"
    target:
      entity_id:
        - light.ceiling_lights
        - light.rack_lights
mode: single 

Are they all zigbee triggers I wonder?
If so may be worth reading the following forum post as may be related:

Ahhhh balls. I think you could be right. Just been back through them and they do all appear to be zigbee ones. I guess the issue is still ongoing for you as that thread appears to have gone a bit stale?

It seems most respondents in the linked topic indicated they were using Deconz (for Zigbee integration). You appear to be using ZHA, a completely different Zigbee integration.

Are you certain the issue you’re experiencing is related to the one in the topic? The symptom may be similar but it doesn’t mean the cause is the same.

BTW, even if it is related to the other one, it doesn’t qualify as a Solution; the other reported issue remains unresolved.

My system suffers from this issue using ZHA

According to user Jeppy (who replied to you) updating to 2023.3.1 and disabling/enabling all automations fixed the problem for them. Did you try that and did it fix the problem for you?

If it didn’t then there’s potentially more than merely ‘because it’s Zigbee’ involved here.

I read that reply slightly differently to be fair.

I read:
He updated to 2023.3.1, he then had the reported symptoms following the update, disabled and enabled the affected automations and that fix the issue for him.

I didnt read that updating was the fix.

For me this problem seems to occur sporadically but once it has occured it seems to affect all zigbee triggers and the only fix appears to be to disable and enable the affected automations.

Having said all of that I haven’t experienced the issue in the last few weeks, maybe even a month so!

Neither did I; I interpreted it as being the combination of updating and disabling/enabling. But maybe it was just updating to the March release, or not. The actual solution is unclear.

When was the last upgrade you performed?

I normally perform the updates on the day of release in most cases.

For me this has been sporadically happening for approx 4 months maybe, so cant put any specific on what’s causing it. The only thing I know for sure is when it happens pretty much nothing rectifies it other than disabling and enabling the automations.

Because it is so sporadic it makes it difficult for me to diagnose!

@danmiles86 should try that. If it works then it qualifies as the Solution for this topic; maybe not a permanent fix, more of a ‘magic incantation’, but at least it clears the cobwebs.

In fact, you could create an automation that periodically disables/enables the affected automations … a periodic invocation of the magic incantation. :slightly_smiling_face:

1 Like