Skip to content

Add Third Reality watering kit options #3926

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 26, 2025
Merged

Conversation

hwzolin
Copy link
Contributor

@hwzolin hwzolin commented Mar 4, 2025

Proposed change

Additional information

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

Copy link

codecov bot commented Mar 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.12%. Comparing base (b87ac89) to head (460cf89).
Report is 11 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #3926      +/-   ##
==========================================
+ Coverage   91.00%   91.12%   +0.11%     
==========================================
  Files         328      334       +6     
  Lines       10656    10787     +131     
==========================================
+ Hits         9698     9830     +132     
+ Misses        958      957       -1     

☔ 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 v2 quirk Quirks using v2 API. Might add custom entities that need translation keys in HA. label Mar 22, 2025
Copy link
Collaborator

@TheJulianJES TheJulianJES left a comment

Choose a reason for hiding this comment

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

I'll push the suggested changes myself.

Please keep in mind the correct capitalization needed for HA entities for future PRs:
Due to HA naming conventions, only the first letter of an entity name should be upper-case (except for abbreviations). So it should be "Water duration" instead of "Water Duration", for example.

Copy link
Collaborator

@TheJulianJES TheJulianJES left a comment

Choose a reason for hiding this comment

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

Also, please use more descriptive PR titles for future PRs.
Examples for this PR:

  • "Add Third Reality watering kit options"
  • "Add Third Reality watering kit entities"
  • "Add Third Reality watering kit configuration"

@TheJulianJES TheJulianJES changed the title Modify the private cluster of the watering kit. Add Third Reality watering kit options Mar 26, 2025
@hwzolin
Copy link
Contributor Author

hwzolin commented Mar 26, 2025

I'll push the suggested changes myself.

Please keep in mind the correct capitalization needed for HA entities for future PRs: Due to HA naming conventions, only the first letter of an entity name should be upper-case (except for abbreviations). So it should be "Water duration" instead of "Water Duration", for example.

OK

@hwzolin
Copy link
Contributor Author

hwzolin commented Mar 26, 2025

Also, please use more descriptive PR titles for future PRs. Examples for this PR:

  • "Add Third Reality watering kit options"
  • "Add Third Reality watering kit entities"
  • "Add Third Reality watering kit configuration"

OK

Copy link
Collaborator

@TheJulianJES TheJulianJES left a comment

Choose a reason for hiding this comment

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

I think this looks good now, thanks!

@TheJulianJES TheJulianJES merged commit 3fca5a9 into zigpy:dev Mar 26, 2025
9 checks passed
@hwzolin
Copy link
Contributor Author

hwzolin commented Mar 26, 2025

I think this looks good now, thanks!

Thank you, too!

@TheJulianJES
Copy link
Collaborator

TheJulianJES commented Mar 26, 2025

It was mentioned that the device has an IasZone cluster. What does that do? Report low battery? @hwzolin

ZHA doesn't support the low battery bit for the IasZone cluster, so if that's the only function, we can disable discovery of default entities for the IasZone cluster by adding this:

.prevent_default_entity_creation(endpoint_id=1, cluster_id=IasZone.cluster_id)

An alternative is to "remove" the cluster entirely (from ZHA's point of view) via:

.removes(IasZone.cluster_id)

@hwzolin
Copy link
Contributor Author

hwzolin commented Mar 26, 2025

It was mentioned that the device has an IasZone cluster. What does that do? Report low battery? @hwzolin

ZHA doesn't support the low battery bit for the IasZone cluster, so if that's the only function, we can disable discovery of default entities for the IasZone cluster by adding this:

.prevent_default_entity_creation(endpoint_id=1, cluster_id=IasZone.cluster_id)

An alternative is to "remove" the cluster entirely (from ZHA's point of view) via:

.removes(IasZone.cluster_id)

Hello, the setting is like this: our watering kit, in the process of watering, if it detects that there is no water, then it will trigger an alarm of no water. This alert also needs to be reflected in the ZHA.
The following is the display of our company APP:

  • ias zone is yes:
    ias_zone_yes
    ias_zone_yes_app
  • ias zone is no:
    ias_zone_no
    ias_zone_no_app

@TheJulianJES
Copy link
Collaborator

TheJulianJES commented Mar 26, 2025

Ah ok, thanks! That'll already work as expected then.

@mguaylam
Copy link
Contributor

mguaylam commented Mar 26, 2025

@hwzolin is there reporting on the custom cluster (0xfff2)?
When I change the value on the device, there is no reporting. I tried to configure it with : min_interval=0, max_interval=900, reportable_change=1 to no avail.

How do you know in the app the user has changed the device values?
I also made changes to watering time : min_value=10, max_value=7200, step=10 if that's ok with you, the manual seem to say it can go as far as 7200 seconds.

See #3983

@hwzolin
Copy link
Contributor Author

hwzolin commented Mar 26, 2025

@hwzolin is there reporting on the custom cluster (0xfff2)? When I change the value on the device, there is no reporting. I tried to configure it with : min_interval=0, max_interval=900, reportable_change=1 to no avail.

How do you know in the app the user has changed the device values? I also made changes to watering time : min_value=10, max_value=7200, step=10 if that's ok with you, the manual seem to say it can go as far as 7200 seconds.

See #3983

@mguaylam Hello and thanks for your feedback. In order to reduce battery drain, the watering duration has been changed to 1 - 1800 seconds, depending on the settings of our new version of the device.

@TheJulianJES However, the user mentioned the issue about the report after the device modification is completed. I'm also curious about what the ZHA platform will do. Is it possible to display the value of the change in real time in the log on the right side of the page?
But I found a problem before, and raised an issue to the official, visible link: #3581
I wonder if there is a solution to this problem?

The following image is a screenshot of the water duration command and the response of the device:
image
image

@TheJulianJES
Copy link
Collaborator

TheJulianJES commented Mar 26, 2025

the issue about the report after the device modification is completed. I'm also curious about what the ZHA platform will do. Is it possible to display the value of the change in real time in the log on the right side of the page?

To update the entity in Home Assistant, you can send a "Zigbee attribute report" for that attribute in the device firmware.
ZHA / Home Assistant will process that and update the entity state. This is the same as sending attribute reports on the "temperature" or "humidity" clusters for sensors, for example.

But I found a problem before, and raised an issue to the official, visible link: #3581
I wonder if there is a solution to this problem?

Replied in the issue. I think I managed to reproduce this, but it's mostly only a visual glitch, from what I can tell.
Found the same issue with the Matter integration.. Clicking on the number entity, the logbook section at the bottom never loads, just an endless spinner. Weird...

The entity should still work fine elsewhere, from what I can see. So, I still recommend setting correct units and hope this can be fixed in Home Assistant at some point.

@hwzolin
Copy link
Contributor Author

hwzolin commented Mar 26, 2025

the issue about the report after the device modification is completed. I'm also curious about what the ZHA platform will do. Is it possible to display the value of the change in real time in the log on the right side of the page?

To update the entity in Home Assistant, you can send a "Zigbee attribute report" for that attribute in the device firmware. ZHA / Home Assistant will process that and update the entity state. This is the same as sending attribute reports on the "temperature" or "humidity" clusters for sensors, for example.

But I found a problem before, and raised an issue to the official, visible link: #3581
I wonder if there is a solution to this problem?

Replied in the issue. I think I managed to reproduce this, but it's mostly only a visual glitch, from what I can tell. Found the same issue with the Matter integration.. Clicking on the number entity, the logbook section at the bottom never loads, just an endless spinner. Weird...

The entity should still work fine elsewhere, from what I can see. So, I still recommend setting correct units and hope this can be fixed in Home Assistant at some point.

OK, thanks for taking the time to look into this. Although the problem is not solved, you cleared up my confusion.

@mguaylam
Copy link
Contributor

mguaylam commented Mar 26, 2025

@mguaylam Hello and thanks for your feedback. In order to reduce battery drain, the watering duration has been changed to 1 - 1800 seconds, depending on the settings of our new version of the device.

  1. @hwzolin so if I understand, there has been a change in the firmware to make max : 1800s? It says in the manual that the maximum is 7200s. photo_2025-03-26_11-43-48

  2. About the reporting issue, it seem to be on the firmware side. The device need to report the change of the value to ZHA. If I change the numbers on the device, ZHA is not made aware of the change.

It works on the OnOff cluster : 2025-03-26 11:54:54.424 DEBUG (MainThread) [zha] Emitting event cluster_handler_attribute_updated with data ClusterAttributeUpdatedEvent(attribute_id=0, attribute_name='on_off', attribute_value=<Bool.false: 0>, cluster_handler_unique_id='b4:0e:06:0f:ff:e0:22:17:1:0x0006', cluster_id=6, event_type='cluster_handler_event', event='cluster_handler_attribute_updated') (1 listeners)

But not on your custom cluster (0xfff2), I can't see any response from the device. You need to do a ZigBee attribute report.

IMG_5027.MOV

@hwzolin
Copy link
Contributor Author

hwzolin commented Mar 28, 2025

@mguaylam Hello and thanks for your feedback. In order to reduce battery drain, the watering duration has been changed to 1 - 1800 seconds, depending on the settings of our new version of the device.

  1. @hwzolin so if I understand, there has been a change in the firmware to make max : 1800s? It says in the manual that the maximum is 7200s. photo_2025-03-26_11-43-48
  2. About the reporting issue, it seem to be on the firmware side. The device need to report the change of the value to ZHA. If I change the numbers on the device, ZHA is not made aware of the change.

It works on the OnOff cluster : 2025-03-26 11:54:54.424 DEBUG (MainThread) [zha] Emitting event cluster_handler_attribute_updated with data ClusterAttributeUpdatedEvent(attribute_id=0, attribute_name='on_off', attribute_value=<Bool.false: 0>, cluster_handler_unique_id='b4:0e:06:0f:ff:e0:22:17:1:0x0006', cluster_id=6, event_type='cluster_handler_event', event='cluster_handler_attribute_updated') (1 listeners)

But not on your custom cluster (0xfff2), I can't see any response from the device. You need to do a ZigBee attribute report.

IMG_5027.MOV

@mguaylam Hello, for your first question. Yes, that's what we're set up right now. You can check the latest electronic version of the user manual on our official website (link is: https://tr-common-us-prod.s3.us-west-1.amazonaws.com/product/manual/SmartWateringKit.pdf)

And your second question, I've already fed back to our developers. We will optimize this in future firmware releases.

Thank you for your attention, I believe that your valuable suggestions will help us make our products better.

mguaylam added a commit to mguaylam/zha-device-handlers that referenced this pull request Mar 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2 quirk Quirks using v2 API. Might add custom entities that need translation keys in HA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants