-
Notifications
You must be signed in to change notification settings - Fork 176
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
Invoke Matter Commands Internally in ESP-Matter (CON-1562) #1290
Comments
You can use the cluster_command class to send a command on a client. The flow should be:
|
I tried this approach with no luck!! Here is my code
The output is: But the LED did not TOGGLE Another thing, |
Did you call |
Hi, thanks for the suggestion. However, I was asking about a server-side solution—not for sending commands from a client. My goal is to receive a command (formatted as endpoint_id, cluster_id, command_id, and command_data in TLV format) over protocols like MQTT (Or maybe WebServer) and then invoke the Matter command callback internally on the Matter server. Essentially, I'm trying to avoid having separate callbacks for each command by having a generic dispatcher that maps the incoming command data to the appropriate Matter command handler. Is there any guidance or recommended approach in the ESP-Matter SDK to achieve this? I was thinking about something like get_callback(command) and then calling err = callback(command_path, tlv_data, opaque_ptr); I tried calling DispatchSingleClusterCommand with nullptr opaque_ptr but it didn't work |
So, you aim to implement the following scenario?
The |
Description
I am developing an ESP-Matter-enabled device that includes an MQTT layer for remote control. I want to create a generic callback function that processes commands from different communication protocols (e.g., MQTT) while reusing the same command execution mechanism that Matter uses internally.
The callback extracts the following from an incoming MQTT message:
endpoint_id
cluster_id
command_id
command_payload
(TLV JSON formatted)My goal is to invoke the command internally (on Server Cluster) using the same mechanism that Matter uses between a client and a server and receive the same response that Matter would normally return.
Question
Is there a generic way in ESP-Matter to invoke an incoming command internally using the standard Matter mechanism?
Should I have a client and a server cluster or can I achieve this on Server Cluster only
Expected Flow:
endpoint_id
,cluster_id
,command_id
,command_payload
) are extracted.Thanks in advance for your help.
The text was updated successfully, but these errors were encountered: