Help with simple automation please

I’m trying to create, what I thought was a simple automation, but when I check my config I get an error.
Here is the .yaml on git hub.
And the error I get:

Testing configuration at /home/homeassistant/.homeassistant
Failed config
  automation: 
    - Invalid config for [automation]: extra keys not allowed @ data['condition'][0]['conditions'][1]['state']. Got None
not a valid value for dictionary value @ data['condition'][0]['conditions'][1]['condition']. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 90

I’m certain I’m missing something obvious here.

Thanks

at first glance you appear to have an indentation error on your 2nd automation and a missing condition:

  condition: and
  conditions:
    - platform: state
      entitiy_id: light.bedroom_light
      state: on
    - platform: time
      after: 22:00:00

should be:

  condition:
    condition: and
    conditions:
      - platform: state
        entitiy_id: light.bedroom_light
        state: on
      - platform: time
        after: 22:10:00
1 Like

Thanks. Good spot

I’ve corrected that but still get the error?
Do I need single quotes around the condition i.e after: '22:00:00'

yes I think you will need the single quotes too

Yeah, I’ve done that and still get an error:

Testing configuration at /home/homeassistant/.homeassistant
Failed config
  automation: 
    - Invalid config for [automation]: [platform] is an invalid option for [automation]

Change platform to condition in your conditions:

  condition:
    condition: and
    conditions:
      - condition: state
        entitiy_id: light.bedroom_light
        state: on
      - condition: time
        after: 22:10:00

can you post your config here rather than link to it so it’s displayed correctly (check the blue bar on top of this page).
It might also be a good idea to comment out one of the automations so we know which one fails. At the moment it’s difficult to help you blindly…

his problem is his condition is wrong, he posted his config in his original post

Missed that, nice one.

Yah, took me a few seconds because that error is doesn’t really paint the picture. I had to go look at the docs.

OK, so here is the current config:

######################################################################
##  TV Backlights
######################################################################

- alias: Lounge TV Backlighting
  initial_state: 'on'
  hide_entity: False
  trigger:
    - platform: state
      entity_id: media_player.bravia_tv
      from: 'standby'
      to: 'on'
  condition:
    condition: and
    conditions:
      - condition: numeric_state
        entity_id: sensor.lounge_light_level
        above: '907'
      - condition: state
        entity_id: switch.tv_backlight_power
        state: 'off'
  action:
    - service: switch.turn_on
      data:
        entity_id:
          - switch.tv_backlight_power
          
######################################################################
## Chromecast Playing at Night
######################################################################

- alias: Bedroom Chromecast Playing PM
  initial_state: 'on'
  hide_entity: False
  trigger:
    - platform: state
      entity_id: media_player.bedroom_chromecast
      to: 'playing'
      from: 'idle'
  condition:
    condition: and
    conditions:
      - condition: state
        entitiy_id: light.bedroom_light
        state: 'on'
      - condition: time
        after: '22:00:00'
  action:
    - service: light.turn_off
      data:
        entity_id: light.bedroom_light
        transition: 5
    - service: automation.turn_off
      entity_id: automation.motion_lights_bedroom_full

and the error:

testing configuration at /home/homeassistant/.homeassistant 
Failed config automation: - Invalid config for [automation]: extra keys not allowed @ data['condition'][0]['conditions'][0]['entitiy_id']. Got None 
extra keys not allowed @ data['condition'][0]['conditions'][0]['state']. Got None 
not a valid value for dictionary value @ data['condition'][0]['conditions'][0]['condition']. Got None 
required key not provided @ data['condition'][0]['conditions'][0]['entity_id']. Got None

You’ve got a typo (misspelled entity_id)

change :

 entitiy_id: light.bedroom_light`

to

entity_id: light.bedroom_light

Oh man, what a plonker!

Thanks all for the help!