I keep getting a notification that I have an error in one of my automations. The notification says to check the log, but the log isn’t much help. This is what I see in the log:
Logger: homeassistant.config
Source: config.py:464
First occurred: June 16, 2022, 3:20:03 PM (13 occurrences)
Last logged: 5:04:46 PM
Invalid config for [automation]: not a valid value for dictionary value @ data[‘type’]. Got None required key not provided @ data[‘entity_id’]. Got None required key not provided @ data[‘hvac_mode’]. Got None. (See /config/configuration.yaml, line 10).
Line 10 in my configuration file is: group: !include groups.yaml
Obviously, that has noting to do with automations, although line 11 is the include line for automations.yaml
How do I track this down? My automations work so I don’t know what to make of this.
Correct. It’s unfortunate but the line number indicated in an error message rarely corresponds to the actual line containing the error. What you need to do is search for an automation (in automations.yaml) that references hvac_mode. It’s misconfigured.
In that case, search through configuration.yaml. If it’s not there, search through all other YAML files in the config folder. hvac_mode is part of the configuration of something that was used incorrectly in one of those files.
Tip:
Some text editors, like Visual Studio Code, allows you to search for a string in multiple files. It makes it easier to find something when you don’t know exactly which file contains it.
I did exactly that. The only hits in the configuration.yaml were from a couple of generic thermostats, and it was part of initial_hvac_mode: "off". The only other hits were in the log file itself.
Note the presence of the three keys mentioned in the error message:
not a valid value for dictionary value @ data[‘type’]. Got None required key not provided @ data[‘entity_id’]. Got None required key not provided @ data[‘hvac_mode’].
A Device Action can be part of an automation or script.