scs / smartmeter-datacollector

Smart Meter Data Collector
Other
57 stars 23 forks source link

'int' object is not subscriptable #21

Closed LichtiMC closed 2 years ago

LichtiMC commented 2 years ago

Hello there,

I'm having the problem, that the datacollector service is restarting after every packet transmitted by the smartmeter with the error-message mentioned in the title.

Here is the full log of one restart-cycle:

Jän 09 23:27:53 ha-server systemd[1]: python3-smartmeter-datacollector.service: Failed with result 'exit-code'.
Jän 09 23:27:53 ha-server systemd[1]: python3-smartmeter-datacollector.service: Service RestartSec=100ms expired, scheduling restart.
Jän 09 23:27:53 ha-server systemd[1]: python3-smartmeter-datacollector.service: Scheduled restart job, restart counter is at 9.
Jän 09 23:27:53 ha-server systemd[1]: Stopped Smart Meter Data Collector Service.
Jän 09 23:27:53 ha-server systemd[1]: Started Smart Meter Data Collector Service.
Jän 09 23:27:54 ha-server smartmeter-datacollector[20895]: DEBUG:asyncio:Using selector: EpollSelector
Jän 09 23:27:54 ha-server smartmeter-datacollector[20895]: INFO:smartmeter:Successfully set up L+G E450 smart meter on '/dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0'.
Jän 09 23:27:54 ha-server smartmeter-datacollector[20895]: INFO:sink:Connected to MQTT broker.
Jän 09 23:28:01 ha-server smartmeter-datacollector[20895]: DEBUG:smartmeter:HDLC Buffer: 7E A0 8B CE FF 03 13 EE E1 E6 E7 00 E0 40 00 01 00 00 77 DB 08 4C 47 5A 67 73 78 1F D0 82 01 03 30 00 00 A4 1E AE 60 03 2D 12 96 F2 D2 86 5D 27 94 F3 59 34 7E
Jän 09 23:28:01 ha-server smartmeter-datacollector[20895]: DEBUG:smartmeter:HDLC frame incomplete and will not be parsed yet.
Jän 09 23:28:01 ha-server smartmeter-datacollector[20895]: DEBUG:smartmeter:HDLC Buffer: 7E A0 8B CE FF 03 13 EE E1 E6 E7 00 E0 40 00 01 00 00 77 DB 08 4C 47 5A 67 73 78 1F D0 82 01 03 30 00 00 A4 1E AE 60 03 2D 12 96 F2 D2 86 5D 27 94 F3 59 34 7E 91 AE FF E2 BC 1F 37 C0 7B 5C 30 A6 9A 48 89 06 30 97 97 8B EF 0D 55 0B BA 69 85 D6 77 61 D9 C3 72 DF 3C 7B F3 3F A3 CB A6 F8 3D B5 5A 71 BE DF 3A 4D B2 9A 89 BC C3 A1 89 11 E6 FF F2 09 4D BF 1F 7B 33 67 A9 F9 78 F4 90 9A 62 03 4E 3D 6E FD 3B 2E 0D 56 66 44 AC 7E
Jän 09 23:28:01 ha-server smartmeter-datacollector[20895]: DEBUG:smartmeter:More DLMS data expected. Not yet ready to be parsed.
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]: DEBUG:smartmeter:HDLC Buffer: 7E A0 8B CE FF 03 13 EE E1 E6 E7 00 E0 40 00 01 00 00 77 DB 08 4C 47 5A 67 73 78 1F D0 82 01 03 30 00 00 A4 1E AE 60 03 2D 12 96 F2 D2 86 5D 27 94 F3 59 34 7E 91 AE FF E2 BC 1F 37 C0 7B 5C 30 A6 9A 48 89 06 30 97 97 8B EF 0D 55 0B BA 69 85 D6 77 61 D9 C3 72 DF 3C 7B F3 3F A3 CB A6 F8 3D B5 5A 71 BE DF 3A 4D B2 9A 89 BC C3 A1 89 11 E6 FF F2 09 4D BF 1F 7B 33 67 A9 F9 78 F4 90 9A 62 03 4E 3D 6E FD 3B 2E 0D 56 66 44 AC 7E 7E A0 8B CE FF 03 13 EE E1 E0 40 00 02 00 00 7A B6 DB 45 4B A6 78 15 1F 0C 46 1D B9 7E
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]: DEBUG:smartmeter:HDLC frame incomplete and will not be parsed yet.
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]: DEBUG:smartmeter:HDLC Buffer: 7E A0 8B CE FF 03 13 EE E1 E6 E7 00 E0 40 00 01 00 00 77 DB 08 4C 47 5A 67 73 78 1F D0 82 01 03 30 00 00 A4 1E AE 60 03 2D 12 96 F2 D2 86 5D 27 94 F3 59 34 7E 91 AE FF E2 BC 1F 37 C0 7B 5C 30 A6 9A 48 89 06 30 97 97 8B EF 0D 55 0B BA 69 85 D6 77 61 D9 C3 72 DF 3C 7B F3 3F A3 CB A6 F8 3D B5 5A 71 BE DF 3A 4D B2 9A 89 BC C3 A1 89 11 E6 FF F2 09 4D BF 1F 7B 33 67 A9 F9 78 F4 90 9A 62 03 4E 3D 6E FD 3B 2E 0D 56 66 44 AC 7E 7E A0 8B CE FF 03 13 EE E1 E0 40 00 02 00 00 7A B6 DB 45 4B A6 78 15 1F 0C 46 1D B9 7E 7C 7B 1C D6 A0 B9 0F 0D 03 5C F8 F2 D1 7B B7 9B D4 2A 45 DC F6 51 09 A2 FD 8B E6 6C 19 F1 89 90 C8 60 29 CE 62 27 20 BB B4 A4 F1 90 C6 47 C9 3A EB 44 65 B0 AE C3 20 E3 10 6E 28 E3 9C 57 E7 61 D6 70 01 53 DC 93 4D A0 C5 6C 74 80 32 2B 44 49 60 9C 22 2F A2 AC 60 C2 A5 1E 95 23 C2 DA 61 6C 60 14 8C 65 FE 97 F2 42 DE 95 3D 27 0D DE 69 7E
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]: DEBUG:smartmeter:More DLMS data expected. Not yet ready to be parsed.
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]: DEBUG:smartmeter:HDLC Buffer: 7E A0 8B CE FF 03 13 EE E1 E6 E7 00 E0 40 00 01 00 00 77 DB 08 4C 47 5A 67 73 78 1F D0 82 01 03 30 00 00 A4 1E AE 60 03 2D 12 96 F2 D2 86 5D 27 94 F3 59 34 7E 91 AE FF E2 BC 1F 37 C0 7B 5C 30 A6 9A 48 89 06 30 97 97 8B EF 0D 55 0B BA 69 85 D6 77 61 D9 C3 72 DF 3C 7B F3 3F A3 CB A6 F8 3D B5 5A 71 BE DF 3A 4D B2 9A 89 BC C3 A1 89 11 E6 FF F2 09 4D BF 1F 7B 33 67 A9 F9 78 F4 90 9A 62 03 4E 3D 6E FD 3B 2E 0D 56 66 44 AC 7E 7E A0 8B CE FF 03 13 EE E1 E0 40 00 02 00 00 7A B6 DB 45 4B A6 78 15 1F 0C 46 1D B9 7E 7C 7B 1C D6 A0 B9 0F 0D 03 5C F8 F2 D1 7B B7 9B D4 2A 45 DC F6 51 09 A2 FD 8B E6 6C 19 F1 89 90 C8 60 29 CE 62 27 20 BB B4 A4 F1 90 C6 47 C9 3A EB 44 65 B0 AE C3 20 E3 10 6E 28 E3 9C 57 E7 61 D6 70 01 53 DC 93 4D A0 C5 6C 74 80 32 2B 44 49 60 9C 22 2F A2 AC 60 C2 A5 1E 95 23 C2 DA 61 6C 60 14 8C 65 FE 97 F2 42 DE 95 3D 27 0D DE 69 7E 7E A0 30 CE FF 03 13 86 F8 E0 C0 00 03 00 00 1F 96 33 41 C0 6B 44 02 3C C0 2E 21 4F 56 B8 D8 7B 6C 73 17 20 37 62 4E 27 DE 9B 55 E4 49 35 37 FC D7 7E
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]: DEBUG:smartmeter:DLMS packet complete and ready for parsing.
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]: INFO:root:App shutting down now.
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]: INFO:sink:Disconnected from MQTT broker.
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]: Traceback (most recent call last):
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]:   File "/usr/local/bin/smartmeter-datacollector", line 14, in <module>
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]:     app.main()
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]:   File "/usr/local/lib/python3.7/dist-packages/smartmeter_datacollector/app.py", line 69, in main
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]:     asyncio.run(build_and_start(app_config), debug=debug_mode)
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]:   File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]:     return loop.run_until_complete(main)
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]:   File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]:     return future.result()
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]:   File "/usr/local/lib/python3.7/dist-packages/smartmeter_datacollector/app.py", line 29, in build_and_start
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]:     data_collector.process_queue())
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]:   File "/usr/local/lib/python3.7/dist-packages/smartmeter_datacollector/smartmeter/meter.py", line 46, in start
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]:     await self._serial.start_and_listen()
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]:   File "/usr/local/lib/python3.7/dist-packages/smartmeter_datacollector/smartmeter/serial_reader.py", line 45, in start_and_listen
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]:     self._callback(data)
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]:   File "/usr/local/lib/python3.7/dist-packages/smartmeter_datacollector/smartmeter/meter.py", line 57, in _data_received
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]:     dlms_objects = self._parser.parse_to_dlms_objects()
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]:   File "/usr/local/lib/python3.7/dist-packages/smartmeter_datacollector/smartmeter/hdlc_dlms_parser.py", line 84, in parse_to_dlms_objects
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]:     parsed_objects = self._client.parsePushObjects(self._dlms_data.value[0])
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]:   File "/usr/local/lib/python3.7/dist-packages/gurux_dlms/GXDLMSClient.py", line 1257, in parsePushObjects
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]:     classID = tmp[0]
Jän 09 23:28:02 ha-server smartmeter-datacollector[20895]: TypeError: 'int' object is not subscriptable
Jän 09 23:28:04 ha-server systemd[1]: python3-smartmeter-datacollector.service: Main process exited, code=exited, status=1/FAILURE
Jän 09 23:28:04 ha-server systemd[1]: python3-smartmeter-datacollector.service: Failed with result 'exit-code'.

