diyruz / flower

DIY Zigbee flower sensor
https://modkam.ru/?p=1700
GNU General Public License v3.0
388 stars 79 forks source link

Help writing groovy device driver #28

Open AutomateMyLifee opened 3 years ago

AutomateMyLifee commented 3 years ago

I'm trying to get this sensor working with the Smartthings/Hubitat platform. It paired easily to the hub, but I had to create my own driver. So far I have the sensors accurately reporting battery and values from BME280 (temp, humid, and pressure), but I can't get the sensor to send the correct values for the soil moisture. These are the commands I sent to configure the device so it sends data. Screenshot from 2021-06-23 18-43-03 But the soil cluster (0408) is sending the attribute 0201 instead of 0000. I had it reporting the soil moisture at one point, but I must be sending the wrong config because now it stopped sending the correct value. I checked all source code best I could, but I don't really have experience with ZigBee firmware. What am I doing wrong with the config command? Screenshot from 2021-06-23 18-59-20

bojanpotocnik commented 3 years ago

I think the problem may actually be in the SmartThings/Hubitat.

All working clusters IDs are defines from zcl.h, that is standard ZCL General Clusters or ZCL Measurement & Sensing Clusters (there is also a reference to the same ZCL standard on the SmartThings page).

SOIL_HUMIDITY cluster is not part of the ZCL v7 specification, that is why its ID is the only one manually typed in source, instead of using define from zcl.h. Consequently it is also not present within SmartThings Capabilities.

ZigBee Cluster Library Specification:

So the behaviour is correct and per-specs: because Soil Humidity is not yet supported in the Zigbee standard, author chose vendor defined Relative Humidity type 0x0201 out of range 0x0200-0xFFFE for vendor defined types.

bojanpotocnik commented 3 years ago

@AutomateMyLifee try with the new release 2.1.0, if there will be any difference.

AutomateMyLifee commented 3 years ago

I haven't found any more success. The new firmware give the same behavior, except there is some warning about the endpoint 2. So you are saying that the value from cluster 0x0408 and attribute 0x0201 should give soil humidity? I tried putting the sensor in water and in air and this value stays basically the same. Isn't it in the source code that the attribute should MeasuredValue, which is 0x0000?