I found a notification now coming up and in the log the following is shown:
Logger: homeassistant.config
Source: config.py:415
First occurred: 16:14:31 (1 occurrences)
Last logged: 16:14:31
Invalid config for [automation]: expected str for dictionary value @ data['to']. Got None. (See /config/configuration.yaml, line 132).
When checking the configuration in dev tools “check configuration”, all is fine (see screenshot).
Unfortunately I integrate my automation through
automation: !include_dir_merge_list automations
I read it as the error line pointing to ALL my automations (which are quite a lot) as this is the “integration” line. The error didnt come up prior, but:
I dont want to restart HA any time to check my config
The indication shows that some “to” field is not filled. Not sure if this is only related to platform state trigger, but this only has optional “to”-fields.
Anybody has an idea to
debug this further efficiently? Or knows this error?
is the startup check showing an error and dev tool check showing all is fine a known bug?
The configuration button really only checks that the YAML is valid and the keys used exist for the integrations. It cannot validate the values you set for every thing.
It’s stating that the ‘to’ field is None. Most likely, you have a template in a “to” field that is evaluating to None. For example:
trigger: state
entity_id: sensor.test
to: "{{ states('sensor.my_other_sensor') }}
If you do have templates in a “to” section, more than likely the sensor it’s trying to evaluate is not yet ready.
Just a general tip on what I do when this happens:
If you have multiple files in your automations folder, try to narrow it down by temporarily renaming one yaml file at a time (like adding an underscore at the end of the file, i.e. file1.yaml_ so that HA ignores the file at startup) until the error goes away. Then comment out automations until you find the offending one. I hade the same issue, and I found it, but I can’t remember what the cause of the error was.
Thanks @jocnnor , will try. The template item makes sense (didnt think about that) - during startup some entities might not be fully connected (e.g. remote sockets with Tasmota or similar) - also I am depending on other docker containers like homegear to be up and running. So I expect this to be the issue. I will narrow it down.
Thanks also @tjntomas for the renaming tip. I am already fearing the 40 times restarting… ;-).
Weirdly the issue only came up recently, so I will need to check what the issue is. I will close the topic. The hints should be sufficient to close this down.
For completeness:
The template part was really helping. The issue was a sensor configuration. I copied a sensor config and by mistake replaced parts of it. The sensor was still working, but didnt provide anything useful back regarding the automation trigger, thus firing the log error.