DomiStyle / esphome-dlms-meter

ESPHome component to read out DLMS smart meters via M-Bus
MIT License
102 stars 26 forks source link

Decryption key format #34

Open valki2 opened 1 year ago

valki2 commented 1 year ago

Hi! For those who get problems when decrypting:

when your key is 32 digits like D658345DF620A2839E5AD6A6D1B85135

then you have to fill each pair of the key into the 0x00 format... like:

0xD6, 0x58, 0x34, 0x5D, 0xF6, 0x20, 0xA2, 0x83, 0x9E, 0x5A, 0xD6, 0xA6, 0xD1, 0xB8, 0x51, 0x35

Have fun!

ert666 commented 11 months ago

@valki2 So your code would be... ... uint8_t key[] = {0xD6, 0x58, 0x34, 0x5D, 0xF6, 0x20, 0xA2, 0x83, 0x9E, 0x5A, 0xD6, 0xA6, 0xD1, 0xB8, 0x51, 0x35}; dlms_meter->set_key(key, 32; // Pass your decryption key and key length here ... ?

kenci commented 10 months ago

@ert666 no, it should be dlms_meter->set_key(key, 16); because there are 16 bytes.