dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.9k stars 498 forks source link

Configure attribute reporting for `float` attributes #6904

Open ebaauw opened 1 year ago

ebaauw commented 1 year ago

Describe the bug

Neither the GUI nor DDF definitions handle correctly the configuration of attribute reporting for attributes of type float (0x39). The Reportable Change needs to be encoded as a iEEE-754 16-bits floating point number (see e.g. the online IEEE-754 Floating Point Converter), but both the GUI and DDF encode the value specified as 16-bit integer.

When entering a Reportable Change value of 1, the GUI sends a Configure Reporting command with value 10 00 00 00, which is 0x00000001 or 1 as integer, but 1.4013e-45 as floating point. When receiving a Read Reporting Configuration Response, Reportable Change remains empty.
When entering 1065353216, the GUI sends 00 00 80 3f, which is 0x3F800000 as integer, but 1 as as floating point. When reading back the configuration, Reportable Change still remains empty, but the Sniffer confirms that the correct value has been set.

In the DDF binding[]/report/change needs to be specified as hex string. The logic behind the DDF also encodes this as an integer value, instead of a floating point value. So for a value of 1, you need to specify 0x3F80000.

Steps to reproduce the behavior

See the Zigbee sniffer.

Expected behavior

The GUI should display and accept numeric float values.

The DDF should accept JavaScript number values.

Screenshots

n/a

Environment

deCONZ Logs

n/a

Additional context

ZCL v8 defines several Concentration Measurement clusters with Measured Value (0x0000) as float and reportable. Notably PM2.5 Measurement (0x040B) and IKEA-specific TVOC Measurement (0xFC7E) on the IKEA VINDSTYRKA.

github-actions[bot] commented 1 year ago

As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

ebaauw commented 1 year ago

Bump