Battery SoC Controlled Lamp — Discrete Colors
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
).
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% | Low/empty | |
| ≤ 40% | Low-mid | |
| ≤ 60% | Mid | |
| ≤ 80% | 🩵 Cyan | High but not full |
| ≤100% | 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
Aninput_numberthat 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].
