Condition invalid option for script

Hi,
I am struggling trying to set a condition in a script.
The script should be triggered by a scene. Basically through that scene I want to turn on the light in the livingroom if it is dark outside.
I have been trying to use conditions in the script but I get the following error message:

[condition] is an invalid option for [script]

This is my code for scripts.yaml:

  enter_home:
    sequence:
    - condition:
          condition: or
          conditions:
          - condition: sun
            after: sunset
            after_offset: "-00:30:00"
          - condition: sun
            before: sunrise
            befose_offset: "-00:30:00"
    - action:
      - service: light.turn_on
        data:
          entity_id: light.livingroom_led

Thanks to anybody who can help!

enter_home:
  sequence:
    - condition: or
      conditions:
        - condition: sun
          after: sunset
          after_offset: "-00:30:00"
        - condition: sun
          before: sunrise
          before_offset: "-00:30:00"
    - service: light.turn_on
      entity_id: light.livingroom_led

Action and condition blocks are for automations, you just use the actual conditions and services in scripts.

1 Like

Thank you!! I didn’t notice :slight_smile:

1 Like