switching from iobroker to HA (and really missing blockly …)
I tried to do a simple automation of my lights at the house.
turn on at 06:00 in the morning, turn off when sun rises (when sun rises before 06:00 basically nothign happens)
turn on when sun sets, turn off again at 23:00 latest
I did the following based on documentation I found:
You are using the wrong type here.
The condition you are using is a full stop of the code if it fails.
Meaning the automation will work with turning on, but not off since it’s below the turn on condition.
What you should be using is choose.
And the condition in the choose is the condition you have here.
Add the action, then add a new option and set up the second condition.
If you now open the Yaml mode you will see that the code is more indented just as you expected.
I’m impressed with your first attempt of an automation.
It’s not easy to know the difference between condition and choose.
The only thing we are missing when the above is done is the condition of sun up before 6.
You can add that as a state condition, sun.sun below horizon.