Invalid Config - cannot figure out the issue

Hello everyone,

for a few days HA tells me that it has a problem with my config in line 28, something to do with automation.
I cannot figure out what is wrong here or where to look otherwise. I would be really thankful if someone could help me sort this out.

thank you very much!!!

attached are a few screenshots :slight_smile:




Line 21 in configuration.yaml piques my curiosity.

Where is the folder and what is the structure inside?

The eleventh action in one of your automations is missing a valid target:

Ignore the listed line number. That is just pointing to your !include automations.yaml file. Line numbers in your editor dont start counting at zero though, so it shows up as line 29, rather than 28.

Look at the last action in the last automation he posted. Looks like script.turn_on with no entity, and a template for the entire data field without template notation.

1 Like

thank you so much for your help.

since i thought this might be the issue i already changed the name, before it was called “automations” and now it is called “alarmanlage”.
so i hoped if there was a mistake i could tell it apart by the other name, but i think this seems to be fine. here are pictures of the structure:



thank you for all your advices, i will get into that later, when i have time :smiley:

do you mean this automation?
it´s been like this since when i started with HA and didnt get an error message before :thinking:

- id: '1655291223426'
  alias: 'Vacuum: Execute vacuum zone'
  description: ''
  trigger: []
  condition: []
  action:
  - service: vacuum.stop
    data: {}
    target:
      entity_id: vacuum.saugi
  - delay:
      hours: 0
      minutes: 0
      seconds: 3
      milliseconds: 0
  - service: script.turn_on
    data:
      if states.input_select.vacuum_zone.state == "Küche": script.vacuum_zone_kitchen
      elif states.input_select.vacuum_zone.state == "Bad": script.vacuum_bathroom
  mode: single´

here is my full automation yaml, in case the upper automation is not what you meant :slight_smile:

- id: '1654371747948'
  alias: Back ups Issue Notification
  description: ''
  trigger:
  - platform: state
    entity_id:
    - binary_sensor.backups_stale
    from: 'Off'
    to: 'On'
  condition: []
  action:
  - service: notify.mobile_app_sm_f926b
    data:
      message: Access the Google Drive Back Up Add On for Details
      title: There is an Issue with the back ups.
      data:
        clickAction: /hassio/ingress/cebe7a76_hassio_google_drive_backup
  mode: single
- id: '1654618714639'
  alias: 'Abfallkalender '
  description: ''
  trigger:
  - platform: calendar
    event: start
    offset: '-6:0:0'
    entity_id: calendar.abfallkalender
  condition: []
  action:
  - service: notify.mobile_app_sm_f926b
    data:
      title: Abfallkalender
      message: '{{ trigger.calendar_event.summary }}'
  mode: single
- id: '1655291223426'
  alias: 'Vacuum: Execute vacuum zone'
  description: ''
  trigger: []
  condition: []
  action:
  - service: vacuum.stop
    data: {}
    target:
      entity_id: vacuum.saugi
  - delay:
      hours: 0
      minutes: 0
      seconds: 3
      milliseconds: 0
  - service: script.turn_on
    data:
      if states.input_select.vacuum_zone.state == "Küche": script.vacuum_zone_kitchen
      elif states.input_select.vacuum_zone.state == "Bad": script.vacuum_bathroom
  mode: single
- id: '1658344308206'
  alias: Waschkeller
  description: ''
  trigger:
  - type: power
    platform: device
    device_id: 0301f500271eaac1ba91b7fc5ccbb011
    entity_id: sensor.waschkeller_power
    domain: sensor
    below: 10
    for:
      hours: 0
      minutes: 3
      seconds: 0
  condition: []
  action:
  - service: notify.mobile_app_sm_f926b
    data:
      message: Die Wäsche ist fertig!
      title: Waschkeller
  - service: notify.alexa_media
    data:
      message: Die Wäsche ist fertig!
      target:
      - media_player.alexa_bad
      - media_player.alexa_display
      - media_player.show_kuche
      data:
        type: tts
  - type: turn_off
    device_id: 0301f500271eaac1ba91b7fc5ccbb011
    entity_id: switch.waschkeller_socket_1
    domain: switch
  mode: single
- id: '1659088417137'
  alias: AA_Juhu Pupsu
  description: ''
  trigger:
  - platform: device
    device_id: 9b46a98118be477b5269956437bf5737
    domain: device_tracker
    entity_id: device_tracker.christinsiphone
    type: enters
    zone: zone.home
  condition: []
  action:
  - service: media_player.volume_set
    data:
      volume_level: 0.4
    target:
      device_id: f0406544b464e42b2c84869d01a53bb5
  - service: notify.alexa_media
    data:
      message: <amazon:emotion name="excited" intensity="high">       Juhuuu Pupsu,
        schön dass du wieder da bist!  Wir haben dich ganz schön dolle vermisst.  </amazon:emotion>
      target: media_player.show_kuche
      data:
        type: tts
  - service: media_player.volume_set
    data:
      volume_level: 0.15
    target:
      device_id: f0406544b464e42b2c84869d01a53bb5
  mode: single
- id: '1659296021639'
  alias: test alarm an wenn weg
  description: ''
  trigger:
  - platform: device
    device_id: 9b46a98118be477b5269956437bf5737
    domain: device_tracker
    entity_id: device_tracker.christinsiphone
    type: leaves
    zone: zone.home
  - platform: device
    device_id: 61ccc66caa570d5fce8feeaf84edd154
    domain: device_tracker
    entity_id: device_tracker.atzenjule_s_fold3
    type: leaves
    zone: zone.home
  condition:
  - condition: and
    conditions:
    - condition: device
      device_id: 9b46a98118be477b5269956437bf5737
      domain: device_tracker
      entity_id: device_tracker.christinsiphone
      type: is_not_home
    - condition: device
      device_id: 61ccc66caa570d5fce8feeaf84edd154
      domain: device_tracker
      entity_id: device_tracker.atzenjule_s_fold3
      type: is_not_home
  action:
  - service: alarm_control_panel.alarm_arm_away
    data: {}
    target:
      entity_id: alarm_control_panel.alarmanlage
  mode: single
- id: '1659338393479'
  alias: Pool aus
  description: ''
  trigger:
  - type: power
    platform: device
    device_id: 248fc16e6bdc41a25f6d3549d36b1706
    entity_id: sensor.pool_power
    domain: sensor
    below: 10
    for:
      hours: 0
      minutes: 3
      seconds: 0
  condition: []
  action:
  - type: turn_off
    device_id: 248fc16e6bdc41a25f6d3549d36b1706
    entity_id: switch.pool_socket_1
    domain: switch
  - type: turn_off
    device_id: 248fc16e6bdc41a25f6d3549d36b1706
    entity_id: switch.pool_usb_1
    domain: switch
  mode: single
- id: '1659338414145'
  alias: Lichterkette aus
  description: ''
  trigger:
  - type: power
    platform: device
    device_id: 97559de97821ae792ad261d8c176d91b
    entity_id: sensor.lichterkette_power
    domain: sensor
    below: 10
    for:
      hours: 0
      minutes: 3
      seconds: 0
  condition: []
  action:
  - type: turn_off
    device_id: 97559de97821ae792ad261d8c176d91b
    entity_id: switch.lichterkette_socket_1
    domain: switch
  - type: turn_off
    device_id: 97559de97821ae792ad261d8c176d91b
    entity_id: switch.lichterkette_usb_1
    domain: switch
  mode: single

Replace this:

  - service: script.turn_on
    data:
      if states.input_select.vacuum_zone.state == "Küche": script.vacuum_zone_kitchen
      elif states.input_select.vacuum_zone.state == "Bad": script.vacuum_bathroom

With this:

  - choose:
      - conditions:
          - condition: state
            entity_id: input_select.vacuum_zone
            state: 'Küche'
        sequence:
          - script.vacuum_zone_kitchen
      - conditions:
          - condition: state
            entity_id: input_select.vacuum_zone
            state: 'Bad'
        sequence:
          - script.vacuum_bathroom

Or in a more compact version:

  - choose:
      - conditions:
          - "{{ is_state('input_select.vacuum_zone','Küche') }}"
        sequence:
          - script.vacuum_zone_kitchen
      - conditions:
          - "{{ is_state('input_select.vacuum_zone','Bad') }}"
        sequence:
          - script.vacuum_bathroom
1 Like

this doesnt seem to be the issue, i have tried your suggestion and also deleted the automation since the error message appeared again.

I have also deleted the first empty line in the config, now it says line 27 (the sensors line again).

Logger: homeassistant.config
Source: config.py:455
First occurred: 12:30:19 PM (1 occurrences)
Last logged: 12:30:19 PM

Invalid config for [automation]: expected a dictionary for dictionary value @ data['action'][10]['target']. Got None. (See /config/configuration.yaml, line 27).

config file:

# Loads default set of integrations. Do not remove.
default_config:


#Remote Access
http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.30.33.0/24
  ip_ban_enabled: true          
  login_attempts_threshold: 3
   

# Text to speech
tts:
  - platform: google_translate


#Automationen für Alarmanlage
automation split: !include_dir_list ./alarmanlage/
alarm_control_panel: !include alarm_control_panel.yaml


#Allgemein
script: !include scripts.yaml
scene: !include scenes.yaml
sensor: !include sensors.yaml
automation: !include automations.yaml


#Tankerkönig
tankerkoenig: !include tankerkoenig.yaml


#Alexa
alexa:                          
 smart_home:
 #Frage Antwort 
input_text:
  alexa_actionable_notification:
    name: Alexa Actionable Notification Holder
    max: 255
    initial: '{"text": "Dies ist ein Test des Alexa-Skills. Hat es funktioniert?", "event": "actionable.skill.test"}'
 
