I'm trying to write my own driver for a Sonoff SNZB-02 temp humidity sensor. I know there is a built in driver but I want to add some "extras" to the driver.
Specifically I want to understand the data encoding or data type. In the below messages the temperature (0402) is of data type 29 (Signed 16-bit integer) and the humidity (0405) is of type 21 (Unigned 16-bit integer)
However in the past I've ignored the encoding/data type with positive results. I've seen in other code Groovy is forgiving of not specifying data types. And things like "state variables" are really string, however we can read state variables as numbers.
Question is: do we really care about message data encoding? Or does the Hubitat groovy simple take care of it?
Thanks
John
Raw Description= read attr - raw: A5DE0104020A0000292409, dni: A5DE, endpoint: 01, cluster: 0402, size: 0A, attrId: 0000, encoding: 29, command: 0A, value: 2409
Raw Description= read attr - raw: A5DE0104050A0000212616, dni: A5DE, endpoint: 01, cluster: 0405, size: 0A, attrId: 0000, encoding: 21, command: 0A, value: 2616