Read electricity meter Iskra MT631 lazarus / 21-General ---------------------------------------------------------------------- coradi · 2022-06-24 17:59 Has anyone created code in Pascal to read one of the new smart electricity meters yet? Here it is in Python Unfortunately I am not yet completely through how I "decode" the values, i.e. momentary consumption etc. https://www.stefan-weigert.de/php_loader/sml.php ---------------------------------------------------------------------- MarkMLl · 2022-06-24 20:25 Take a look at Github: there are several relevant projects. MarkMLl p.s. Hint: Github, Hackaday and so on have their own search facilities which you can use as Mozilla extensions. If necessary install the Mycroft Project's extension first, since it apparently provides a useful bridge between APIs. MarkMLl ---------------------------------------------------------------------- alpine · 2022-06-24 20:58 Quote from: coradi on June 24, 2022, 07:59:47 pmHas anyone created code in Pascal to read one of the new smart electricity meters yet? Here it is in Python Unfortunately I am not yet completely through how I "decode" the values, i.e. momentary consumption etc. https://www.stefan-weigert.de/php_loader/sml.php It looks fairly well documented. But I don't speak German. Looking at Python sources I can see that the values are taken from a fixed offsets in the message: Code: Python  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if message[0:8] == '\x1b\x1b\x1b\x1b\x01\x01\x01\x01':                      watchdog.stop()                        AB_Wges = round((int(message[150:158].encode('hex'),16)*0.0001),4)                      AB_Pges = (int(message[294:298].encode('hex'),16))                      AB_PL1 = (int(message[314:318].encode('hex'),16))                      AB_PL2 = (int(message[334:338].encode('hex'),16))                      AB_PL3 = (int(message[354:358].encode('hex'),16))                      mystring=""                        result={"AB_Pges": AB_Pges,"AB_PL1": AB_PL1,"AB_PL2": AB_PL2,"AB_PL3": AB_PL3,"AB_Wges": AB_Wges}                        with open('/mnt/RAMDisk/AB.json', 'w') as file:                              json.dump(result, file)  Which is not a good practice, though. Some field can go wider and trash the result. Also, I can see some scaling parameters, which are not taken into account, assumed as fixed (AB_Wges=round(int(...)*0.0001),4)), others probably assumed as 1. I can find something similar at: https://github.com/boernhart/smart- meter-logger, but a bit smarter - it looks for some signatures "looking for OBIS Code: 1-0:1.8.0*255", again scaling pre-assumed. What exactly needed? Baked Pascal sources?