Issues with old config now updating

So, since a few releases ago, ive noticed that things are not working as expected any more. If I remove automations, scripts and ESPHome configs etc, they still remain as entities and the entities are not removed. This is leaving a lot of old, unused and messy configuration lying around. Ive rebooted, and when adding or deleting automations and ESPHome esp32 configs, they are not removed or added to my entities.

Any ideas?

Removing ESPHome config files does not delete the integrations, it only removes the device from the addon management page.

You can delete the integration in the Settings > Devices & Services page.

How were the automations and scripts created?

They were a mixture of created in the GUI and created in the config manually.

Once you have deleted yaml automations and restarted you need to go to the Settings > Automations list and delete the “restored” entity. It’s probably the same for scripts. It’s definitely the same for yaml helpers.

I dont have any restored entity in my Automations or any tabs in settings >> automations, they are all empty except the last one blueprints

So what’s the problem?

they show up when I try to add things like triggers for automations, they show up.

Clear your browser cache.
It is just a first step to avoid ghosts from the browser clouding the issue.

Its weird because strange stuff is hapenning. I always run in incognito.

Right now I have this is configuration.yaml


# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

frontend:
  themes: !include_dir_merge_named themes
  
switch:
  - platform: rpi_gpio
    ports:
      27: Door Lock

  - platform: rpi_gpio
    ports:
      20: Pool Pump

  - platform: rpi_gpio
    ports:
      19: Wall Lights
      
  - platform: rpi_gpio
    ports:
      13: Pool Lights
      
  - platform: rpi_gpio
    ports:
      23: relay5
      
  - platform: rpi_gpio
    ports:
      22: relay6
      
  - platform: rpi_gpio
    ports:
      12: relay7
      
  - platform: rpi_gpio
    ports:
      26: relay8
      
automation:
  - alias: 'tree lamp notification'
    trigger:
      platform: state
      entity_id: door2
      to: 'open'
    action:
      - service: notify.mobile_app_SM-G973F
        data:
          title: "Lights"
          message: "The tree lamp is on"
          
  - alias: 'leaving home'
    trigger:
      platform: state
      entity_id: device_tracker.dean
      to: 'open'
    action:
      - service: notify.mobile_app_SM-G973F
        data:
          title: "Lights"
          message: "The tree lamp is on"

Yes I am getting this in my logs.

Invalid config for [automation]: Entity door1 is neither a valid entity ID nor a valid UUID for dictionary value @ data[‘entity_id’]. Got None. (See /config/configuration.yaml, line 48).

2:03:09 AM – (ERROR) config.py - message first occurred at 1:30:22 AM and shows up 8 times

YAML file /config/configuration.yaml contains duplicate key “automation”. Check lines 47 and 59

1:56:39 AM – (WARNING) util/yaml/loader.py

Have tried to reload core configuration and check config on configuration.yaml and comes back valid.

How is it seeing any entity for door1 in my configuration.yaml, there is no entry there for door1.

That is not a valid entity id. Entity ids must be of the form domain.object_id

Which is why it is saying:


Invalid config for [automation]: Entity door1 is neither a valid entity ID nor a valid UUID for dictionary value @ data[‘entity_id’].

But where is it getting door1 from anyway?

So I replaced with binary_sensor.door2, same thing.

What is the error log saying now?

With this config

automation:
  - alias: 'tree lamp notification'
    trigger:
      platform: state
      entity_id: binary_sensor.door2
      to: 'open'
    action:
      - service: notify.mobile_app_SM-G973F
        data:
          title: "Lights"
          message: "The tree lamp is on"

I get these errors.

Invalid config for [automation]: Entity door1 is neither a valid entity ID nor a valid UUID for dictionary value @ data[‘entity_id’]. Got None. (See /config/configuration.yaml, line 48).

2:29:04 AM – (ERROR) config.py - message first occurred at 1:30:22 AM and shows up 14 times

YAML file /config/configuration.yaml contains duplicate key “automation”. Check lines 47 and 59

1:56:39 AM – (WARNING) util/yaml/loader.py

I clear the errors, reload core configuration and check configuration on my configuration.yaml, and they errors come back as notifications.

These states are not valid for either of the trigger entities:

to: 'open'

It is going to be 'on' for the binary sensor and 'home' for the tracker.

You have this in your config file twice when it should only be there once:

automation:

Check these lines:

Does “binary_sensor.door2” exist in your system?

look in the dev tools states page to see if it’s listed there.

Yes, its in my entities page and also under the states page.

However what does not exist is my SM-G973F phone for some reason.

Did you fix this?

You can’t have both this:

default_config:

and this:

automation:

In the same configuration.yaml file since default_config also implicitly does this:

automation: !include automations.yaml

If you want to have YAML only automations like that you need to use a labeled automation block like it says here. Change it to something like this:

automation smart_stuff:

You can change smart_stuff to whatever you want, just give it a label.

At least I think so, it looks right otherwise. That’s the whole configuration.yaml right, not a subset?

Oh so I should be defining those automations in the automations.yaml instead?