wdoekes / pe32me162ir_pub

ProjectEnergy32: read ISKRA ME-162 electric meter through optical port using ESP8266, publish to MQTT
6 stars 2 forks source link

ISKRA MT381 energy meter compatibility #4

Open MatejsLab opened 1 year ago

MatejsLab commented 1 year ago

Hi, this project seems interesting, I am planning to integrate the Iskra energy meter into Openhab.

How do I know if my energy meter is compatible with your software?

My meter has IR ports with a magnet ring, but the model seems different.

image

I actually already measure just current with CTs to prevent overloads of mains fuses.

I would like to send the 15-minute consumption, active tariff, and warning flag "grid transformer overload" if it exists. Our electric company set up a new plan with 5 tariffs and 3 of them change in a day, 2 are winter and 2 are summer only, and one is the baseline. I could guess with Openhab based on time what tariff is on but it is cheating it may be false.

Now they announced a new flexible contract where you get a cheaper tariff if you turn off loads at peak demands, but it is dumb as they expect me to fiddle with unplugging devices manually in 15 minutes when I get an SMS or Mail to get a bonus. I have openhab to do this, to manage with dryers and boilers w smart plugs and dial down smart heating.

Maybe just point me out if smarting the energy meter is useful for that, or it cant be smartened to tell that grid load indicator and my 15-minute energy rate that my energy company talks all over the place that smart meters can do but not how I can use it to control my smart heating for example.

Thanks in advance Matej

wdoekes commented 1 year ago

Hi Matej,

Cool that you're considering using this.

How do I know if my energy meter is compatible with your software?

You don't =)

On the internet, I found a me162_technical_description.pdf PDF:

ME162 Single-Phase Electronic Meter Technical Description Version 1.1, 02.06. 2006

With among others this text:


image


The relevant bits are documented at the top: https://github.com/wdoekes/pe32me162ir_pub/blob/e3394b07da8b45497a526614b9aaa04789441637/pe32me162ir_pub.ino#L1-L44 (IEC 62056-21 protocol).

There's an initial connect readout sample here: https://github.com/wdoekes/pe32me162ir_pub/blob/e3394b07da8b45497a526614b9aaa04789441637/pe32me162ir_pub.ino#L645-L656

I also have a Python version here: https://github.com/wdoekes/pe32me162irpy_pub

It is not as well documented, but it is written in Python, so it might be easier to hack/extend/change. You can use that if you're testing on a laptop/raspberry, instead of on an ESP.


I would like to send the 15-minute consumption, active tariff, and warning flag "grid transformer overload" if it exists.

Hard to tell whether that exists. The ME162 has the following EDIS/OBIS codes for readout:

image

There is no such thing as a 15-minute consumption there. Only the "current" positive/negative cumulative values (1.8.x and 2.8.x). And it has no mention at all of what the active tariff is. Although the latest change in any of the 1.8.x or 2.8.x. values should give you a clue which one is active.


I think this might be your manual: https://www.telematicasistemi.it/it/documents/_01.category/manuali/Mx381_User_manual_eng_V1.01.pdf It looks way more advanced than my device.

It's likely that the same protocol is supported: image

The EDIS/OBIS codes are scattered throughout the document: 1.8.0, 90.7.0, etc..

I think from "Annex 1: MT381 object list" and downwards, you have a boatload of these OBIS codes. Among those 0-0:96.14.0.255 ("Currently Active Tariff") and the aforementioned 1-0:1.8.0.255 ("Active Energy Plus").

The 0-0 vs. 1-0 probably specifies which internal device this code is for. At login time, the "default" device is selected here: https://github.com/wdoekes/pe32me162ir_pub/blob/e3394b07da8b45497a526614b9aaa04789441637/pe32me162ir_pub.ino#L331

I think you'll need to write /?0! to talk to device 0 and /?1! to talk to device 1.

In the Python version, that would be here: https://github.com/wdoekes/pe32me162irpy_pub/blob/a7ccc15ab079cc323bd7b96adf6188a4e0b28891/pe32me162irpy_pub.py#L437

You'll probably need to "log out" to switch between devices: https://github.com/wdoekes/pe32me162ir_pub/blob/e3394b07da8b45497a526614b9aaa04789441637/pe32me162ir_pub.ino#L447-L452

With these parts you might be able to:


Good luck! Walter

JieffeEl commented 1 year ago

To add some info, I'm using this program with a ME372 meter and it works fine. My meter doesn't publish much data though, especially not the instant consumption. Here is what I have :

[ISK5\2ME372-2102] C.1.0(xxxxxxxxx) // Meter manufacturer number 0.0.0(xxxxxxxxx) // Meter serial number 1.8.0(029809kWh) // Total imported active energy 2.8.0(000000kWh) // Total exported active energy 128.20.0(020) // GSM signal status (15-20 = 2 bars) 128.20.1(015) // GSM Status !

