I’m trying to create an automation when the door opens the light goes on. But i want it only to happen after sunset and before sunrise. The moment i put the part condition in my automation it stops working and i have an error next to condition. Any ideas?
Just wanted to show the error beside the code
In any case this is the full code no more errors in the file editor but now i get a strange error in the log.
- id: '1608156855532'
alias: deur licht aan gang
description: ''
trigger:
- type: opened
platform: device
device_id: 2bbe457e13d27e811b16afa618d988aa
entity_id: binary_sensor.deur_naar_gang
domain: binary_sensor
condition: or
conditions:
- condition: sun
after: sunset
- condition: sun
before: sunrise
action:
- service: switch.turn_on
data: {}
entity_id: switch.sonoff_voordeur
mode: single
Invalid config for [automation]: required key not provided @ data[‘trigger’][1][‘platform’]. Got None. (See /config/configuration.yaml, line 10).
Invalid config for [automation]: [condition] is an invalid option for [automation]. Check: automation->condition. (See /config/configuration.yaml, line 10).
Yep that was it
I find it very confusing to put the word condition 4 times in there… I tried several ways but they failed every time.
Thanx for the advice!
First one is the condition block of the automation, second one says that you want to use an OR condition, third and fourth are the conditions you’re ORing.