Hi All!
I’m trying to change the scene for my lights depending on what time the sensor is triggered.
My background is writing websites, so I’m learning how to write automation yaml files.
The problem is that I’m trying to include if/then/else conditions. If I were writing it in a website, it would look like this.
-
alias: Kitchen Lights
trigger:
- type: motion
platform: device
device_id: 88193dc03fbfec4d70ba99174ec5393a
entity_id: binary_sensor.kitchen_sensor_motion
domain: binary_sensor
- type: motion
If time > 17:00 and time < 23:00
then
var_scene = scene.kitchen_bright
else
var_scene = scene.kitchen_dimmed
end if
action:
- service: scene.turn_on
target:
entity_id: var_scene