100%
smarthome-metering debounce view
Description

Imported from GitHub: zargony/smarthome-metering · commit cc9a229 · license EUPL-1.2

Description

A device for capturing energy consumption at home by reading energy meters.

README

Smart Home Energy Metering

A device for capturing energy consumption at home by reading energy meters.

This device, built around the ESP32-C3, collects data from electricity, gas, and water meters and publishes it via MQTT for integration with databases and long-term analysis. Housed in a DIN rail enclosure, it fits seamlessly into a standard European meter cabinet.

Hardware

The standard DIN rail enclosure can be mounted onto a DIN rail and only shows status and activity LEDs when installed in a meter cabinet. Power supply and sensor connections are exposed via screw terminals. An external antenna can be connected to the SMA socket and is best mounted outside the cabinet for good Wifi connection. An USB-C socket exposes the ESP32-C3 Serial/JTAG port for easy programming/debugging (e.g. if OTA failed).

Sensor connections

This device provides a 3.3V bidirectional UART for reading a serial data stream, e.g. an electric meter's infrared interface. Additionally 3 debounced impulse contacts can be used to capture simple count impulses, e.g. from reed contacts on water and gas meters (or electric meters without IR interface but impulse LEDs).

GPIODirectionUsage
GPIO3Input, Pull-Up, DebouncedContact 1 (gas meter)
GPIO4Input, Pull-Up, DebouncedContact 2 (water meter)
GPIO5Input, Pull-Up, DebouncedContact 3
GPIO6InputUART Rx (electrical meter)
GPIO7OutputUART Tx
GPIO8OutputStatus LED (active low)
GPIO9Input, Pull-UpBoot button

I use this device with sensors described below. It's tailored to my specific environment and some links reference German websites, as they relate to the energy meters installed in my home. However, you may still find parts of it useful for your own setup.

Electrical

The eBZ DD3 electrical meter has an infrared UART interface that continuously provides information about voltage, current, power and total consumption. Several DIY IR sensors (and schematics) are available online, e.g. I got a Hichi IR (the simple TTL variant, no Wifi or USB). It works fine with 3.3V and is connected directly to this device. It continuously receives metering information in OBIS D0 format (D0 is ASCII based, unlike SML).

Gas

A Honeywell IN-Z61 impulse sensor is attached to my GMT BK-G4 gas meter. One impulse is sent every 0.01 m³ (10 liters). Impulses are counted and summed up in software.

Water

The water meter is similar to a Sensus 420 water meter and allows to attach a Sensus HRI sensor. Several variants exist. HRI-A is a simple pulse emitter while HRI-B has an additional M-Bus data interface. While HRI-A would be sufficient, they don't seem to be available anymore nowadays. The pulse emitter is a trivial interface, similar to the gas meter. One impulse is sent every 0.001 m³ (1 liter). Impulses are counted and summed up in software.

Firmware

There's a variety of ESP32 firmwares available that can be used. Most popular are ESPHome and Tasmota. With proper configuration, it captures energy meters readings and can submit readings to an MQTT broker where they can be picked up by various tools like Home Assistant, Node-RED or Telegraf.

See esphome.yaml for an example ESPHome configuration of this device which then can be auto-discovered in Home Assistant.

Contribution

Feel free to get in touch and discuss ideas, improvements or your experiences with it.

License

Hardware licensed under the CERN Open Hardware License (Strongly Reciprocal). Software licensed under the European Union Public License (EUPL). Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above, without any additional terms or conditions.

History

An early prototype was built using a NodeMCU V2 dev kit (ESP8266) on perfboard and used to dangle loosely next to the meter cabinet for way too long.

Comments
Sign in to comment

No comments yet. Be the first to ask about this board.