Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Home Assistant Physical Color Wheel for Albums: How It Works

· 6 min read · Home Automation

In this article
  1. What Is a Physical Color Wheel for Home Assistant?
  2. How the Color-to-Album Mapping Works
  3. Hardware Options and How to Build One
  4. Software Setup: ESPHome and Home Assistant Automations
  5. Common Problems and How to Troubleshoot
  6. Alternatives: Digital Wheels and Voice Control
  7. Frequently Asked Questions

A physical color wheel can absolutely be used with Home Assistant to flip through music albums, and it works by mapping each color on the wheel to a specific media selection command. You spin the wheel to a color, and Home Assistant triggers an automation that plays the album you have assigned to that color.

What Is a Physical Color Wheel for Home Assistant?

A physical color wheel is a hardware input device—usually a rotary knob with a colored disc or a ring of color segments—that connects to a smart home hub. In the context of Home Assistant, it is typically built using a microcontroller like an ESP32 or a Raspberry Pi Pico, paired with a color sensor or a rotary encoder. The wheel itself can be a repurposed color picker from a paint store, a custom 3D-printed disc, or even an old color wheel from a design classroom.

Each segment of the wheel corresponds to a specific color, and when you rotate the wheel to a segment, the sensor reads the color and sends a value to Home Assistant via MQTT, ESPHome, or a REST API. Home Assistant then uses that value to trigger an automation—for example, playing a specific album on a smart speaker or media player.

How the Color-to-Album Mapping Works

The core idea is that you assign each album in your collection to a color. The mapping can be stored in a Home Assistant automation or in a script that uses the color value as a trigger. Here’s a typical flow:

  1. The user rotates the physical wheel to a color, say red.
  2. A color sensor (like a TCS34725) reads the RGB value and sends it to the microcontroller.
  3. The microcontroller publishes the color name or RGB value to an MQTT topic, e.g., home/color_wheel/state.
  4. Home Assistant listens to that topic and triggers an automation that matches the color to an album.
  5. The automation calls a media player service, such as media_player.play_media, with the album’s URI or playlist.

For example, you might set red to “Abbey Road” by The Beatles, blue to “Kind of Blue” by Miles Davis, and green to “Random Access Memories” by Daft Punk. When you spin the wheel to blue, Home Assistant plays Miles Davis.

Hardware Options and How to Build One

There are several ways to build a physical color wheel, depending on your skill level and budget. The most common approach uses an ESP32 board, a color sensor, and a stepper motor or a simple rotary encoder. Here are the main components:

  • Microcontroller: ESP32, ESP8266, or Raspberry Pi Pico (ESP32 is popular due to built-in Wi-Fi and Bluetooth).
  • Color sensor: TCS34725 or APDS-9960 (can detect RGB and clear light).
  • Rotary encoder: To detect rotation angle if you’re not using a color sensor.
  • Wheel disc: A printed or painted disc with distinct color segments.
  • Enclosure: 3D-printed case or a repurposed box.

If you prefer a simpler build, you can skip the color sensor and use a rotary encoder with a fixed set of positions, each mapped to a color. For example, a 12-position encoder can represent 12 colors, and you can label the wheel accordingly.

Software Setup: ESPHome and Home Assistant Automations

The easiest way to integrate the hardware with Home Assistant is to use ESPHome, which allows you to define the device as a sensor and send the color value directly to Home Assistant. Here’s a high-level setup:

  1. Flash ESPHome firmware on the ESP32 with a color sensor component.
  2. Define the sensor in the YAML configuration, e.g., sensor: with platform tcs34725.
  3. Create a template sensor that converts the RGB values to a color name (red, green, blue, etc.).
  4. In Home Assistant, create an automation that triggers when the color sensor changes, and use a choose action to match the color to an album.

Alternatively, you can use MQTT directly. The microcontroller publishes the color value to an MQTT topic, and Home Assistant uses an MQTT sensor to trigger automations. This approach gives you more flexibility if you’re already using MQTT in your setup.

Common Problems and How to Troubleshoot

Like any DIY project, you might run into issues. Here are the most common problems and their fixes:

  • Color sensor readings are inconsistent: Calibrate the sensor under the same lighting conditions you’ll use, and consider adding a small light shield to block ambient light.
  • Wheel doesn’t stop at the right segment: Use detents on the encoder or a mechanical click mechanism to ensure each position is stable.
  • Home Assistant doesn’t receive the value: Check MQTT topic names and ensure the sensor is publishing correctly. Test with an MQTT client like MQTT Explorer.
  • Album doesn’t play: Verify the media player entity ID and that the album URI is correct. Test the automation manually with the media_player.play_media service.

If you’re using a color sensor, make sure the wheel’s color segments are large enough for the sensor to read reliably. A segment that is too small might cause the sensor to read two colors at once.

Alternatives: Digital Wheels and Voice Control

If building a physical wheel seems like too much work, there are simpler alternatives. A digital color wheel on a tablet or phone can be used with Home Assistant’s frontend to achieve a similar effect. You could create a dashboard with a color picker card that triggers the same automations. Another option is to use voice commands with a smart speaker—just say “Play the red album” and use a voice assistant to trigger a script. However, a physical wheel offers a tactile, visual experience that digital interfaces can’t match, and it can be a fun conversation piece.

Frequently Asked Questions

Do I need a color sensor, or can I use a rotary encoder?

You can use either. A color sensor reads the actual color on the wheel, which is great if you want to repaint or change the wheel without reprogramming. A rotary encoder uses fixed positions, so you’d need to program each position to a color. Both work well; it depends on whether you prefer flexibility or simplicity.

Can I use this with Spotify or Apple Music?

Yes, as long as your media player integration supports play_media with a URI. For Spotify, you can use the Spotify integration and provide a playlist or album URI. For Apple Music, you’d need a compatible integration like the Apple TV or a HomePod, but the same automation principle applies.

How many albums can I assign to a wheel?

It depends on how many distinct colors you can reliably distinguish. A typical wheel might have 8 to 12 segments, but you could use more if you have a high-resolution sensor and carefully chosen colors. You can also use multiple wheels or a wheel with a secondary button to switch between “pages” of albums.

Is this project suitable for beginners?

It’s a moderate DIY project. If you’re comfortable with basic electronics and have some experience with Home Assistant and ESPHome, it’s doable. Beginners might want to start with a simpler version using a rotary encoder and a pre-built enclosure.

Can I use the wheel to control other things besides albums?

Absolutely. The color-to-action mapping can control lights, scenes, or any Home Assistant entity. For example, you could set red to turn on a “movie night” scene, blue to set the thermostat to eco mode, and so on. The wheel is just an input device; the automations define what each color does.