Help with automation.yaml

Hi there guys,

Goodmorning from the Netherlands.
Small question, since the last update to 0.50.2 my automations dont work anymore.

Now i,am kinda new here and i cannot figure it out how the new automations work.

Is any of you willing to help me change the file so it will work again.

I only have a couple of automations nothing big.

see my automations here: https://drive.google.com/open?id=0B5PoHcM4GtA2Zmx3Tk1wYTh0STQ

And off-course the rror log it’s a big one: https://drive.google.com/open?id=0B5PoHcM4GtA2NW5UOG1rbDZWRTg

Maybe post your error log and someone might be able to help you

My Automation.yaml file.

  • alias: ‘Dim lights when playing Netflix in Living Room’
    trigger:
    platform: state
    entity_id: media_player.dikkelul
    to: ‘playing’
    condition:
    condition: sun
    after: sunset
    after_offset: “-0:20:00”
    action:
    service: light.turn_on
    data:
    entity_id: light.woonkamer
    brightness: 120
    transition: 10

  • alias: ‘Brighten lights when stop playing Chromecast in Living Room’
    trigger:

    • platform: state
      entity_id: media_player.dikkelul
      from: ‘playing’
      to: ‘off’
    • platform: state
      entity_id: media_player.dikkelul
      from: ‘playing’
      to: ‘idle’
    • platform: state
      entity_id: media_player.dikkelul
      from: ‘playing’
      to: ‘paused’
      condition:
      condition: sun
      after: sunset
      after_offset: “-0:20:00”
      action:
      service: light.turn_on
      data:
      entity_id: light.woonkamer
      brightness: 255
      transition: 10
  • alias: ‘Lights on when home pre sunset’
    trigger:

    • platform: sun
      event: sunset
      offset: “-0:20:00”
    • platform: state
      entity_id: group.all_devices
      from: ‘not_home’
      to: ‘home’
      condition:
      condition: and
      conditions:
      • condition: sun
        after: sunset
        after_offset: “-0:20:00”
      • condition: state
        entity_id: group.all_devices
        to: ‘home’
        action:
        service: light.turn_on
        data:
        entity_id: light.woonkamer
  • alias: ‘Lights off when away’
    trigger:
    platform: state
    entity_id: group.all_devices
    to: ‘not_home’
    action:
    service: light.turn_off
    data:
    entity_id: light.woonkamer

Hello,

When I use an extended automation.yaml.
I need to add - id: idname
Here an example, maybe it will help you.

- id: lights_off_when_000
  alias: 'when its 0:00 turn off the lights'
  trigger:
    - platform: time
      at: '00:00:00'
  action:
  - service: light.turn_off
    data:
      entity_id: light.pa_kamer

It did something lot less orrors.

I,am at work now so have to show the error log later on the day.

If anybody has more idea’s please tell me

after: sunset

This is no longer used. It needs to be “at: sunset”

Look at Breaking Changes here: 0.50: Voice control, History improvements, and Xiaomi - Home Assistant

Oke guys working on it now for almost 11 hours, deleted al my automations.
just left with this and even this gives me shit, Help me please:

  - alias: 'Lights off when away'
  trigger:
  - platform: state
    entity_id: group.all_devices
    to: 'not_home'
  action:
    service: light.turn_off
    data:
      entity_id: light.woonkamer

- alias: 'Light when i get home'
  trigger:
  - platform: state
    entity_id: group.all_devices
    state: 'home'
  - platform: sun
    event: sunset
  - condition: state
    entity_id: sun.sun
    state: 'below_horizon'
  action:
    service: light.turn_on
    data:
      entity_id: light.woonkamer

The following errors have been logged this session:

2017-08-09 19:09:05 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [state] is an invalid option for [automation]. Check: automation->trigger->0->state. (See /home/homeassistant/.homeassistant/configuration.yaml, line 109). Please check the docs at Automation - Home Assistant

Failed config
automation:
- action: [source /home/homeassistant/.homeassistant/automation.yaml:6]
data: [source /home/homeassistant/.homeassistant/automation.yaml:8]
entity_id: light.woonkamer
service: light.turn_off
alias: Lights off when away
trigger: [source /home/homeassistant/.homeassistant/automation.yaml:2]
- platform: state
entity_id: group.all_devices
to: not_home
- action: [source /home/homeassistant/.homeassistant/automation.yaml:21]
data: [source /home/homeassistant/.homeassistant/automation.yaml:23]
entity_id: light.woonkamer
service: light.turn_on
alias: Light when i get home
trigger: [source /home/homeassistant/.homeassistant/automation.yaml:12]
- platform: state
entity_id: group.all_devices
state: home
- platform: sun
event: sunset
- condition: state
entity_id: sun.sun
state: below_horizon

Successful config (partial)
automation:
- action: ?
- data: [source /home/homeassistant/.homeassistant/automation.yaml:8]
entity_id: light.woonkamer
service: light.turn_off
alias: Lights off when away
hide_entity: False
trigger: ?
- platform: state
entity_id: ?
- group.all_devices
to: not_home

Still from the breaking changes link. state: in triggers becomes to:
Just a general recommendation. Every new release brings some breaking change. Read through all the release notes and pay special attention to breaking changes. There will almost always be some. If you only update occasionally, go back and read the breaking changes for the updates you missed.