My energy-provider is Energie Steiermark and I have the L+G e450 smartmeter-model.

Anybody knows of a solution? Thank you.

raymar9 commented 2 years ago

Hi LichtiMC This seems to be a bug in the converter library (from Gurux) that we use for HDLC/DLMS translation. Unfortunately your raw data (HDLC Buffer before "DLMS packet complete and ready for parsing") is encrypted with the key you probably entered in the configuration and we cannot reproduce your experienced error nor test whether the translation works with an updated version of the Gurux library.

LichtiMC commented 2 years ago

I could provide you with the key. How can I contact you? Thank you.

raymar9 commented 2 years ago

Please send your key to this temporary mail address: pobawoc989@vinopub.com Thanks for the idea of using /dev/serial/by-id/.. for the devices (seen in your posted log). I had problems distinguishing the devices /dev/tty* when more than one adapter is attached.

LichtiMC commented 2 years ago

Forgot to ping back: Mail sent! Thank you!

raymar9 commented 2 years ago

Sorry, something did not work with the temp mail service. I didn't receive your mail. Please send it again to the following address: xrb4rzmk6qs@temp.mailbox.org This is a better provider and should work. Thank you!

LichtiMC commented 2 years ago

Mail sent.

raymar9 commented 2 years ago

Thanks, I received it. You will here from me as soon as I discover something.

raymar9 commented 2 years ago

Hi LichtiMC I tried a couple of things with your raw data and the key that you sent me. Unfortunately nothing has worked so far. I've written a unit test with your data and key to reproduce the behavior and to use step-by-step debugging. It seems that the data can not be decoded into the DLMS data objects (it is still bytecode after the tried conversion). Also I used the Gurux DLMS Translator (online tool and Windows-Tool) to decode the data, but without success. I suspect either some configuration of your meter is incorrect or the key is somehow invalid. I'm not sure how to help you further... Sorry! At least I prepared a branch with a fix that the software does not crash anymore. We hope to build soon a new version with this fix. Sincerely, raymar9

aselviar commented 2 years ago

Hi LichtiMC

Do you have the list with the objects that are pushed from your smart meter? If yes, could you share the list?

Another issue may be the mbus adapter you are using, I know of people having experienced problems with those as well. Is it possible to share which adapter you are using and/or try with a different one?

I would also recommend checking again with your utility that the decryption key you enter is valid.

Best aselviar

LichtiMC commented 2 years ago

First of all here you have 10 new lines of raw data for analysis:

7e a0 8b ce ff 03 13 ee e1 e6 e7 00 e0 40 00 01 00 00 77 db 08 4c 47 5a 67 73 78 1f d0 82 01 03 30 00 02 56 ef 9e 37 4e e0 7a d2 d9 79 58 43 8a 7c 36 7c 8a 88 79 5e 6f 1d 55 59 cf 61 a5 6c 52 68 82 51 c7 94 0c 69 be 8d c3 8f 86 de fe 4e 95 3e 1b 72 bf 8f 02 52 76 29 a4 08 ad d0 bf 39 09 ad e6 b0 25 9b 97 86 eb 8f 04 c7 c9 62 4f b8 8c b8 77 79 66 07 6f 90 99 5e ab 2c d3 26 7d 2d 6a 94 e6 7a c3 ed 82 53 f7 8a dc 66 74 7e 7e a0 8b ce ff 03 13 ee e1 e0 40 00 02 00 00 7a f1 53 bc c6 d4 b0 fe 8e 8b 90 08 a9 1f ed db f6 77 13 eb b6 19 b9 7f 46 84 b7 d0 b4 50 63 ee 77 79 2a 14 63 42 8f d4 84 9e 61 52 8c 18 1a 95 95 6e 20 a3 60 a5 3c 7b 28 57 53 8c e9 63 55 32 ae b8 e0 27 e2 eb de 04 8b 21 e7 a0 38 52 20 08 79 04 7e af cb 9f 21 50 79 97 46 68 47 91 60 0d d4 ce bc ce 9d 40 7e 67 15 06 bc cd 11 53 4a e2 2d 1c 2a 24 18 44 57 75 3e 5e d0 29 a4 7e 7e a0 30 ce ff 03 13 86 f8 e0 c0 00 03 00 00 1f 97 49 11 eb cd 64 e1 dd f4 c4 4d 29 38 72 3b 96 c7 0f 73 68 5d d7 3a d0 51 c7 a2 38 46 eb 03 53 97 7e
7e a0 8b ce ff 03 13 ee e1 e6 e7 00 e0 40 00 01 00 00 77 db 08 4c 47 5a 67 73 78 1f d0 82 01 03 30 00 02 56 f0 4d b4 68 47 e1 a5 e6 59 03 ef 4c 05 cf 52 91 c8 53 26 df 52 65 4e 93 00 9d c3 88 d4 db b4 74 d1 a9 98 1a a0 09 8e 91 51 7b c6 f4 74 1b 96 e1 9e c3 a2 dd 2d 96 85 47 1d fe 0e 2f e6 40 87 62 da c8 bb 14 96 1c a7 70 09 8a 2c c6 94 0a b8 1b 70 e3 56 d4 78 e4 a9 01 64 91 e5 a1 c0 f1 19 a7 8a 7a 47 6f e3 6c 4a e9 7e 7e a0 8b ce ff 03 13 ee e1 e0 40 00 02 00 00 7a 6c 4a cf 92 57 53 31 91 d2 40 18 16 e3 9a 34 a6 33 dd 2e 7e fe 3c 68 c9 67 7b 20 2b e2 86 89 2a 58 65 9d 9c d0 32 ba 15 55 09 ee 53 f4 57 0b a4 db d4 d8 3b 22 55 64 5a 4c e4 a7 f1 30 25 04 65 bd 49 f5 9e 43 ad de 02 21 b6 d2 30 14 df 14 34 35 b2 48 88 b1 e7 dc 59 50 f2 d2 f4 16 02 d7 ef 38 bd 17 90 d7 94 84 3a a5 a9 b4 70 30 55 aa 35 8d a2 8f fa 9a bb 08 e9 4b 4c 05 ef 7e 7e a0 30 ce ff 03 13 86 f8 e0 c0 00 03 00 00 1f 23 ee 75 c6 bd 63 50 db ee 20 f6 23 3c 1c 06 6c 21 19 42 10 4a e3 0f ff e7 20 78 26 b7 71 1d 1e 58 7e
7e a0 8b ce ff 03 13 ee e1 e6 e7 00 e0 40 00 01 00 00 77 db 08 4c 47 5a 67 73 78 1f d0 82 01 03 30 00 02 56 f1 14 61 9e 55 3e f5 d2 af b0 fb 31 ec 55 ee 8c 80 33 d0 3a 3e ac 6c 74 09 03 5f ab 8f 85 42 f4 30 7c f6 25 57 1d 78 22 c0 62 7f db 55 f0 73 68 c4 56 9f 31 a3 1b 74 37 4c 4d f1 46 d8 59 4a d4 7a 13 2e 36 d5 14 e8 d3 ea 4c 8d 71 c0 9f 27 34 32 a6 9a e0 ab 94 a8 39 1b 83 12 61 16 df 02 f3 a6 bf 7e 46 20 84 17 11 7e 7e a0 8b ce ff 03 13 ee e1 e0 40 00 02 00 00 7a 2f 0c 48 ff 7b 16 58 1b 0d 6b 5f 8e 75 62 b1 e3 96 b1 00 0d 94 83 e8 2f 37 32 5b 8c f6 fe 96 67 ba ad b7 02 f2 05 87 89 a2 2d 7e db 80 97 ff 2b 33 1e 8e 3c e2 3d 04 6c 5e 3f f0 a0 e8 c8 85 36 91 b4 30 57 8b 21 38 ac f2 74 e4 67 ef 17 24 70 06 dd 9f 45 d2 a5 7c 25 55 27 3d fc 57 b1 7f e1 0c 46 7e b6 61 60 f1 5c 3e 16 08 5e 21 75 d0 43 e7 8b d4 e2 cf 44 39 ef 33 09 3d 38 7e 7e a0 30 ce ff 03 13 86 f8 e0 c0 00 03 00 00 1f 05 af b9 1f 2c 08 6e 31 5c f9 bb b0 ba 3e e1 0b 5e c9 d5 f2 4c 84 47 6e ce 44 96 b5 a8 4a 14 25 f6 7e
7e a0 8b ce ff 03 13 ee e1 e6 e7 00 e0 40 00 01 00 00 77 db 08 4c 47 5a 67 73 78 1f d0 82 01 03 30 00 02 56 f2 8c 40 08 0e aa b4 43 06 32 84 3e e0 e2 26 88 58 e2 c9 0a ce 97 93 b2 8b c8 f7 ff 2e 0f 16 f2 da a6 bd 5d c8 35 51 78 95 b5 51 fb 22 b7 5e 27 4e c4 b0 67 33 85 52 57 72 94 15 68 cd c2 7f de 41 09 35 d3 94 33 7c cf 9c f7 f4 7b 6e 47 6e 1e c2 71 d5 bd 05 48 3b a0 60 d0 51 6d 8b 2a 41 cd c4 12 b7 2d ef 3a 7b 22 7e 7e a0 8b ce ff 03 13 ee e1 e0 40 00 02 00 00 7a 30 16 71 0c 1a 47 75 16 d1 ea 41 87 2c 38 f4 67 dc 1c dc 4f 8b f1 57 5c b2 79 2a d6 5c 48 db 31 cb a8 4e d7 8e 48 44 ed ce a8 11 0c df 04 c9 1d 7c 78 23 84 be 54 63 a0 ee 28 3e c7 ab 6c 5d a8 3b d6 43 a4 a5 a8 20 da 15 bd 5f e9 be 71 fe 76 86 e4 1d 8f 9e 3f ec 25 ee cf d7 7b 4b 68 41 3c cf 2b 4a ee e0 93 c6 7d c6 95 4c b1 49 9e 55 d5 9d ee 6c 17 84 92 5b bd 64 39 b8 c9 7e 7e a0 30 ce ff 03 13 86 f8 e0 c0 00 03 00 00 1f 91 56 1b 99 3d f6 04 c6 5d be 86 82 19 b0 b8 19 27 54 41 e9 c5 e5 cc 4c c8 cd e1 6f d8 53 31 9f 1a 7e
7e a0 8b ce ff 03 13 ee e1 e6 e7 00 e0 40 00 01 00 00 77 db 08 4c 47 5a 67 73 78 1f d0 82 01 03 30 00 02 56 f3 bb 49 77 c7 4c 5a f9 9b 94 e1 21 9c 92 f6 5e dd e4 8e a0 40 54 ee b9 7f 48 ce f6 9c 32 2c d1 58 bb 10 a5 4b 31 0b 5d 2d e2 12 f6 60 1a 6b 33 43 bb 4e f4 2e 4d 4a 39 c7 6c ac e0 b9 9f 3a 81 14 05 b8 98 c0 4c 45 3f 81 b9 7d 83 ec d3 98 24 53 96 13 1b d9 9b 7c b2 6b 42 ef 0e c0 14 96 67 c0 eb f5 14 a3 73 b8 66 7e 7e a0 8b ce ff 03 13 ee e1 e0 40 00 02 00 00 7a 3b a7 07 d5 09 aa e7 4d 74 0b c0 bd 1d 7e be 3b 69 47 56 ce 29 73 59 0a 8f af 7b b4 92 34 06 d2 4f 23 95 9f cf 1a 06 34 5e 99 b1 89 73 14 2a a4 aa 75 d9 ce cf 9f 6b d1 f5 f4 4f b8 3d 7d 60 84 3d 67 f0 ce cf 7b 6d 8f c8 e9 bc ff 62 fa 02 73 7a f1 28 22 b7 bf 63 73 44 6a 85 81 16 95 7c 55 8c a6 35 d3 bd 54 ef f1 53 e0 3a 36 64 bd 61 e2 27 cf 69 26 08 0e 74 8a 2d 60 34 37 7e 7e a0 30 ce ff 03 13 86 f8 e0 c0 00 03 00 00 1f 49 97 2b cd 67 55 a9 9b c7 00 df f6 75 b6 e6 f6 93 1f 9e 47 16 65 98 e0 cb 11 e0 89 9f ed 61 7d ce 7e
7e a0 8b ce ff 03 13 ee e1 e6 e7 00 e0 40 00 01 00 00 77 db 08 4c 47 5a 67 73 78 1f d0 82 01 03 30 00 02 56 f4 7e 29 1e ed a1 e3 36 bb 5c e9 4b d4 fe 53 e3 86 96 a6 e8 ed 0a ef 31 54 0a 21 a8 e3 ea 90 cc f3 53 ec 22 1f 57 13 a3 39 9d 5a f7 8a ce dd c0 46 82 7e 7f 30 c0 24 db 23 1a 84 b1 e5 c9 9b 1a 21 a1 fc 20 d5 25 19 15 a1 0b 1b 25 f2 91 76 9d 1f 0b 2b 01 be a5 b1 29 c6 79 b1 1d 58 6a 6d 75 ff 65 22 fa f7 c2 62 92 7e 7e a0 8b ce ff 03 13 ee e1 e0 40 00 02 00 00 7a 1f d1 5b 13 d4 d6 f7 e9 8c 12 1f 02 93 f8 eb 5f b9 ff d9 4e ff 2f cf 1d 56 0e 18 73 41 8c 80 cd e0 17 ca f0 7d 2c e3 1d 0f 0b 6b 6f d5 88 22 a8 88 3e e8 ac 3a f2 7b 1c 8c f1 ba c7 34 18 9e 81 90 73 f7 4e f0 8f 14 6c 5f 1f 76 6a 83 04 00 07 aa 6f 07 d7 40 13 b9 f9 1d 0d 33 de 10 5c 6a 33 f5 07 38 45 ed f5 d2 d6 bf 28 7e c2 ec 6c b3 7f 72 53 ea e0 bf c3 da b9 d1 c0 40 8c 7e 7e a0 30 ce ff 03 13 86 f8 e0 c0 00 03 00 00 1f 83 17 6d 94 e9 2e bd 63 79 7f cf c5 b7 e2 14 ae 37 c2 bf e8 af ad c6 5a a5 ef c6 b9 38 26 08 b0 83 7e
7e a0 8b ce ff 03 13 ee e1 e6 e7 00 e0 40 00 01 00 00 77 db 08 4c 47 5a 67 73 78 1f d0 82 01 03 30 00 02 56 f5 4f e9 c5 33 43 a6 66 60 3d a9 d2 f0 d9 69 83 33 c3 c1 7f 8a f2 40 b1 66 01 b4 d4 b9 ba f1 b5 39 0d c3 3e 38 c2 fe bd d8 8e 85 08 26 61 01 a5 0b d6 8e cd cd b9 f3 96 90 2c 86 a4 a1 68 99 cc 2f 30 7e f7 39 51 be c4 25 ee 6a ca c2 b4 29 24 63 fa 1d f5 85 be 49 43 68 12 1d e0 e8 16 d0 f0 03 5f 57 a9 58 13 c5 d0 7e 7e a0 8b ce ff 03 13 ee e1 e0 40 00 02 00 00 7a 7a 6b 16 5d f1 1c ff e9 70 e2 da 8a 5d c9 fb 6a ee 04 48 fa 46 c7 b2 3b 5e ad f6 0b a3 43 5d ca 49 98 2e 5c 86 d6 60 f7 da 34 ad 25 29 f4 03 b3 c6 75 15 e7 46 d8 2f 07 40 7f 85 81 5e 37 f6 f2 c9 c7 d6 7e 0f 2f d7 2d 48 c0 97 1c b4 6a a9 3d e4 d8 09 96 87 ed aa f9 6c c2 ca bc 47 4f a3 7c 72 60 83 13 82 42 2d 5d 05 56 83 c0 3d 91 16 f2 49 ac c4 8b 63 9a 4c 80 4c ee e7 1c 7e 7e a0 30 ce ff 03 13 86 f8 e0 c0 00 03 00 00 1f e3 58 e6 bd 71 f5 d8 ed 76 70 a8 df 4d df fb 00 c7 5d 5a b6 d1 14 d7 d6 19 35 f1 0f 9b 94 ee 4b 57 7e
7e a0 8b ce ff 03 13 ee e1 e6 e7 00 e0 40 00 01 00 00 77 db 08 4c 47 5a 67 73 78 1f d0 82 01 03 30 00 02 56 f6 91 9f 91 dd 1f 7a ee 2e b5 44 b6 f7 c2 26 c0 3e 69 fa a7 45 a8 d9 b4 a9 f8 2c be 4e 4a a1 f0 36 10 6c 2c fc 7b 79 1c ad a0 12 65 52 17 63 45 e1 c0 e2 36 7e de 9e 92 55 b3 8b 53 47 6c b2 80 eb c9 b6 1a c1 51 f8 af 17 41 fd fd 0e 85 7b 15 2e ee 47 45 2f 56 05 54 ea 4c 97 cf 19 5d 4c 24 dd 93 78 24 55 49 4f 24 7e 7e a0 8b ce ff 03 13 ee e1 e0 40 00 02 00 00 7a 99 c7 a8 af 82 d8 bb a6 27 b9 7b 63 03 b0 06 d9 81 77 da c5 fb 04 fd 51 c7 d9 0e 99 29 0f f0 79 f4 46 ea 99 b8 d8 63 f0 a7 e6 9c e1 5a 5e c0 56 64 aa 7d 44 af f9 44 54 4d 67 55 a9 43 61 a5 cc eb e3 4c 68 fb a1 07 12 12 7e 6d b9 67 5e b8 bd 24 9b 3c 03 dd 3b ba e6 c9 0d 25 27 be f2 c9 e7 25 55 08 7d 17 2a e2 c0 44 f3 07 cc e5 e2 31 ef 04 26 05 be 45 9c 98 f0 a7 1a 24 3a 7e 7e a0 30 ce ff 03 13 86 f8 e0 c0 00 03 00 00 1f 0d 64 43 07 e7 c6 9f fd ad a6 eb b8 37 f7 33 0e 89 6e a7 c3 65 04 60 ef 09 78 a2 f3 f6 8b fc 67 44 7e
7e a0 8b ce ff 03 13 ee e1 e6 e7 00 e0 40 00 01 00 00 77 db 08 4c 47 5a 67 73 78 1f d0 82 01 03 30 00 02 57 86 92 ae 37 5e 74 d1 8c 24 6b c8 08 90 9f 41 e5 87 dd 1a 86 2f cc 59 f9 c8 59 d8 24 36 8b 0e f3 0d d2 e2 87 51 aa 82 8e 4e a1 1e b1 53 12 1c cd d3 ab dc 9d e4 57 6f df d4 e6 e8 9a f8 70 6c 15 a4 6a 31 04 e3 2b 31 5f d1 f2 91 47 6e d4 55 14 90 34 85 5a c7 c6 1f 45 b5 d3 97 4b 16 03 58 94 b3 39 40 38 e7 5c 72 34 7e 7e a0 8b ce ff 03 13 ee e1 e0 40 00 02 00 00 7a 05 12 d6 01 3c 24 1e a7 0a d9 f2 15 3a 8e a9 0c 24 fe d8 15 87 56 46 5b e6 f9 f6 bf 2e 2f d0 91 04 2d 38 18 a6 9e 86 24 c2 10 c5 26 3a 66 77 3e 25 e0 98 a3 cd 36 1f a5 d8 c1 d5 2c 96 9f 18 88 59 2e 01 21 88 47 61 eb 36 07 4a 4a 1c e7 b4 be 54 58 b2 2d 18 e9 46 ae 22 d4 e8 b3 24 35 3d 6c 37 2f 9e dd f1 1f 68 25 6c 8f 77 68 da ec ff 98 11 ec 2e 19 3f 7b e3 6f 30 ef d7 f5 7e 7e a0 30 ce ff 03 13 86 f8 e0 c0 00 03 00 00 1f 61 e7 f2 ea 67 cd 79 35 c0 21 f3 77 d7 e8 29 e5 db 01 2a 16 61 52 43 be ff 1a 7b 66 79 01 7c b2 b1 7e

