SzczepanLeon / esphome-components

150 stars 52 forks source link

FlowIQ2200: Short frames not decoded correctly #85

Closed anhorbc closed 8 months ago

anhorbc commented 8 months ago

Long frames (80 chars) is working perfectly.

[13:28:27][D][mbus:023]: Processing C1 B frame
[13:28:27][V][mbus:027]: Frame: 4F44372C773954233A168D206F14350E214A37BE3B3046E701073C9D0E9A1EF9D0D1924CEF06FB03D026530FEBB8BA3D16D251D537184A1888A75437C6D39385B4C911B0F9A731566FCFEA50CF6B45AE (80) [with CRC]
[13:28:27][V][mbus:165]: Validating CRC for Block1 + Block2
[13:28:27][V][crc:031]:     calculated: 0x45AE, read: 0x45AE
[13:28:27][V][mbus:062]: Frame: 4D44372C773954233A168D206F14350E214A37BE3B3046E701073C9D0E9A1EF9D0D1924CEF06FB03D026530FEBB8BA3D16D251D537184A1888A75437C6D39385B4C911B0F9A731566FCFEA50CF6B (78) [without CRC]
[13:28:27][VV][wmbus:061]: Have data from CC1101 ...
[13:28:27][D][wmbus:097]: Using driver 'flowiq2200' for ID [0x23543977] RSSI: -56 dBm LQI: 128 Frame: C1 B T: 4D44372C773954233A168D206F14350E214A37BE3B3046E701073C9D0E9A1EF9D0D1924CEF06FB03D026530FEBB8BA3D16D251D537184A1888A75437C6D39385B4C911B0F9A731566FCFEA50CF6B (78)
[13:28:27][VV][wmbus:099]: Key defined, trying to decrypt telegram ...
[13:28:27][VV][utils:109]: (ELL)  CI: 8D  offset: 17
[13:28:27][VV][utils:112]: (ELL)  IV: 372C773954233A162014350E21000000
[13:28:27][VV][utils:115]: (ELL) KEY: MY_PRIVATE_KEY (16)
[13:28:27][VV][utils:124]: (ELL) AES_CTR decrypting: 4A37BE3B3046E701073C9D0E9A1EF9D0D1924CEF06FB03D026530FEBB8BA3D16D251D537184A1888A75437C6D39385B4C911B0F9A731566FCFEA50CF6B (61)
[13:28:27][VV][utils:152]: (ELL) AES_CTR  decrypted: 77657804FF2300000000041397D501004413C7C50100426C0132023B000092013B5102A2013B000006FF1B1CB0011DC001A1015B0691015B10A101670F (61)
[13:28:27][V][wmbus:283]: Validating CRC for ELL payload
[13:28:27][V][crc:046]:     calculated: 0x6577, read: 0x6577
[13:28:27][D][wmbus:104]: Decrypted T : 4D44372C773954233A168D206F14350E2177657804FF2300000000041397D501004413C7C50100426C0132023B000092013B5102A2013B000006FF1B1CB0011DC001A1015B0691015B10A101670F (78)
[13:28:27][VV][drivers:253]: Found register '0413' with '120215'->'120.215000'
[13:28:27][VV][drivers:035]: Value added to map
[13:28:27][VV][drivers:273]: Found register '4413' with '116167'->'116.167000'
[13:28:27][VV][drivers:035]: Value added to map
[13:28:27][V][drivers:573]: Found register '04FF23' with '00000000'
[13:28:27][VV][drivers:035]: Value added to map
[13:28:27][VV][drivers:090]: Found register '023B' with '0'->'0.000000'
[13:28:27][VV][drivers:035]: Value added to map
[13:28:27][V][sensor:043]: 'Watermeter lqi': Received new state 128.000000
[13:28:27][D][sensor:094]: 'Watermeter lqi': Sending state 128.00000  with 0 decimals of accuracy
[13:28:27][V][sensor:043]: 'Watermeter RSSI': Received new state -56.000000
[13:28:27][D][sensor:094]: 'Watermeter RSSI': Sending state -56.00000 dBm with 0 decimals of accuracy
[13:28:27][V][wmbus:121]: Publishing 'status' = 0.0000
[13:28:27][V][sensor:043]: 'Watermeter Current status': Received new state 0.000000
[13:28:27][D][sensor:094]: 'Watermeter Current status': Sending state 0.00000  with 0 decimals of accuracy
[13:28:27][V][wmbus:121]: Publishing 'target_water_m3' = 116.1670
[13:28:27][V][sensor:043]: 'Watermeter Target water m3': Received new state 116.167000
[13:28:27][D][sensor:094]: 'Watermeter Target water m3': Sending state 116.16700 m³ with 3 decimals of accuracy
[13:28:27][V][wmbus:121]: Publishing 'total_water_m3' = 120.2150
[13:28:27][V][sensor:043]: 'Watermeter Total Water m3': Received new state 120.214996
[13:28:27][D][sensor:094]: 'Watermeter Total Water m3': Sending state 120.21500 m³ with 3 decimals of accuracy
[13:28:27][V][wmbus:121]: Publishing 'volume_flow_lh' = 0.0000
[13:28:27][V][sensor:043]: 'Watermeter volume flow 1h': Received new state 0.000000
[13:28:27][D][sensor:094]: 'Watermeter volume flow 1h': Sending state 0.00000 l/h with 0 decimals of accuracy

When processing short frames (compressed frames?) value of total_water_m3 is way off, and it seems that the actual correct total water m3 value is published to target_water_m3. Flow values are also way off.

[13:34:42][D][mbus:023]: Processing C1 B frame
[13:34:42][V][mbus:027]: Frame: 3644372C773954233A168D207374350E21004D1E028D95DC40E91F81359088BDF2D60344C0D1D60E6318EE642ED0E7C62427A3BF004507 (55) [with CRC]
[13:34:42][V][mbus:165]: Validating CRC for Block1 + Block2
[13:34:42][V][crc:031]:     calculated: 0x4507, read: 0x4507
[13:34:42][V][mbus:062]: Frame: 3444372C773954233A168D207374350E21004D1E028D95DC40E91F81359088BDF2D60344C0D1D60E6318EE642ED0E7C62427A3BF00 (53) [without CRC]
[13:34:42][VV][wmbus:061]: Have data from CC1101 ...
[13:34:42][D][wmbus:097]: Using driver 'flowiq2200' for ID [0x23543977] RSSI: -56 dBm LQI: 128 Frame: C1 B T: 3444372C773954233A168D207374350E21004D1E028D95DC40E91F81359088BDF2D60344C0D1D60E6318EE642ED0E7C62427A3BF00 (53)
[13:34:42][VV][wmbus:099]: Key defined, trying to decrypt telegram ...
[13:34:42][VV][utils:109]: (ELL)  CI: 8D  offset: 17
[13:34:42][VV][utils:112]: (ELL)  IV: 372C773954233A162074350E21000000
[13:34:42][VV][utils:115]: (ELL) KEY: MY_PRIVATE_KEY (16)
[13:34:42][VV][utils:124]: (ELL) AES_CTR decrypting: 004D1E028D95DC40E91F81359088BDF2D60344C0D1D60E6318EE642ED0E7C62427A3BF00 (36)
[13:34:42][VV][utils:152]: (ELL) AES_CTR  decrypted: 1C1D79F3A9E1A30000000097D50100C7C5010001320000510200001CB0011DC00106100F (36)
[13:34:42][V][wmbus:283]: Validating CRC for ELL payload
[13:34:42][V][crc:046]:     calculated: 0x1D1C, read: 0x1D1C
[13:34:42][D][wmbus:104]: Decrypted T : 3444372C773954233A168D207374350E211C1D79F3A9E1A30000000097D50100C7C5010001320000510200001CB0011DC00106100F (53)
[13:34:42][VV][drivers:052]: Found total_water with '29367553'->'29367.553000'
[13:34:42][VV][drivers:035]: Value added to map
[13:34:42][VV][drivers:070]: Found target_water with '120215'->'120.215000'
[13:34:42][VV][drivers:035]: Value added to map
[13:34:42][VV][drivers:088]: Found status with '00000000'
[13:34:42][VV][drivers:035]: Value added to map
[13:34:42][VV][drivers:105]: Found volume_flow with '45084'->'45084.000000'
[13:34:42][VV][drivers:035]: Value added to map
[13:34:42][VV][drivers:122]: Found max_flow with '50631'->'50631.000000'
[13:34:42][VV][drivers:035]: Value added to map
[13:34:42][V][sensor:043]: 'Watermeter lqi': Received new state 128.000000
[13:34:42][D][sensor:094]: 'Watermeter lqi': Sending state 128.00000  with 0 decimals of accuracy
[13:34:42][V][sensor:043]: 'Watermeter RSSI': Received new state -56.000000
[13:34:42][D][sensor:094]: 'Watermeter RSSI': Sending state -56.00000 dBm with 0 decimals of accuracy
[13:34:42][V][wmbus:121]: Publishing 'max_flow_lh' = 50631.0000
[13:34:42][V][sensor:043]: 'Watermeter max flow 1h': Received new state 50631.000000
[13:34:42][D][sensor:094]: 'Watermeter max flow 1h': Sending state 50631.00000 l/h with 0 decimals of accuracy
[13:34:42][V][wmbus:121]: Publishing 'status' = 0.0000
[13:34:42][V][sensor:043]: 'Watermeter Current status': Received new state 0.000000
[13:34:42][D][sensor:094]: 'Watermeter Current status': Sending state 0.00000  with 0 decimals of accuracy
[13:34:42][V][wmbus:121]: Publishing 'target_water_m3' = 120.2150
[13:34:42][V][sensor:043]: 'Watermeter Target water m3': Received new state 120.214996
[13:34:42][D][sensor:094]: 'Watermeter Target water m3': Sending state 120.21500 m³ with 3 decimals of accuracy
[13:34:42][V][wmbus:121]: Publishing 'total_water_m3' = 29367.5530
[13:34:42][V][sensor:043]: 'Watermeter Total Water m3': Received new state 29367.552734
[13:34:42][D][sensor:094]: 'Watermeter Total Water m3': Sending state 29367.55273 m³ with 3 decimals of accuracy
[13:34:42][V][wmbus:121]: Publishing 'volume_flow_lh' = 45084.0000
[13:34:42][V][sensor:043]: 'Watermeter volume flow 1h': Received new state 45084.000000
[13:34:42][D][sensor:094]: 'Watermeter volume flow 1h': Sending state 45084.00000 l/h with 0 decimals of accuracy
SzczepanLeon commented 8 months ago

Seems that there is more than one format for compressed frame. I will disable readings from compressed frames. Disabled in v 3.2.1

Will be handled via https://github.com/SzczepanLeon/esphome-components/issues/86