Invalid config for [automation]: not a valid value for dictionary value @ data['action'][1]['entity_id']. Got None. (See /config/configuration.yaml, line 31)

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
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:

#S1 Lights Daily Routine Rule 1 of 8
- id: Lights_daily_on_at_sunset
  alias: 'Lights daily on at sunset'
  initial_state: 'off'
    platform: sun
    event: sunset
  - service: light.turn_on
      entity_id: light.hue_color_lamp_1
      brightness: 254
      rgb_color: [255,241,224]
      transition: 10
  - service: light.turn_on
      entity_id: light.upstairs
      brightness: 254
      rgb_color: [255,255,255]
      transition: 10
  - delay: "{% if states('weather.home') in ['fog','cloudy','partlycloudy','rainy','pouring','snowy-rainy','snowy'] %}00:00:01{% else %}00:15:00{% endif %}"
  - service: switch.turn_on
    entity_id: switch.tpswmaindoor

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.

can you try with color_name: white

instead of rgb_color: [255,255,255]

Thanks for suggesttion but is that the problem? That will not allow me to choose the color of my choice in subseuquent automation rules.

It couldn’t be the problem just wanted to see if this goes through or not.

Error remains the same even with the use of color_name instead of rgb_color. Problem is something else.

Try like this

  - service: light.turn_on
      transition: 60
        - 255
        - 100
        - 100

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.

1 Like

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.

Look at automations for which you use a template for entity_id.

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.

#   Triggers when master failure detected
- id: Make_Me_Master_Node
  alias: 'Make Me Master Node'
  initial_state: 'on'
  - platform: state
    entity_id: binary_sensor.hassosprod
    from: 'on'
    to: 'off'
      seconds: 15
    condition: state
    entity_id: input_boolean.ha_node_auto_master_mode
    state: 'on'
  - service: persistent_notification.create
      message: 'Master failure suspected, taking control!'
      notification_id: '0200'
      title: Alert 
  - service: automation.turn_on
      - automation.Lights_daily_on_at_sunset
      - automation.Lights_daily_upstairs_morning_on_off_7_2_12am
      - automation.Lights_upstairs_evening_on_off_7_2_10pm
      - automation.Lights_daily_off_at_night
      - automation.Lights_daily_off_at_sunrise
      - automation.Lights_livingroom_lamp_off_at_11night
      - automation.Lights_daily_Christmas_on_at_sunset
      - automation.Lights_daily_Christmas_off_at_morning
      - automation.Away_mode_NBR_light_on_at_night
      - automation.Away_mode_NYBR_lights_switch_over_at_night
      - automation.Away_mode_YOBR_light_off_at_night
      - automation.Away_mode_office_light_off_at_night
      - automation.Garage_entry_motion_light_on
      - automation.Garage_entry_motion_light_off
      - automation.Garage_door_open_alerting
      - automation.Garage_Door_open_send SMS_awaymode_on
      - automation.Garage_door_SMS_reminder_20
      - automation.Garage_door_SMS_reminder_60
      - automation.Garage_door_closed_set_all_normal
      - automation.Garage_door_auto_close
      - automation.Garbage_Reminder_Light
      - ........

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:

#      - automation.Garage_Door_open_send SMS_awaymode_on
#      - automation.Office_tablelamp_on with_mainlight

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.

The two entities have a space character in their names:

      - automation.Garage_Door_open_send SMS_awaymode_on

      - automation.Office_tablelamp_on with_mainlight

Perhaps you accidentally entered a space instead of an underscore?

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.

Thank you all for your reply.