Valid automation config won't let HA startup

Hi there, I’m new to home assistant/home automation/raspberry pi/z-wave etc…

I have been trying for many weeks to get some simple light automations working. However once I have one light working another fails for one reason or another, constant whack-a-mole. I am running hassio and I am up to date, two leviton switches, a aeotec multi-6 sensor, z-stick and a ge 26933 motion switch (with multiple instances of the light and motion sensor but that I would consider a separate issue, and likely one that can be ignored).

I began trying to use UI to make automations but I couldn’t get the light to turn off after 15minutes (many various reasons). So I have recently tried to rewrite the UI yaml into hand written yaml. In my example below, the UI generated code lets HA startup, I will add the hand written code and click the check config button and it will be valid, but a restart results in HA not starting up.

Any help is greatly appreciated. -Thanks

  • action:

    • data:
      entity_id: light.leviton_unknown_type3201_id0001_level
      service: light.turn_on
      alias: PlantLightOn
      condition:
      id: ‘1510522028672’
      trigger:
    • at: 09:00
      platform: time
  • action:

    • data:
      entity_id: light.leviton_unknown_type3201_id0001_level
      service: light.turn_off
      alias: PlantLightOff
      condition:
      id: ‘1510522133474’
      trigger:
    • at: ‘20:30’
      platform: time
  • alias: Bathroom On
    trigger:
    platform: numeric_state
    entity_id: sensor.ge_26933_smart_motion_dimmer_burglar
    below: 7
    action:
    service: homeassistant.turn_on
    entity_id: light.ge_26933_smart_motion_dimmer_level

  • alias: Bathroom off
    trigger:
    platform: numeric_state
    entity_id: sensor.ge_26933_smart_motion_dimmer_burglar
    above: 7
    for:
    minutes: 15
    action:
    service: homeassistant.turn_off
    entity_id: light.ge_26933_smart_motion_dimmer_level

I was able to get it working. In case anyone ever reads this. Checking your code in the UI doesn’t provide as much feedback as you get in the home-assistant.log file. While the code is ok in the UI, on loading it didn’t like the trigger condition ‘after’. At least that was the last error it was stuck on…

Here’s what ended up working.

  • alias: ‘Valance On’
    trigger:
    platform: state
    entity_id: binary_sensor.aeotec_zw100_multisensor_6_sensor
    to: ‘on’
    condition:
    • condition: time
      after: ‘07:00:00’
      before: ‘20:30:00’
      action:
      service: homeassistant.turn_on
      entity_id: light.leviton_valance_level
  • alias: ‘Valance off’
    trigger:
    platform: state
    entity_id: binary_sensor.aeotec_zw100_multisensor_6_sensor
    to: ‘off’
    for:
    minutes: 15
    action:
    service: homeassistant.turn_off
    entity_id: light.leviton_valance_level
  • alias: ‘Bathroom On’
    trigger:
    platform: numeric_state
    entity_id: sensor.ge_26933_smart_motion_dimmer_burglar
    below: 7
    condition:
    • condition: time
      after: ‘7:00:00’
      before: ‘20:30:00’
      action:
      service: homeassistant.turn_on
      entity_id: light.ge_26933_smart_motion_dimmer_level
  • alias: ‘Bathroom off’
    trigger:
    platform: numeric_state
    entity_id: sensor.ge_26933_smart_motion_dimmer_burglar
    above: 7
    for:
    minutes: 15
    action:
    service: homeassistant.turn_off
    entity_id: light.ge_26933_smart_motion_dimmer_level
  • alias: Planter On
    trigger:
    platform: time
    hours: 8
    minutes: 3
    action:
    service: homeassistant.turn_on
    entity_id: light.leviton_unknown_type3201_id0001_level
  • alias: Planter Off
    trigger:
    platform: time
    hours: 21
    minutes: 13
    action:
    service: homeassistant.turn_off
    entity_id: light.leviton_unknown_type3201_id0001_level