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

Level Control Cluster with Bridge-app (CON-734) #606

Closed
ghost opened this issue Aug 31, 2023 · 13 comments
Closed

Level Control Cluster with Bridge-app (CON-734) #606

ghost opened this issue Aug 31, 2023 · 13 comments

Comments

@ghost
Copy link

ghost commented Aug 31, 2023

In the bridge-app It is given for the on /off light where I need to integrate the Dimmer instead on on/off light.
Does bridge-app example support Dimmers.
The changes made for Dimmer:
dimmer_changes.txt
with these changes I observed that:

  1. the attribute is mismatched(current level)
  2. Once it read the callback doesn't go to write callback.

Kindly share the resources if available.

@github-actions github-actions bot changed the title Level Control Cluster with Bridge-app Level Control Cluster with Bridge-app (CON-734) Aug 31, 2023
@wqx6
Copy link
Contributor

wqx6 commented Aug 31, 2023

Looks like you are using the bridge-app from upstream connectedhomeip repo. For level control cluster, we must call MatterLevelControlPluginServerInitCallback before enabling the dynamic endpoint to make the cluster work.

If you use APIs from esp-matter-bridge this PluginServerInit Callback will be call in plugin_init_callback_endpoin and the dimmable-light can be create with create_device.

@ghost
Copy link
Author

ghost commented Aug 31, 2023

@wqx6 I'm using bridge-app examples from here, where we don't have any matter related file includes in it. When I try to add the header files it throws the error as
No such file or directory
#include <esp_matter.h>
any reference docs for the matter bridge?

@wqx6
Copy link
Contributor

wqx6 commented Aug 31, 2023

I'm using bridge-app examples from here.

In that example, you should call MatterLevelControlPluginServerInitCallback() after you call Esp32AppServer::Init() to use the LevelControl Cluster in Dynamic endpoint. You should call emberAfLevelControlClusterServerInitCallback() after you enable the dynamic endpoint with emberAfEndpointEnableDisable().

any reference docs for the matter bridge?

9.12. Bridge for non-Matter devices in SPEC might help you

@ghost
Copy link
Author

ghost commented Aug 31, 2023

Could you share the location of the file where the MatterLevelControlPluginServerInitCallback() function exist.

@wqx6
Copy link
Contributor

wqx6 commented Aug 31, 2023

Sorry for the wrong reply. I have changed the function in the last comment. emberAfLevelControlClusterServerInitCallback() is in connectedhomeip/src/app/clusters/level-control.cpp

@wqx6
Copy link
Contributor

wqx6 commented Aug 31, 2023

The DECLARE_DYNAMIC_CLUSTER doesn't include the init function so the cluster initialization function is not called for the dynamic endpoint, that's why the level control cluster doesn't work on dynamic endpoint.

@ghost
Copy link
Author

ghost commented Aug 31, 2023

@wqx6 initialized the function, but doesn't seems like the level control cluster works. still the write callback is not called and the level cluster is not handled.
if (emAfMatchAttribute(cluster, am, attRecord))// this condition is getting failed.

initializtion of the function:
endpoint_index=AddDeviceEndpoint(&gLight[array_index],&bridgedDimmableLightEndpoint, Span(gBridgedDimDeviceTypes),Span(gDimmableLight1DataVersions), 1);
emberAfLevelControlClusterServerInitCallback(endpoint_index);

@wqx6
Copy link
Contributor

wqx6 commented Sep 4, 2023

The input of emberAfLevelControlClusterServerInitCallback is endpoint ID, not endpoint index.

@ghost
Copy link
Author

ghost commented Sep 4, 2023

named the variable as endpoint_index, but passing the endpoint only. Is there anything that need to be updated in the ZAP config for the clusters and attributes.

@ghost
Copy link
Author

ghost commented Sep 8, 2023

@wqx6 The logs are as this when the level functions are not being called. I tried calling the function emberAfLevelControlClusterServerInitCallback(), but no use. How do I get the level cluster related callbacks.
level_bridge.txt

@ghost
Copy link
Author

ghost commented Oct 3, 2023

I'm using
esp-idf: v4.4.3
Matter: release/v1.0

When ever I change the level in the dimmer through alexa the level cluster is not being called. Tried the above configurations as suggested but still getting the same issue.

@wqx6
Copy link
Contributor

wqx6 commented Apr 25, 2024

bridge-level-control.txt
Could you apply this patch to your example? I tested and the external write callback was called when I sent the movetolevel command to the endpoint.

@dhrishi
Copy link
Collaborator

dhrishi commented Dec 23, 2024

Closing this now

@dhrishi dhrishi closed this as completed Dec 23, 2024
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

No branches or pull requests

2 participants