2017-08-09 19:30:28 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: expected dict for dictionary value @ data[‘action’][0][‘data’]. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 109). Please check the docs at Automation - Home Assistant
2017-08-09 19:30:28 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [to:] is an invalid option for [automation]. Check: automation->trigger->0->to:. (See /home/homeassistant/.homeassistant/configuration.yaml, line 109). Please check the docs at Automation - Home Assistant

Failed config
  automation: 
    - action: [source /home/homeassistant/.homeassistant/automation.yaml:6]
        data: None
        entity_id: light.woonkamer
        service: light.turn_off
      alias: Lights off when away
      trigger: [source /home/homeassistant/.homeassistant/automation.yaml:2]
        - platform: state
          entity_id: group.all_devices
          to: not_home
    - action: [source /home/homeassistant/.homeassistant/automation.yaml:21]
        data: None
        entity_id: light.woonkamer
        service: light.turn_on
      alias: Light when i get home
      trigger: [source /home/homeassistant/.homeassistant/automation.yaml:12]
        - platform: state
          entity_id: group.all_devices
          to:: home
        - platform: sun
          event: sunset
        - condition: state
          entity_id: sun.sun
          to: below_horizon

You have a double colon to:: home

saw that fixed.
only left with this

The following errors have been logged this session:

2017-08-09 19:37:03 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: expected dict for dictionary value @ data[‘action’][0][‘data’]. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 109). Please check the docs at https://home-assistant.io/components/automation/
2017-08-09 19:37:03 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: expected dict for dictionary value @ data[‘action’][0][‘data’]. Got None
required key not provided @ data[‘trigger’][2][‘platform’]. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 109). Please check the docs at https://home-assistant.io/components/automation/

Remove the lines data: and line up the entity_id: lines with the service: lines that preceed them.

@anon43302295 sorry i dont understand what you mean.

sorry got it now i get this:

Failed config
automation:
- action: [source /home/homeassistant/.homeassistant/automation.yaml:6]
entity_id: light.woonkamer
service: light.turn_off
alias: Lights off when away
trigger: [source /home/homeassistant/.homeassistant/automation.yaml:2]
- platform: state
entity_id: group.all_devices
to: not_home
- action: [source /home/homeassistant/.homeassistant/automation.yaml:20]
entity_id: light.woonkamer
service: light.turn_on
alias: Light when i get home
trigger: [source /home/homeassistant/.homeassistant/automation.yaml:11]
- platform: state
entity_id: group.all_devices
to: home
- platform: sun
event: sunset
- condition: state
entity_id: sun.sun
to: below_horizon

Successful config (partial)
automation:
- action: ?
- entity_id: ?
- light.woonkamer
service: light.turn_off
alias: Lights off when away
hide_entity: False
trigger: ?
- platform: state
entity_id: ?
- group.all_devices
to: not_home

Post the actual config as it is now?

I would guess you have some random whitespace somewhere (a tab where there should be some spaces, or something similar)

This is the actual config:

- alias: 'Lights off when away'
  trigger:
  - platform: state
    entity_id: group.all_devices
    to: 'not_home'
  action:
    service: light.turn_off
    entity_id: light.woonkamer

- alias: 'Light when i get home'
  trigger:
  - platform: state
    entity_id: group.all_devices
    to: 'home'
  - platform: sun
    event: sunset
  - condition: state
    entity_id: sun.sun
    to: 'below_horizon'
  action:
    service: light.turn_on
    entity_id: light.woonkamer
- alias: 'Light when i get home'
  trigger:
  - platform: state
    entity_id: group.all_devices
    to: 'home'
  - platform: sun
    event: sunset
  condition:
    condition: state
    entity_id: sun.sun
    state: 'below_horizon'
  action:
    service: light.turn_on
    entity_id: light.woonkamer

als ik dat doe Bob krijg ik dit:

2017-08-09 22:26:02 ERROR (Thread-2) [homeassistant.util.yaml] mapping values are not allowed here
  in "/home/homeassistant/.homeassistant/automation.yaml", line 18, column 14
2017-08-09 22:26:02 ERROR (MainThread) [homeassistant.components.automation] mapping values are not allowed here
  in "/home/homeassistant/.homeassistant/automation.yaml", line 18, column 14
2017-08-09 22:26:02 ERROR (Thread-5) [homeassistant.util.yaml] mapping values are not allowed here
  in "/home/homeassistant/.homeassistant/automation.yaml", line 18, column 14
2017-08-09 22:26:02 ERROR (MainThread) [homeassistant.components.group] mapping values are not allowed here
  in "/home/homeassistant/.homeassistant/automation.yaml", line 18, column 14
2017-08-09 22:26:03 WARNING (MainThread) [homeassistant.components.media_player] Updating samsungtv media_player took longer than the scheduled update interval 0:00:10
2017-08-09 22:26:03 ERROR (Thread-6) [homeassistant.util.yaml] mapping values are not allowed here
  in "/home/homeassistant/.homeassistant/automation.yaml", line 18, column 14
2017-08-09 22:26:03 ERROR (MainThread) [homeassistant.components] mapping values are not allowed here
  in "/home/homeassistant/.homeassistant/automation.yaml", line 18, column 14

just edited my post :wink:

ok ok i think we might be there.

let me test only took 13 hours :stuck_out_tongue:

1 Like