Automations GONE

My entity IDs are random numbers just like the device IDs.

- id: '1689273577770'
  alias: Master Bedroom Dimmer Long Press 20%
  description: ''
  trigger:
  - platform: device
    device_id: e16fc5fda0a493c6ff5c9c79b58af70b
    domain: zwave_js
    type: event.value_notification.central_scene
    property: scene
    property_key: '002'
    endpoint: 0
    command_class: 91
    subtype: Endpoint 0 Scene 002
    value: 2
  condition: []
  action:
  - type: turn_on
    device_id: e16fc5fda0a493c6ff5c9c79b58af70b
    entity_id: 1c93305e9794c1a5658977d05196d4d7
    domain: light
    brightness_pct: 20
  mode: single

How did I screw that up?

Hmm. That is interesting.

If I create an automation in the service call it works as it should.

description: ""
mode: single
trigger: []
condition: []
action:
  - service: light.turn_on
    data: {}
    target:
      device_id: 7debd32ca1c4f1429f9d4f86473aa070
      entity_id: light.back_house_potlights

I donā€™t usually use the UI for automations, I do it all in YAML. Iā€™ve never seen something like that before. You might have to manually go through your automations and specify the entity_id where required.

You did not screw that up. It is a change in the automations editor since a few versions, before the entity_ids were readable too.

Edit: see Jasonā€™s example above.

I think this explains it, Jason uses a service call with a device id, you use a device automation

1 Like

Good catch!

and in the latter example, the device_id can be deleted without consequences :wink:

Not if they refer to different devices.

  - service: light.turn_on
    data: {}
    target:
      device_id:
        - 7debd32ca1c4f1429f9d4f86473aa070
        - 4be59b51cd419d64829c0e0aa52d5dd5
      entity_id: light.bathroom_shower_light

Iā€™m not that confident with yaml yetā€¦ :pensive:

I think Iā€™m grasping this nowā€¦ so in many cases turning on a light via a service call rather than through the device will help avoid my situation as long as I rename the new device IDs the same (which I did).

2 Likes

sure you can mix entities and device_idā€™s:


action:
  - service: light.turn_on
    data: {}
    target:
      entity_id: light.flux
      device_id: 7583e30d7b3b33083f94237b4130162c

but in the above, the device/entity are not the representing the same devicešŸ¤”

So in general, just avoid using device_idā€™s, and use ā€˜choose entityā€™ :wink:

Iā€™m glad you agree with me :wink:

OMG this happen to me also but I havenā€™t changed anything. Some of the automations are still working tho it seems. I have a few disabled I use for the holidays and it seems that nothing past this area is working in the house. You would think with the new repairs area it would put up a warning there and not disable all the automations.

1 Like

Okay after over 5000 lines finally found it. Looks like one of my devices for a condition it doesnā€™t like anymore. Also found 2 weird lines in the yaml.

- *id001
- id: '1692482822877'

and

- &id001
  id: '1692482428289'

Any idea where the *id001 and &id001 would of come from? I deleted them and the automations saved and loaded with no errors.

Those are YAML anchors. They are used to repeat code in YAML. I donā€™t think the UI based automation editor uses them so maybe you mistakenly copied and pasted them from somewhere?

Search for ā€œanchorā€ on this page.
http://thomasloven.com/blog/2018/08/YAML-For-Nonprogrammers/

1 Like

Just happened to me. I tried to update firmware on my usb stick and z2m stopped working, needed to restart it manually. All seems to be working, but now most of automations donā€™t work. They are there, but disabled and devices are blank. All of them are zigbee, so I guess my zigbee devices somehow got missing temporarily and now I have to go fix all the automations by hand.
Devs: this behavior is not acceptable! You should disable affected automations at most, but not edit them to remove devices! This is ridiculous.

The developers donā€™t come here. Create an issue on Github if this really happened.