Automations got deleted after re-pairing a remote

Hello,

I had dozens of automations where an Ikea symfonisk gen 2 remote was the trigger.
The remote stopped working, so I deleted it and repaired it on ZHA, and then I saw that all my automations with that remote got deleted.

Is this normal behavior?

I know will have to spend hours recreating these automations…

Thank you

EDIT: I just recreated one of the old automations that got deleted, and all of a sudden, they all re-appeared again… very strange…

Did your automations have device triggers or did they have state triggers?

The triggers were device triggers.

see example:

alias: Denon UP volume
description: ""
trigger:
  - device_id: 872d37954e576adf799387e00c4b7020
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: dim_up
condition: []
action:
  - service: media_player.volume_set
    data:
      volume_level: >-
        {{ state_attr('media_player.denon_avr_x2700h_2', 'volume_level') | float
        +0.03 }}
    target:
      device_id: c3db1119ba04d9a00b8da15579b192ef
mode: single

That’s your problem.

Delete a device and all automations where the device_id is used will disappear.

There are other reasons not to use device triggers, conditions and actions. They are a simple way to start but are not easy to maintain.

2 Likes