UtilitechAS / amsreader-firmware

ESP8266 and ESP32 compatible firmware to read, interpret and publish data to MQTT from smart electrical meters, both DLMS and DSMR is supported
Other
376 stars 71 forks source link

Amperage scaling for Kaifa MA309MH4LAT1 Austria/Vorarlbergnetz #539

Closed Rasfumi closed 1 year ago

Rasfumi commented 1 year ago

Hi, first i want to thank you for this great project!

I have the firmware running since last November on a ESP8266 connected to my Smart meter: Kaifa MA309MH4LAT1 in Austria supplied by provider "Vorarlbergnetz".

I just updated to V2.2.15 from an unknown version of Nov 2022. Unfortunately the amperage scaling is not correct anymore now. The used multipliers are: Watt: 1, Volt: 10, Amp: 100, kWh: 1.

The amperes displayed are too low by a factor of 10 i think but it is not possible to set the scaling to 1000 as it is limited to 655. Would it be possible to set the limit higher in the webpage?

Thank you

gskjold commented 1 year ago

Thank you for your kind words! A "amperage autoscaling" feature have been removed in 2.2.x series firmware which I am guessing have affected you. Could you possibly provide me with a hex dump of the data payload from your meter? (Instructions: https://amsleser.no/blog/post/24-telnet-debug)

Rasfumi commented 1 year ago

This is what i get when i set telnet debug to verbose. After this data the ESP8266 reboots.

(V) DLMS frame: (V) 0F 00 2A 3C B4 0C 07 E7 04 19 02 0A 3B 1E 00 FF (V) 88 80 02 10 09 06 00 00 01 00 00 FF 09 0C 07 E7 (V) 04 19 02 0A 3B 1E 00 FF 88 80 02 02 09 06 00 00 (V) 60 01 00 FF 09 0E 31 4B 46 4D 30 32 30 30 31 38 (V) 32 35 31 37 02 02 09 06 00 00 2A 00 00 FF 09 10 (V) 4B 46 4D 31 32 30 30 32 30 30 31 38 32 35 31 37 (V) 02 03 09 06 01 00 20 07 00 FF 12 09 1A 02 02 0F (V) FF 16 23 02 03 09 06 01 00 34 07 00 FF 12 09 15 (V) 02 02 0F FF 16 23 02 03 09 06 01 00 48 07 00 FF (V) 12 09 1A 02 02 0F FF 16 23 02 03 09 06 01 00 1F (V) 07 00 FF 12 00 2D 02 02 0F FE 16 21 02 03 09 06 (V) 01 00 33 07 00 FF 12 00 2B 02 02 0F FE 16 21 02 (V) 03 09 06 01 00 47 07 00 FF 12 00 51 02 02 0F FE (V) 16 21 02 03 09 06 01 00 01 07 00 FF 06 00 00 00 (V) 00 02 02 0F 00 16 1B 02 03 09 06 01 00 02 07 00 (V) FF 06 00 00 00 18 02 02 0F 00 16 1B 02 03 09 06 (V) 01 00 01 08 00 FF 06 00 15 68 9C 02 02 0F 00 16 (V) 1E 02 03 09 06 01 00 02 08 00 FF 06 00 10 D5 46 (V) 02 02 0F 00 16 1E 02 03 09 06 01 00 03 08 00 FF (V) 06 00 02 04 D1 02 02 0F 00 16 20 02 03 09 06 01 (V) 00 04 08 00 FF 06 00 07 D3 2A 02 02 0F 00 16 20 (V)

(D) Received valid DLMS at 36

(V) Using application data: (V) 02 10 09 06 00 00 01 00 00 FF 09 0C 07 E7 04 19 (V) 02 0A 3B 1E 00 FF 88 80 02 02 09 06 00 00 60 01 (V) 00 FF 09 0E 31 4B 46 4D 30 32 30 30 31 38 32 35 (V) 31 37 02 02 09 06 00 00 2A 00 00 FF 09 10 4B 46 (V) 4D 31 32 30 30 32 30 30 31 38 32 35 31 37 02 03 (V) 09 06 01 00 20 07 00 FF 12 09 1A 02 02 0F FF 16 (V) 23 02 03 09 06 01 00 34 07 00 FF 12 09 15 02 02 (V) 0F FF 16 23 02 03 09 06 01 00 48 07 00 FF 12 09 (V) 1A 02 02 0F FF 16 23 02 03 09 06 01 00 1F 07 00 (V) FF 12 00 2D 02 02 0F FE 16 21 02 03 09 06 01 00 (V) 33 07 00 FF 12 00 2B 02 02 0F FE 16 21 02 03 09 (V) 06 01 00 47 07 00 FF 12 00 51 02 02 0F FE 16 21 (V) 02 03 09 06 01 00 01 07 00 FF 06 00 00 00 00 02 (V) 02 0F 00 16 1B 02 03 09 06 01 00 02 07 00 FF 06 (V) 00 00 00 18 02 02 0F 00 16 1B 02 03 09 06 01 00 (V) 01 08 00 FF 06 00 15 68 9C 02 02 0F 00 16 1E 02 (V) 03 09 06 01 00 02 08 00 FF 06 00 10 D5 46 02 02 (V) 0F 00 16 1E 02 03 09 06 01 00 03 08 00 FF 06 00 (V) 02 04 D1 02 02 0F 00 16 20 02 03 09 06 01 00 04

dbeinder commented 1 year ago

Vorarlbergnetz encodes a scaling factor with each value, I have implemented decoding some time ago here: https://github.com/dbeinder/KsmWestKaifaReader/blob/master/kaifa.py#L175-L222

gskjold commented 1 year ago

The same scaling factor is handled in our code here: https://github.com/UtilitechAS/amsreader-firmware/blob/master/src/IEC6205675.cpp#L590-L593

So, I'm a bit puzzled why you get the wrong numbers here, you should not need any scaling factor on anything really

gskjold commented 1 year ago

Correction, you should not need any multiplier in config

gskjold commented 1 year ago

Ah, scratch that, I found the problem! Will build you a test firmware in a sec

gskjold commented 1 year ago

esp32.zip esp32c3.zip esp32s2.zip esp32solo.zip esp8266.zip

Rasfumi commented 1 year ago

Wow, that was fast! Thanks a lot for fixing!

image
gskjold commented 1 year ago

No problem :) Will include this in 2.2.16. It was a old special case handling added for Norwegian Kaifa meters. This handling have been changed in later versions, so the code have technically been dormant until recently.