We had a incredible snowy winter this year in Toronto. 25cm of snow in 24 hours on Sunday [2025-02-16 Sun], which preceded by 20+cm earlier Thursday. While stuck at home, I found sometime to work on some long delaying projects. This got me into ESPHome. Yeah, home automation, somehow I feel this is probably inevitable for north American dwellers.
This days, the smart home word is incredibly messy, on the one hand, you have those giant players like Google home, Apple HomeKit, and Amazon Alexa. On the other hand, all the IoT manufactures are trying to steal user data by their crappy app. water valves, light switch, garage door openers. All of them are trying to lock you to their app. For you to simply close your garage, you have to send a command on your phone to their proprietary cloud server, then travel all the way back to connect to your opener at home. This is insane! Hopefully with the new Matter standard, it may bring some sanity back.
At the moment, we have esphome, allows you to combine some low cost, low power esp32 micro-controllers (RISC-V) with some sensors to make an local IoT device. That sounds complicated, but actually esphome guys really made this project noob friendly, most of times, all you have to do is writing some YML and you are good to go.
For my personal case, I tried to add a home energy monitoring device to my electric panel. (Learned quite a bit electricity 101 along the way). The best option for me at the moment is through emporia-vue-esphome. How it works is the main board (with an ESP32 chip on it) connects to some CT Clamp which use to measure the current. On the other hand, 2 or 3 cooper wires connect to each 2 phases of your circuit breaker to measure the voltage. With the 2, then you obviously can compute the wattage and energy use.

emporia vue voltage and current connection, image from emporia guide
The Emporia device itself does not actually have esphome installed, obviously we have to get creative. There are a few steps needed here, there are already quite a few resources online on how to do it. I am not an expert in electronics, quite a contrary, I am a newbie. So I will focus on the point of view of a noob on this project. Assuming you have some software background with 0 hardware knowledge, and you need to take my advice with grain of salt.
Step 0: Take blue pill or red pill?
Emporia actually has a home assistant integration already, if you don't mind your electricity data collected by that company, you can jump directly to step 4.
Step 1: creating a ROM on ESPhome
ESPHome guys made it really easy to create a firmware, and you don't need to get every right the first time. Soon as you got any EspHome flashed in, the following updates can happen wirelessly. Only thing needed at the moment is:
esphome:
name: ${name}
area: ${area}
friendly_name: ${friendly_name}
name_add_mac_suffix: false
external_components:
# Update for Vue 3
- source: github://emporia-vue-local/esphome@vue3
components:
- emporia_vue
api:
encryption:
key: !secret api_key_emporia
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# I choose manual IP, you can obviously do DHCP if you want
manual_ip:
static_ip: !secret ip_emporia
gateway: !secret ip_gateway
subnet: !secret ip_subnet
dns1: !secret ip_dns1
The difficult thing is that that the emporia device is not easy to turn on. As you can see in ref:fig:emporia, you need to manually wire the hot/neutral wires to power it on and I am not sure without anything else in the code, will the board be fried? I created my first filmware from one of the template. You will get all your reading wrong I suppose but those can be fixed by following updates.
In the end, you will get a filmware.bin
we need to upload in step 3.
Step 2: connect the esp board to computer
This is the most difficult step to me at least, there is no USB port on it you have to manually use jump wires to connect to the tiny pins on the PCB board. Either through 1) soldering or in my case a 2) BPM Frame. The BPM frame is really tricky to work with, you have to precisely place the needles on exact copper contact, because they are flat, the needle turned to slip away with any movement.

The (GND, 3.3V, TXD, RXD, GPIO0), image from online
What I managed to do is to place the needles near the top of the copper dots, because there is some tiny tiny gap near the edges of the contacts, hopefully the electricity can successfully flow through.
Step 3: flash the firmware
With some patience and luck, when you plug the TTL adapter to your computer, the LEDs on the Emporia board may start flashing and if you run the esptool.py flash_id
. You may get some output like this:
#this is the output from another device, you may have something on /dev/ttyUSB0
Serial port /dev/ttyACM0
Connecting...
Detecting chip type... ESP32-C6
Chip is ESP32-C6 (QFN40) (revision v0.0)
Features: WiFi 6, BT 5, IEEE802.15.4
Crystal is 40MHz
MAC: 40:4c:ca:ff:fe:55:bc:8c
BASE MAC: 40:4c:ca:55:bc:8c
MAC_EXT: ff:fe
Uploading stub...
Running stub...
Stub running...
Manufacturer: c8
Device: 4017
Detected flash size: 8MB
Hard resetting via RTS pin...
Make a backup if you want, assuming the needles stay in place for a while, then you want to flash the firmware on the ESP32 chip:
esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size detect 0x0 emporia_vue.bin
Step 4: wire the Emporia in your panel.
The Guide provided by Emporia is actually comprehensive. If you are curious how it all work, the brilliant video by engineering mindset is really helpful to understand what is split-phases and identify your electric panel.

wiring the emporia
To save some time, I labeled my every circuit breaker and took a picture so I know exactly what the clamps are hooked onto. The yellow and green colors are the two different phases, which is common in US and Canada households. There is no much more I can say here, except be careful, as careful as you can. 😄
Summary
The result of the work is quite rewarding, you get to monitor how much electricity your home is using on each appliance level. Purely magical

The individual appliance electricity use