Time and conditions problems

Hi,
I’m trying to switch off all lights at 22.30 all days before a working day
This is the code I’m struggling with:

  trigger:
    platform: time
    after: '22:30'
    condition:
      condition: time
      weekday:
      - sun
      - mon
      - tue
      - wed
      - thu
  action:
  - service: homeassistant.turn_off
    entity_id: 
    - group.all_switches
    - light.Hurts_gillestuga
    - light.UteAltan 

I get the error:
Invalid config for [automation]: [condition] is an invalid option for [automation]

The strange thing is that I’ve checked other users automations and their’s look the same… :frowning:

When posting logs or configuration snippets please use code blocks and syntax highlighting.

Sebastian

I tried but I couldn’t find any formatting for code…

It’s the </> icon in the editor toolbar.

Sebastian

Didn’t work the first time I tried but now it definitively looks better :slight_smile:

Much better now :slight_smile:
Your indentation is off, try it this way:

  trigger:
    platform: time
    after: '22:30'
  condition:
    condition: time
    weekday:
      - sun
      - mon
      - tue
      - wed
      - thu
  action:
    - service: homeassistant.turn_off
      entity_id: 
        - group.all_switches
        - light.Hurts_gillestuga
        - light.UteAltan

Sebastian

Indentation, indentation, indentation…

Thank you!!

1 Like