↩ Deze pagina in het Nederlands
ESP32 · HomeWizard · WiFi

Live energy usage on your own display

Waveshare ESP32-S3 1.54 inch LCD showing energy data
Waveshare ESP32-S3 1.54" LCD (240×240) — compact board with a matching white plastic enclosure

Connect a small ESP32 module wirelessly to your smart meter via the HomeWizard P1 meter (and optionally control Energy Sockets) — no cloud, no subscription.

Your smart meter records everything, but shows nothing. This €13 display shows it — live, no subscription. How much does the washing machine use? When are the solar panels injecting, and how much? What is the monthly peak? Optionally, the module switches up to three sockets automatically based on your power surplus.

Live usage

View your electricity consumption and solar energy generation directly from your digital meter via WiFi.

🔌

Smart sockets

Enable Energy Sockets automatically — if desired — when there is sufficient sunlight, adjustable per second.

🏠

100% local

Works even if HomeWizard's servers or your internet go down — only your home WiFi is needed.

What does the screen show?

Display with numbered labels
  1. Socket — name of the socket (see colour legend below)
  2. Projected quarter-hour peak — expected peak if current consumption continues
  3. Current time - yellow = daytime rate, green = nighttime rate
  4. Highest monthly peak — the highest quarter-hour peak recorded this month
  5. Chart area — historical consumption and feed-in over time
  6. Current consumption or surplus — in watts; negative = feeding back to the grid
🎨 Socket colour legend and icons
  • Sockets light blue: active (shows consumption per socket)
  • Sockets dark blue: active but no consumption (e.g. thermostat on device switches off)
  • Sockets grey: socket is off (shows switch-off delay in seconds)
  • Green dots (and green lines): sockets can be switched
  • Lightning icon: yellow = day rate, green = night rate
Lilygo T-Display S3 showing sockets and values
Lilygo T-Display S3 — display layout (all values in Watts)
Lilygo T-Display with P1 data
Lilygo T-Display: at the top sockets, below them the projected quarter-hour peak on the left, time in the middle, highest monthly peak on the right. At the bottom: consumption or production.
Lilygo T-Display showing power graph
T-Display — graph view
Lilygo T-Display S3 showing power graph
T-Display S3 — graph view

What do you need?

💡 Check WiFi coverage Make sure your WiFi signal reaches your smart meter (meter cupboard). A repeater can help if the signal is weak.
🌍 Not just the Netherlands and Belgium The HomeWizard P1 Meter works with most modern smart meters across Europe — including in the Netherlands, Belgium, Luxembourg, Sweden, Denmark, Finland, Ireland, and Norway. This sketch only talks to your HomeWizard P1 Meter's local API, so as long as that works for your meter and you enable the local API, this code works wherever the HomeWizard P1 Meter is supported.
HomeWizard P1 meter
HomeWizard P1 meter connected to the smart meter

Physical installation

  1. Plug the HomeWizard P1 meter into the smart meter and follow HomeWizard's instructions.
  2. (Optional) Plug the HomeWizard Energy Sockets into a wall outlet and follow HomeWizard's instructions.

Enable the local API

Open the HomeWizard app and go to Settings → Devices → P1 Meter. Enable the local API at the bottom. Without this, the module cannot retrieve data.

(Optional) Repeat this for any sockets you want to switch or monitor with the module.

Put the firmware on the board

First download the correct file for your board:

▸ LilyGo T-Display / T-Display S3 — How do I flash this? (step-by-step)

You need no software — this is done directly from your browser (Chrome, Edge or Opera) using espflash.app.

  1. Open the flash tool in your browser

    Go to espflash.app, connect your board via the USB data cable and click "Connect Device". Select the correct port in the pop-up.

    ESPFlash connect
  2. Choose the firmware file

    Click "Click to upload firmware" and select the .bin file you downloaded above.

    Choose firmware file File selected
  3. Start flashing

    Click "Start Flashing" and wait patiently. Do not disconnect the USB cable during this process (takes a few minutes).

    Flashing in progress
  4. Done!

    You will see "Done!" or "Flash successful". Unplug and reconnect the cable — the board starts up with the new firmware.

    Flash successful
⚠ Troubleshooting
  • No COM port visible? Install the USB driver (CP210x or CH340).
  • Process stalls? Hold the BOOT button while clicking "Program".
  • Still not working? Try a different USB cable or USB port.
▸ Waveshare ESP32-S3 1.54" — How do I flash this? (step-by-step)

The Waveshare ESP32-S3 uses native USB and works best with esptool-js (also directly in the browser, no installation needed).

  1. Open the flash tool

    Go to espressif.github.io/esptool-js in Chrome, Edge or Opera. Connect your Waveshare board via the USB data cable.

  2. Connect to the board

    Click "Connect" and select the correct port in the pop-up (e.g. "USB JTAG/serial debug unit").

  3. Configure the flash settings

    Set the flash address to 0x0 or just zero 0Click "Choose File" and select the Autosockets_154_T.ino.merged.bin file you downloaded above.
    If a second file row is visible, click "Remove" to delete it.
    Also set: Flash Mode: keepFlash Frequency: keepFlash Size: 16 MB.

  4. Start flashing

    Click "Program" and wait patiently. Do not disconnect the USB cable during this process. You'll still have to wait even after “100%.” Once everything is finished, you'll see another notification, and then you can restart the device.

  5. Done!

    You will see "Leaving... Hash of data verified." at the bottom. Unplug and reconnect the cable — the board starts up with the new firmware.

⚠ Troubleshooting
  • No port visible? Use Chrome, Edge or Opera — Firefox does not support WebSerial.
  • Process stalls? Hold BOOT, briefly press RESET and release BOOT. Then click "Program" again.
  • Still not working? Try a different USB cable or USB port.
🔧 Advanced users: source code and Arduino IDE

Want to modify or compile the code yourself? Request the source code at johanok@gmail.com. This approach only makes sense if you are familiar with Arduino and library management.

First-time configuration

Power on the board by connecting it to a power source. If it cannot connect to WiFi, it opens its own wireless access point (Lily, no password required).

  1. Turn off mobile data on your smartphone and connect to the Lily network.
  2. Open your browser at 192.168.4.1.
  3. Enter only your WiFi credentials (SSID and password) — the board will then automatically scan your network for HomeWizard devices, save them, and restart.
✅ Automatic detection If no P1 meter has been configured yet, the board scans the network automatically and stores found devices.
Setup page when no WiFi
Configuration page at 192.168.4.1
Scan in progress Scan results
Setup part 1 Setup part 2
💡 The board saves found devices by hostname automatically when it scans. E.g. p1meter-123abc.local instead of 192.168.1.x. If the IP address ever changes, you won't need to update anything.
Settings saved confirmation
After configuring, you can save a screenshot for future reference
⚡ Faster than the HomeWizard app The app switches sockets with a minimum delay of 1 minute. This module works per second — useful on cloudy days when sun and cloud alternate rapidly.

Changing settings later

Press the top button for 5 seconds. Turn off mobile data, reconnect to Lily (no password) and open 192.168.4.1. You can then:

Button overview

LilyGo T-Display & T-Display S3

Two buttons. A short press on the bottom button also displays the full button overview directly on the screen for 5 seconds.

Button hints on the LilyGo T-Display
Button hints on the LilyGo T-Display — shown after a short press on the bottom button
Button Action Function
Top button (FLASH / BOOT)
▲ Top Long (5 sec) Clear WiFi credentials and restart. The board opens its own access point (name: Lily) so you can enter new credentials via 192.168.4.1.
▲ Top Short Toggle monthly peak display on/off. Also shows uptime and the current switch-on threshold per socket for 5 seconds.
▲ Top Double click Rotate display 180° — useful when the USB connector is on the other side. Note: after rotating, top and bottom buttons swap positions in this table.
Bottom button
▼ Bottom Long (5 sec) Reset all switch-on thresholds to 150 W. The display briefly confirms with a message. Useful if auto-calibration has set a threshold too high.
▼ Bottom Short Shows the button overview on the display for 5 seconds, with an arrow per button and the corresponding actions in colour (orange = long press, green = short press, cyan = double click).
▼ Bottom Double click Switch display mode: sockets + peaks → 3-hour chart → 6-hour chart → 12-hour chart → 24-hour chart → quarter-hour projection → back to sockets. The selection is saved and persists after a restart.

Waveshare ESP32-S3 1.54″

Three buttons. A short press on the middle button (PWR) displays the button overview on the screen for 5 seconds.

Button hints on the Waveshare 1.54"
Button hints on the Waveshare ESP32-S3 1.54″ — shown after a short press on the PWR button
Button Action Function
Top button (FLASH / BOOT)
▲ Top Long (5 sec) Clear WiFi credentials and restart. The board opens its own access point (name: Lily) so you can enter new credentials via 192.168.4.1.
▲ Top Short Toggle monthly peak display on/off. Also shows uptime and the current switch-on threshold per socket for 5 seconds.
▲ Top Double click Rotate display 180° — useful when the USB connector is on the other side. Note: after rotating, top and bottom buttons swap positions in this table.
Middle button (PWR)
⏻ PWR Long (5 sec) Toggle automatic socket switching on/off. The current status is shown as a coloured line at the top of the display (green = enabled). On the TTGO and T-Display S3 this setting can only be changed via the web page.
⏻ PWR Short Shows the button overview on the display for 5 seconds, with an arrow per button and the corresponding actions in colour (orange = long press, green = short press, cyan = double click).
Bottom button (KEY)
▼ Bottom Long (5 sec) Reset all switch-on thresholds to 150 W. The display briefly confirms with a message.
▼ Bottom Short Switch display mode: sockets + peaks → 3-hour chart → 6-hour chart → 12-hour chart → 24-hour chart → back to sockets. The selection is saved and persists after a restart.

Built-in safety mechanisms

⚙️ Technical LilyGO modules run on the powerful ESP32 chip and operate on standard 5V via USB‑C. No computer required after flashing — they work fully stand‑alone. Thanks to FreeRTOS, network scanning and socket polling run in parallel, delivering fast and rock‑solid performance.
🖥 Bigger screen? Need better visibility from across the room? With a small code adjustment, the same firmware also runs on the ESP32‑3248S035 — a bright 3.5" touchscreen that instantly gives your project a more professional look. Available on AliExpress.
🤓 Nerd stuff:
  • Written in modern C++ and optimized with FreeRTOS tasks for maximum speed and responsiveness.
  • The priority‑driven switching logic ensures smart, predictable and stable control.
  • When solar production increases gradually (sunrise, cloud moves away), the lowest‑power consumer switches on first.
  • When there's a sudden surplus, the socket with the longest off‑delay gets priority.
  • Manual control via the HomeWizard app, curl or the physical button is always possible — the board detects the real state and continues without any hiccups.
  • If you manually turn on a socket while there isn't enough surplus, the board will automatically switch it off again.