-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SML sensor for reading smartmeters #1041
Comments
Hey Syntoxr, just to clarify, SMLReader does support more than one input. And at least one has confirmed that it is working :-). |
Hi, |
I am in for it. |
SML Support in ESPHome would be awesome. +1 from me ;) |
Same here! Would very much appreciate SML support... |
This would really very nice to have it in ESPHome. |
Since Home Assistant 2021.8 just added the Energy Dashboard, I wanted to bump this. I hope this is ok. |
I would also like to see this integrated in Esphome rather than my current solution via tasmota ;) |
There exists a library in C. Maybe ist is of use. |
SML Integration in ESPHome would be very cool. Many smartmeters use SML records to send their values. Very cheap sensors (only a phototransistor + pullup resistor + 2 neodym magnets) could easily build (cost less than 1 Euro). |
I have played a bit around with esphome and the existing dsmr component. Now I am thinking how the parsing should be done. One option would be to adapt the dsmr parser. I didn't look into it in detail yet if it makes sense. @mruettgers is using the libSML package from here https://github.com/volkszaehler/libsml So my question is if this is an option for esphome or not. I am also not clear how the integration into esphome would be possible. |
I just saw that DSMR is also using a external library in the final implementation in esphome. So it should be fine here as well. |
Maybe it would be possible to implemewnt an custom component for parsing? |
I successfully integrated libsml into my custom component via plattform.io. |
Nice job! I hope it works out for you! Because it would be the best solution so far! |
I was also playing around with a custom component which reads out the total energy and active power from my smart meter using SML. „Parsing“ is done by just specifying the bytes (position and length) in the SML file. |
I looked at your solution, you do not use the sml lib, but only the parser for your counter, ie for another would be necessary to adjust the parser? |
Yes, as I said: You have to identify the corresponding byte positions by yourself. I guess a more mature solution would parse for the specified OBIS numbers and then derive the values. I don't know if |
Can you maybe explain how I can do it for my counter. That would be current quick and durty but working solution. https://wiki.volkszaehler.org/hardware/channels/meters/power/edl-ehz/iskraemeco_mt681 |
I have uploaded my test to https://github.com/BMOD89/sml. Basically I adapted dsmr so I can read the values. I have created a "mapping" table which maps the OBIS ID to a name, so I can configure it in a similar way as dsmr. But this solution is not really universal. It seems to me that some meters use different codes for the same type of value. For example @Diddlik's meter uses 1-0:15.7.0 for the power while mine uses 1-0:16.7.0. But for now the current "solution" is working. Currently I see the follwoing open points:
@Diddlik, you should be able to test it with your meter. I have added a second mapping for the power which is called power_delivered_2. If the table in the volkszaehler wiki is correct, this should work for your device. |
not bad. I am currently working on the alengwenus' solution, next will test your! |
Thank you very mutch. Works fine with my smart meter "Norax3d" |
Do you guys think SML is also being using by Kamstrup smart water meters which feature a similar bidirectional optical IR eye head? If so please see request #1402 |
May be it is woth to add my Gas-Meter Idea here too: My plan is to work on this in Oct. 21 |
@syssi Does the custom component has any effect on the IR reader I use? I suppose not, does it? |
Hello, i´ll try to get my Easymeter Q3CA into Homeassistant. This is my log:
|
@r100gs Could you edit your post and use three backticks (`) to enclose your code blocks? |
@r100gs Please start with:
And provide some logs again. I'm looking for this block:
It describes all available keys (obis codes) and values. If we know the supported obis codes of your device it's easy to extend the configuration. On page 15 of the manual you can see the UART settings: https://www.easymeter.com/downloads/products/zaehler/Q3C/q3c_betriebsanleitung_rev_04.pdf The byte format is |
@altacoon I tried to understand the different parsers: https://github.com/BMOD89/esphome_compontens/blob/main/components/d0/d0_parser.cpp And it looks like the See https://wiki.volkszaehler.org/software/sml#sonstige_erkenntnisse |
@syssi THX for your help! |
@r100gs The code block must start and end with 3 backticks. Let's assume "*" are backticks it must look like this:
|
This is what I get in log with 8N1:
|
@r100gs It looks like your IR receiver works fine. The It looks like the
|
@syssi
|
@syssi Thanks for this help. Today the IR reader (Hichi IR) was delivered. Tomorrow I will try it together with the sml component from BMOD89. I will come back and report. |
@altacoon from your picture here #1041 (comment), I would guess that you have this meter: https://wiki.volkszaehler.org/hardware/channels/meters/power/edl-ehz/emh-ehz-k If I understand the manual (https://emh-metering.com/wp-content/uploads/2020/08/eHZ-K-BIA-D-1-20.pdf), you will need the sml component from here: https://github.com/alengwenus/esphome_components.git |
@syssi |
@r100gs If you increase the RX buffer just a bit does it boot this time? It's possible 512 was too much. I counted the bytes of a message yesterday. It was around 480 bytes. My idea was to increase the buffer size to the message size to be sure the message does fit into the buffer completely. I will try to check the custom component ( |
@syssi |
@r100gs Please ignore my |
I come back with the Hichi-IR-reader installed. And thanks to you all @syssi, @BMOD89, @alengwenus - it works! Please find the corresponding yaml (without the introducing lines showing my credentials). The yaml reads two differnt electricity meters. The bidirectional meter (EMH) by reading the sml protocol of its D0 interface. And a second meter which measures the generated energy of my solar panels by using ESPHome's pulse meter sensor.
Thanks to the advice of @BMOD89 I swapped to the external sml-component from @alengwenus. Thank you for this! And many thanks to @alengwenus for your excellent work! |
This has also worked like a charm for me - thanks a lot, in particular to @altacoon, who's esphome configuration worked out of the box with only little adaptations to my setup. For those of you interested: I have used a Sonoff SV, which conveniently provides 3,3V onboard for the IR sensor head, has three GPIOs (two of which I used for UART), Wifi, and can be powered by up to 24V DC. In my case 23,3V come from our Siedle mains rectifier. I put the Sonoff into a small plastic case that I attached to the smart meter. This makes for a small, clean, and self-sufficient setup - no power supply, Raspberry Pi or similar required. |
@altacoon hmmm, i have hichi too, i bough wervison with esp01 with tasmota in it, in tasmota head reads things, i can even read the garbage if i point head on the white paper or mirror etc. But with esphome it does never read anything. I think this
should log all the traffic, right? rest of it (does not work for me)
|
@evlo Some ideas:
ESPHome will use the default behavior afterwards: Print raw data (bytes in hex). |
you are right that first step is to read anything with the esphome and then i can focus on why I can't read the meter.
I think this is also better to try to read some bogus data at least from the mirror reflection of sent data
With this script in tasmota i do receive response from the meter.
(yes, that format is rather crazy and imo not really what is described n tasmota docs, but seems 300 baud rate, rx=gpio3, tx=gpio1) |
So I do get gibberish traffic in esphome when trying to just capture something
(yes i forgot to remove the string thing), |
Thanks to all the info and work of you all, i got it to work: Esphome installed on hass.io on Raspberry 4: using two ir reading devices (HICHI) attached to 3,3 v, Ground and ports/GPIOs 23 and 15 (only rx, tx is not connected) of a Hardware TWO easymeter q3a:
i get more info from the meter on port GPIO15, because i have placed the IR reader on a different place (D0), the other one is attached only to the INFO LED instead of D0. Now i need to define the right sensors in homeassistant! |
I get Answer, but no interpretation of the the values. Any ideas? `esphome: esp8266: Enable logginglogger: Enable Home Assistant APIapi: ota: wifi: Enable fallback hotspot (captive portal) in case wifi connection failsap: captive_portal: Example configuration entryuart:
interval:
- delay: 1s- uart.write:id: uart_busdata: [0x06, 0x30, 0x35, 0x30, 0x0D, 0x0A]sensor:
text_sensor:
Serial Console:
|
Hi guys, i had setup your examples on a NodeMCU8266 with TCRT5000 IR Sensor (just the receiver, the sender is removed). The SmartMeter is an ISKRA MT691 with INFO enabled. Running esphome 2022.11.3 with the following code `external_components:
web_server: Enable fallback hotspot (captive portal) in case wifi connection failswifi: Enable fallback hotspot (captive portal) in case wifi connection failsap: captive_portal: uart:
sml:
sensor:
Upload is OK, but I can get any useful information Logging shows:
The IR is mounted on the optical Interface in the upper right corner of the Smartmeter. Did someone has similar issues? |
Yes, here its the same |
@r100gs |
@Hohenloherin,
no, I gave up so far. I get the output of my smartmeter, but thats it. None
of the protocols I tried gives me results.
If you are able to get values and things are working fine please help me.
THX,
Stefan
Hohenloherin ***@***.***> schrieb am Mi., 11. Jan. 2023,
18:53:
… @r100gs <https://github.com/r100gs>
Did you get it running finally? I would like to learn how you managed it.
—
Reply to this email directly, view it on GitHub
<#1041 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADAGTRCS2KDDQWYYOXG52RTWR3XRXANCNFSM4U5RZNQA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Describe the problem you have/What new integration you would like
Hi,
I would love to see SML (smart message language) support for ESPHome as (I think) many smart meters use the SML language in combination with the D0 or other reading heads. I use a phototransistor like described in the repo linked below of @mruettgers.
Please describe your use case for this integration and alternatives you've tried:
My use case, as described, is to read smart meters without having to buy overpriced hardware from the manufacturer of smart meters. The Alternative I'm currently using is this one:
https://github.com/mruettgers/SMLReader
I have multiple smart meters and it supports only one input.
Also ESPHome integrates better into HomeAssistant and it's obviously easier to manage everything from one place.
Additional context
This site is written in German but I think most of it is translatable and it describes the structure of this protocol well:
https://www.msxfaq.de/sonst/bastelbude/smartmeter_d0_sml_protokoll.htm
Thank you for your work 👍
The text was updated successfully, but these errors were encountered: