UPDATE 8/12/22 - updated to use the new BTHome v2 protocol, will only work with HA 2022.12.0 or above!
UPDATE 5/10/22 - new code uses BTHome to allow easy set up with Home Assistant and Discovery - see post 8 for setup instructions. Thanks!
TL:DR: Puck.js, LDR, modified Passive BLE Monitor component and code for Puck.js here.
Just a little project that got me scratching my head over the last few weeks!
I have a ‘smart’ electricity meter I wanted to integrate with HA but because it’s a SMETS1 and I’m no longer with my electric company it’s now as useful as nipples on a fish.
My meter is outside my house, so I wanted something inexpensive, battery-powered (sorry HA Glow), long-lasting, and without having to interfere with any of the high-amp wiring coming into the house. I also wanted accuracy without fiddly linear calibration - CT clamps have issues here.
I based this project on Gordon Williams’ Puck.js board - it’s a £30 CR2032-powered board with 6-12 months battery life, a button, LEDs, magnetometer, compass, themometer, IR, and more. Gordon has already made a smart meter project with this using a light dependent resistor soldered to D1 and D2 to measure the LED flashes on a standard 1000 Imp/kWh electricity meter.
I have modified this project so that it also calculates the active electricity usage in the house in watts. Data is broadcast as a byte array over BLE advertising to minimise power consumption. To read the data I have made a custom version of the Passive BLE Monitor component, which can be found here. The required code for the Puck.js is included in the repository (puckjs_energymeter.js). New version uses BTHome - see above
Alternatively you can buy an iNode for a similar price - this is already integrated into the BLE Passive Monitor component, however it only updates once per minute, battery reporting is less accurate, and I had issues trying to get hold of one. Plus the Puck.js allows for a lot more customisation if you know what you’re doing!