The IR probe is not sold any more by the Danes as a kit (I think I was the last to order one), but the components are very common and easy to source on Ali. The PCB schematics are still available and can be used to order the PCB on JLCPCB or PCBWAY. The enclosure can be 3D-printed (the STL is on the Danes website and there is even an improved version with space for a Wemos on Thingiverse, https://www.thingiverse.com/thing:4437840)

MatejsLab commented 1 year ago

Wow thanks for so detailed replies. I will look into the documentation, for interesting fearures, thanks fo providing links. Today i got access to the new energy potral where i also see meters and reports, but sadly they dont allow an API yet or open Website for norifications to connect to OpehHab or anything else, and is protected by rekono so no easy way to grant access to OH.

I will ask them what they plan to develop as they want to reduce grid strain with this system. It they wont have a clue or plan to provide a solution i will experiment further with this project.

Thanks for support.

V tor., 6. jun. 2023 10:05 je oseba Walter Doekes @.***> napisala:

Hi Matej,

Cool that you're considering using this.

How do I know if my energy meter is compatible with your software?

You don't =)

On the internet, I found a me162_technical_description.pdf PDF:

ME162 Single-Phase Electronic Meter Technical Description Version 1.1, 02.06. 2006

With among others this text:

[image: image] https://user-images.githubusercontent.com/1225014/243588949-96fa9a09-0315-45c6-b168-31f8398b6749.png

The relevant bits are documented at the top: https://github.com/wdoekes/pe32me162ir_pub/blob/e3394b07da8b45497a526614b9aaa04789441637/pe32me162ir_pub.ino#L1-L44 (IEC 62056-21 protocol).

There's an initial connect readout sample here: https://github.com/wdoekes/pe32me162ir_pub/blob/e3394b07da8b45497a526614b9aaa04789441637/pe32me162ir_pub.ino#L645-L656

I also have a Python version here: https://github.com/wdoekes/pe32me162irpy_pub

It is not as well documented, but it is written in Python, so it's easier to hack/extend/change. You can use that if you're testing on a laptop/raspberry, instead of on an ESP.

I would like to send the 15-minute consumption, active tariff, and warning flag "grid transformer overload" if it exists.

Hard to tell whether that exists. The ME162 has the following EDIS/OBIS codes for readout:

[image: image] https://user-images.githubusercontent.com/1225014/243598437-d17425e8-cb0f-47fe-bf03-e4a170e741d3.png

There is no such thing as a 15-minute consumption there. Only the "current" positive/negative cumulative values (1.8.x and 2.8.x). And it has no mention at all of that the active tariff is. Although the latest change in any of the 1.8.x or 2.8.x. values should give you a clue which one is active.

I think this might be your manual: https://www.telematicasistemi.it/it/documents/_01.category/manuali/Mx381_User_manual_eng_V1.01.pdf It looks way more advanced than my device.

It's likely that the same protocol is supported: [image: image] https://user-images.githubusercontent.com/1225014/243605265-9c36918a-34a2-4ab3-9588-b1f7ee5ba4bd.png

The EDIS/OBIS codes are scattered throughout the document: 1.8.0, 90.7.0, etc..

I think from "Annex 1: MT381 object list" and downwards, you have a boatload of these OBIS codes. Among those 0-0:96.14.0.255 ("Currently Active Tariff") and the aforementioned 1-0:1.8.0.255 ("Active Energy Plus").

The 0-0 vs. 1-0 probably pecifies which internal device this code is for. At login time, the "default" device is selected here:

https://github.com/wdoekes/pe32me162ir_pub/blob/e3394b07da8b45497a526614b9aaa04789441637/pe32me162ir_pub.ino#LL331C17-L331C20

I think you'll need to specify /?0! to talk to device 0 and /?1! to talk to device 1.

In the Python version, that would be here: https://github.com/wdoekes/pe32me162irpy_pub/blob/a7ccc15ab079cc323bd7b96adf6188a4e0b28891/pe32me162irpy_pub.py#L437

You'll probably need to "log out" to switch between devices: https://github.com/wdoekes/pe32me162ir_pub/blob/e3394b07da8b45497a526614b9aaa04789441637/pe32me162ir_pub.ino#L447-L452

With these parts you might be able to:

  • log in on dev 0
  • fetch the currently active tarrif; push value to openhab
  • log out
  • log in on dev 1
  • fetch the current readings from 1.8.x for 15 minutes (or less if you don't know when the tariff changes); push delta to openhab
  • log out
  • repeat

Good luck! Walter

— Reply to this email directly, view it on GitHub https://github.com/wdoekes/pe32me162ir_pub/issues/4#issuecomment-1578138937, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG3CQWJ4AVFEODNC25LD2YTXJ3QEPANCNFSM6AAAAAAYZMJIIQ . You are receiving this because you authored the thread.Message ID: @.***>

wdoekes commented 10 months ago

FYI: In 6ccff8ba59ed8fb200c236907e1be0baf32f0f04 I removed the Danes from the docs and added a link to Bret's eBay where he sells presoldered ones (no plastic cover / magnets though).