ESPHomeHome Assistant

Live power meter with an over-limit alarm on a Cheap Yellow Display

A Cheap Yellow Display shows a Home Assistant power sensor as a big number, an arc, and a bar. The card turns green, amber, or red, and a tone plus the RGB LED stay on until you tap the screen.

Difficulty · IntermediateSetup · 45–75 minutesHA · 2024.10 or newerESPHome · 2026.10
Get the pack · from $19Have us set it up

Some hardware links on this page are affiliate links. As an Amazon Associate I earn from qualifying purchases. We may earn a commission if you buy through them, at no extra cost to you. See the affiliate disclosure.

A phone dashboard is a poor place to notice that the house is pulling more power than you wanted. This firmware puts that number on the 320×240 panel of an ESP32-2432S028R, the usual one-USB Cheap Yellow Display. The watts come from a Home Assistant sensor you name. The card color follows two thresholds stored on the display, so a reboot does not forget them. If the reading stays over a third threshold, the board beeps and the RGB LED flashes until you tap the glass.

The same board, used as buttons, a thermostat, or a status face, is CYD touch control panel, CYD desk companion, and CYD PC hardware monitor. This one only watches power, plus one switch tile.

What problem it solves

You want whole-home or circuit watts on the desk, a color that means normal, elevated, or high, and a local alarm that keeps going until someone in the room acknowledges it.

How it works

ESPHome draws one LVGL page. Home Assistant is the source of the watts, the optional daily energy, and the switch state. The display does not talk to the meter directly.

  1. The number. A substitution names one power sensor. The big figure, the arc, and the bar all follow it. The arc and the bar top out at meter_max_w (pack default 12000). A higher reading stays pinned at the end of the scale. The number itself is not pinned.
  2. The color. Two number entities on the device, Amber threshold and Red threshold, are restored after a reboot. Under amber the card is green. From amber up to red it is orange. At red and above it is red. Change the numbers in Home Assistant. The card updates on the next reading.
  3. Daily energy. A second substitution names a kWh sensor. It is a smaller line under the watts. A missing entity shows kWh -- and does not affect the alarm.
  4. The switch tile. One button calls homeassistant.toggle on the entity you name. The tile label follows that entity’s state. The device has to be allowed to perform Home Assistant actions, or the tap does nothing.
  5. The alarm. Alarm threshold, Alarm hysteresis, and Alarm hold are number entities, also restored. When power stays above the alarm threshold for the hold time, Over limit turns on, the speaker plays a short tone in a loop, and the onboard RGB LED flashes red. Tap the screen, or turn on Mute alarm in Home Assistant, and the tone and the LED stop. Over limit stays on. It clears, and mute clears with it, only after power drops below the alarm threshold minus the hysteresis.
  6. Backlight. After idle (pack default 60 seconds) the backlight turns off, unless an alarm is latched. A tap brings it back. An alarm also forces the backlight on.

Wi-Fi, the API key, and OTA stay in secrets.yaml.

Hardware notes

  • Board. Stock one-USB resistive CYD. Display is MIPI SPI, model ILI9341, color order BGR. SPI clock GPIO14, MOSI GPIO13, MISO GPIO12, CS GPIO15, DC GPIO2. Backlight is LEDC on GPIO21. Touch is XPT2046 on a second SPI bus: clock GPIO25, MOSI GPIO32, MISO GPIO39, CS GPIO33, interrupt GPIO36. Rotation is 90. This is the same map as CYD touch thermostat and CYD now playing display.
  • Other CYDs. A two-USB board or an ST7789 panel needs a different display model and pin map. This file does not cover those. If touch is mirrored, flip touch_mirror_x or touch_mirror_y and reflash.
  • Speaker. The tone uses LEDC and RTTTL on buzzer_pin, pack default GPIO26, which is the speaker header on this board. For a passive buzzer on a free pin, set buzzer_pin to GPIO22 or GPIO27. Do not move the RGB LED off GPIO4, GPIO16, and GPIO17. Those three are inverted.
  • Power. USB is enough. Later updates can be OTA.
  • Meter. Any Home Assistant sensor that reports watts. A daily energy sensor is optional. The switch tile is optional. Point it at a real switch, or leave the substitution and ignore the tile.

Snippet

Names, the meter scale, and the speaker pin are substitutions. The page, the thresholds, and the alarm script are in the pack.

substitutions:
  device_name: power-display
  power_entity: sensor.change_me_power
  energy_entity: sensor.change_me_energy
  toggle_entity: switch.change_me
  buzzer_pin: GPIO26
  meter_max_w: "12000"
  idle_seconds: "60"

Setup outline

  1. Copy the secrets example into your ESPHome secrets. Fill Wi-Fi, a new API key, OTA, and the fallback password.
  2. Paste the device YAML. Set the power sensor, and the energy sensor and switch if you have them.
  3. Validate, then flash over USB. Accept the device in Home Assistant. Open the ESPHome device and enable Allow the device to perform Home Assistant actions.
  4. Confirm the watts on the panel match the sensor. Set Amber threshold, Red threshold, and Alarm threshold under the device. They survive a reboot.
  5. Hold a load above the alarm threshold for the hold time. The tone and the red LED should start, and Over limit should turn on. Tap the screen. The tone should stop and Alarm muted should turn on. Drop the load below the threshold minus the hysteresis. Over limit and mute should both clear.
  6. Tap the switch tile. The switch should toggle, and the tile text should follow.

Troubleshooting

  • The screen stays white. This YAML is the ILI9341 one-USB map. A two-USB or ST7789 board will not show a picture on this file.
  • The number stays on dashes. The power entity id is wrong, or that sensor is unavailable. The second line can stay on kWh -- without blocking the watts.
  • The card color never leaves green. Amber threshold is above the live reading, or the number entities were restored to old values. Read them on the device page.
  • The tone never starts. Power has to stay above Alarm threshold for the whole hold. A dip resets the timer. GPIO26 is the speaker header. A board with no speaker soldered stays silent. Move buzzer_pin to a passive buzzer.
  • Tap does not mute. The touch calibration is off. Start from the pack values, then adjust touch_x_min, touch_x_max, touch_y_min, and touch_y_max. Mirroring is the other pair of substitutions. Mute alarm in Home Assistant does the same job without touch.
  • The switch tile does nothing. The allow-actions checkbox is still off, or toggle_entity is not a switch the homeassistant.toggle action can reach.
  • The alarm returns as soon as you unmute. Power is still above the threshold. Mute holds only while Over limit is on. It re-arms after the reading falls below the threshold minus the hysteresis.
  • The backlight never dims. An alarm is latched, or something is touching the panel and resetting the idle timer.

Credits

Inspired by CYD-HA-display. This pack is the power reading, the tier colors, the switch tile, and the over-limit alarm. It does not include the other gauges from that project. The display, touch, and LVGL setup matches the other Cheap Yellow Display packs on this site.

Changelog

v1.0 · Nov 1, 2026: First publish.