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 Siren TS0601 _TZE204_hcxvyxa5 variant #3361

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

upsuper
Copy link
Contributor

@upsuper upsuper commented Sep 14, 2024

Proposed change

This PR adds siren TS0601 _TZE204_hcxvyxa5 into the existing quirk of TuyaSirenGPP_NoSensors, and fixes #3255 and fixes #3228.

I have confirmed locally that it enables the siren to be toggled like other similar sirens, and I am able to adjust melody and duration via "Manage zigbee device".

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 Sep 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.49%. Comparing base (acecf70) to head (5c99358).
Report is 10 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #3361   +/-   ##
=======================================
  Coverage   88.49%   88.49%           
=======================================
  Files         305      305           
  Lines        9621     9621           
=======================================
  Hits         8514     8514           
  Misses       1107     1107           

☔ 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 Sep 16, 2024
@TheJulianJES TheJulianJES changed the title Support Tuya Siren TS0601 _TZE204_hcxvyxa5 Add Tuya Siren TS0601 _TZE204_hcxvyxa5 variant Sep 16, 2024
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 722812a into zigpy:dev Sep 24, 2024
7 checks passed
Copy link

@JAKAMI99 JAKAMI99 left a comment

Choose a reason for hiding this comment

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

Working!

At first, I enabled custom quirks in the configuration.yaml in home assistant because I didn't want to wait for the :main update.
zha: enable_quirks: true custom_quirks_path: /config/zha_quirks/

Then I downloaded the custom quirk:
➜ zha_quirks wget https://raw.githubusercontent.com/zigpy/zha-device-handlers/5c993588c79b7708f9ecfc8ad893df6e51d97924/zhaquirks/tuya/ts0601_siren.py

I rebooted, removed and added the _TZE204_hcxvyxa5 device.

Now the device has a switch. If turned on, the device makes a siren noise for ~500ms and turns off again,

Trough "manage zigbee device" I could change some settings by choosing cluster "TuyaMCUSiren" through the attributes

  • alarm_duration (id: 0x0267) sets the alarm duration in seconds.
  • The volume can be changed trough volume (id: 0x0474) by setting the value to 0(low) , 1(medium) or to 2(high)
  • The melody can be set trough melody (id: 0x0466) where the value can be from 0 to 36 (37 seems to be a duplicate with 0) which varies from classical songs like "Für Elise" (24) to notification ish/doorbell sounds (11) to the three alarm siren sounds (0-2) where 0 is the most alarm one, but they really have a big cheap toy vibe 👶

Melody (dropdown-menu), volume (dropdown-menu) and duration (slider) should be added to the GUI, so everyone can access it.

Thanks for the quick implementation! ✅

@upsuper upsuper deleted the siren-ts0601-tze204-hcxvyxa5 branch September 24, 2024 21:26
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.

Tuya Siren (new) TS0601 by _TZE204_hcxvyxa5 Tuya Siren TS0601 by _TZE204_hcxvyxa5
3 participants