Invalid config for [automation]: expected str for dictionary value @ data['id']

I’ve been haunted by this error for a while not but I just can’t figure out what might be causing it. Does anyone have an idea on what I should look for?

Could it be an old entity_id that I’m referring to somewhere?

2022-11-01 10:50:42.676 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: expected str for dictionary value @ data['id']. Got None. (See ?, line ?).

Can you check (e. g. logbook if you have enabled it) which automation triggered at 10:50:42?

That’s a great idea. I wasn’t able to go that far back, for some reason it just kept on loading and noting happened. So I restarted HA and took a new look but there is no event with the same time stamp as in the log.

If you like, post your ‘Home Assistant started’ automation code.

Here are all things related to that automation.

Home Assistant Starting

    - id: '1667230386'
      alias: 'Home Assistant Starting'
      initial_state: true
      trigger:
        - platform: homeassistant
          event: start
      action:
        - service: shell_command.phue_all_off
        - service: script.all_lights_on
        - service: script.outside_lights_on
        - service: shell_command.loopia_dns

Script to turn off all lights in the Hue bridge quickly

phue_all_off: 'curl -X PUT -d ''{"on": false}'' http://10.0.0.31/api/******/groups/0/action'

All lights on

all_lights_on:
  alias: All Lights On
  mode: single
  sequence:
    - service: script.window_lights_on
    - service: script.kitchen_lights_on
    - service: script.sitting_room_lights_on
    - delay:
        milliseconds: 120
    - service: script.office_xxxxx_lights_on
    - service: script.hallway_lights_on
    - service: script.living_room_lights_on
    - delay:
        milliseconds: 120
    - service: script.office_yyyyy_lights_on
    - service: script.guest_room_lights_on
    - service: script.bedroom_lights_on
    - delay:
        milliseconds: 120
    - service: script.inner_hallway_lights_on
    - service: script.garage_lights_on

Outside Lights

    outside_lights_on:
      sequence:
        - service: script.outside_lights_sunset
        - service: script.outside_lights_evening
        - service: script.outside_lights_night

    outside_lights_sunset:
      sequence:
        - condition: sun
          after: sunset
          after_offset: '-00:45:00'
        - condition: time
          before: '20:00:00'
        - service: light.turn_on
          target:
            entity_id:
              - light.entrance
              - light.driveway
              - light.porch
          data:
            brightness: 120
            transition: 5

    outside_lights_evening:
      sequence:
        - condition: time
          after: '20:00:00'
        - condition: time
          before: '22:30:00'
        - service: light.turn_on
          target:
            entity_id:
              - light.entrance
              - light.driveway
              - light.porch
          data:
            brightness: 60
            transition: 60

    outside_lights_night:
      sequence:
        - condition: time
          after: '23:30:00'
        - condition: sun
          before: sunrise
        - condition: time
          before: '22:30:00'
        - service: light.turn_off
          target:
            entity_id:
              - light.entrance
              - light.porch
        - service: light.turn_on
          target:
            entity_id: light.driveway
          data:
            brightness: 35
            transition: 5

Script to update my domain name with the current ip

loopia_dns: 'curl -s --user ''*****:*****'' "https://dyndns.loopia.se?hostname=xxxx.yyyy.zz&myip="`curl -s dyndns.loopia.se/checkip | sed ''s/^.*: \([^<]*\).*$/\1/''`; echo'

Literally, somewhere the automation ID is missing or the prefix automation. What kind of packages are you using? How are the files included?

1 Like

Files are included like this:

automation: !include automations.yaml
binary_sensor: !include binary_sensors.yaml
group: !include groups.yaml
script: !include scripts.yaml
sensor: !include sensors.yaml
notify: !include notifications.yaml
scene: !include scenes.yaml

But to my knowledge everything works, there might be some minor automation that doesn’t but not that I have noticed. Though the missing id you said is interesting and could likely be the case. I will for sure look through all my automations and make sure they have a valid id.

Do you see anything else I should take a close look at?

With packages, do you mean those I’ve written myself or things included from the ui/hacs?

@pedolsky you genius! I found the issue thanks too you - it was as you pointed out an automation id that was missing quotes. Thank you!

Warnings about incorrect automation ids could be improved, I’ve had issues before when duplicating an old automation and missing to update the id. No warnings about duplicated ids, things just don’t work. Here I had errors but impossible to understand what they meant.

I only assumed that you are using packages because the UI typical condition: [] is missing in your automation :slight_smile:

At first glance I cannot encounter any syntax errors (but I’m not familiar with shell commands).

Glad to hear!
Oh yes, sometimes the error report is terribly pointless. Would be great if that could be improved someday.