Creating Dynamic Lighting Scenes with Yeelight: A Smart Home Automation Journey

I recently embarked on a project to enhance my home’s ambiance using Yeelight smart LED bulbs, and I must say, it’s been an enlightening experience! :star2:

The Setup

I started by replacing traditional bulbs in my living room with Yeelight’s RGBW version, aiming to create dynamic lighting scenes. The idea was to automate the lighting based on time of day, mood, or even specific activities like movie nights or gaming sessions.

The Challenge

Initially, I faced a bit of confusion with the automation rules. I wanted the lights to transition smoothly between colors and brightness levels, but setting up individual triggers for each scenario seemed overwhelming. I had multiple scenes in mind—like a warm, dim setting for relaxation and a vibrant, energetic mode for parties—and I didn’t want to create separate automations for each.

The Solution

After some research and experimentation, I discovered a more streamlined approach using Home Assistant’s automation capabilities. Instead of creating separate triggers for each color or brightness level, I utilized input selects and templates to simplify the process. Here’s how I did it:

  1. Input Select for Modes
    I created an input select entity called input_select.yeelight_mode with options like ‘Relax’, ‘Party’, ‘Movie’, and ‘Game’. This acts as a central control point for selecting the desired lighting scene.

  2. Automation Rules
    I set up a single automation that listens for changes to input_select.yeelight_mode and triggers the corresponding lighting scene. Each mode maps to specific RGB color values and brightness levels, ensuring a seamless transition.

Here’s a snippet of the automation configuration:

yaml

  • id: ‘1582362294780’
    alias: yeelight_color_change
    description: ‘’
    trigger:

    • platform: state
      entity_id: input_select.yeelight_mode
      to: relax
      condition:
      action:
    • service: yeelight.set_color_scene
      data:
      entity_id: light.yeelight
      brightness: 50
      rgb_color: [255, 165, 0] # Warm orange
  • id: ‘1582362994505’
    alias: yeelight_blue
    description: ‘’
    trigger:

    • platform: state
      entity_id: input_select.yeelight_mode
      to: party
      condition:
      action:
    • service: yeelight.set_color_scene
      data:
      entity_id: light.yeelight
      brightness: 100
      rgb_color: [0, 0, 255] # Vibrant blue
  1. Integration with Scenes
    To make it even more user-friendly, I integrated these modes into custom scenes within the Lovelace interface. Now, with a single tap, I can switch between different lighting scenarios without delving into the backend configuration.

The Outcome

The result is a versatile and intuitive lighting system that adapts to my needs effortlessly. Whether it’s a cozy evening at home or a lively gathering, the Yeelight bulbs deliver the perfect ambiance. Plus, the energy-saving features ensure that I’m not only enhancing my home’s look but also being mindful of efficiency.

Tips for Others

If you’re looking to implement a similar setup, here are a few tips:

  • Start Small: Begin with one room and gradually expand to other areas as you become comfortable with the system.
  • Experiment with Colors: Don’t be afraid to mix and match colors to find the perfect combinations for your space.
  • Leverage Templates: Use templates and input selects to keep your configurations clean and manageable.

This project has been a fantastic way to dive deeper into the world of smart home automation, and I’m excited to see how I can expand it further in the future! :rocket:

If anyone has tips or alternative approaches, I’d love to hear them! Let’s continue to illuminate our homes in innovative ways! :sparkles: