Automations GONE

All of my automations just disappeared. The automations.yaml file still exists though and it appears all my automation are there. But when HA is loaded, the Automations screen is blank. Additionally, when I go to Settings>System the “Backups” section is gone, so I cannot restore a backup.

The automations did have errors as I had to reprogram my entire z-Wave stick and I needed to change the devices the automations were associated with, but they were all still there before.

Does anyone have any wisdom or suggestions for me?

Restart ha. If that doesn’t work restart the entire machine.

I tried both of those. Neither helped.

These notifications appeared after the machine restart.

image

rename automations.yaml to automations.old
create an empty automations.yaml

restart HA

copy one for one an automation from automations.old to automations.yaml, reload automations, until you find the faulty automation

Before I go through all that, they all stopped working on their own, I mean, I didn’t add or change any automations. Most, if not all the automations need the associated device changed since I had to reprogram my entire zwave controller. Would that be the cause of the problem? Before they just were missing the associated device; that was what I was going to fix and re-add.

This happens if you use device automations, and the device does not exists any more.

1 Like

Ahhh… crap.

So if I copy an automation back into the new automation.yaml in which the device does not exist anymore, I’ll have the same problem, won’t I?

Am I better off just starting over?

If you choose
developes tools → yaml → reload → automation, and you see a repair appearing, you know you found the faulty automation. So you just have to fix that one.

But ANY automation that uses a device that does not exist anymore will be “faulty,” right?

If I just went in the automation.yaml file and removed all the device IDs, would that enable me to load the automations and then go assign new IDs?

Never tried that

And because the devices have changed, then I assume most of the entity IDs that were related to those devices are probably also no good as well?

You can figure out the new device_ID for each device and do a find & replace on the automations.yaml file. Back it up first (copy to automations.old or something). How much work this is depends on how many devices you have.

I recommend in the future you always try to use an entity_id as your target when you can (it’s not always possible). It’s much easier to rename a few entity id’s if you need to when you reinstall a device or even change to a completely different one than try to change the device id in all your automations, scripts etc. You just found that out the hard way.

Automations isn’t even available in developer tools > yaml

Good grief… you ain’t kidding…

How do I find the new device IDs?

if it is not there, maybe , your name in left lower corner, and then

afbeelding

Advanced mode is on. It just isn’t showing up…

Easist way is in develper tools → template. Pick any entity_id from the device.

Here’s the device ID for one of my zwave locks.

If you created the blank automations.yaml file already, restart HA.

Thanks, guys, for your help. I’m getting it done… slowly.

The hard part is figuring out the entity IDs. My automations.yaml file was 1800 lines of code. This will take a while.

I think I’m following what you’re saying, but don’t really see the difference. If I change a device, its ID along with all the Entity IDs associated with that device will also change, right?

Entities are name based, so when you replace a device and give it the same name, it will work.
This won’t be the case with device id’s :thinking:

Have a look at my automation, it doesn’t use any id’s, only entity names :wink:

alias: NightLight
description: toggle switch
trigger:
  - platform: state
    entity_id:
      - sensor.bedroomswitch_action
    to: "on"
    id: "on"
  - platform: state
    entity_id:
      - sensor.bedroomswitch_action
    to: "off"
    id: "off"
condition: []
action:
  - service: light.toggle
    data:
      transition: 2
    target:
      entity_id: light.bedroomnightlight
mode: single