Skip to content

Conversation

@3reality-support
Copy link
Contributor

@3reality-support 3reality-support commented Oct 9, 2025

Proposed change

This PR added adaptation code for soil sensor and added 3 additional private clusters

  1. temperature_correction_fahrenheit: Calibrate Fahrenheit
  2. temperature_correction_celsius: Calibrate Celsius
  3. humidity_correction: Calibrate humidity
  4. The two types of temperature calibration are separated, making it convenient for users to calibrate according to their own needs

Additional information

dd1c7c38-0aad-4679-8668-65288966085e

Device diagnostics

Checklist

  • The changes are tested and work correctly
  • pre-commit checks pass / the code has been formatted using Black
  • Tests have been added to verify that the new code works
  • Device diagnostics data has been attached

@codecov
Copy link

codecov bot commented Oct 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.19%. Comparing base (500e74e) to head (0069b18).
⚠️ Report is 19 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #4380      +/-   ##
==========================================
+ Coverage   92.12%   92.19%   +0.06%     
==========================================
  Files         358      366       +8     
  Lines       11917    12019     +102     
==========================================
+ Hits        10979    11081     +102     
  Misses        938      938              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TheJulianJES TheJulianJES added the manufacturer This request was made by the device's manufacturer label Oct 10, 2025
Comment on lines +21 to +31
temperature_correction_fahrenheit: Final = ZCLAttributeDef(
id=0x0033,
type=t.int16s,
is_manufacturer_specific=True,
)

temperature_correction_celsius: Final = ZCLAttributeDef(
id=0x0031,
type=t.int16s,
is_manufacturer_specific=True,
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this device (also) have a display or why is the temperature correction for Celsius and Fahrenheit separate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no display screen, and the reason for separating Celsius and Fahrenheit is that some users use Celsius and Fahrenheit, so they can calibrate freely according to the unit without the need for additional conversion

- move `cluster_id`
- add device classes
- rename "calibration" to "offset"
@TheJulianJES
Copy link
Collaborator

TheJulianJES commented Oct 28, 2025

If we add the temperature device class two the two temperature offset entities, I believe HA switches the entities to be in the preferred unit for the user.

  1. Can you explain the difference for temperature C° and F° correction for all devices?
  2. How/when is which option applied? Which one is used for ZCL vs which one is used for display? Or are both used for the display?
  3. Can we just remove the "Fahrenheit" option and only keep the "Celsius" option (as it's similar to how temperature is represented within ZCL)? If we name it "Temperature offset" and set the device class, HA should show the preferred unit for the user.

Also see:

@3reality-support
Copy link
Contributor Author

3reality-support commented Oct 29, 2025

If we add the temperature device class two the two temperature offset entities, I believe HA switches the entities to be in the preferred unit for the user.

  1. Can you explain the difference for temperature C° and F° correction for all devices?
  2. How/when is which option applied? Which one is used for ZCL vs which one is used for display? Or are both used for the display?
  3. Can we just remove the "Fahrenheit" option and only keep the "Celsius" option (as it's similar to how temperature is represented within ZCL)? If we name it "Temperature offset" and set the device class, HA should show the preferred unit for the user.

Also see:

There is no difference between temperature C ° and F °. Setting one of them will convert the other into the corresponding value according to the formula, just for the convenience of the user. If it is possible to achieve the same calibration unit as the temperature unit set by the user, it would be even better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manufacturer This request was made by the device's manufacturer waiting for reply Waiting for a reply (e.g. to test a custom quirk)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants