Seems like my automations are preventing me getting a valid configuration

Hi everyone!

I’m a newbie to Home Assistant and have no coding skills. Probably the cause to my problems now :grinning_face_with_smiling_eyes:

Home Assistant 2022.9.6
Supervisor 2022.09.1
Operating System 9.0
Installed on a NUC

Some days ago I needed to restart HA but nothing happened. I then went to Developer Tools and checked the configuration. The wheel got stuck in spinning and I never got the valid message (or an error message).

I started to comment out different parts in the configuration.yaml and checked the configuration for each time. Finally when I commented out automation: !include automations.yaml I got the valid message and was able to restart HA.

With my limited knowledge I came to the conclusion that one or more of my automations is causing the problem. All my automations are made through the UI. Right now I have 18 automations.

I did a full backup of HA and started on top of my automation list and deleted one by one, checking the configuration after each deletion. When I only had 4 automations left I finally got the valid message. Again with my limited knowledge I came to the conclusion that the last automation I deleted had to be the cause for the problem.

I did a restore of the previous backup and deleted only the automation that I suspected to be the cause of the problem. But no success. The configuration wheel is still spinning without a valid or error message.

I repeated these steps with deleting automations, and for each time different automations seemed to be the cause of not beeing able to get a valid configuration. After doing this 5 times and I still couldn’t get a valid configuration when deleting the 5 automations I had narrowed down, I gave up and now I’m here :grinning_face_with_smiling_eyes:

All my automations was made before the new UI for automations. I don’t know if this could be an issue. I’ve also not been careful when making automations so some of them are probably not setup in the best way possible, but at least they are done through the UI and have been performing the tasks without any problems.

Any ideas? Should I post my config file and/or automations?

I appreceate any help. I still have lots to learn!

Cheers!

yes.

