bernikr / esphome-wienernetze-im150-smartmeter

5 stars 1 forks source link

AM550 esphome custom component #4

Open rippinsail opened 2 months ago

rippinsail commented 2 months ago

Hi, I have an AM550 smartmeter by WienerNetze which needs a decryption key. I already managed to receive the encrypted IR data in realtime with ESPhome and also to manually decrypt the enrypted data blocks by using code snippets from this repository: https://github.com/tofuSCHNITZEL/wiener_netze_smartmeter.git

My next step would be to write a custom component for ESPhome which I never did before. I just found that you already did that (just not for the AM550) and it would be an honor for me to do some collaboration on that topic. Thanks

bernikr commented 2 months ago

I don't really remember why I wrote that tthhe 550 is unsupported, but you could try my component and add

logger:
  level: VERBOSE

to your esp config to see what parts work.

rippinsail commented 2 months ago

great, thanks a lot, I will try it this week and let you know about the outcome

rippinsail commented 2 months ago

Hi, I activated verbose logs and received the following below. The encryption key is correct, I managed to decrypt plausible data with my manual python script. Thankful for any advice. cheers

[23:45:56][V][im150:021]: raw recieved data: 7E.A0.67.CF.02.23.13.FB.F1.E6.E7.00.DB.08.49.53.4B.68.75.36.86.4B.4F.20.02.72.AB.D9.D5.90.08.84.CA.34.17.71.6D.50.4A.5D.16.C7.E3.B7.15.F0.A1.D0.F0.0E.15.9B.C7.58.F3.D2.38.DD.8D.B9.48.2D.DA.12.E1.52.EA.2F.4A.59.2B.26.6E.D4.36.59.A6.17.B8.70.81.54.6B.29.1B.DA.41.FE.DF.78.3F.86.C4.5A.B1.42.EB.4A.32.2C.95.89.EE.F9.7E (105) [23:45:56][W][im150:054]: Unknown smartmeter model, support is untested. [23:45:56][W][im150:055]: Please open a GitHub issue:

[23:45:56][V][im150:078]: decrypted data: 68.B0.6B.98.75.C1.6C.FC.E4.3F.36.24.C1.54.89.0F.31.07.41.15.50.3E.30.69.07.E1.A5.EA.5C.F9.3F.A4.12.82.E4.C2.41.74.E5.8F.5D.4F.F3.A2.89.0C.21.A8.18.40.E7.85.70.44.EC.AF.D3.E4.D9.84.05.8D.B6.29.EE.92.15.B6.A3.15.05.92 (72) [23:45:56][W][im150:084]: decryption error, please check if your key is correct [23:45:57][D][uart_debug:114]: <<< 7E:A0:67:CF:02:23:13:FB:F1:E6:E7:00:DB:08:49:53:4B:68:75:36:86:4B:4F:20:02:72:AB:DA:F1:33:DF:89:9D:32:1D:09:1B:60:BF:9B:BB:C5:00:22:2B:63:60:BA:1C:70:FB:61:06:0E:BA:1A:87:FD:D5:71:E3:AD:03:F4:F6:6C:B0:42:61:9E:40:E2:9D:F7:4C:3E:4F:53:3D:C0:D6:88:0E:D3:27:54:23:6A:5F:6C:0B:91:52:FF:2B:A8:DC:DD:7C:69:DC:47:79:27:7E [23:45:57][V][im150:021]: raw recieved data: 7E.A0.67.CF.02.23.13.FB.F1.E6.E7.00.DB.08.49.53.4B.68.75.36.86.4B.4F.20.02.72.AB.DA.F1.33.DF.89.9D.32.1D.09.1B.60.BF.9B.BB.C5.00.22.2B.63.60.BA.1C.70.FB.61.06.0E.BA.1A.87.FD.D5.71.E3.AD.03.F4.F6.6C.B0.42.61.9E.40.E2.9D.F7.4C.3E.4F.53.3D.C0.D6.88.0E.D3.27.54.23.6A.5F.6C.0B.91.52.FF.2B.A8.DC.DD.7C.69.DC.47.79.27.7E (105)

rippinsail commented 2 months ago

forked your repo and did some little trials but I think I am to tired now to go on, haha, last debug output:

[03:29:49][V][am550:021]: raw recieved data: 7E.A0.67.CF.02.23.13.FB.F1.E6.E7.00.DB.08.49.53.4B.68.75.36.86.4B.4F.20.02.72.E0.52.A5.F2.AE.D5.FF.C0.B3.0F.26.D2.E2.4B.AC.2D.B2.2F.08.30.CA.BA.A9.8F.12.D5.47.57.EC.8B.E2.B0.25.C2.CF.DC.D4.46.76.39.B9.22.38.09.B2.E5.33.63.1D.21.4D.AA.CC.A4.A4.94.E6.A0.D5.45.B9.6C.72.67.E1.1D.96.59.DC.8E.09.8B.5E.34.BB.1B.BE.6E.7E (105)

[03:29:49][V][am550:081]: decrypted data: 59.80.BE.68.DB.27.F9.1D.26.48.C7.16.51.8D.E2.DF.EC.3D.53.A5.D4.17.4A.04.4C.89.49.01.96.82.1C.41.7D.8F.AA.D6.55.6A.36.35.E8.71.EE.D9.AF.D6.3F.A7.69.E8.73.22.FA.76.33.23.61.99.55.B3.97.34.C1.45.35.00.03.82.2D.0C.20.DF (72) [03:29:49][V][am550:084]: Checking decrypted message byte 0: 59 [03:29:49][V][am550:085]: Checking decrypted message byte msglen-5: 82 [03:29:49][V][am550:086]: Checking decrypted message byte msglen-10: c1 [03:29:49][V][am550:087]: Checking decrypted message byte msglen-15: 99 [03:29:49][V][am550:088]: Checking decrypted message byte msglen-20: fa [03:29:49][V][am550:089]: Checking decrypted message byte msglen-25: a7 [03:29:49][V][am550:090]: Checking decrypted message byte msglen-30: ee [03:29:49][V][am550:091]: Checking decrypted message byte msglen-35: 6a [03:29:49][V][am550:092]: Checking decrypted message byte msglen-40: 7d [03:29:49][W][am550:098]: decryption error, please check if your key is correct