Automations not working after Zigbee reconfigutation

My Zigbee mesh went down and after I’d brought it up again, automations involving Zigbee devices aren’t working.

All the devices were recognised and working, but their locations were missing and had to be added. The problem seems to be associated with the automation IDs now not being recognised.

Can anyone suggest a ‘work around’ that will avoid me having to rewrite all the automations again, please?

Jim

I do know it’s not what you want to hear but you’re probably recobfiguring your automations one last time… But let’s take a look at making it better when you do…

It sounds like you’re not using state triggers and entities in your automations and using devices instead?

How this applies. Whatever fix you had to do - sounds like it updated the devices and gave you new device id’s. - the only way around that is ensure you’re not using devices in your automations (device id’s do not persist when you delete a device) and use entities where available.

I end up having to blow away one of my integrations on a monthly basis. Which one is not important. The important fact is all the automations I have based on the items it provides are entity based and when I completely delete the integration, restart HA and re add it. I know I have one entity_id to rename to something and all of the automation built on it just works. If I had used devices I’d be editing 12 scripts…

1 Like

Thanks for the reply Nathan.

I used the visual editor for automations and it only gives the option to select a device rather than an entity.

Jim

1 Like

Show the one you’re talking about.

Its not very obvious at first glance but it’s only in rare circumstances you can’t find an alternative

You need to look for state triggers and numeric state triggers. They work with entities.

1 Like

you need to scroll further down in the drop-down selector box. They are there. see “numeric_state” and “state” in the list below.

And “call service” in the list below:

image

1 Like

I’ve been trying to post a screenshot of one of my problem automations, but keep getting ‘unformatted code’ errors. I’ve used the ‘Upload’ icon and the image appears OK in the RH pane, but it simply won’t post!

Thanks for the replies.

Jim

Don’t post screenshots of your automations. post the actual yaml code instead ensuring that it’s properly formatted using three backticks (```) on both the line before and after the code.

1 Like

Thanks ‘finity’.

The automation below worked fine before I needed to restore the Zigbee mesh:

alias: Landing Light
description: ""
trigger:
  - type: motion
    platform: device
    device_id: f46fa5e069e99ad735f55a4971712017
    entity_id: binary_sensor.landing_motion_motion
    domain: binary_sensor
condition:
  - condition: sun
    before: sunrise
    after: sunset
    enabled: true
    after_offset: "-00:30:00"
action:
  - service: light.turn_on
    data:
      brightness_pct: 10
      rgb_color:
        - 237
        - 51
        - 59
    target:
      area_id: landing
      device_id: 68799596eb2f9e23dd0c953e2ec0ee74
  - delay:
      hours: 0
      minutes: 3
      seconds: 0
      milliseconds: 0
  - service: light.turn_off
    data: {}
    target:
      area_id: landing
      device_id: 68799596eb2f9e23dd0c953e2ec0ee74
mode: single

Jim