yes, you can do it in one automation by using âwait_template:â as steps in the automation.
create the automation with sunrise as a trigger then in the action the first one will be to turn on the LED, then wait for each milestone to switch to the next step with the last step being to turn the led off.
But I wouldnât do it like that since the automation will be running continuously all day and if one part fails then the rest also fail.
just make a few automations that trigger at the milestones above and perform just one action each. It will be way more reliable.
But according to your requirements above you donât âactivate itâ (I assume you mean âtriggerâ or âto cause the automation to runâ) by a switch. It runs at sunrise to turn on the LED. So the âtriggerâ would be âat sunriseâ. then the next automation would have âat 9amâ as itâs trigger. then âat sunsetâ, then âat 11pmâ.
Yes, it will âtriggerâ automatically based on the time. But Iâd probably also want to turn off the script altogether (so the LED does not cycle throughout the day - e.g. switch it off completely).
you could create an input boolean (virtual switch) and put it in the conditions for each of the automations to prevent the action if the boolean is turned off.