Skip to content

Add device triggers for Paulmann 501.41 remote #4013

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 6 commits into
base: dev
Choose a base branch
from

Conversation

arnoudkooi
Copy link

@arnoudkooi arnoudkooi commented Apr 16, 2025

Proposed change

Add a quirk for the Paulmann 501.41 Zigbee Smart Home Remote. This remote is available separate or included with various Paulmann Zigbee lighting kits. It does not report a model or manufacturer via the Basic cluster, so matching is done using endpoint and cluster signature. The quirk provides device automation triggers for:

  • Brightness control (plus/minus buttons)
  • Color temperature adjustment (fire/ice buttons)
  • Scene recall and storage (S1/S2 buttons)
  • A general-purpose power button (on/off/toggle)

Only meaningful, distinguishable button actions are included. Long press release events (e.g., stop_move_step) are intentionally omitted due to lack of distinguishing data in the Zigbee payload.

Checklist

  • The changes are tested and work correctly
  • pre-commit checks pass / the code has been formatted using Black
  • Tests have been executed to verify that the new code works

Fix quirk matching by using None for model/manufacturer to support devices reporting 'unk_model'. Migrated all device_automation_triggers from 'args' to 'params' to align with latest ZHA requirements. Also added comment at top.
@arnoudkooi arnoudkooi force-pushed the add-paulmann-remote-quirk branch from 41ddc27 to 4ca70fb Compare April 16, 2025 08:54
Copy link

codecov bot commented Apr 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.18%. Comparing base (7713d81) to head (6cff35e).
Report is 6 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #4013   +/-   ##
=======================================
  Coverage   91.18%   91.18%           
=======================================
  Files         334      335    +1     
  Lines       10862    10869    +7     
=======================================
+ Hits         9904     9911    +7     
  Misses        958      958           

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

"""

signature = {
"model": "unk_model",
Copy link
Author

Choose a reason for hiding this comment

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

Change value to None, this value is to pass the tests here and on line 22

@arnoudkooi
Copy link
Author

Thanks for the the automated tests! ✅

Important message:
This device reports "unk_model" / "unk_manufacturer", so these are used literally to satisfy signature validation. In practice, the quirk works by matching endpoint and cluster signature.

For the quirk to use change line 21 and 22
From:

"model": "unk_model",
"manufacturer": "unk_manufacturer",

To

"model": None,
"manufacturer": None,

@TheJulianJES
Copy link
Collaborator

"unk_model" / "unk_manufacturer" generally means that the device didn't complete pairing properly.
Can you remove the device and try to re-pair it?

@arnoudkooi arnoudkooi force-pushed the add-paulmann-remote-quirk branch from 76d863c to b48d0f4 Compare April 25, 2025 15:19
@arnoudkooi
Copy link
Author

Updating Zigbee USB dongle fixed it.
The PR is now updated and passed tests.

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.

Please use a v2 quirk for defining the device_automation_triggers instead.
See this example: https://github.com/zigpy/zha-device-handlers/blob/dev/zhaquirks/sonoff/button.py

Also, we already have some constants defined here: https://github.com/zigpy/zha-device-handlers/blob/dev/zhaquirks/const.py

@TheJulianJES TheJulianJES added the waiting for changes Waiting for changes to the PR label Apr 29, 2025
@TheJulianJES TheJulianJES changed the title Add quirk for Paulmann 501.41 Zigbee Smart Home Remote with automations Add device triggers for Paulmann 501.41 remote Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for changes Waiting for changes to the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants