1st Automation not working :-(

He Guys,

I have a very basic Question. I started today with automation. Heres my 1st Automation:

  • alias: ‘TV Ambiente Ein’
    trigger:
    platform: state
    entity_id: media_player.tv
    state: ‘on’
    condition: time
    after: 17:30:00
    action:
    • service: light.turn_on
      data:
      entity_id: light.tv_ambiente

Log is saying:

16-11-13 18:34:10 homeassistant.bootstrap: Invalid config for [automation]: expected a dictionary @ data[‘condition’][0]. Got None
extra keys not allowed @ data[‘after’]. Got {}. (See /home/hass/.homeassistant/automation.yaml:0). Please check the docs at Automation - Home Assistant

I’m sitting here for 2 hours now an can’t figure out whats going wrong.

Any help on that?

Thanks a lot.

BR

Lukas

Look down (Made now Post with the Correct Code)

For future reference, use the code markup (</> button above the editor) so that we can read your config. Indentation is important.

@ih8gates I did, but i looks like Code Markup messed up my Code

You can do that by highlighting your code block and then clicking on the button indicated in the image below:

Looks like you also used blockquote. Those can conflict. Just use code.

EyEy Captain :slight_smile:

Heres the Working Code:

- alias: 'TV Ambiente Ein'
  trigger:
    platform: state
    entity_id: media_player.tv
    state: 'on'
  condition:
    condition: sun
    after: 'sunset'
  action:
    service:  homeassistant.turn_on
    entity_id: light.tv_ambiente