Trying to make a script i can call in an automation and not sure what im doing wrong
- if:
- condition: state
entity_id: light.sw2_b_new_light_1
state: "on"
then:
- service: light.turn_off
target:
entity_id: light.sw2_b_new_light_1
- delay:
seconds: 2
else:
- service: light.turn_on
target:
entity_id: light.sw2_b_new_light_1
- delay:
seconds: 1
- service: light.turn_off
target:
entity_id: light.sw2_b_new_light_1
- delay:
seconds: 2
- service: light.turn_on
target:
entity_id: light.sw2_b_new_light_1
data:
brightness_pct: 100```
says "extra keys not allowed at data[0] ive messed with this for a few hours now and am just tired at this point please help me