Closed portexst closed 9 months ago
Here I see partial data:
It seems that not all frames are with voltage etc
Please capture frame with voltage.
Hello,
23:54:04 | [I] | [wmbus:078] | Using driver 'amiplus' for ID [0x56693928] RSSI: -86 dBm LQI: 128 Mode: T1 T: 7E4401062839695601027A181070059887A3F804E4A19584254C3D5E075120E3EAB018A93ABB17F53009EA9174B6ABEBF3325DA7808CF44186215F41C0EBA284902E5B1ADFDC01F7CDAF64A6AE62CFE6C4904371AC1DFE928085303309A03B48074FC5AFCAEF3D2DC07F211489197B025A7A7C70A0E67C1A8B63AF8EDDFB9D (127)
23:54:04 | [D] | [wmbus:090] | Decrypted T : 7E4401062839695601027A181070052F2F0E037460590000008E10037460590000008E20030000000000008E30030000000000000E833C4202000000008E1084902E5B1ADFDC01F7CDAF64A6AE62CFE6C4904371AC1DFE928085303309A03B48074FC5AFCAEF3D2DC07F211489197B025A7A7C70A0E67C1A8B63AF8EDDFB9D (127)
23:54:04 | [D] | [sensor:093] | '0x56693928 Energy meter lqi': Sending state 128.00000 with 0 decimals of accuracy
23:54:04 | [D] | [sensor:093] | '0x56693928 Energy meter rssi': Sending state -86.00000 dBm with 0 decimals of accuracy
23:54:04 | [D] | [sensor:093] | '0x56693928 Energy meter total energy consumption kwh': Sending state 596.07397 kwh with 3 decimals of accuracy
23:54:04 | [D] | [sensor:093] | '0x56693928 Energy meter total energy production': Sending state 0.24200 kwh with 3 decimals of accuracy
23:54:04 | [W] | [component:204] | Component wmbus took a long time for an operation (0.10 s).
23:54:04 | [W] | [component:205] | Components should block for at most 20-30ms.
Hello, same issue for me. I think this is connected with decription bug because last 16 bytes in frame was not decrypted.
Received frame frame: 4E44B6101373250000027A0B0040050FBB06B505DDB02FB3CDB7968762BEDFCE0816D585F8991CF2819482F210B48ABCE44BEA5629AF9C0D607A6873E4F1C7 854FF18EECD57D41BC871D9123BE6FF5
Decrypted frame by wmbus: 4E44B6101373250000027A0B0040052F2F0C7814981300066D0072131131400E039582590500000E833C0000000000000B2B0203000BAB3C0000000AFDC9FC 854FF18EECD57D41BC871D9123BE6FF5
Decrypted frame by wmbusmeters: 4E44B6101373250000027A0B0040052F2F0C7814981300066D0072131131400E039582590500000E833C0000000000000B2B0203000BAB3C0000000AFDC9FC 0145020BABC8FC100000002F2F2F2F2F
I put space before last of 16 bytes in each frame to visualise it.
Great findings. I will check it.
@SzczepanLeon it was related to _tpl_num_encrblocks in wmbus-lib/utils.cpp. If I commented one if function, it works fine (i know it was only workaround):
// if (tpl_num_encr_blocks) {
// num_bytes_to_decrypt = tpl_num_encr_blocks*16;
// }
[21:09:59][VV][wmbus:126]: Publishing 'voltage_at_phase_1_v' = 245.0000
[21:09:59][V][sensor:043]: '0x257313 Tauron L1 Voltage': Received new state 245.000000
[21:09:59][D][sensor:094]: '0x257313 Tauron L1 Voltage': Sending state 245.00000 V with 0 decimals of accuracy
[21:09:59][V][json:038]: Attempting to allocate 512 bytes for JSON serialization
[21:09:59][V][json:058]: Size after shrink 88 bytes
[21:09:59][VV][api.service:140]: send_sensor_state_response: SensorStateResponse {
key: 4033323085
state: 245
missing_state: NO
}
@SzczepanLeon it was related to tpl_num_encr_blocks in wmbus-lib/utils.cpp
Probably bug is here: https://github.com/SzczepanLeon/wMbus-lib/blob/main/utils.cpp#L53
I will fix it tomorrow.
@SzczepanLeon it was related to tpl_num_encr_blocks in wmbus-lib/utils.cpp
Probably bug is here: https://github.com/SzczepanLeon/wMbus-lib/blob/main/utils.cpp#L53
I will fix it tomorrow.
I fix it based on code from wmbusmetes, but i'm not sure if it is good solution.
uint16_t tpl_cfg = ((uint32_t)frame[14] << 8) | ((uint32_t)frame[13]);
uint8_t tpl_num_encr_blocks = (tpl_cfg >> 4) & 0x0f;
if (tpl_num_encr_blocks) {
num_bytes_to_decrypt = tpl_num_encr_blocks*16;
}
but i'm not sure if it is good solution
Should be OK.
uint8_t tpl_num_encr_blocks = ((uint8_t)frame[13] >> 4) & 0x0f;
Should be enough.
@ficueu @portexst Please try version 2.5.0
Not working - same issue with encrypted and decrypted telegram:
Received: 4E44B6101373250000027AD70040052F8171BF536389B8E1A215177DEE0777AA46CCA722A65B32AFEF4548F4CF48FFD068AB8818B56B898A8802418F397D95 22ECCDCC64FB6337F07459C8C109AF8F
Decrypted: 4E44B6101373250000027AD70040052F2F0C7814981300066D004E171131400E036593590500000E833C0000000000000B2B6702000BAB3C0000000AFDC9FC 22ECCDCC64FB6337F07459C8C109AF8F
Compilation with code posted https://github.com/SzczepanLeon/esphome-components/issues/52#issuecomment-1896662841 works great.
Maybe issue is related to mistakes in wmbus-lib versions (not direct in code):
Library Manager: Installing git+https://github.com/SzczepanLeon/wMbus-lib#1.4.7
INFO Installing git+https://github.com/SzczepanLeon/wMbus-lib#1.4.7
git version 2.39.2
Cloning into '/data/cache/platformio/cache/tmp/pkg-installing-67cvvkk_'...
Note: switching to '52ec461d97bd40060bd01437fb4d974d9401335f'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
Library Manager: wMbus-lib@1.4.6+sha.52ec461 has been installed!
INFO wMbus-lib@1.4.6+sha.52ec461 has been installed!
@SzczepanLeon tested today, now reading voltage works fine, thanks.
Great
Hello, I am trying to configure the amiplus meter but for some reason I can read only:
I cannot read current_power_production_kw, current_power_consumption_kw, voltage_at_phase_1_v, voltage_at_phase_2_v, voltage_at_phase_3_v sesnors.
I have checked https://wmbusmeters.org/ and when I put telegram and my decryption key I am able to read all information:
In the esphome log I have found this:
Here is my configuration:
Could you help me with this issue?