Replies: 1 comment
-
@jacekk015 if you have little time between tuya DP device coding i think this one is easy for you to fixing. Adding one new attribute that can being setted and the quirk is using it for calculating one corrected sensor reading to ZHA. I think for normal Zigbee device is OK putting it in the quirk INIT but i believe that tuya DP device need having one extra in there quirk for it to working on them. Only that you have time between your coding marathons. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Some user have manager implementing calibration of tuya TRV local temperature in quirk with nice slider for changing the correction + - 10.0° in 0.1° steps.
That is using one new cluster for doing the calibration with GUI but i think for this is not needed implementation just adding one new attribute to the sensor cluster (perhaps attribute 0x8000 ?) and zigpy is saving it in the DB and the quirk is using the save value for correcting the received attribute.
If the value is not set (none) the quirk shall using 0 and not throwing errors (its doing that today in the test quirk).
I have 2 sensors that is needing this on its sensor clusters:
zha-device-handlers/zhaquirks/philips/motion.py
Lines 99 to 100 in fbee5ba
and
zha-device-handlers/zhaquirks/xiaomi/aqara/weather.py
Lines 82 to 84 in fbee5ba
I think its easy implementing in the quirk or in the quirk init but shall it being implanted in the zha_quirk init so all sensor is getting the same function if using the new cluster ?
Many devices have getting functions corrected in the zha_quirk init like battery reporting only with voltage or reporting 100% instead of 200% battery renaming so i think its better doing it there then in all devices quirks.
Do some have other ideas how to correcting sensor data reported to ZHA ?
My feeling is that it shall being made in the lower part so the data sent to HA is "fixed" and not saving / using bad data in HA.
GUI in ZHA for setting the offset ?
Using manufacture code for the attribute (looks being over kill if making it for all sensors and not only Xiaomi) ?
Putting it in zigpy can being one alternative but its making zigpy little dirty so perhaps better in zha_quirks.
Also for different sensor classes how shall the limes being ?
Temperature + - 10.0° with 0.1° looks OK for my.
Pressure + - ?
Humidity + - ?
Illuminance + - ?
and so on.
More thinking and feed back is very welcome !!
Beta Was this translation helpful? Give feedback.
All reactions