All automations turn off and become uneditable

I apologize if this has been covered, but I can’t seem to find it. I’ve created several automations (through the config) which work fine, but then sometimes when I go back into my automations, I find that they’ve all been disabled and I’m unable to turn them back on or edit them, getting the message "only automations defined in automations.yaml are editable. When I check the file, they all seem to be in there. I’ve had this happen several times now and I can’t figure out why. It seems to happen whenever I try to add a new automation or a new device. I’ve started creating entire snapshots before I add anything new. Sometimes one snapshot will give me my automations back, sometimes the same snapshot won’t. I’m at my wit’s end because I have no idea what’s causing it or how to fix it. It’s probably something simple but I’m still very new at Home Assistant (still moving devices over from Smartthings) so I could use some help.

try adding

initial_state: true

to the automation

I assume you mean in the configuration.yaml (or more correctly automations.yaml) by manually editing the yaml itself?

Or do you mean thru the GUI editor?

Because you only get this message if you create the automations in yaml and then later try to edit them with the GUI editor. Which you can’t do. You can only edit automations that were created manually via manual text editor. And you can only edit automations created via the GUI editor via the GUI editor.

What exactly do you mean by this?

Where are you seeing that they are “disabled”?

I initially created the automations in the automation editor, and initially they all worked fine. But after adding a device (or two or three), I came back to add another automation and all my automations were turned off. I was unable to turn them back on. The pencil icon on the right of each automation (to edit them) was crossed out and when I hovered my mouse over it, that’s when I got the error message saying “only automations defined in automations.yaml are editible.” So then I went into the file editor and pulled up the automations.yaml and all of the automations were in there. So I’m really confused.

Do the automations still have unique ids?

Also, do you have any errors in your home-assistant.log file related to automations?

Yes, they do.

I’m not seeing any. Is there an easy way to search through them? I looked for ERROR over the last couple of days and none came up.

I think the easiest way is to restart HA to clear out the old log entries and if the automations come back as disabled/uneditable then look at that point.

It’s true I may have edited the automations.yaml. I was trying a lot of things, so it’s hard to say. I copied the text in the file to my notepad to make it easier to reproduce the automations, and then deleted everything in the automations.yaml and saved it, hoping I could just start over and create all new automations. Unfortunately, whenever I create them in the automation editor now, they don’t show up in the list (of automations). I click save and it just disappears into the ether. But they are getting written to the automations.yaml file, even though they don’t work. How do I get out of this?

Can you post a couple of the automations here (correctly formatted) so that we can see the form that they are in from the file you saved?

I removed all of the automations and cleared the automations.yaml file, so there aren’t any left at this point. I’m hoping to find a way to just start over and create new automations via the automation editor, but whenever I create one and hit save, it won’t show up on the list, even though it does get written to the yaml file. None of them work though, when triggered.

Did you also do an automations reload when you cleared that file manually?

Sure, here are the first two, as written to the automations.yaml file from the automation editor: (sorry about that!)

- id: '1611154306723'
  alias: Kitchen Pantry Light Switch on
  description: Switch will turn on with motion
  trigger:
  - type: turned_on
    platform: device
    device_id: 18e3f6fa3118924a1061ff1a7a7444de
    entity_id: binary_sensor.wink_unknown_type_0101_id_0001_sensor
    domain: binary_sensor
  condition: []
  action:
  - type: turn_on
    device_id: fda29f270f5469c9eff8495f698338f2
    entity_id: switch.pantry_light_switch_switch
    domain: switch
  mode: restart
- id: '1611156529885'
  alias: Kitchen Pantry Light Switch off
  description: light turns off after 1 minute of inactivity
  trigger:
  - type: turned_off
    platform: device
    device_id: 18e3f6fa3118924a1061ff1a7a7444de
    entity_id: binary_sensor.wink_unknown_type_0101_id_0001_sensor
    domain: binary_sensor
    for:
      hours: 0
      minutes: 1
      seconds: 0
  condition: []
  action:
  - type: turn_off
    device_id: fda29f270f5469c9eff8495f698338f2
    entity_id: switch.pantry_light_switch_switch
    domain: switch
  mode: single

Yes, I’ve reloaded the automations as well as restarting Home Assistant. Multiple times. :frowning:

edit your post and put three back ticks (```) on the line before and then again on the line after your code block.

OK, let’s recap…

right now you have a completely empty automations.yaml file?

And you have no automations at all listed in the automations GUI editor page?

And you have an entry in your configurations.yaml file for including the automations.yaml file?

automation: !include automations.yaml

and you have restarted HA and have no errors in the log file?

Ahh…I do NOT have that line in my congurations.yaml file. I did at one point, but took it out thinking maybe that’s what was causing the problem. Let me see what that does.

yes, you definitely need it.

Apparently I did, THANK YOU! My automations are showing up now and they also work when triggered. I’ll go ahead and rebuild them and stay away from the automations file from now on. Thank you thank you thank you! I’ve been struggling with this forever (okay, maybe just 2 days but it feels like forever)! One last question, I remember taking 3 lines out of my configuration.yaml. What would the other two have been? Scripts and scenes?

1 Like