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

Difficulty Integrating Multiple Switches with Different Press Types in Matter #66

Open
tiziano149 opened this issue Jun 29, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@tiziano149
Copy link

Hardware

Arduino Nano Mater

Core version

2.0.0

Arduino IDE version

2.3.2

Operating system

Mac os Sonoma

Radio stack variant

Matter

OpenThread Border Router device (if using Matter)

No response

Issue description

I’m working on a project using the Arduino Nano Matter board with the Matter 2.0.0 library. My goal is to integrate four switches into a single accessory in Apple HomeKit. Each switch should support different press types, including short press, long press, and multi-press.

I’m encountering challenges where each switch appears as a separate device, and I’m struggling to implement the various press types using the MatterSwitch class. Methods like report_event or triggerEvent don’t seem to be available.

I would appreciate any guidance or examples on how to consolidate these switches into one accessory and properly handle different button press types within the existing library framework. Thank you for any assistance you can provide!

Serial output

No response

RTT output (if using Matter)

No response

Minimal reproducer code

No response

@tiziano149 tiziano149 added the bug Something isn't working label Jun 29, 2024
@silabs-bozont silabs-bozont self-assigned this Aug 1, 2024
@lboue
Copy link

lboue commented Aug 7, 2024

I'd also like to make the same device.

@leonardocavagnis
Copy link
Contributor

The MatterSwitch class doesn't natively support multiple press types such as short, long, and multi-press.

A possible approach could be to use the "Operational State Cluster", where you define a unique state for each switch condition (e.g., long press on switch 1, short press on switch 1, multi-press on switches 1 & 2, etc.).
Unfortunately, this cluster is currently not implemented in the core.

image
(Matter Application Cluster Specification 1.2)

A quick and dirty solution could be to use one of the "Measurement and Sensing" clusters (such as Humidity, Thermostat, etc.) and assign a numeric value for each state. I understand this isn’t an elegant solution, but it’s the only workaround that comes to mind. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants