mweimerskirch / smarty_dsmr_proxy

This project is abandoned. I recommend using https://www.zuidwijk.com/product/slimmelezer-plus/
MIT License
20 stars 13 forks source link

DSMR via M-Bus #11

Closed rufinus closed 2 years ago

rufinus commented 2 years ago

Hi, in lower austria the EVN is using the sagemcom T210 but instead of using DSMR via p1 they use M-BUS. i was able to get my hands on a m-bus slave to usb adapter and can read the rawdata.

to connect i needed to set the baud rate down to 2400 (a parameter for it would be nice). but after listening i only get ERROR, expected 0x82 separator byte not found, dropping frame on all messages.

here are some sample encrypted payloads i fetched with the script from https://www.kode24.no/guider/smart-meter-part-1-getting-the-meter-data/71287300

68 01 01 68 53 FF 00 01 67 DB 08 53 41 47 59 05 E8 B4 CB 81 F8 20 00 07 71 D6 59 B2 72 59 25 58 A8 64 EC B9 84 8F 99 B7 59 C7 7F F4 7E 44 73 68 62 12 EA 04 FA 27 06 F8 76 7D 18 5F 69 F3 F8 C7 6D C9 D6 16 6B 37 55 44 74 60 F8 DD ED 0E B3 B0 BE 5B 84 99 08 FD 35 C0 42 82 10 99 62 7D BC 21 41 FE 2F 11 41 1F 76 6B C2 F8 29 29 67 31 D5 78 F5 50 24 7E E1 25 89 67 83 6E C3 23 6E 8F 7A 21 44 F0 18 63 08 EA E6 E1 6D 46 B5 1B DA 60 18 DD 6D E3 EA 6B 71 62 0D FA DA 50 4A 97 A3 41 65 DA 0B DD A9 F4 6A AF 1D BD 39 4D 5F C0 68 04 EE 87 10 A9 4B 2C 76 54 AF AA 89 76 51 27 BE 21 02 D9 10 38 C4 43 7A 18 EB 1D D6 E1 AB 84 60 B6 55 F7 DC 4B 6E 83 A9 2E E1 F4 D3 78 87 37 A6 A2 D4 CF F3 5A D8 12 60 A7 1E 29 DB 0C 24 3A 54 64 1D 83 45 71 D0 42 62 71 F8 D1 DE DB FB 0A 63 D9 B9 3D 8A EF 12 DF 60 ED 16 68 0D 0D 68 53 FF 11 01 67 4A 2D 70 53 FE 7A 51 56 24 16
68 01 01 68 53 FF 00 01 67 DB 08 53 41 47 59 05 E8 B4 CB 81 F8 20 00 07 71 D5 CC 14 11 A5 C5 17 25 80 8A 7D 14 E9 E4 83 B1 FC 02 E7 C5 CA F5 1F D4 D3 10 FF 47 A4 2A 47 91 9A 8B 10 7C D0 78 97 20 C8 B4 18 B7 76 DD 50 0A FD C8 6C 4B 71 5D 14 EB 23 19 87 A2 8B 35 0E 5D 87 C7 27 1B 42 32 5E 2B 57 1F 1C 2B 95 2B 10 70 38 26 85 CD 42 E6 00 52 4A EF A4 0B C7 AD 28 CF 82 2C DA 5A 3D CF AE B0 7D 6A 1D A5 CD 55 64 3F A2 D7 56 A5 E4 65 0C 95 32 1C 43 60 6F B7 F6 3A DD 4E 56 CF E8 B0 2A 62 F9 B7 13 68 3E 4A 57 63 E2 FE F4 0B D7 13 F0 D0 4B 12 CE C1 FE 05 37 AA 54 9A AC A9 B6 F4 85 91 0C F1 3C 6F 0D EA 73 CF 7E 62 03 13 E1 BC C1 60 07 A1 F4 A5 4B A7 39 2E 17 3E 49 42 38 CC 3C D5 E0 00 89 15 25 7B 84 6B 3B DB 31 76 DC 90 D0 B1 8F 35 EF E3 09 7B 86 C5 E2 65 33 BE D6 8A A4 0D 35 B6 B8 F3 C4 16 68 0D 0D 68 53 FF 11 01 67 82 98 36 4A 78 D0 FA DE 85 16
68 01 01 68 53 FF 00 01 67 DB 08 53 41 47 59 05 E8 B4 CB 81 F8 20 00 07 71 D3 B7 8B 38 C1 A9 F5 01 88 76 A0 98 70 9B 7D C6 4E B9 11 8E 91 6A B8 CE C0 C6 43 1D F0 DF 7C 6A 59 45 A4 DF 11 85 D0 86 94 53 75 E5 1B D9 82 6E BF CF D5 25 82 0F C5 19 A3 8F E4 BB 88 43 6F 2A DD C3 AB 92 A7 6F D5 27 29 57 D6 59 F0 06 7C FA 88 D2 09 23 11 8B 95 CF BF 3A EF D1 A0 91 7F 36 12 2B DE 48 6A C5 0C 59 A9 9A FC 45 23 CE 48 3E 9F C8 D5 70 D8 77 25 B7 7B 8D A4 99 6D 50 7F 60 81 4D AF 82 B4 92 98 2E 4C BB 6B A8 D8 D3 EE E6 78 56 D7 FB A6 2A EE 70 C4 08 C6 FF EE 40 23 51 85 10 F2 2E 22 0B 8F 95 FF 98 51 80 F4 0E A4 62 03 72 77 4C DE 50 79 7B 14 82 08 B5 B4 01 70 80 7C 78 D1 17 EA EB 7C BD A1 D2 3B D7 67 5F 99 7B 44 21 D9 BB A4 13 3B