post the yaml itself properly formatted (``` before and after the code block) not a screenshot.

Thanks, finity! Like this?

configuration.yaml


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

# Text to speech
tts:
  - platform: google_translate

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.30.33.0/24

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
frontend:
  themes: !include_dir_merge_named themes


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

nordpool:

sensor:
  - platform: nordpool

    # Should the prices include vat? Default True
    VAT: True

    # What currency the api fetches the prices in
    # this is only need if you want a sensor in a non local currency
    currency: "NOK"
    
    # Option to show prices in cents (or the equivalent in local currency)
    price_in_cents: false

    # Helper so you can set your "low" price
    # low_price = hour_price < average * low_price_cutoff
    low_price_cutoff: 0.95

    # What power regions your are interested in.
    # Possible values: "DK1", "DK2", "FI", "LT", "LV", "Oslo", "Kr.sand", "Bergen", "Molde", "Tr.heim", "Tromsø", "SE1", "SE2", "SE3","SE4", "SYS", "EE"
    region: "Bergen"

    # How many decimals to use in the display of the price
    precision: 2

    # What the price should be displayed in default
    # Possible values: MWh, kWh and Wh
    # default: kWh
    price_type: kWh

    # This option allows the usage of a template to add a tariff.
    # now() always refers start of the hour of that price.
    # this way we can calculate the correct costs add that to graphs etc.
    # The price result of the additional_costs template expects this additional cost to be in kWh and not cents as a float
    # default {{0.0|float}}
    additional_costs: "{{0.0|float}}"

automations.yaml

- id: '1650558036948'
  alias: Lys trapp på
  description: ''
  trigger:
  - type: motion
    platform: device
    device_id: dcc5834ac823894e5104f9b85330727a
    entity_id: binary_sensor.aqara_motion_sensor_3_ias_zone
    domain: binary_sensor
  - type: motion
    platform: device
    device_id: f94b9b9ae300e7234cd0fb5391c5a4b2
    entity_id: binary_sensor.aqara_motion_sensor_2_ias_zone
    domain: binary_sensor
  condition:
  - type: is_illuminance
    condition: device
    device_id: dcc5834ac823894e5104f9b85330727a
    entity_id: sensor.aqara_motion_sensor_3_illuminance
    domain: sensor
    below: 45
  action:
  - service: light.turn_on
    data:
      transition: 1
      brightness_pct: 30
    target:
      entity_id: light.blaa_bordlampe
  mode: single
- id: '1651164132834'
  alias: Lysbryter Stue
  description: ''
  use_blueprint:
    path: Vogete/zha-aqara-wireless-remote-switch-single-rocker.yaml
    input:
      aqara_mini_switch: 2759d60cedcc18708680345ebb602e27
      button_single_press:
      - service: light.toggle
        data:
          brightness_pct: 100
          transition: 2
        target:
          entity_id: light.lys_stue
      button_double_press:
      - service: scene.turn_on
        target:
          entity_id: scene.lys_stue_fargespill
        metadata: {}
      button_long_press:
      - service: scene.turn_on
        target:
          entity_id: scene.lys_stue_100
        metadata: {}
- id: '1651583828951'
  alias: Lys trapp av
  description: ''
  trigger:
  - type: no_motion
    platform: device
    device_id: dcc5834ac823894e5104f9b85330727a
    entity_id: binary_sensor.aqara_motion_sensor_3_ias_zone
    domain: binary_sensor
  - type: no_motion
    platform: device
    device_id: f94b9b9ae300e7234cd0fb5391c5a4b2
    entity_id: binary_sensor.aqara_motion_sensor_2_ias_zone
    domain: binary_sensor
  condition:
  - condition: device
    type: is_on
    device_id: 32f1fceee87929f97118a7c91c11c287
    entity_id: light.blaa_bordlampe
    domain: light
  action:
  - service: light.turn_off
    data:
      transition: 2
    target:
      entity_id: light.blaa_bordlampe
  mode: single
- id: '1652125119547'
  alias: Nattbordlampe Jørgen
  description: ''
  use_blueprint:
    path: SeanM/zha-aqara-wireless-mini-switch.yaml
    input:
      aqara_mini_switch: 4bf422a6c2238e7cc86772969f661289
      button_single_press:
      - type: toggle
        device_id: f55b3f70113b7e64418fbf65de2e0467
        entity_id: switch.nattbordlampe_1
        domain: switch
      button_double_press:
      - type: toggle
        device_id: f55b3f70113b7e64418fbf65de2e0467
        entity_id: switch.nattbordlampe_1
        domain: switch
      - type: toggle
        device_id: ed2618034751a82dd04cb92c3856ba69
        entity_id: switch.nattbordlampe_2
        domain: switch
- id: '1652125621303'
  alias: Nattbordlampe Maria
  description: ''
  use_blueprint:
    path: SeanM/zha-aqara-wireless-mini-switch.yaml
    input:
      aqara_mini_switch: 6e468062a2c9795fee1c8b0d49618309
      button_single_press:
      - type: toggle
        device_id: ed2618034751a82dd04cb92c3856ba69
        entity_id: switch.nattbordlampe_2
        domain: switch
      button_double_press:
      - type: toggle
        device_id: ed2618034751a82dd04cb92c3856ba69
        entity_id: switch.nattbordlampe_2
        domain: switch
      - type: toggle
        device_id: f55b3f70113b7e64418fbf65de2e0467
        entity_id: switch.nattbordlampe_1
        domain: switch
- id: '1652652048451'
  alias: Vaskemaskin Varsel
  description: ''
  trigger:
  - platform: state
    entity_id:
    - input_boolean.vaskemaskin_test
    from: 'off'
    to: 'on'
    id: Vaskemaskin-ferdig
    for:
      hours: 0
      minutes: 50
      seconds: 0
  condition: []
  action:
  - service: light.turn_on
    data:
      rgb_color:
      - 10
      - 0
      - 255
    target:
      entity_id: light.sofalampe
  mode: single
- id: '1652655510220'
  alias: Lys stue 50%
  description: ''
  trigger:
  - device_id: ecedb825062fd62361da3ada03fbdea6
    domain: zha
    platform: device
    type: remote_button_long_press
    subtype: remote_button_long_press
  condition: []
  action:
  - service: light.turn_on
    data:
      brightness_pct: 50
      transition: 1
    target:
      entity_id: light.lys_stue
  mode: single
- id: '1652832893591'
  alias: Vaskemaskin Varsel Av Del2
  description: ''
  trigger:
  - device_id: 097037a7ef950bf654287b1e1b9dcb79
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: remote_button_short_press
  condition:
  - condition: device
    type: is_off
    device_id: 654c98c5aeaab5f57db69b6d7d41ac79
    entity_id: light.stalampe
    domain: light
  - condition: device
    type: is_off
    device_id: 77af4375c0385c759d2edc4cf23073ce
    entity_id: light.skjenk_lampe1_on_off
    domain: light
  - condition: device
    type: is_off
    device_id: faf940b41d632f84f294f420564dc5ab
    entity_id: light.skjenk_lampe2_8bd0c00b_level_light_color_on_off
    domain: light
  - condition: device
    type: is_off
    device_id: 4304aba75655b40ac16c4b4283d43a1f
    entity_id: light.tivolilampe_1
    domain: light
  - condition: device
    type: is_off
    device_id: 00486bca85e5832e63d429dd5781718b
    entity_id: light.tivolilampe_2
    domain: light
  - condition: device
    type: is_on
    device_id: c8d061f6792a5946082fa5aecb760408
    entity_id: light.sofalampe
    domain: light
  action:
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - type: turn_off
    device_id: c8d061f6792a5946082fa5aecb760408
    entity_id: light.sofalampe
    domain: light
  mode: single
- id: '1654982071146'
  alias: Vaskemaskin Ferdig
  description: ''
  use_blueprint:
    path: Sbyx/notify-or-do-something-when-an-appliance-like-a-dishwasher-or-washing-machine-finishes.yaml
    input:
      power_sensor: sensor.apex_smartplug_vaskemaskin_electrical_measurement
      starting_threshold: 20
      starting_hysteresis: 5
      finishing_threshold: 11
      finishing_hysteresis: 4
      actions:
      - service: input_boolean.turn_on
        data: {}
        target:
          entity_id: input_boolean.vaskemaskin_test
      - delay:
          hours: 0
          minutes: 0
          seconds: 3
          milliseconds: 0
      - service: counter.increment
        data: {}
        target:
          entity_id:
          - counter.vaskemaskinteller_uke
          - counter.vaskemaskinteller_maned
          - counter.vaskemaskinteller_total
          - counter.vaskemaskinteller_dag
          - counter.vaskemaskinteller_aar
      pre_actions:
      - service: input_boolean.turn_off
        data: {}
        target:
          entity_id: input_boolean.vaskemaskin_test
- id: '1656449312941'
  alias: Varsel1
  description: ''
  trigger:
  - type: motion
    platform: device
    device_id: f94b9b9ae300e7234cd0fb5391c5a4b2
    entity_id: binary_sensor.aqara_motion_sensor_2_ias_zone
    domain: binary_sensor
  condition: []
  action:
  - service: light.turn_on
    data:
      rgb_color:
      - 255
      - 0
      - 0
    target:
      entity_id: light.sofalampe
  mode: single
- id: '1658150573601'
  alias: White Noise stue
  description: ''
  use_blueprint:
    path: SeanM/zha-aqara-wireless-mini-switch.yaml
    input:
      button_single_press:
      - service: media_player.play_media
        target:
          entity_id: media_player.nest_audio
        data:
          media_content_id: media-source://media_source/local/01-4-timer.mp3
          media_content_type: audio/mpeg
        metadata:
          title: 01-4-timer.mp3
          thumbnail:
          media_class: music
          children_media_class:
          navigateIds:
          - {}
          - media_content_type: app
            media_content_id: media-source://media_source
      - if:
        - condition: time
          after: '21:30:00'
          before: 07:00:00
          weekday:
          - mon
          - wed
          - tue
          - thu
          - fri
          - sat
          - sun
        then:
        - service: light.turn_on
          data:
            brightness_pct: 15
            transition: 2
          target:
            entity_id: light.lys_stue
      aqara_mini_switch: ecedb825062fd62361da3ada03fbdea6
      button_double_press:
      - service: media_player.media_stop
        data: {}
        target:
          entity_id: media_player.nest_audio
      - if:
        - condition: time
          after: '23:00:00'
          before: 07:00:00
          weekday:
          - mon
          - tue
          - wed
          - thu
          - fri
          - sat
          - sun
        then:
        - service: light.turn_on
          data:
            brightness_pct: 50
            transition: 2
          target:
            entity_id: light.lys_stue
- id: '1659104618289'
  alias: Vaskemaskin Varsel Av Del1
  description: ''
  trigger:
  - device_id: 097037a7ef950bf654287b1e1b9dcb79
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: remote_button_short_press
  condition:
  - condition: state
    entity_id: input_boolean.vaskemaskin_test
    state: 'on'
  action:
  - service: input_boolean.turn_off
    data: {}
    target:
      entity_id: input_boolean.vaskemaskin_test
  - if:
    - condition: state
      entity_id: light.lys_stue
      state: 'on'
    - condition: and
      conditions:
      - condition: template
        value_template: '{{ state_attr(''light.sofalampe'', ''rgb_color'') != ( 255,
          173, 102 ) }}'
    then:
    - service: light.turn_on
      data:
        color_temp: 345
      target:
        entity_id: light.sofalampe
    else:
    - if:
      - condition: state
        entity_id: light.lys_stue
        state: 'off'
      - condition: device
        type: is_on
        device_id: c8d061f6792a5946082fa5aecb760408
        entity_id: light.sofalampe
        domain: light
      then:
      - service: light.turn_on
        data:
          color_temp: 345
        target:
          entity_id: light.sofalampe
  mode: single
- id: '1663080856097'
  alias: Reset Vaskemaskin-teller dag
  description: ''
  trigger:
  - platform: time
    at: 02:00:00
  condition:
  - condition: time
    weekday:
    - mon
    - tue
    - wed
    - thu
    - fri
    - sat
    - sun
  action:
  - service: counter.reset
    data: {}
    target:
      entity_id: counter.vaskemaskinteller_dag
  mode: single
- id: '1663080904599'
  alias: Reset Vaskemaskin-teller uke
  description: ''
  trigger:
  - platform: time
    at: 01:00:00
  condition:
  - condition: time
    weekday:
    - mon
  action:
  - service: counter.reset
    data: {}
    target:
      entity_id: counter.vaskemaskinteller_uke
  mode: single
- id: '1663164408771'
  alias: Reset Vaskemaskin-teller måned
  description: ''
  trigger:
  - platform: calendar
    event: start
    offset: 0:0:0
    entity_id: calendar.reset_vaskemaskinteller
  condition:
  - condition: state
    entity_id: calendar.reset_vaskemaskinteller
    attribute: message
    state: Tilbakestill månedsteller
  action:
  - service: counter.reset
    data: {}
    target:
      entity_id: counter.vaskemaskinteller_maned
  mode: parallel
- id: '1663164524963'
  alias: Reset Vaskemaskin-teller år
  description: ''
  trigger:
  - platform: calendar
    event: start
    offset: 0:0:0
    entity_id: calendar.reset_vaskemaskinteller
  condition:
  - condition: state
    entity_id: calendar.reset_vaskemaskinteller
    attribute: message
    state: Tilbakestill årsteller
  action:
  - service: counter.reset
    data: {}
    target:
      entity_id: counter.vaskemaskinteller_aar
  mode: parallel
- id: '1663197628581'
  alias: Reset dusjteller
  description: ''
  trigger:
  - platform: calendar
    event: start
    offset: 0:0:0
    entity_id: calendar.reset_vaskemaskinteller
  condition: []
  action:
  - if:
    - condition: state
      entity_id: calendar.reset_vaskemaskinteller
      attribute: message
      state: Tilbakestill dagteller
    then:
    - service: counter.reset
      data: {}
      target:
        entity_id: counter.dusjteller_dag
  - if:
    - condition: state
      entity_id: calendar.reset_vaskemaskinteller
      attribute: message
      state: Tilbakestill uketeller
    then:
    - service: counter.reset
      data: {}
      target:
        entity_id: counter.dusjteller_uke
  - if:
    - condition: state
      entity_id: calendar.reset_vaskemaskinteller
      attribute: message
      state: Tilbakestill månedsteller
    then:
    - service: counter.reset
      data: {}
      target:
        entity_id: counter.dusjteller_maned
  - if:
    - condition: state
      entity_id: calendar.reset_vaskemaskinteller
      attribute: message
      state: Tilbakestill årsteller
    then:
    - service: counter.reset
      data: {}
      target:
        entity_id: counter.dusjteller_ar
  mode: single
- id: '1663265683352'
  alias: Trappeteller
  description: ''
  trigger:
  - type: motion
    platform: device
    device_id: f94b9b9ae300e7234cd0fb5391c5a4b2
    entity_id: binary_sensor.aqara_motion_sensor_2_ias_zone
    domain: binary_sensor
  condition:
  - type: is_motion
    condition: device
    device_id: dcc5834ac823894e5104f9b85330727a
    entity_id: binary_sensor.aqara_motion_sensor_3_ias_zone
    domain: binary_sensor
  action:
  - service: counter.increment
    data: {}
    target:
      entity_id: counter.trappeteller_dag
  mode: single
- id: '1663941843225'
  alias: Dusjteller
  description: ''
  trigger:
  - type: humidity
    platform: device
    device_id: 64982eb0c06417e40a14158e31288ca5
    entity_id: sensor.aqara_bad_humidity
    domain: sensor
    above: 56
  condition: []
  action:
  - service: counter.increment
    data: {}
    target:
      entity_id:
      - counter.dusjteller_dag
      - counter.dusjteller_uke
      - counter.dusjteller_maned
      - counter.dusjteller_ar
      - counter.dusjteller_total
  mode: single
- id: '1663941910612'
  alias: Dusjteller
  description: ''
  trigger:
  - type: humidity
    platform: device
    device_id: 64982eb0c06417e40a14158e31288ca5
    entity_id: sensor.aqara_bad_humidity
    domain: sensor
    above: 56
  condition: []
  action:
  - service: counter.increment
    data: {}
    target:
      entity_id:
      - counter.dusjteller_dag
      - counter.dusjteller_uke
      - counter.dusjteller_maned
      - counter.dusjteller_ar
      - counter.dusjteller_total
  mode: single

I think it would be easier if you just posted the error you’re getting on the config check.

Unfortunately I don’t get any error on the config check. I only get a spinning wheel. On second thought I have not let it run for more than 5 minutes. I’ll do the check again and let it run longer.

Before when I checked config (not related to this problem) I would get an error message after a few seconds if the config was not valid, but I will try again!

Refresh the cache in your browser. You can also just reload your automations and the logs will spit out the real error if there is one.

What if you look in the log? I do not think more than 5 min will help.

And, you have 2 automations with the same alias in the automations.yaml. Both called “Dusjteller”. open automation.yaml in a text editor and delete one of them

You can have 2 automations with the same alias. That won’t cause problems.

OK, just solve a problem for me earlier when I ended same place, as only one showed up in the GUI.

then you had 2 automations with the same unique_id

Good catch! Don’t know why I have 2 with the same alias when I only have 1 in the automations UI.

I see some errors in the logs. What’s the best way to share? Just copy and paste in here?

yep, same way you did with your config

Only the first log entries in the top or should I load the entire log? The entire log is very long. If I need to post the entire log, will it contain any personal info like passwords etc that is in the system?

Just the bits relative to the reload of the automation, or the config check. Note the time, reload, then post the logs after the reload.

I don’t see any log entries after I reload only the automations. Does that mean that the automations are ok?

then your config is fine

Ok that’s good, but why can’t I get a valid message unless I comment out the automations from configuration.yaml? Seems strange to me. I also can’t restart HA when I don’t get a valid message.

most likely browser cache

Unfortunately no success. I’ve also tried using different browsers and through the companion app on both android and iphone