Color Rotation Automation for Two Bulbs

Hey everyone, I’ve been working on a fun little project with my smart bulbs, and I wanted to share my experience in case anyone else is trying to achieve something similar. I have two color bulbs set up with some basic holiday automations, and I wanted to create a rotating color effect between them. Here’s how I approached it and what I learned along the way!

Initially, my setup was pretty straightforward: one bulb turned green and the other red at sunset for a festive look. But I wanted to add some dynamic flair by having the colors switch every 30 minutes or so. The challenge here was figuring out how to trigger the switch without both bulbs reacting to the same automation at the same time.

I started by thinking about using a time trigger, but that seemed too simplistic and might not handle overlapping schedules well. Then I remembered the input_boolean feature in Home Assistant. The idea was to use this as a toggle between the two bulbs. Here’s how I structured it:

  1. Create an input_boolean entity: This would act as a switch to determine which bulb should be active. I set it to off by default.
  2. Set up two automations: One would activate when input_boolean was on, and the other when it was off. Each automation would set the respective bulb to its designated color.
  3. Add a time-based trigger: Every 30 minutes, I wanted to toggle the input_boolean state. This would effectively switch the active bulb and its color.

The execution was a bit tricky at first. I had to ensure that the automations didn’t conflict and that the toggle worked seamlessly. After some trial and error, I realized that using separate automations for each state of input_boolean was the key. This way, each bulb knew exactly when to change its color based on the toggle.

To make it even more dynamic, I considered adding a random delay to the toggle. This would prevent both bulbs from switching at the same exact time, creating a more natural-looking effect. However, I decided to stick with the fixed interval for simplicity, as the visual effect was already quite impressive.

One thing I learned is the importance of testing each part of the automation separately before combining them. This helped me identify and fix issues early on, like ensuring the input_boolean state was updating correctly and that each bulb responded to its automation without delays.

Overall, this project was a great way to get more comfortable with Home Assistant’s automation capabilities. It’s amazing how a little creativity and some trial and error can turn a simple setup into something truly engaging. If anyone has questions or wants to share their own color rotation ideas, I’d love to hear about them!

Cheers, and happy automating! :rocket: