↩ 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
🧰 Step 1 — What do you need?
Waveshare ESP32-S3 1.54 inch LCD
Waveshare 1.54" — compact, built-in enclosure
Lilygo T-Display S3
T-Display S3 — larger screen
💡 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
🔧 Step 2 — 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.
🔑 Step 3 — 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.

💾 Step 4 — 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.ino.merged.bin file you downloaded above.
    If a second file row is visible, click "Remove" to delete it.
    Also set: Flash Mode: keep — Flash Frequency: keep — Flash 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.
🚀 Step 5 — 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 (AutoS, no password required).

  1. Turn off mobile data on your smartphone and connect to the AutoS 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.
🔄 Step 6 — Changing settings later

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

  • Set the switch-off delay per socket and enter the name of the connected device.
  • Set the switch-off threshold (value 0 = requires zero consumption; or higher if e.g. 100W base consumption is acceptable to you).
  • Set the switch-on threshold (recommended starting value: 150W — the module adjusts this automatically, but only upward). If you connect a device with a lower power rating than the previous one to the socket, press and hold the bottom button for 5 seconds to reset the thresholds.
  • SSID and password of your WiFi, name or IP of the P1 meter and sockets, and update intervals (in milliseconds).
🔘 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 8 seconds, with a countdown in the bottom right.

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: AutoS) 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 8 seconds, with an arrow pointing at the button concerned and the corresponding actions in colour (orange = long press, green = short press, cyan = double click). A countdown runs in the bottom right.
▼ 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. On the T-Display S3 the cycle runs through the same steps without the separate quarter-hour projection. 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 8 seconds, with a countdown on the right.

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: AutoS) so you can enter new credentials via 192.168.4.1.
▲ Top Short 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 8 seconds, with an arrow pointing at the button concerned and the corresponding actions in colour (orange = long press, green = short press, cyan = double click). A countdown runs on the right.
⏻ PWR Double click Shows the chart of the last hour for 8 seconds, after which the display returns to the previous view. This 1-hour window is not part of the regular chart cycle.
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.
▼ Bottom Double click Toggle the monthly peak display on/off. When enabled, the forward-looking quarter-hour projection appears on the left and the highest quarter-hour value of the month on the right.
🛡️ Technical — Built-in safety mechanisms & nerd stuff
  • 📡 No connection to the P1 meter? All sockets (controlled by this module) switch off automatically.
  • ⚠️ Invalid sensor data? Socket stays off until valid data is available again.
  • 🔋 Consumption too high? Lowest-priority sockets are switched off first.
  • ☁️ Not enough solar? Sockets stay off until the surplus rises above the threshold again.
  • 📡 Please note: if your local WiFi suddenly goes down completely, sockets that are currently on cannot be turned off by the device. Be aware that such outages may occur; the author of this page is not responsible for unexpected power consumption in this case.
  • 💡
    Power consumption of the board itself:
    • Waveshare 0.76 W
    • LilyGo T-Display 0.92 W
    • LilyGo T-Display S3 0.95 W
⚙️ 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.
🏠 Several displays in one home? Every module queries the P1‑meter itself with an HTTP GET. One such round trip — request plus response — takes a few tens of milliseconds. The more modules you run in a single home, the greater the chance they get in each other's way at the meter. You notice this as a board that occasionally skips a reading or briefly shows Conn ERR. That is why there is also a sender/receiver setup: only the LilyGo T‑Display S3 queries the P1‑meter and the sockets, and forwards everything that belongs on screen to the other boards. Those only receive and display — they do not scan, they do not switch anything, and there is nothing to configure. Forwarding uses one small UDP packet of just over 200 bytes per second, sent straight to the boards that registered. Other devices in the house never see it. Want to know more? Click Client-Server.
🤓 Nerd stuff:
  • Written in modern C++ and optimized with FreeRTOS tasks for maximum speed and responsiveness.
  • Scanning the network for sockets and the P1 meter (first use) is blazing fast (1 ~ 3 seconds): a single mDNS query returns every HomeWizard device at once, after which only those addresses are queried for their type and serial number. If your router blocks multicast, the board falls back to a parallel scan of all 254 addresses.
  • The hostnames of the sockets and the P1 meter are resolved to their IP address once and then reused, so no time is lost on name resolution while polling (every 1 ~ 3 seconds). A new lookup only happens after a failed poll — that way a DHCP address change is picked up automatically.
  • Every socket has its own network connection: they are polled truly in parallel, and one slow or absent device never blocks the others.
  • The priority‑driven switching logic ensures smart, predictable and stable control.
  • The off‑delay doubles as the priority ranking: the longest delay marks the most important device — first on, last off. One setting doing two jobs.
  • When solar production increases gradually (sunrise, cloud moves away), the socket with the lowest switch‑on threshold comes on first — in practice the lowest‑power consumer, because that threshold calibrates itself to 102% of the measured power.
  • When there's a sudden surplus, the socket with the longest off‑delay gets priority.
  • At most one socket is switched per cycle, and switching off always takes precedence over switching on. Consecutive switch‑ons are at least ten seconds apart: no simultaneous inrush currents, no oscillation.
  • Decisions run on a rolling average of five readings rather than the instantaneous value. Switching off additionally requires both the average and the instantaneous value to exceed the threshold — so a single kettle spike never turns anything off.
  • If two sockets share the same off‑delay, a round‑robin breaks the tie, spreading the wear across both.
  • Manual control via the HomeWizard app, curl or the physical button is always possible — the board polls the real state and continues without any hiccups.
  • If you manually turn on a socket while there isn't enough surplus, the board switches it off again. A socket that is on but draws nothing is switched off too — but only after the actual consumers have had their turn, since switching those off is what really lowers the draw.