I have two servers running HA version 2020.12.1 and version 2021.1.3, I am getting below error while running 2021.1.x but no error on 2020.12.1.
Logger: homeassistant.config
Source: config.py:415
First occurred: January 15, 2021, 9:24:26 PM (10 occurrences)
Last logged: 2:36:16 PM
Invalid config for [automation]: not a valid value for dictionary value @ data['action'][1]['entity_id']. Got None. (See /config/configuration.yaml, line 31).
Below is the configuration in automation.yaml, line 31 is rgb_color: [255,255,255] where newer version HA is throwing error:
Need help what should be changed in service call for data dictionary values. There is no template used for any value and first entity is Philips hue bulb whereas second entity is Lifx bulb. Any help along this is appreciated.
Please don’t post pictures of code or error logs, instead post the code and format it correctly as stated in the community guidelines point 11.
The picture of the code you show is this from configuration.yaml? I assume it’s automations.yaml and you have automation: !include automations.yaml in configuration.yaml, because the error you show says that it didn’t get an entity_id, nothing about the color. I believe it’s another automation that’s causing the issue.
I agree with community guidelines and removed images from post.
Yes, you are right code is from automations.yaml and config.yaml points to automations file. Your point that error is not for rgb_color make sense to me becuase I already tried different formats for rgb_color etc. but nothing worked. Let me try by eliminating all other automation rules from file and see if the error disappears. Thanks for your reply.
The error message isn’t referring to line 31 of automations.yaml. It refers to configuration.yaml. Your automations aren’t part of configuration.yaml so I wouldn’t put too much emphasis on the reported line number.
Post the first 50 lines of the automations.yaml file.
Automation file is more than 1000 lines so I removed all the lines after first rule and started adding blocks of automations to find out which rule is causing the problem. Caught the below automation rule is throwing the error more specifically service: automation.turn_on section. I have two servers one prod (master) and other one development(slave); when prod services fails, development servers takes control by turning on all relvant automations on dev PI.
All your entity_ids start with a capital letter after automation.. Entity_ids are always all lowercase, you can see the correct name under Developer Tools -> States.
Adjust the entity_ids and you should be good to go.
I do not believe this is the issue because I have been using upper case naming convention for long time and this is working well on other instance no complain.
As of now I commented below two rules and there is no automation error, moment I uncomment any of these two rules, error comes back:
Problem is somewhere else in the code and I agree with earlier comment from Taras that line number in error message is not referring to actual error location.
For the friendly name maybe, but the entity_id is always all lowercase. Please show a screenshot from Developer Tools → States for one of these automations and show me that the entity_id has any uppercase letter.
Bingo Taras, you caught the space and I changed the space to underscore to fix the problem. It was a typo while renaming automation rules. Thank you.
It brings another interesting point because I have two different installations on raspberry pi. This typo happened on my prod server which runs 2020.12.1 version and that version automatically added underscore to the automation rule name where it was blank space but the dev server running 2021.1.x did not replace blank with underscore. I have no idea about this behaviour of two different versions? Here is the screenshot green one from prod and blue one from dev environments:
I use dev pi as slave that takes over control by turning on all automation rules when it detects the heatbeat failure from prod server. Underscore fixed error message I am yet to check functionalities of the rules.
Burn also pointed naming convention for entity_ids, yes I am using upper case in names but system automatically converts all of these to lowercase in the background, see the screenshot.