#Themes
frontend:
  themes: !include_dir_merge_named themes
  
  
#Saugroboter 
camera:
  - platform: xiaomi_cloud_map_extractor
    host: !secret xiaomi_vacuum_host
    token: !secret xiaomi_vacuum_token
    username: !secret xiaomi_cloud_username
    password: !secret xiaomi_cloud_password
    draw: ['all']
    attributes:
      - calibration_points 

and the new automations yaml: i deleted unused automations, to clear it out a bit.

- id: '1654371747948'
  alias: Back ups Issue Notification
  description: ''
  trigger:
  - platform: state
    entity_id:
    - binary_sensor.backups_stale
    from: 'Off'
    to: 'On'
  condition: []
  action:
  - service: notify.mobile_app_sm_f926b
    data:
      message: Access the Google Drive Back Up Add On for Details
      title: There is an Issue with the back ups.
      data:
        clickAction: /hassio/ingress/cebe7a76_hassio_google_drive_backup
  mode: single
- id: '1654618714639'
  alias: 'Abfallkalender '
  description: ''
  trigger:
  - platform: calendar
    event: start
    offset: '-6:0:0'
    entity_id: calendar.abfallkalender
  condition: []
  action:
  - service: notify.mobile_app_sm_f926b
    data:
      title: Abfallkalender
      message: '{{ trigger.calendar_event.summary }}'
  mode: single
- id: '1655291223426'
  alias: 'Vacuum: Execute vacuum zone'
  description: ''
  trigger: []
  condition: []
  action:
  - service: vacuum.stop
    data: {}
    target:
      entity_id: vacuum.saugi
  - delay:
      hours: 0
      minutes: 0
      seconds: 3
      milliseconds: 0
  - service: script.turn_on
    data:
      if states.input_select.vacuum_zone.state == "Küche": script.vacuum_zone_kitchen
      elif states.input_select.vacuum_zone.state == "Bad": script.vacuum_bathroom
  mode: single
- id: '1658344308206'
  alias: Waschkeller
  description: ''
  trigger:
  - type: power
    platform: device
    device_id: 0301f500271eaac1ba91b7fc5ccbb011
    entity_id: sensor.waschkeller_power
    domain: sensor
    below: 10
    for:
      hours: 0
      minutes: 3
      seconds: 0
  condition: []
  action:
  - service: notify.mobile_app_sm_f926b
    data:
      message: Die Wäsche ist fertig!
      title: Waschkeller
  - service: notify.alexa_media
    data:
      message: Die Wäsche ist fertig!
      target:
      - media_player.alexa_bad
      - media_player.alexa_display
      - media_player.show_kuche
      data:
        type: tts
  - type: turn_off
    device_id: 0301f500271eaac1ba91b7fc5ccbb011
    entity_id: switch.waschkeller_socket_1
    domain: switch
  mode: single

This is not valid syntax:

As I said before, ignore the line number. It is numbered from 0. Your file line numbers start at 1.

You have an automation somewhere with more than 11 actions. The 11th action (again numbered from 0) is missing an entity id.

Is there something in your automation spilt file?

You REALLY need to listen to Tom and Petro.

that service syntax is not valid.

It has never been valid and there is no way that could have ever worked.

It’s very likely that the yaml parser can’t figure out what to do with that invalid syntax and is giving a strange error based on that.

Fix the invalid syntax and then go from there if it still gives an error.

ok thanks i changed the lines as you told me before.

sorry i misunderstood what you said with counting from number 0 instead of 1. got it now :slight_smile:

i will also now look into that automation split file if there is something wrong.

     target:
      - media_player.alexa_bad
      - media_player.alexa_display
      - media_player.show_kuche

These listed entities need to be indented further.
Disregard, see below

No they don’t. That’s fine.

As long as the indentation under each block is consistent it can be anything.

e.g. all these are valid

      target:
      - media_player.alexa_bad
      - media_player.alexa_display
      - media_player.show_kuche
      target:
        - media_player.alexa_bad
        - media_player.alexa_display
        - media_player.show_kuche
      target:
          - media_player.alexa_bad
          - media_player.alexa_display
          - media_player.show_kuche

This is not valid:

      target:
        - media_player.alexa_bad
      - media_player.alexa_display
      - media_player.show_kuche

Ahh okay, thanks mate.

Edit, happy to delete if that cleans it up best?

1 Like

Leave it. It may help others.

1 Like

ok i was able to figure out with automation caused the issue, there was bad spacing/intendation which caused that the entity was not recognized. but now another error message appears:

Logger: homeassistant.config
Source: config.py:455
First occurred: 10:33:50 AM (10 occurrences)
Last logged: 10:45:54 AM

Invalid config for [automation]: template value is None for dictionary value @ data['action'][0]['data']. Got None. (See /config/configuration.yaml, line 27).

this means the first action in an automation is missing data value? is that right?

Specifically the first action (that’s what [action][0] means) is looking for a template value but it is getting nothing.

1 Like