At the Energienetze Steiermark Website (e-netze.at) there I can find two encryption keys. One is called "Global Unicast Encryption Key (GUEK)" and the other one is called "Global Authentication Key (GAK)". The key I sent to you is the "Global Unicast Encryption Key (GUEK)". Now I sent another mail with both of the keys to the above-mentioned mail address. Maybe you have success with the second one. According to this document both keys are necessary to decrypt the payload data: https://oesterreichsenergie.at/fileadmin/user_upload/Smart_Meter-Plattform/20200201_Konzept_Kundenschnittstelle_SM.pdf

My adapter is this one: https://www.amazon.de/gp/product/B07PDH2ZBV/ In my opinion the packets look fine. Unfortunately I don't have another adapter to test.

raymar9 commented 2 years ago

I received your E-mail with both keys. I managed to inspect the data with the DLMS Director / Translator Tool https://www.gurux.fi/Download. However, your data seems to be differently structured compared to our L+G E450 meter. And our software (actually the library we use) is unable to parse your data structure. Actually, it has nothing to do with the authentication key, which is not needed to inspect the data (I tried it with & without the auth key.) Only the encryption key is required. Last time I did not use the correct tool in the DLMS Director to inspect the data.

Your meter:

<!-- IDIS system title:
Manufacturer Code: LGZ
Device type: IDIS package2 IP polyphase meter
Function type: Disconnector, Load Management, Multi Utility
Serial number: 58204112
 -->
  <DataNotification>
    # Invoke ID: 153327
    <LongInvokeIdAndPriority Value="153327" />
    # 22.01.2022 20:40:10
    <DateTime Value="07E601160614280AFF800000" />
    <NotificationBody>
      <DataValue>
        <Structure Qty="33" >
          # 22.01.2022 20:40:10
          <OctetString Value="07E601160614280AFF800000" />
          # 1.0.1.8.0.255
          <OctetString Value="0100010800FF" />
          <UInt32 Value="4495453" />
          # 1.0.1.8.1.255
          <OctetString Value="0100010801FF" />
          <UInt32 Value="3164981" />
          # 1.0.1.8.2.255
          <OctetString Value="0100010802FF" />
          <UInt32 Value="1330472" />
          # 1.0.1.7.0.255
          <OctetString Value="0100010700FF" />
          <UInt32 Value="1048" />
          # 1.0.2.8.0.255
          <OctetString Value="0100020800FF" />
          <UInt32 Value="0" />
          # 1.0.2.8.1.255
          <OctetString Value="0100020801FF" />
          <UInt32 Value="0" />
          # 1.0.2.8.2.255
          <OctetString Value="0100020802FF" />
          <UInt32 Value="0" />
          # 1.0.2.7.0.255
          <OctetString Value="0100020700FF" />
          <UInt32 Value="0" />
          # 1.0.3.8.0.255
          <OctetString Value="0100030800FF" />
          <UInt32 Value="830134" />
          # 1.0.3.8.1.255
          <OctetString Value="0100030801FF" />
          <UInt32 Value="507549" />
          # 1.0.3.8.2.255
          <OctetString Value="0100030802FF" />
          <UInt32 Value="322585" />
          # 1.0.3.7.0.255
          <OctetString Value="0100030700FF" />
          <UInt32 Value="0" />
          # 1.0.4.8.0.255
          <OctetString Value="0100040800FF" />
          <UInt32 Value="997194" />
          # 1.0.4.8.1.255
          <OctetString Value="0100040801FF" />
          <UInt32 Value="693919" />
          # 1.0.4.8.2.255
          <OctetString Value="0100040802FF" />
          <UInt32 Value="303275" />
          # 1.0.4.7.0.255
          <OctetString Value="0100040700FF" />
          <UInt32 Value="521" />
        </Structure>
      </DataValue>
    </NotificationBody>
  </DataNotification>

Our meter:

<!-- IDIS system title:
Manufacturer Code: LGZ
Device type: IDIS package2 IP polyphase meter
Function type: Load Management, Multi Utility
Serial number: 53520967
 -->
  <DataNotification>
    # Invoke ID: 3463726
    <LongInvokeIdAndPriority Value="3463726" />
    # 06.12.2021 01:05:00
    <DateTime Value="07E50C0601010500FF800000" />
    <NotificationBody>
      <DataValue>
        <Structure Qty="13" >
          <Array Qty="13" >
            <Structure Qty="4" >
              <UInt16 Value="40" />
              # 0.9.25.9.0.255
              <OctetString Value="0009190900FF" />
              <Int8 Value="2" />
              <UInt16 Value="0" />
            </Structure>
            <Structure Qty="4" >
              <UInt16 Value="40" />
              # 0.9.25.9.0.255
              <OctetString Value="0009190900FF" />
              <Int8 Value="1" />
              <UInt16 Value="0" />
            </Structure>
            <Structure Qty="4" >
              <UInt16 Value="1" />
              # 0.0.42.0.0.255
              <OctetString Value="00002A0000FF" />
              <Int8 Value="2" />
              <UInt16 Value="0" />
            </Structure>
            <Structure Qty="4" >
              <UInt16 Value="1" />
              # 0.0.96.1.1.255
              <OctetString Value="0000600101FF" />
              <Int8 Value="2" />
              <UInt16 Value="0" />
            </Structure>
            <Structure Qty="4" >
              <UInt16 Value="8" />
              # 0.0.1.0.0.255
              <OctetString Value="0000010000FF" />
              <Int8 Value="2" />
              <UInt16 Value="0" />
            </Structure>
            <Structure Qty="4" >
              <UInt16 Value="3" />
              # 1.1.1.8.1.255
              <OctetString Value="0101010801FF" />
              <Int8 Value="2" />
              <UInt16 Value="0" />
            </Structure>
            <Structure Qty="4" >
              <UInt16 Value="3" />
              # 1.1.1.8.2.255
              <OctetString Value="0101010802FF" />
              <Int8 Value="2" />
              <UInt16 Value="0" />
            </Structure>
            <Structure Qty="4" >
              <UInt16 Value="3" />
              # 1.1.2.8.1.255
              <OctetString Value="0101020801FF" />
              <Int8 Value="2" />
              <UInt16 Value="0" />
            </Structure>
            <Structure Qty="4" >
              <UInt16 Value="3" />
              # 1.1.2.8.2.255
              <OctetString Value="0101020802FF" />
              <Int8 Value="2" />
              <UInt16 Value="0" />
            </Structure>
            <Structure Qty="4" >
              <UInt16 Value="3" />
              # 1.1.5.8.1.255
              <OctetString Value="0101050801FF" />
              <Int8 Value="2" />
              <UInt16 Value="0" />
            </Structure>
            <Structure Qty="4" >
              <UInt16 Value="3" />
              # 1.1.5.8.2.255
              <OctetString Value="0101050802FF" />
              <Int8 Value="2" />
              <UInt16 Value="0" />
            </Structure>
            <Structure Qty="4" >
              <UInt16 Value="3" />
              # 1.1.8.8.1.255
              <OctetString Value="0101080801FF" />
              <Int8 Value="2" />
              <UInt16 Value="0" />
            </Structure>
            <Structure Qty="4" >
              <UInt16 Value="3" />
              # 1.1.8.8.2.255
              <OctetString Value="0101080802FF" />
              <Int8 Value="2" />
              <UInt16 Value="0" />
            </Structure>
          </Array>
          # 0.9.25.9.0.255
          <OctetString Value="0009190900FF" />
          # LGZ1030653520967
          <OctetString Value="4C475A31303330363533353230393637" />
          # 1909113
          <OctetString Value="31393039313133" />
          # 06.12.2021 01:05:00
          <OctetString Value="07E50C0601010500FF800001" />
          <UInt32 Value="0" />
          <UInt32 Value="134284" />
          <UInt32 Value="0" />
          <UInt32 Value="0" />
          <UInt32 Value="0" />
          <UInt32 Value="0" />
          <UInt32 Value="0" />
          <UInt32 Value="99887" />
        </Structure>
      </DataValue>
    </NotificationBody>
  </DataNotification>
LichtiMC commented 2 years ago

Do you know of a case that works and also uses an L+G E450 and the Energienetze-Steiermark provider? Is my smart meter malconfigured / defective? And: Will there be taken some programming effort by you creators of this software to make it work?

LichtiMC commented 2 years ago

I just saw this fork for my provider: https://github.com/martink173/smartmeter-datacollector I will try and ask for help there. Maybe you are able to merge the changes of the fork and make it work for the Energienetze Steiermark provider too!?

raymar9 commented 2 years ago

No, unfortunately I do not know a case where a LG E450 meter from Energienetze Steiermark is used. We only worked with meters from EKZ (Elektrizitätswerke Kantons Zürich). I suppose it is not defective but differently configured but I am not sure what exactly the problem is.

Will there be taken some programming effort by you creators of this software to make it work?

Yes, that is for sure. Already analyzing the data, writing tests and such took me a couple hours.

The fork looks promising, however we must analyze it in more detail and certainly adapt a couple of things to be compatible with our software.

LichtiMC commented 2 years ago

Can you provide a time horizon until when it will work? Like a week / month / year / etc. ? Thank you for your efforts!

raymar9 commented 2 years ago

Hi LichtiMC Yesterday, I tried to integrate the changes from martink173 into our project. The problem is that he actually uses a different implementation for parsing the data from L+G E450 meter model which, as you already know and tried, we provide one by our-self. I ran our unittests with his implementation but the tests do not succeed. I highly suspect that with this modification the data of our meters would not be able to be parsed anymore. We would need to add his parsing implementation separately as a new smart meter type (like L+G E450-Steiermark). Furthermore, I just posted this problem of the different data structure of our meters in the Gurux forum. Let's see if they know more about this.

Question: Did you try the implementation of martink173 with your meter? Did it work?

Concluding, I cannot guarantee you that we eventually integrate this modification into our project due to the reasons above. Therefore the time horizon would be either a couple of weeks or never. I'm sorry. If I found a solution for this I would inform you.

LichtiMC commented 2 years ago

Question: Did you try the implementation of martink173 with your meter? Did it work?

Yes, it is running on my raspberry pi without a problem.

DEBUG:smartmeter:More DLMS data expected. Not yet ready to be parsed.
DEBUG:smartmeter:HDLC Buffer: 7E A0 8B CE FF 03 13 EE E1 E6 E7 00 E0 40 00 01 00 00 77 DB 08 4C 47 5A 67 73 78 1F D0 82 01 03 30 00 06 90 3C EB 7B E1 75 48 BF D7 C3 6E DF 96 48 93 7D 7C 78 26 2B E5 FC FE E3 6B 41 D0 61 CF F3 FA 3A E6 91 8B FD C6 1F 95 67 19 E2 95 91 FC D6 D0 A1 98 D6 CA 49 CC DD 56 5F D3 8A 5F 9A 6C 8E AC 3A BE EE 11 0D 2E C4 EB B6 DC 10 43 D3 5A 8B C8 7D 42 0E 75 A2 3C 44 F4 08 B7 A7 31 F1 62 1F 84 86 F3 50 C3 A4 9D 02 06 B1 3A 7E 7E A0 8B CE FF 03 13 EE E1 E0 40 00 02 00 00 7A 48 44 3E 98 6B 54 C0 4A 4E 84 AE 52 EC F1 89 4A CC 58 67 52 28 E2 45 6F 9B ED CD 22 79 03 FE 91 16 50 5C 90 02 A6 9A C4 5E F7 35 40 9B 4D 7E
DEBUG:smartmeter:HDLC frame incomplete and will not be parsed yet.
DEBUG:smartmeter:HDLC Buffer: 7E A0 8B CE FF 03 13 EE E1 E6 E7 00 E0 40 00 01 00 00 77 DB 08 4C 47 5A 67 73 78 1F D0 82 01 03 30 00 06 90 3C EB 7B E1 75 48 BF D7 C3 6E DF 96 48 93 7D 7C 78 26 2B E5 FC FE E3 6B 41 D0 61 CF F3 FA 3A E6 91 8B FD C6 1F 95 67 19 E2 95 91 FC D6 D0 A1 98 D6 CA 49 CC DD 56 5F D3 8A 5F 9A 6C 8E AC 3A BE EE 11 0D 2E C4 EB B6 DC 10 43 D3 5A 8B C8 7D 42 0E 75 A2 3C 44 F4 08 B7 A7 31 F1 62 1F 84 86 F3 50 C3 A4 9D 02 06 B1 3A 7E 7E A0 8B CE FF 03 13 EE E1 E0 40 00 02 00 00 7A 48 44 3E 98 6B 54 C0 4A 4E 84 AE 52 EC F1 89 4A CC 58 67 52 28 E2 45 6F 9B ED CD 22 79 03 FE 91 16 50 5C 90 02 A6 9A C4 5E F7 35 40 9B 4D 7E CE 2D 89 CD 86 F6 5B FB DF E6 1C 94 3F CE A4 CA 64 6C 3E EC BD 8C 38 BA 05 7B C5 21 DA 2C 08 E5 9B E8 FB B3 FE 59 27 94 D5 80 41 AF 33 2D C0 ED 7A 51 19 06 ED A5 24 07 95 81 9C 85 39 68 52 D7 9D 3A B7 B8 3B C7 30 23 F7 4B 5F 01 FE 7E
DEBUG:smartmeter:More DLMS data expected. Not yet ready to be parsed.
DEBUG:smartmeter:HDLC Buffer: 7E A0 8B CE FF 03 13 EE E1 E6 E7 00 E0 40 00 01 00 00 77 DB 08 4C 47 5A 67 73 78 1F D0 82 01 03 30 00 06 90 3C EB 7B E1 75 48 BF D7 C3 6E DF 96 48 93 7D 7C 78 26 2B E5 FC FE E3 6B 41 D0 61 CF F3 FA 3A E6 91 8B FD C6 1F 95 67 19 E2 95 91 FC D6 D0 A1 98 D6 CA 49 CC DD 56 5F D3 8A 5F 9A 6C 8E AC 3A BE EE 11 0D 2E C4 EB B6 DC 10 43 D3 5A 8B C8 7D 42 0E 75 A2 3C 44 F4 08 B7 A7 31 F1 62 1F 84 86 F3 50 C3 A4 9D 02 06 B1 3A 7E 7E A0 8B CE FF 03 13 EE E1 E0 40 00 02 00 00 7A 48 44 3E 98 6B 54 C0 4A 4E 84 AE 52 EC F1 89 4A CC 58 67 52 28 E2 45 6F 9B ED CD 22 79 03 FE 91 16 50 5C 90 02 A6 9A C4 5E F7 35 40 9B 4D 7E CE 2D 89 CD 86 F6 5B FB DF E6 1C 94 3F CE A4 CA 64 6C 3E EC BD 8C 38 BA 05 7B C5 21 DA 2C 08 E5 9B E8 FB B3 FE 59 27 94 D5 80 41 AF 33 2D C0 ED 7A 51 19 06 ED A5 24 07 95 81 9C 85 39 68 52 D7 9D 3A B7 B8 3B C7 30 23 F7 4B 5F 01 FE 7E 7E A0 30 CE FF 03 13 86 F8 E0 C0 00 03 00 00 1F 1F FE C7 27 11 0F 74 B7 EF F4 1B 48 F7 47 B6 B6 A2 39 5B 42 BD 61 EA 18 7E
DEBUG:smartmeter:HDLC frame incomplete and will not be parsed yet.
DEBUG:smartmeter:HDLC Buffer: 7E A0 8B CE FF 03 13 EE E1 E6 E7 00 E0 40 00 01 00 00 77 DB 08 4C 47 5A 67 73 78 1F D0 82 01 03 30 00 06 90 3C EB 7B E1 75 48 BF D7 C3 6E DF 96 48 93 7D 7C 78 26 2B E5 FC FE E3 6B 41 D0 61 CF F3 FA 3A E6 91 8B FD C6 1F 95 67 19 E2 95 91 FC D6 D0 A1 98 D6 CA 49 CC DD 56 5F D3 8A 5F 9A 6C 8E AC 3A BE EE 11 0D 2E C4 EB B6 DC 10 43 D3 5A 8B C8 7D 42 0E 75 A2 3C 44 F4 08 B7 A7 31 F1 62 1F 84 86 F3 50 C3 A4 9D 02 06 B1 3A 7E 7E A0 8B CE FF 03 13 EE E1 E0 40 00 02 00 00 7A 48 44 3E 98 6B 54 C0 4A 4E 84 AE 52 EC F1 89 4A CC 58 67 52 28 E2 45 6F 9B ED CD 22 79 03 FE 91 16 50 5C 90 02 A6 9A C4 5E F7 35 40 9B 4D 7E CE 2D 89 CD 86 F6 5B FB DF E6 1C 94 3F CE A4 CA 64 6C 3E EC BD 8C 38 BA 05 7B C5 21 DA 2C 08 E5 9B E8 FB B3 FE 59 27 94 D5 80 41 AF 33 2D C0 ED 7A 51 19 06 ED A5 24 07 95 81 9C 85 39 68 52 D7 9D 3A B7 B8 3B C7 30 23 F7 4B 5F 01 FE 7E 7E A0 30 CE FF 03 13 86 F8 E0 C0 00 03 00 00 1F 1F FE C7 27 11 0F 74 B7 EF F4 1B 48 F7 47 B6 B6 A2 39 5B 42 BD 61 EA 18 7E D9 A0 99 8B 81 45 44 78 7E
DEBUG:smartmeter:DLMS packet complete and ready for parsing.
DEBUG:smartmeter:Parsing...
WARNING:smartmeter:e450 - 2022-02-23T21:36:00 - Active Energy + Total: 6226327 Wh
WARNING:smartmeter:e450 - 2022-02-23T21:36:00 - Active Energy + T1: 4395170 Wh
WARNING:smartmeter:e450 - 2022-02-23T21:36:00 - Active Energy + T2: 1831157 Wh
WARNING:smartmeter:e450 - 2022-02-23T21:36:00 - Active Power +: 769 W
WARNING:smartmeter:e450 - 2022-02-23T21:36:00 - Active Energy - Total: 0 Wh
WARNING:smartmeter:e450 - 2022-02-23T21:36:00 - Active Energy - T1: 0 Wh
WARNING:smartmeter:e450 - 2022-02-23T21:36:00 - Active Energy - T2: 0 Wh
WARNING:smartmeter:e450 - 2022-02-23T21:36:00 - Active Power -: 0 W
WARNING:smartmeter:e450 - 2022-02-23T21:36:00 - Reactive Energy + Total: 1139036 VAh
WARNING:smartmeter:e450 - 2022-02-23T21:36:00 - Reactive Energy + T1: 689910 VAh
WARNING:smartmeter:e450 - 2022-02-23T21:36:00 - Reactive Energy + T2: 449126 VAh
WARNING:smartmeter:e450 - 2022-02-23T21:36:00 - Reactive Power +: 0 VA
WARNING:smartmeter:e450 - 2022-02-23T21:36:00 - Reactive Energy - Total: 1373822 VAh
WARNING:smartmeter:e450 - 2022-02-23T21:36:00 - Reactive Energy - T1: 958712 VAh
WARNING:smartmeter:e450 - 2022-02-23T21:36:00 - Reactive Energy - T2: 415110 VAh
WARNING:smartmeter:e450 - 2022-02-23T21:36:00 - Reactive Power -: 442 VA
DEBUG:sink:{"value": 6226327, "timestamp": 1645648560} sent to MQTT broker.
DEBUG:sink:{"value": 4395170, "timestamp": 1645648560} sent to MQTT broker.
DEBUG:sink:{"value": 1831157, "timestamp": 1645648560} sent to MQTT broker.
DEBUG:sink:{"value": 769, "timestamp": 1645648560} sent to MQTT broker.
DEBUG:sink:{"value": 0, "timestamp": 1645648560} sent to MQTT broker.
DEBUG:sink:{"value": 0, "timestamp": 1645648560} sent to MQTT broker.
DEBUG:sink:{"value": 0, "timestamp": 1645648560} sent to MQTT broker.
DEBUG:sink:{"value": 0, "timestamp": 1645648560} sent to MQTT broker.
DEBUG:sink:{"value": 1139036, "timestamp": 1645648560} sent to MQTT broker.
DEBUG:sink:{"value": 689910, "timestamp": 1645648560} sent to MQTT broker.
DEBUG:sink:{"value": 449126, "timestamp": 1645648560} sent to MQTT broker.
DEBUG:sink:{"value": 0, "timestamp": 1645648560} sent to MQTT broker.
DEBUG:sink:{"value": 1373822, "timestamp": 1645648560} sent to MQTT broker.
DEBUG:sink:{"value": 958712, "timestamp": 1645648560} sent to MQTT broker.
DEBUG:sink:{"value": 415110, "timestamp": 1645648560} sent to MQTT broker.
DEBUG:sink:{"value": 442, "timestamp": 1645648560} sent to MQTT broker.

Do you have the list with the objects that are pushed from your smart meter? If yes, could you share the list?

image

gcey commented 2 years ago

I have an L+G E450 from Wiener Netze and I also get the "TypeError: 'int' object is not subscriptable" in "GXDLMSClient.py line 1257". The "DLMS Director / Translator Tool" decodes to this:


<!-- IDIS system title:
Manufacturer Code: LGZ
Device type: IDIS package2 IP polyphase meter
Function type: Disconnector, Load Management, Multi Utility
Serial number: 58992622
 -->
<!-- Invocation Counter: 1053652 -->
<!-- Decrypt data: 0F 00 10 13 D4 0C 07 E6 04 0E 04 0F 31 02 FF 80 00 00 02 09 09 0C 07 E6 04 0E 04 0F 31 02 FF 80 00 80 06 00 04 FE 3D 06 00 00 00 00 06 00 01 C6 CB 06 00 00 01 5C 06 00 00 02 92 06 00 00 00 00 06 00 00 01 40 06 00 00 00 00
  <DataNotification>
    # Invoke ID: 1053652
    <LongInvokeIdAndPriority Value="001013D4" />
    # 2022-04-14 15:49:02
    <DateTime Value="07E6040E040F3102FF800000" />
    <NotificationBody>
      <DataValue>
        <Structure Qty="09" >
          # 2022-04-14 15:49:02
          <OctetString Value="07E6040E040F3102FF800080" />
          <UInt32 Value="0004FE3D" />
          <UInt32 Value="00000000" />
          <UInt32 Value="0001C6CB" />
          <UInt32 Value="0000015C" />
          <UInt32 Value="00000292" />
          <UInt32 Value="00000000" />
          <UInt32 Value="00000140" />
          <UInt32 Value="00000000" />
        </Structure>
      </DataValue>
    </NotificationBody>
  </DataNotification>
-->
raymar9 commented 2 years ago

I propose that you directly contact Gurux with this request since I won't be able to investigate this issue further. Use this sub-forum to do that: https://www.gurux.fi/forum/25. If you find out more you can post the link to the forum issue here.

Alternatively, you could use the fork of martink173 (https://github.com/martink173/smartmeter-datacollector).

gcey commented 2 years ago

I propose that you directly contact Gurux with this request since I won't be able to investigate this issue further. Use this sub-forum to do that: https://www.gurux.fi/forum/25. If you find out more you can post the link to the forum issue here.

I did so, see https://www.gurux.fi/comment/23821#comment-23821 There I got the information, that parsePushObjects() is only to be used, if the smart meter sends a list of the objects of the push message as a first parameter. But the L+G E450 from Wiener Netze does not send this list. It just sends the objects themselves. In such a case parsePushObjects() must not be called. Instead the list of objects has to be created with GXDLMSPushSetup. I found out, that for the L+G E450 from Wiener Netze this can be done in the following way:

from gurux_dlms.objects import GXDLMSPushSetup, GXDLMSClock, GXDLMSCaptureObject
...
class HdlcDlmsParser:
    ...
    def __init__(self, cosem_config: Cosem, block_cipher_key: Optional[str] = None) -> None:
        ...  
        self._p = GXDLMSPushSetup()
        self._p.pushObjectList.append((GXDLMSClock(), GXDLMSCaptureObject(2, 0)))
        self._p.pushObjectList.append((GXDLMSRegister("1.1.1.8.0.255"), GXDLMSCaptureObject(2, 0)))
        self._p.pushObjectList.append((GXDLMSRegister("1.1.2.8.0.255"), GXDLMSCaptureObject(2, 0)))
        self._p.pushObjectList.append((GXDLMSRegister("1.1.3.8.0.255"), GXDLMSCaptureObject(2, 0)))
        self._p.pushObjectList.append((GXDLMSRegister("1.1.4.8.0.255"), GXDLMSCaptureObject(2, 0)))
        self._p.pushObjectList.append((GXDLMSRegister("1.0.1.7.0.255"), GXDLMSCaptureObject(2, 0)))
        self._p.pushObjectList.append((GXDLMSRegister("1.0.2.7.0.255"), GXDLMSCaptureObject(2, 0)))
        self._p.pushObjectList.append((GXDLMSRegister("1.0.3.7.0.255"), GXDLMSCaptureObject(2, 0)))
        self._p.pushObjectList.append((GXDLMSRegister("1.0.4.7.0.255"), GXDLMSCaptureObject(2, 0)))
    ...
    def parse_to_dlms_objects(self) -> Dict[str, GXDLMSObject]:
        parsed_objects: List[Tuple[GXDLMSObject, int]] = []
        if isinstance(self._dlms_data.value, list):
            #pylint: disable=unsubscriptable-object
            parsed_objects = self._p.pushObjectList
            for index, (obj, attr_ind) in enumerate(parsed_objects):
                self._client.updateValue(obj, attr_ind.attributeIndex, self._dlms_data.value[index])
                LOGGER.debug("%d %s %s %s: %s", index, obj.objectType, obj.logicalName, attr_ind.attributeIndex, obj.getValues()[attr_ind.attributeIndex - 1])
        self._dlms_data.clear()
        return {obj.getName(): obj for obj, _ in parsed_objects}

In this way I get perfect results (e.g. in the logger sink):

INFO:DataLogger:/dev/ttyUSB0 - 2022-05-07T14:30:03 - Active Energy +: 864051.0 Wh
INFO:DataLogger:/dev/ttyUSB0 - 2022-05-07T14:30:03 - Active Energy -: 0.0 Wh
INFO:DataLogger:/dev/ttyUSB0 - 2022-05-07T14:30:03 - Reactive Energy +: 299034.0 VAh
INFO:DataLogger:/dev/ttyUSB0 - 2022-05-07T14:30:03 - Reactive Energy -: 943.0 VAh
INFO:DataLogger:/dev/ttyUSB0 - 2022-05-07T14:30:03 - Active Power +: 735.0 W
INFO:DataLogger:/dev/ttyUSB0 - 2022-05-07T14:30:03 - Active Power -: 0.0 W
INFO:DataLogger:/dev/ttyUSB0 - 2022-05-07T14:30:03 - Reactive Power +: 299.0 VA
INFO:DataLogger:/dev/ttyUSB0 - 2022-05-07T14:30:03 - Reactive Power -: 0.0 VA

IMO this issue should be reopened and the smartmeter-datacollector should be enhanced in the way, that the user can configure, whether

In case of the L+G E450 from Wiener Netze the user has to configure (b) with the following 9 objects:


    Clock
    Register 1.1.1.8.0.255
    Register 1.1.2.8.0.255
    Register 1.1.3.8.0.255
    Register 1.1.4.8.0.255
    Register 1.0.1.7.0.255
    Register 1.0.2.7.0.255
    Register 1.0.3.7.0.255
    Register 1.0.4.7.0.255
raymar9 commented 2 years ago

This is some great piece of information. Thank you for your effort! We will try to find a good solution for the integration in smartmeter-datacollector and also smartmeter-datacollector-configurator and discuss this extension with EKZ.

I created a new feature-request issue: #31 to further track this extension.

raymar9 commented 2 years ago

@gcey @LichtiMC Since we do not possess a L+G meter without the push-list configuration I require some raw data for testing and writing unit tests. Can you provide me with some unencrypted raw data and the corresponding push object list? Or send me some encrypted raw data including the decryption key and the corresponding push object list? However, this unit test code, your data and decryption key is going to be published on this repository, so unencrypted data, if possible, would be the easiest solution.

Please provide that, if you can, in the new issue #31