#Using an automation in place of a light effect to run indefinitely

1 messages · Page 1 of 1 (latest)

serene prairie
#

So! End goal is that when I have a specific conditioon active, a light should fade between two colors over an interval. The plan for actually making this fade happen is to just send a command to fade to one color for the next 5 seconds every 10 seconds, and then at 5/10 on that interval send a command to fade back to the first color over the remaining 5 seconds.

I know endless automation loops are generally frowned upon and have some issues. Instead, I would like to know which would be a better approach to achieve this effect, given that in both methods a helper or some other boolean will allow dropping the loop (potentially in the form of disabling the automation, but still)

  • Endless recursion of the automation
  • The automation actually runs once every 5 seconds and determines which state should be transitioned to based on whether the current number of seconds is 0 or evenly divisible by 10
  • Two timer helpers?

Not sure which would be preferred here. I used 5 and 10 in this example, but assume I might choose any x and y as long as 2x <= y and a state transition begins every y/2 seconds.

#

I just realized someone figured a similar process out with a template that would perform endless recursion but was wondering if I should use a different approach.

timid flame
#

Use what works, what you understand, and what you can fix. The actual stress on the system is generally neglagable, or will break and cause rule 1 to break.

#

Remember that automations do not survive reboots and other system interruptions.

eager mountain
#

Does the light itself support the transition of the light? For example in case of Hue does so you may be able to send just one command?

serene prairie
serene prairie