Battery SOC Controlled Lamp (discrete colors)

Battery SoC Controlled Lamp — Discrete Colors

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

A simple Home Assistant blueprint that sets the color of a smart color-changing bulb based on the current battery state of charge (SoC). This makes it easy to glance at a light and know whether your home battery is low, mid, or full — ideal for Powerwall, solar, or any battery integration (though it would be a bit weird to use for your phone!).

In my case, I’m connecting this up to a cute desk lamp I found on Etsy (I haven’t gotten it yet :cry:).

Features
  • Discrete colors defined by user-configurable thresholds
  • Useful for solar systems
  • Fully configurable in the UI — no YAML edits required.

Example Behavior (default thresholds)

SoC (%) Color Meaning
≤ 20% :red_circle: Red Low/empty
≤ 40% :orange_circle: Orange Low-mid
≤ 60% :yellow_circle: Yellow Mid
≤ 80% 🩵 Cyan High but not full
≤100% :green_circle: Green Full

You can freely adjust thresholds and colors in the blueprint configuration.


Required Inputs

  • Battery SoC Sensor
    A sensor or number entity reporting SoC as a percentage (0–100).
    Example: sensor.powerwall_battery_level.

  • Target Light
    Any color-capable light entity. Works with most Zigbee, Thread, and Wi-Fi bulbs. It was tested using a LIFX Wi-Fi bulb.

  • Brightness Control
    An input_number that controls the brightness of the lamp dynamically.

  • Color Map
    A mapping between the SOC level and the color used is provided. This is fully editable. The possible colors are: red, orange, yellow, green, blue, indigo, violet, lime, gold, and cyan. The entries in the color map don’t need to be in any particular order. The default values correspond to the values above.

  • Update interval (seconds)
    The automation is triggered every so often to keep the bulb color up-to-date.


Blueprint Image

Source

The source for these automations is on GitHub [here](dbwalker0min/home-assistant-blueprints: A Home Assistant Blueprint to automatically open the garage door when returning home).

Questions

If you have any questions about the blueprint, contact me at [email protected].