#Question about light automation
1 messages · Page 1 of 1 (latest)
Then you spilt it into trigger, condition and action:
When do you (maybe) want it to happen? = trigger => At 6:00
What needs to be true for it to happen? = condition => You're home aka occupancy sensor is in detected state
What need to happen? = action => Turn on the light
Now just selecting that for an automation you have:
description: ""
mode: single
triggers:
- trigger: time
at: "06:00:00"
conditions:
- condition: state
entity_id: binary_sensor.you_sensor
state: "on"
actions:
- action: light.turn_on
metadata: {}
data: {}
target:
entity_id: light.you_light
Do note, this does only exactly what you asked! So there is nothing to turn off the light or what to do if you enter the house @ 6:05. For that, you will have to also describe what you want. And then make an automation for it (or update this one to include it).
First of all, thank you very much for your quick reply! How would you have solved this? Do you have any suggestions for improvement, for example, what happens if I arrive home at 6:05?
Like I said, start with just writing down what you want to happen in that case. Don´t start with "how do I write an automation", start with "what do I want to happen". The better you write down what you want to happen in all possible scenario's, the easier it is to make that into an automation (or multiple).
The trigger part is to tell you "when should the automation run" and once it tries to run, it will 1. check conditions and if all are pass, will go to 2. execute actions.