Skip to content
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

Add Tuya soil sensor variant _TZE284_aao3yzhs and _TZE284_sgabhwa6 #3315

Merged
merged 4 commits into from
Aug 27, 2024

Conversation

prairiesnpr
Copy link
Collaborator

@prairiesnpr prairiesnpr commented Aug 25, 2024

Proposed change

Add support for TUYA TS0601 _TZE284_aao3yzhs

Also adds support for TS0601_TZE284_sgabhwa6. @GeoffWy confirms suitability for TS0601_TZE284_sgabhwa6.

Additional information

Fixes: #3305
Fixes: #3266

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 Aug 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.27%. Comparing base (daef394) to head (a5cab62).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #3315   +/-   ##
=======================================
  Coverage   88.27%   88.27%           
=======================================
  Files         302      302           
  Lines        9447     9453    +6     
=======================================
+ Hits         8339     8345    +6     
  Misses       1108     1108           

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

@TheJulianJES TheJulianJES added the Tuya Request/PR regarding a Tuya device label Aug 26, 2024
@TheJulianJES TheJulianJES changed the title Add Tuya _TZE284_aao3yzhs Soil Sensor Add Tuya soil sensor variant _TZE284_aao3yzhs Aug 26, 2024
@GeoffWy
Copy link
Contributor

GeoffWy commented Aug 27, 2024

This quirk also works for Tuya soil sensor variant _TZE284_sgabhwa6

@prairiesnpr prairiesnpr changed the title Add Tuya soil sensor variant _TZE284_aao3yzhs Add Tuya soil sensor variant _TZE284_aao3yzhs a Aug 27, 2024
@prairiesnpr prairiesnpr changed the title Add Tuya soil sensor variant _TZE284_aao3yzhs a Add Tuya soil sensor variant _TZE284_aao3yzhs and _TZE284_sgabhwa6 Aug 27, 2024


class TuyaSoilSensorVar02(CustomDevice):
"""Tuya temp and humidity sensor (variation 05)."""
Copy link
Collaborator

@TheJulianJES TheJulianJES Aug 27, 2024

Choose a reason for hiding this comment

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

Suggested change
"""Tuya temp and humidity sensor (variation 05)."""
"""Tuya soil sensor (variation 2)."""

The other docstring is also wrong, can't add a suggestion for that here though. Feel free to PR the change for TuyaSoilSensor. It still says "temp and humidity sensor".

EDIT: Actually, this is a temp/humidity sensor. So, it's fine.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The numbering seems a bit wrong overall. Feel free to improve it in a future PR.

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.

Thanks!

@TheJulianJES TheJulianJES merged commit dca24aa into zigpy:dev Aug 27, 2024
7 checks passed
@skypyxis
Copy link

skypyxis commented Aug 27, 2024

I have a _TZE284_sgabhwa6 and I confirm I can get the temperature and moisture readings.
However, the battery level isn't being detected, and the moisture level seems quite low. Still, this is definitely promising

image

@hairyfred
Copy link

Got a TZE284_aao3yzhs so fingers crossed for when this releases :)

@GeoffWy
Copy link
Contributor

GeoffWy commented Aug 27, 2024

I agree the soil moisture reading seems quite low, but I have confirmed it does read 100% (or near enough) when the probes are fully immersed in water, so I believe the readings are being scaled correctly.

My battery level isn't being detected either, but my experience has been that some sensors take 24 hours to start producing battery level, so still waiting in hope.

It would be nice to change the battery type to 3AA instead of 2AAA.

@prairiesnpr
Copy link
Collaborator Author

Quickly looking at the z2m convertor, I doubt the battery will work for _TZE284_sgabhwa6. Looks like it uses dp 115 for battery where the _TZE284_aao3yzhs uses 15.

@BonesJD
Copy link

BonesJD commented Jan 7, 2025

Hey sorry I'm a bit confused about the status of this. Has support been implemented yet or not?
I just bought a "TS0601 by _TZE284_aao3yzhs" and connected through ZHA but I'm not seeing any sensor readings.
image
Am I doing something wrong?

@prairiesnpr
Copy link
Collaborator Author

It's been in since HA 2024.9, if you are on the latest HA and it's still not showing, I'd open an incident with your signature, diagnostics, and logs.

@BonesJD
Copy link

BonesJD commented Jan 8, 2025

It's been in since HA 2024.9, if you are on the latest HA and it's still not showing, I'd open an incident with your signature, diagnostics, and logs.

Sorry that was a simple fix, I should have checked the version first. I just installed home assistant from the CasaOS store yesterday so I assumed it would be the latest version but it was 2024.5 for some reason. I updated to the latest and it's working correctly now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tuya Request/PR regarding a Tuya device
Projects
None yet
6 participants