Electricity smart-meter optical (IR) port

Dear HA community, thanks for the great 2021.8 release I’m really excited about all the cool energy-related features that comes with it.

Regarding reading data from electricity smart-meters as I understand there’s two ways to read data out-of-the box today with HA:

  1. Using a P1 port (which I don’t have on my smart-meter (Landis & Gyr E230)
  2. Using home assistant “glow”, and counting the LED blinks on the counter

But there’s a 3rd way and I was wondering if somebody already considered working on it (before I do):

On my smart meter I have an optical RX/TX port (see picture), and as I understand this is also something that comes by default on most smart-meters.

This optical serial port can easily be queried for consumption + production metrics, I’ve written some POC a long time ago → GitHub - xens/smartmeter

Now I was wondering how to properly integrate that within HA and I wanted some advice:

  1. Should I use my existing python code and expose these metrics to HA through an intermediate device (raspi, …).
  2. Should I rewrite stuff and leverage ESPhome ?

I’m really new to HA so any pointers / recommendations are welcome :slight_smile:

Romain

Hey Romain

Due to the new Energy features starting in 2021.08 I plan to do something similar with the difference of having a Siemens TD-3511 from our energy supplier:

siemens-td3511

Volkszähler provides some information about this type too: hardware:channels:meters:power:edl-ehz:siemens_td3511 [wiki.volkszaehler.org]

As for the IR-Interface I ordered the following RS232 cable from Ali: Electricity Meter Reading RS232 to Near Infrared Converter Serial Port to Infrared RS232 to IR Meter Meter Reading|Air Conditioner Parts| - AliExpress

I found another option for a USB driven reader at ELV: ELV Bausatz Lesekopf mit USB-Schnittstelle für digitale Zähler USB-IEC | Bausätze | ELV Elektronik

I explicitly wanted to have a RS232 version to be able to use it with simple ESPs like the 8266 (e.g. d1 mini). I plan to use ESPHome and the following integrations, to retrieve data from the smart meter and provide it as sensor to HA:

Maybe this gives you some inputs. Myself I’m still waiting to get my cable delivered, so I haven’t had the chance to really play around with the setup yet.

Best,
Raphi

1 Like

Any news here?

There is a very interesting solution in Austria, unfortunately this solution is also limited to Austria
http://www.mitterbaur.at/amis-leser.html

Unfortunately I didn’t really progress here - I wasn’t able to communicate with my energy meter yet :frowning: - however didn’t spend too much time on it yet. I’ll let you know once I may have an update.

1 Like

I stumbled upon this polish company producing these BLE beacons that read information from the optical interface.

At first I thought that they allow only reading information from beacon with mobile app, but apparently there’s a gateway application image provided to send the data to their cloud.

https://onemeter.com/docs/gateway/

Unfortunately, the integration with HA is done by reading data from the cloud. At the moment there’s no possibility to ingest data directly to HA. I did not try it yet, I’ll come back with my impressions. I think I’ll give it a try.

Hi @chutch

Dis you have any Łuck with onemeter?

Thanks

Hi,
you can get IR Adapters on eBay. Most of the items I found are from Germany, so I don’t know if they do international shipping. Also most of the instructions I found are in German, but maybe this can still help you.
You can get just the basic board and attach it to some ESP or raspberry, or buy an all-in-one solution that comes with everything but a power supply.

I bought this: WIFI lesekopf lese-schreib-Kopf EHZ Volkszähler Hichi Smartmeter | eBay
It is an ESP01s, the IR-Board, a magnet and a 3D printed case. I just needed an old micro-USB charger as a power supply. The device comes pre-flashed with Tasmota.

There is an article on heise (german) about this device that shows the components: Ausprobiert: Günstiger IR-Lesekopf für Smart Meter mit Tasmota-Firmware | heise online

Note: You can not update Tasmota via the integrated updater, as the provided binaries don’t have all the features you need :warning:
If you want to update or flash a new version because you broke it you need to compile Tasmota with these flags:

#ifndef USE_SCRIPT
#define USE_SCRIPT
#endif

#ifndef USE_SML_M
#define USE_SML_M
#endif

#ifndef USE_SML_SCRIPT_CMD
#define USE_SML_SCRIPT_CMD
#endif

#ifdef USE_RULES
#undef USE_RULES
#endif

You then need to configure a script for your smart meter Smart Meter Interface - Tasmota, setup MQTT and add it to HA via the Tasmota integration.

Then customize the sensors to have the correct units:

sensor.elster_t510_current_l1:
  icon: mdi:current-ac
  device_class: current
  unit_of_measurement: 'A'

sensor.elster_t510_current_l2:
  icon: mdi:current-ac
  device_class: current
  unit_of_measurement: 'A'  

sensor.elster_t510_current_l3:
  icon: mdi:current-ac
  device_class: current
  unit_of_measurement: 'A'  

sensor.elster_t510_power_l1:
  icon: mdi:flash
  device_class: power
  unit_of_measurement: 'W'

sensor.elster_t510_power_l2:
  icon: mdi:flash
  device_class: power
  unit_of_measurement: 'W'

sensor.elster_t510_power_l3:
  icon: mdi:flash
  device_class: power
  unit_of_measurement: 'W'

sensor.elster_t510_power_total:
  icon: mdi:flash
  device_class: power
  unit_of_measurement: 'W'
  
sensor.elster_t510_total_in:
  icon: mdi:flash
  device_class: energy
  unit_of_measurement: 'kWh'
  state_class: total_increasing
  last_reset: '1970-01-01T00:00:00+00:00'

If Tasmota is restarted and did not read the values yet it sends 0, which breaks the statistics in the energy dashboard, so i prevent this via another sensor:

- sensor:
    name: "Strom Gesamtverbrauch"
    unit_of_measurement: 'kWh'
    device_class: energy
    state_class: total_increasing
    icon: mdi:flash
    state: >-
      {% if states('sensor.elster_t510_total_in') | float(0) > 0 %}
        {{ states('sensor.elster_t510_total_in') }}
      {% endif %}

Here is another blog (german) that helped a lot setting this up: Stromzähler via ESP8266 auslesen - ottelos Webseite

I hope this helps :smiley:

Edit:
Another note: Some meters are locked and you need to get a pin from your operator. Fortunately mine was not, so I don’t know how you would enter the pin.

2 Likes