2 years ago, I developed a custom Handler for the Fibaro FGK-101 which at that time was not supported at all by SmartThings.
I posted this Handler on github and made it available to the SmartThings community.
So when one of the users reported it was not working with his new Z-Wave+, aka ZW5, version of the FGK-101, I investigated and decided to fix my Handler… if I could.
Several months later, this (supposedly) “easy” fix turned into a nightmare.
The latest problem is that the temperature reports I get from the FGK-101+DS18B20 are sometimes right, sometimes buggy, but close enough to be misleading.
It all depends who initiated the SensorMultilevelReport() :
- if “spontaneous”, initiated by the FGK-101 itself (every 4 hours, or when temperature difference is greater than 0.3°C), the reported temperature values are correct
- if an answer to an asynchronous SensorMultilevelGet() from the Handler, the temperature value is different from the one above by about 1°C, sometimes in excess, sometimes below.
Furthermore, sometimes the SensorMultilevelReport() returns CRC16 encoded, sometimes it is plain (with the SAME SensorMultilevelGet() call !).
See for example the trace below : all 24.25°C reported values (cmd.scaledSensorValue) are actually buggy, [16:10:44, 15:56:02, 15:56:01, 15:27:36, 15:27:35] although 1°C close to the other, correct, temperature values reported less than 1 second after.
Sorry, entries are missing randomly in that trace, because log.debug drops randomly entries (due to race conditions ?).
> 94d60b86-4430-41df-807b-a24d03e2fbee 16:28:13: debug cmd.scaledSensorValue : 23.81
> 94d60b86-4430-41df-807b-a24d03e2fbee 16:28:13: debug CRC16.......... cmd : Crc16Encap(checksum: 32004, command: 5, commandClass: 49, data: [1, 66, 9, 77])
> 94d60b86-4430-41df-807b-a24d03e2fbee 16:28:13: debug Parsing... 'zw device: 18, command: 5601, payload: 31 05 01 42 09 4D 7D 04 '
> 94d60b86-4430-41df-807b-a24d03e2fbee 16:23:59: debug Parsed Crc16Encap(checksum: 18759, command: 5, commandClass: 49, data: [1, 66, 9, 108]) to null
> 94d60b86-4430-41df-807b-a24d03e2fbee 16:23:59: debug SensorMultilevelReport.scaledSensorValue : 24.12
> 94d60b86-4430-41df-807b-a24d03e2fbee 16:23:59: debug CRC16.......... cmd : Crc16Encap(checksum: 18759, command: 5, commandClass: 49, data: [1, 66, 9, 108])
> 94d60b86-4430-41df-807b-a24d03e2fbee 16:23:41: debug Parsed SensorMultilevelReport(precision: 2, scale: 0, scaledSensorValue: 23.93, sensorType: 1, sensorValue: [9, 89], size: 2) to null
> 94d60b86-4430-41df-807b-a24d03e2fbee 16:23:41: debug cmd.scaledSensorValue : 23.93
> 94d60b86-4430-41df-807b-a24d03e2fbee 16:23:41: debug Parsing... 'zw device: 18, command: 3105, payload: 01 42 09 59 '
> 94d60b86-4430-41df-807b-a24d03e2fbee 16:10:45: debug cmd.scaledSensorValue : 23.31
> 94d60b86-4430-41df-807b-a24d03e2fbee 16:10:45: debug Parsing... 'zw device: 18, command: 3105, payload: 01 42 09 1B '
> **94d60b86-4430-41df-807b-a24d03e2fbee 16:10:44: debug cmd.scaledSensorValue : 24.25**
> 94d60b86-4430-41df-807b-a24d03e2fbee 16:10:44: debug Parsing... 'zw device: 18, command: 3105, payload: 01 42 09 79 '
> 94d60b86-4430-41df-807b-a24d03e2fbee 15:59:15: debug cmd.scaledSensorValue : 23.25
> 94d60b86-4430-41df-807b-a24d03e2fbee 15:59:15: debug Parsing... 'zw device: 18, command: 3105, payload: 01 42 09 15 '
> 94d60b86-4430-41df-807b-a24d03e2fbee 15:56:02: debug Parsed SensorMultilevelReport(precision: 2, scale: 0, scaledSensorValue: 24.25, sensorType: 1, sensorValue: [9, 121], size: 2) to null
> **94d60b86-4430-41df-807b-a24d03e2fbee 15:56:02: debug cmd.scaledSensorValue : 24.25**
> 94d60b86-4430-41df-807b-a24d03e2fbee 15:56:02: debug Parsing... 'zw device: 18, command: 3105, payload: 01 42 09 79 '
> **94d60b86-4430-41df-807b-a24d03e2fbee 15:56:01: debug cmd.scaledSensorValue : 24.25**
> 94d60b86-4430-41df-807b-a24d03e2fbee 15:56:01: debug Parsing... 'zw device: 18, command: 3105, payload: 01 42 09 79 '
> 94d60b86-4430-41df-807b-a24d03e2fbee 15:43:40: debug cmd.scaledSensorValue : 23.18
> 94d60b86-4430-41df-807b-a24d03e2fbee 15:43:40: debug CRC16.......... cmd : Crc16Encap(checksum: 1443, command: 5, commandClass: 49, data: [1, 66, 9, 14])
> 94d60b86-4430-41df-807b-a24d03e2fbee 15:32:41: debug Parsed SensorMultilevelReport(precision: 2, scale: 0, scaledSensorValue: 23.18, sensorType: 1, sensorValue: [9, 14], size: 2) to null
> 94d60b86-4430-41df-807b-a24d03e2fbee 15:32:41: debug SensorMultilevelReport.scaledSensorValue : 23.18
> 94d60b86-4430-41df-807b-a24d03e2fbee 15:32:41: debug Parsing... 'zw device: 18, command: 3105, payload: 01 42 09 0E '
> 94d60b86-4430-41df-807b-a24d03e2fbee 15:28:04: debug Parsed Crc16Encap(checksum: 32004, command: 5, commandClass: 49, data: [1, 66, 9, 77]) to ['displayed':true, 'value':'23.8', 'isStateChange':true, 'linkText':JJ's ZW5, 'name':'temperature', 'unit':'C', 'descriptionText':JJ's ZW5 temperature is 23.8°C]
> 94d60b86-4430-41df-807b-a24d03e2fbee 15:28:04: debug ftemp : 23.8
> 94d60b86-4430-41df-807b-a24d03e2fbee 15:28:04: debug CRC16.......... cmd : Crc16Encap(checksum: 32004, command: 5, commandClass: 49, data: [1, 66, 9, 77])
> **94d60b86-4430-41df-807b-a24d03e2fbee 15:27:36: debug SensorMultilevelReport.scaledSensorValue : 24.25**
> 94d60b86-4430-41df-807b-a24d03e2fbee 15:27:36: debug Parsing... 'zw device: 18, command: 3105, payload: 01 42 09 79 '
> 94d60b86-4430-41df-807b-a24d03e2fbee 15:27:35: debug Parsed SensorMultilevelReport(precision: 2, scale: 0, scaledSensorValue: 24.25, sensorType: 1, sensorValue: [9, 121], size: 2) to ['displayed':true, 'value':'24.3', 'isStateChange':true, 'linkText':JJ's ZW5, 'name':'temperature', 'unit':'C', 'descriptionText':JJ's ZW5 temperature is 24.3°C]
> **94d60b86-4430-41df-807b-a24d03e2fbee 15:27:35: debug cmd.scaledSensorValue : 24.25**
> 94d60b86-4430-41df-807b-a24d03e2fbee 15:27:35: debug SensorMultilevelReport.sensorValue : [9, 121]
> 94d60b86-4430-41df-807b-a24d03e2fbee 15:27:35: debug Parsing... 'zw device: 18, command: 3105, payload: 01 42 09 79 '
At the beginning, I thought the problem was in my Handler; then I suspected some faulty DS18B20 and replaced it : no improvement.
At that point I suspect some subtle bug in SmartThings parsing routines, but I cannot submit a Bug Report to SmartThings Support, since they reject immediately anything related to a Custom Handler.
So my question is : has anybody ever seen something similar ?
Do you have any suggestion on a workaround or a way to refine the source of the problem ?