New device to read electric meters IEC62056-21

Hi,

I created a device to read remotely electric and other types of meters. See PiggyMeter — Aquaticus Docs documentation

PiggyMeter

It is based on ESPHome + custom component and optical interface.

The device is compatible with all types of meters supporting the IEC 62056-21 optical interface, offering a seamless solution for collecting meter readings remotely.

Meter Compatibility : The device is engineered to support all kinds of meters (water, electric, and so on) that adhere to the IEC 62056-21 optical interface standard. This means you can use it with a wide range of meters.

Assembly Instructions : Instructions with clear and easy-to-follow steps for hardware and software setup.

3D Printer Files for Housing : 3D printer files for the device’s housing are available. The enclosure fits Wemos/Lolin ESP32 C3/S2 mini boards.

2 Likes

This seems very promising. I’ve checked with my hydro company but cannot determine the IEC standard they use in their meters. Is there a way to verify this on the meter itself ?

In most cases no.

Bought this off you on a whim, tested and getting no transmission.

Meter is EDMI Mk7c.

Specs state:

Communications
• Up to 3 independently working communication ports:

  • Optical port: FLAG (IEC 62056-21) or ANSI Type 2 (ANSI C12.18)
  • RS-232 with modem power supply
    (It supports most modems in the market)
  • RS-485 multi-drop (2 or 4-wire RJ45 or 2-wire screw terminal)
    • Option for passive RS-232
    • UDP/IP GPRS/PPP capable
    • Compatible with MV-90™ and PLC Protocol
    • EDMI command line
    • DLMS
    • MODBUS

Yet still no data received… does the above look like its compatible?

I’m currently trying to implement the Piggymeter project with a C3-mini board and the optical interface. But I’m already failing with the Yaml file.
The yaml file looks like this:

esphome:
name: piggymeter
friendly_name: piggymeter

esp32:
board: esp32-c3-devkitm-1
framework:
type: arduino

Enable logging

logger:
level: DEBUG

Enable Home Assistant API

api:
encryption:
key: “hidden”

ota:
password: “hidden”

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password

Enable fallback hotspot (captive portal) in case wifi connection fails

ap:
ssid: “Piggymeter Fallback Hotspot”
password: “hidden”

captive_portal:

substitution:
name: piggymeter-c3-iec62056-21
variant: esp32c3
board: lolin_c3_mini
tx_pin: GPIO5
rx_pin: GPIO4
led_pin: GPIO7

sensor:
- platform: iec62056
obis: 1-0:15.7.0
name: Absolute active energy total
unit_of_measurement: kWh
accuracy_decimals: 3
device_class: energy
state_class: total_increasing

Include common configuration

#<<: !include piggymeter-common.yaml

external_components:
# IEC62056 component
- source: github://aquaticus/esphome-iec62056

But I get the following error message:
mapping values are not allowed here
in “/config/esphome/piggymeter.yaml”, line 43, column 12
This is this line:
obis: 1-0:15.7.0

I don’t understand what’s wrong with that.

Hi,

you must indent text below -platform. Not sure if there is indentation or not as you pasted config as text not as code.

- platform: iec62056
  obis: 1-0:15.7.0
  name: Absolute active energy total
  unit_of_measurement: kWh
  accuracy_decimals: 3
  device_class: energy
  state_class: total_increasing

Hi, it is pasted as text.
As code it is like:

  sensor:
   - platform: iec62056
       obis: 1-0:15.7.0
       name: Absolute active energy total
       unit_of_measurement: kWh
       accuracy_decimals: 3
       device_class: energy
       state_class: total_increasing

and that’s what I get at yammllint.com, when I check the code:

Hi,
the entire section

       obis: 1-0:15.7.0
       name: Absolute active energy total
       unit_of_measurement: kWh
       accuracy_decimals: 3
       device_class: energy
       state_class: total_increasing

must be exactly under letter p in -platform. See my previous post.
This is wrong:

   - platform: iec62056
       obis: 1-0:15.7.0

this is OK

   - platform: iec62056
     obis: 1-0:15.7.0

Thank you, that was the fault.
But now I have an other problem.
I’ve installed esphome on home assistant and I trie to run the yaml. But I get this message:

INFO ESPHome 2024.2.2
INFO Reading configuration /config/esphome/piggymeter.yaml…
Failed config

substitutions: None
  name: piggymeter-c3-iec62056-21
  variant: esp32c3
  board: lolin_c3_mini
  tx_pin: GPIO5
  rx_pin: GPIO4
  led_pin: GPIO7

Must be string, got <class ‘esphome.helpers.EList’>. did you forget putting quotes around the value?.

 sensor: 
    - platform: iec62056
      obis: 1-0:15.8.0
      name: Absolute active energy total
      unit_of_measurement: kWh
      accuracy_decimals: 3
      device_class: energy
      state_class: total_increasing

remove None from

substitutions: None

My code is like:

substitutions:
  name: piggymeter-c3-iec62056-21
  variant: esp32c3
  board: lolin_c3_mini
  tx_pin: GPIO5
  rx_pin: GPIO4
  led_pin: GPIO7

the NONE is added in the error message.
But it refers to the “substitutions” section.

I got the failure:

the code in “piggymeter-c3-iec62056-21.yaml” is like:

substitutions:
  name: piggymeter-c3-iec62056-21
  variant: esp32c3
  board: lolin_c3_mini
  tx_pin: GPIO5
  rx_pin: GPIO4
  led_pin: GPIO7
  
  sensor:
   - platform: iec62056
       obis: 1-0:15.8.0
       name: Absolute active energy total
       unit_of_measurement: kWh
       accuracy_decimals: 3
       device_class: energy
       state_class: total_increasing

It should be like:

substitutions:
  name: "piggymeter-c3-iec62056-21"
  variant: "esp32c3"
  board: "lolin_c3_mini"
  tx_pin: "GPIO5"
  rx_pin: "GPIO4"
  led_pin: "GPIO7"
  
sensor:
  - platform: iec62056
    obis: "1-0:15.8.0"
    name: "Absolute active energy total"
    unit_of_measurement: kWh
    accuracy_decimals: 3
    device_class: energy
    state_class: total_increasing

It is possible to use this methods also for gas meter?