it says the usual - Config will not prevent Home Assistant from starting
francisp
(Francis)
August 11, 2023, 2:42pm
6
Rename automations.yaml to automations.old
create an empty automations.yaml
restart HA
does that work ?
1 Like
that worked - at least automations are showing up now on the visual editor. I guess one of those automations was breaking things up then?
francisp
(Francis)
August 11, 2023, 2:52pm
8
Yes, now the work is finding which one.
1 Like
tom_l
August 11, 2023, 2:52pm
9
Yeah. Paste the back from the old file a few at a time until you find the issue.
1 Like
This is the solution. I troubleshooted it and learned the hard way not to delete devices abruptly - a single device deletion called this mayhem. Also for anyone reading this afterwards - MINIMIZE the use of DEVICE in triggers - do states instead. That will simplify troubleshooting vs. looking at random IDs and having to read entire automation
1 Like
tom_l
August 12, 2023, 12:54am
11
Ok. While I strongly agree with your stance on device automations, you may have just found a bug.
In a recent release the behaviour of device automations was changed. Rather than disappearing completely a device automation that used an unavailable device should now report as unavailable. It seems that instead it is creating the mess of issues you reported above.
We should open an issue about this. Can you post the automation that caused the issue (if you still have your automations.old file)?
Also what version of home assistant are you on?
Edit:
For my reference this is the PR: Set automations which fail validation unavailable by emontnemery · Pull Request #94856 · home-assistant/core · GitHub
Others with this issue:
Hello all
I have been frustrated today by my home assistant installations
I was running HA supervisor on a dedicate debian laptop until 2 week ago and all was fine. I migrated to a HA OS solution on a vm in proxmox and for the first week (using the backup from the laptop) all was fine.
I have a different phone and i wanted to add it to HA. I read that i needed to add
Mobile_app
discovery
to the configuration yaml. Which i did . I restarted HA and when it came back up all my automation were…
After the latest update I am getting the following error and all my automations have broken. I haven’t changed anything recently so not sure what is causing it? Can anyone point me in the direction on how to troubleshoot?
2023-08-10 09:37:00.458 ERROR (MainThread) [homeassistant.setup] Error during setup of component automation
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 259, in async_setup
File "/usr/src/homeassistant/homeassistant/components/automation/…
wbravin
(william bravin)
August 13, 2023, 11:04pm
12
Hello all
This happened to me again out of the blue after a complete rebuild and updates
After a complete destruction of the HA vm on proxmox I re-install HA OS and all the addons and integration i had before.
I restarted HAOS af ter each addition
As I’m adding z-wave devices and i started to add simple automation this situation happed for the 3rd time.
I tried to rename automation .yaml to old this was more a disaster than before because it goes way beyond my comfort zone.
I deleted and destroyed the HA VM again and recreated it.
After each step I created a backup (just in case)
As i added addons and integrations nothing happened.
I added z-wave js ui addon and the js integration as per instructions and so far all is fine.
I truly believe that the root cause of this were all the updates from HA and the integrations that were not aligned.
I will continue to add integrations and automations and continued to create full backups and see where this goes
tom_l
August 14, 2023, 3:02am
13
The cause is that you are using device automations, and the way missing devices in automations are handled has changed, possibly including a bug.
If you keep adding back the same faulty automation without changing it you will get the same result.
You did not answer any of my questions so I can’t help you.
R1DEN
August 14, 2023, 7:26pm
14
@tom_l
Same thing happened to me.
What would be the info needed to debug it?
I’ve updated from 2023.8.1 to 2023.8.2 and also use device automation. However I certainly did not delete any of them that are used in automations.
tom_l
August 15, 2023, 2:17am
15
You would need to remove all the automations from your automations.yaml file, reload or restart the add them back one at a time reloading in-between to find the automation at fault.
1 Like
R1DEN
August 15, 2023, 7:59am
16
Okay, I’ve dug through the logs, found the ID it was erroring on, found it in the automations.yaml and changed the triggers and conditions from device based to state based (glad I’ve already had them in other automations and could just copy them)
Thank you, nevertheless!
1 Like
I think it was this one (I did retain Automations.old). Device that caused it is the one in “Condition”
- id: '1691345676498'
alias: Princess Window R Open/Close
description: ''
trigger:
- platform: time
at: '21:00:00'
condition:
- type: is_open
condition: device
device_id: a84a65093ec671a93f09e00a34769ce9
entity_id: 702f5fe57949392deaaef8d89966e2f4
domain: binary_sensor
action:
- type: turn_on
device_id: 287d6dfad0dc0c36c5b8fd09238e5742
entity_id: light.king_bulb_ceiling
domain: light
brightness_pct: 90
alias: Turn on King Bulb
- service: notify.alexa_media_sphere
data:
data:
type: tts
message: Princess right window is open
mode: single
Version - wise:
Home Assistant 2023.8.2
Supervisor 2023.08.1
Operating System 10.4
Frontend 20230802.0 - latest
this is actually very simple (I am not technical at all myself) - all you do is go into File Editor → rename Automations to .old and then click + to create file automations.yaml. That’s it. You then restart and all starts working. Then just copy across from automations.old little by little to identify the culprit and quash it.
tom_l
August 15, 2023, 8:07am
19
Are any of the devices used in that automation unavailable?
Yes, the one in Condition was
tom_l
Split this topic
August 16, 2023, 12:07pm
21
3 posts were split to a new topic: Automation lux condition issue
tom_l
August 15, 2023, 8:42am
24
Perfect.
I have opened an issue for you here:
opened 08:41AM - 15 Aug 23 UTC
### The problem
[PR 94856 ](https://github.com/home-assistant/core/pull/94856)w… as introduced to prevent automations that use devices from disappearing when those devices were unavailable and to mark the automations as unavailable instead.
However numerous users [are reporting](https://community.home-assistant.io/t/automations-wont-start-on-home-assistant-restart/601814?u=tom_l) (forum link) that if they have an automation with a missing device that home assitant fails to start with the following error message:
```
2023-08-11 14:31:10.255 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of default_config. Setup failed for dependencies: automation
2023-08-11 14:31:10.257 ERROR (MainThread) [homeassistant.setup] Setup failed for default_config: (DependencyError(...), 'Could not setup dependencies: automation')
```
### What version of Home Assistant Core has the issue?
core-2023.8.2
### What was the last working version of Home Assistant Core?
core -2023.7.
### What type of installation are you running?
Home Assistant OS
### Integration causing the issue
Automation
### Link to integration documentation on our website
https://www.home-assistant.io/docs/automation/
### Diagnostics information
_No response_
### Example YAML snippet
```yaml
- id: '1691345676498'
alias: Princess Window R Open/Close
description: ''
trigger:
- platform: time
at: '21:00:00'
condition:
- type: is_open
condition: device
device_id: a84a65093ec671a93f09e00a34769ce9
entity_id: 702f5fe57949392deaaef8d89966e2f4
domain: binary_sensor
action:
- type: turn_on
device_id: 287d6dfad0dc0c36c5b8fd09238e5742
entity_id: light.king_bulb_ceiling
domain: light
brightness_pct: 90
alias: Turn on King Bulb
- service: notify.alexa_media_sphere
data:
data:
type: tts
message: Princess right window is open
mode: single
```
### Anything in the logs that might be useful for us?
```txt
2023-08-11 14:31:10.235 ERROR (MainThread) [homeassistant.setup] Error during setup of component automation
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 288, in _async_setup_component
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 259, in async_setup
await _async_process_config(hass, config, component)
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 976, in _async_process_config
entities = await _create_automation_entities(hass, updated_automation_configs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 860, in _create_automation_entities
cond_func = await _async_process_if(hass, name, config_block)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 989, in _async_process_if
checks.append(await condition.async_from_config(hass, if_config))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/condition.py", line 246, in async_from_config
return cast(ConditionCheckerType, await factory(hass, config))
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/device_automation/condition.py", line 55, in async_condition_from_config
return trace_condition_function(platform.async_condition_from_config(hass, config))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/binary_sensor/device_condition.py", line 317, in async_condition_from_config
state_config = condition.state_validate_config(hass, state_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/condition.py", line 1022, in state_validate_config
config[CONF_ENTITY_ID] = er.async_validate_entity_ids(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 1395, in async_validate_entity_ids
return [async_validate_entity_id(registry, item) for item in entity_ids_or_uuids]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 1395, in <listcomp>
return [async_validate_entity_id(registry, item) for item in entity_ids_or_uuids]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 1364, in async_validate_entity_id
raise vol.Invalid(f"Unknown entity registry entry {entity_id_or_uuid}")
voluptuous.error.Invalid: Unknown entity registry entry 702f5fe57949392deaaef8d89966e2f4
2023-08-11 14:31:10.255 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of default_config. Setup failed for dependencies: automation
2023-08-11 14:31:10.257 ERROR (MainThread) [homeassistant.setup] Setup failed for default_config: (DependencyError(...), 'Could not setup dependencies: automation')
```
### Additional information
device_id: a84a65093ec671a93f09e00a34769ce9 used in the above automation was unavailable.
Please follow along and answer any of the developers questions that you can.
1 Like
thanks, hopefully helped community a bit beyond just paying for Nabu Casa
petro
(Petro)
Split this topic
August 16, 2023, 12:03pm
26