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 missing model info quirk for TUYA TZE200 #1740

Merged
merged 1 commit into from
Sep 12, 2022
Merged

Conversation

Palid
Copy link
Contributor

@Palid Palid commented Sep 9, 2022

This commit adds a missing model info quirk for TUYA TZE200 without which it'll only show VOClevel sensor instead of all the available sensors on the device.

This commit adds a missing model info quirk for TUYA TZE200 without which it'll only show VOClevel sensor instead of all the available sensors on the device.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 3021063200

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 71.568%

Totals Coverage Status
Change from base Build 2972024041: 0.0%
Covered Lines: 5266
Relevant Lines: 7358

💛 - Coveralls

@codecov-commenter
Copy link

Codecov Report

Merging #1740 (ed17d08) into dev (b98948e) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##              dev    #1740   +/-   ##
=======================================
  Coverage   71.56%   71.56%           
=======================================
  Files         239      239           
  Lines        7358     7358           
=======================================
  Hits         5266     5266           
  Misses       2092     2092           
Impacted Files Coverage Δ
zhaquirks/tuya/air/ts0601_air_quality.py 100.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Collaborator

@javicalle javicalle left a comment

Choose a reason for hiding this comment

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

LGTM

@javicalle
Copy link
Collaborator

Could you include a link to the device manufacturer?
This way other users will be able to identify if your device is the same.

@javicalle javicalle added the needs final review PR is ready for a final review from a maintainer label Sep 9, 2022
@Palid
Copy link
Contributor Author

Palid commented Sep 9, 2022

@javicalle it's a follow-up to #1367

Had to add this line otherwise most of the sensors were not found.
Please let me know if I should amend the commit with details about previous PR, or with the manufacturer details.

@javicalle
Copy link
Collaborator

No, there is no need.

I suppose that is some kind of upgraded version with the GPP cluster.

It's this the device?:

@Palid
Copy link
Contributor Author

Palid commented Sep 9, 2022

Yep, that's this one, however it seems that I might need to do some filtering over the CO2 meter, as it's giving out garbage data.

Alright, looked into the issue a bit more, see #1406
I'll handle the mismatched values first and then let's merge, my PR adds the sensors but with wrong values.

Edit #2: the sensors were mismatched, and it seems that after properly moving sensor to their actual device the garbage does not appear anymore. I'll watch the logs for a while and if garbage reappears I'll add some simple garbage filter (is that even doable in quirks? would love some point of reference), but other than that it seems that this device requires a different dp_to_attribute marcher than the previous ones.

@javicalle
Copy link
Collaborator

it's giving out garbage data.

Sometimes the device needs to be repaired to fix the garbage data (random 0 values).

it seems that this device requires a different dp_to_attribute marcher than the previous ones

It would be a pity because that would mean to duplicate also the TuyaCO2Sensor class.

is that even doable in quirks?

I believe that is not supported in the present implementation:

@gudvinr
Copy link

gudvinr commented Sep 10, 2022

You can see a bit of history in zigbee2mqtt implementation: Koenkk/zigbee2mqtt#11033

They filter garbage values and there is correct value mapping too

@Palid
Copy link
Contributor Author

Palid commented Sep 10, 2022

Alright, it means that I need to figure out some basic denouncing and filtering for the data there. Hoped that there's something for that in ZHA codebase already, but I can write some simple helpers myself.

The zigbee2mqtt issue is of this device, so I can try to mirror the mappings too, might be that we won't need another mapping class.

@dmulcahey dmulcahey merged commit ded6fb1 into zigpy:dev Sep 12, 2022
@gudvinr
Copy link

gudvinr commented Sep 12, 2022

This still needs additional modifications though since device doesn't report values correctly.

This device uses DP22 (instead of DP2) for CO2, DP2 for PM2.5 and DP20 (instead of DP22) for HCHO/Formaldehyde.

Also DP2 produces garbage values of 0xAAAC and 0xAAAB that drastically differ from real values that close to 0.

@Palid Palid deleted the patch-1 branch September 12, 2022 18:28
@pamatika
Copy link

Any update on this fix?
I have also _TZE200_dwcarsat and only voc value available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs final review PR is ready for a final review from a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants