Skip to content

Conversation

makuser
Copy link

@makuser makuser commented Jul 2, 2025

Proposed change

Add Support for HOBEIAN (Tuya) soil sensor ZG-303Z and Tuya soil sensor _TZE200_npj9bug3

Additional information

Fixes #4144, #4122 (comment)

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

@makuser makuser force-pushed the tuya-soil-sensors-1 branch from dc3acba to 461f114 Compare July 2, 2025 23:42
Copy link

codecov bot commented Jul 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.28%. Comparing base (79df871) to head (8346cd3).
⚠️ Report is 21 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #4160   +/-   ##
=======================================
  Coverage   91.28%   91.28%           
=======================================
  Files         339      339           
  Lines       10967    10971    +4     
=======================================
+ Hits        10011    10015    +4     
  Misses        956      956           

☔ 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.

@makuser makuser force-pushed the tuya-soil-sensors-1 branch from 02a3438 to 8346cd3 Compare July 3, 2025 00:02
@GWRon
Copy link

GWRon commented Jul 7, 2025

To avoid an accidental merge of this PR in its current state:

As written in the referenced issues, this PR does (for now) add new sensor information and adjustment settings (calibration) but does not (yet) tackle a "soil moisture/air humidity is sharing values" bug which I reported in #4122.

Makuser is surely just a little step away from fixing these small annoyancies too. So I hope this post here does not disencourage you to continue the PR.

@TheJulianJES TheJulianJES added the Tuya Request/PR regarding a Tuya device label Jul 30, 2025
@sandros06
Copy link

sandros06 commented Aug 1, 2025

Work for humidity on sol on hard copy on core, when we merge this ?

@GWRon
Copy link

GWRon commented Aug 1, 2025

@sandros06 so "dry" and "wet" is not mixed on your installation? Here it is marked as "wet" if there is only some percents of moisture - but "dry" if I just added fresh water. Means "please give water" alarms won't work the way people expect (you need to check for the opposite value).

@sandros06
Copy link

@sandros06 so "dry" and "wet" is not mixed on your installation? Here it is marked as "wet" if there is only some percents of moisture - but "dry" if I just added fresh water. Means "please give water" alarms won't work the way people expect (you need to check for the opposite value).

Hmm, you're right! I missed this part and it's not working very well.

@danielholm
Copy link

Works fine here with device ZG-303Z.
I added the following in configuration.yaml of HA and put the file tuya_sensor.js from this PR in the new quirks directory. Restarted HA.

zha:
  custom_quirks_path: /config/zha_quirks/
  enable_quirks: true

@slymas
Copy link

slymas commented Aug 31, 2025

I tried this out on my ZG-303Z. It seems to be working, I got a whole set of configuration controls, and the moisture value. However I also noticed the dry/wet binary sensor is mixed up. I watered the plant and moisture reports 100%, while the binary sensor is still "dry".

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
Development

Successfully merging this pull request may close these issues.

[Device Support Request] Add support for Tuya TS0601 soil sensor (_TZE200_npj9bug3)
6 participants