energy-display

Overview

In 2023, we purchased a rooftop PV system with battery storage. To make the most of this, we need to think about when we switch on energy-hungry appliances such as the dishwasher or washing machine or when we charge our electric vehicle. So far, we have based this decision on the smartphone app / website provided by the manufacturer, which informs us about the battery's state of charge and the feed-in to the grid (power surplus). For the power surplus, the most convenient information would be a predicition for the near future (next few hours), but the next best thing is the history of the past few hours. Theoretically, the app can provide this (feed-in histogram), but in practice the data often lags a few hours behind. In addition, you always have to look at your smartphone or web browser to get this information.

To remedy this, I built something I call "energy-display" (for lack of a better name): a small box that sits in our living room and is equipped with a series of LEDs that provide us with exactly the information we need to make decisions.

Hardware

The prototype is based on a Raspberry Pi Zero 2 W with a 12-segment RGB LED ring and an 8 x 8-segment RGB LED matrix panel based on the WS2812 (also known as Adafruit NeoPixel). In a later variant I plan to use a Raspberry Pi Pico, or at least see how far I can get with this much smaller device. I also designed a 3D printed enclosure, with lots of ventilation holes, to meet the originally expected power consumption of 4 to 5 watts (which turned out to be much less, as the RGB LEDs were outrageously bright and are now dimmed to about 5%).

Assembled case, front Assembled case, back

Inside, I designed a plug-in card system that allows easy replacement of components and future expansions, such as a light sensor for adaptive dimming and a piezo beeper for notifications. The front panel has covered holes through which the LEDs can shine and has mounting clips for alignment.

Base part with board holder Screen part without matrix

Software

The prototype software is based on Rasbperry Pi OS and is written in Python. Due to an initial misunderstanding that the Adafruit NeoPixel library always requires root privileges to run, the LED handling code was placed in a separate component called LED Server. The LED Server provides an HTTP API that is used by the Display Updater, which contains the entire business logic of the project. The actual display data is provided by an existing infrastructure: an instance of InfluxDB (historical data) and an MQTT broker (current data).

Component dependencies

The original approach was to use Docker containers for all software components, but the library used by the LED Server currently contains an issue that makes it impossible to use it within a container. However, when using the LED server with the memory-based loopback implementation, the container approach works without any problems, so it should be easy to update when the issue is fixed.

When switching to the Raspberry Pi Pico, the software must be fundamentally changed, but the business logic should be reusable when ported to MicroPython.

References