Out of the line messages:
Only 240 bytes instead of 282 of the others

68 01 01 68 53 FF 00 01 67 DB 08 53 41 47 59 05 E8 B4 CB 81 F8 20 00 07 71 D3 B7 8B 38 C1 A9 F5 01 88 76 A0 98 70 9B 7D C6 4E B9 11 8E 91 6A B8 CE C0 C6 43 1D F0 DF 7C 6A 59 45 A4 DF 11 85 D0 86 94 53 75 E5 1B D9 82 6E BF CF D5 25 82 0F C5 19 A3 8F E4 BB 88 43 6F 2A DD C3 AB 92 A7 6F D5 27 29 57 D6 59 F0 06 7C FA 88 D2 09 23 11 8B 95 CF BF 3A EF D1 A0 91 7F 36 12 2B DE 48 6A C5 0C 59 A9 9A FC 45 23 CE 48 3E 9F C8 D5 70 D8 77 25 B7 7B 8D A4 99 6D 50 7F 60 81 4D AF 82 B4 92 98 2E 4C BB 6B A8 D8 D3 EE E6 78 56 D7 FB A6 2A EE 70 C4 08 C6 FF EE 40 23 51 85 10 F2 2E 22 0B 8F 95 FF 98 51 80 F4 0E A4 62 03 72 77 4C DE 50 79 7B 14 82 08 B5 B4 01 70 80 7C 78 D1 17 EA EB 7C BD A1 D2 3B D7 67 5F 99 7B 44 21 D9 BB A4 13 3B

only 64 bytes

EE 61 35 4F 62 C1 EF 42 67 E8 28 AB DA 60 88 C6 DA 11 50 12 53 8A 16 68 0D 0D 68 53 FF 11 01 67 DE 4A CC D4 33 71 4D AE 32 16 68 01 01 68 53 FF 00 01 67 DB 08 53 41 47 59 05 E8 B4 CB 81 F8 20

Any help getting this to work would be highly appreciated. python is not my language :(

rufinus commented 2 years ago

found a document describing the complete datapackage (in german) https://www.tinetz.at/fileadmin/user_upload/Kundenservice/pdf/Beschreibung_Kundenschnittstelle_Smart_Meter_TINETZ.pdf

mweimerskirch commented 2 years ago

That looks like a completely different protocol. I suggest you create an independent project for this. Feel free to use any piece of code from this project that you need. Unfortunately, I won't be able to help you as this will require a lot of time which I don't currently have. Best regards.

rufinus commented 2 years ago

yes in a sense - it is using a different container, the payload itself is exactly the same.

time to learn more python i guess - thanks for the option to "borrow" some of your code :)

mweimerskirch commented 2 years ago

This project does not interpret the payload in any way. It only decodes it and then forwards it to DSMR-Reader. That's why I would recommend creating something independent.