Skip to content

Add Aqara Z1 Pro Light Switch Quirk #4043

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

Open
wants to merge 17 commits into
base: dev
Choose a base branch
from

Conversation

KwFung7
Copy link

@KwFung7 KwFung7 commented May 3, 2025

Proposed change

Related Issue: #3127
Added partial support for Aqara Z1 Pro Light Switch.
I have tested the changes in single rocker, double rocker and triple rocker version.
The changes enable the slider events detection that cannot be supported by default in ZHA.

Additional information

I have created custom ZHA quirks that can help detect slider events from the Aqara Z1 Pro switch. Users can set up automation based on the received ZHA events. For those who are eager to test it before the official release, please follow the steps below to set it up on your local device:

  1. Add the following files to your Home Assistant /config/custom_zha_quirks directory (create it if it does not exist):

  2. (Optional) Enable logging for custom ZHA quirks in /config/configuration.yaml:

    logger:  
      default: info  
      logs:  
        zigpy: debug  
        homeassistant.components.zha: debug  
        zhaquirks: debug  
  3. Restart Home Assistant to activate the custom quirks.

  4. Verify that the quirks are loaded on the target devices and check the logs in /config/home-assistant.log.

Image
  1. Test the Aqara Z1 Pro slider and attempt to capture the ZHA slider event in Developer Tools.
Image

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 May 3, 2025

Codecov Report

Attention: Patch coverage is 82.35294% with 24 lines in your changes missing coverage. Please review.

Project coverage is 91.09%. Comparing base (5556090) to head (88f8612).

Files with missing lines Patch % Lines
zhaquirks/xiaomi/__init__.py 38.46% 16 Missing ⚠️
zhaquirks/xiaomi/aqara/aqara_z1_pro_double.py 92.00% 2 Missing ⚠️
zhaquirks/xiaomi/aqara/aqara_z1_pro_quadruple.py 92.59% 2 Missing ⚠️
zhaquirks/xiaomi/aqara/aqara_z1_pro_single.py 91.66% 2 Missing ⚠️
zhaquirks/xiaomi/aqara/aqara_z1_pro_triple.py 92.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #4043      +/-   ##
==========================================
- Coverage   91.19%   91.09%   -0.11%     
==========================================
  Files         335      339       +4     
  Lines       10886    11022     +136     
==========================================
+ Hits         9928    10040     +112     
- Misses        958      982      +24     

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant