-
Notifications
You must be signed in to change notification settings - Fork 7.7k
-
is there a way to name Lights Endpoint in the code rather than to rename in set up on the device.
always come up on the device as (light, light1, light2, etc)
@SuGlider
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 6 comments 14 replies
-
is there a way to name Lights Endpoint in the code rather than to rename in set up on the device.
always come up on the device as (light, light1, light2, etc)
@SuGlider
This is something that I have to investigate.
If a solution is found, we shall add an API for it.
Thanks for asking!
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Thank you
Beta Was this translation helpful? Give feedback.
All reactions
-
@SuGlider MatterOnOffLight can support more than 3 lights endpoint?
Is there a way to increase the number of them?
Beta Was this translation helpful? Give feedback.
All reactions
-
Yes, it is possible. There is a limit of endpoints for a single node, which, I think that may be around 16.
Using this example: https://github.com/espressif/arduino-esp32/blob/release/v3.1.x/libraries/Matter/examples/MatterComposedLights/MatterComposedLights.ino
In the sketch you can add one or more MatterOnOffLight OnOffLight_n; declarations for each extra light <_n is the sequencial number of that light>, or just name it the way you want.
In the code it is necessary to add OnOffLight_n.begin(bool initialState); and also OnOffLight_n.onChangeOnOff(setLightOnOff_n); with the repective code for setLightOnOff_n().
For testing, just follow the example code. It prints, in the serial console, which light is turned on and off.
Summary: it is just necessary to declare object of the endpoint type and execute obejct.begin() before calling Matter.begin() in order to add another light / any future endpoint to the same node.
Beta Was this translation helpful? Give feedback.
All reactions
-
Yes, it is possible. There is a limit of endpoints for a single node, which, I think that may be around 16.
Using this example: https://github.com/espressif/arduino-esp32/blob/release/v3.1.x/libraries/Matter/examples/MatterComposedLights/MatterComposedLights.ino
In the sketch you can add one or more
MatterOnOffLight OnOffLight_n;declarations for each extra light <_n is the sequencial number of that light>, or just name it the way you want. In the code it is necessary to addOnOffLight_n.begin(bool initialState);and alsoOnOffLight_n.onChangeOnOff(setLightOnOff_n);with the repective code forsetLightOnOff_n().For testing, just follow the example code. It prints, in the serial console, which light is turned on and off.
Summary: it is just necessary to declare object of the endpoint type and execute obejct.begin() before calling Matter.begin() in order to add another light / any future endpoint to the same node.
You are right by default the endpoints for a single node are 16, I tested it.
I wanted to use 20 endpoints for a single node, I found in ESP MATTER repository to change the number of endpoints by changing this CONFIG_ESP_MATTER_MAX_DYNAMIC_ENDPOINT_COUNT=16, but in arduino-esp32 I didn't found this option.
do you have plan to include this option on arduino-esp32 so that we can be able to set number of endpoints?
Beta Was this translation helpful? Give feedback.
All reactions
-
@SuGlider I'm using the matter library to test all scenarios that can happen in daily use.
For the MatterOnOffLight example, I tested 3 scenario
- when the device is configured and connected to WiFi you can use UI or Physical button to control Light, which is OK.
- When WiFi is disconnected while the Esp board is ON and configured, you can not use UI but the physical button can control Light, which is OK.
- When WiFi is disconnected and you restart the Esp board while the board is already configured, Matter can not begin even if you comment this lines.
//while (WiFi.status() != WL_CONNECTED) {
// delay(500);
// Serial.print(".");
// }
This kind of scenario can happen any time when the access point is damaged and restart esp board.
It will be OK to be able to use physical button to control the light because the board was already configured.
Beta Was this translation helpful? Give feedback.
All reactions
-
No change in src code would make scenario 3 work.
Matter depends on IPv6 (WiFi/Thread/ETH/PPP) connection.
Matter is a network protocol.
Beta Was this translation helpful? Give feedback.
All reactions
-
Thank you so much for the information.
I was wondering if scenario 2 was able to work without internet, the scenario 3 can work too.
Beta Was this translation helpful? Give feedback.
All reactions
-
Please detail how the second scenario was tested. It is not possible to control the light using the APP when there is no WiFi working.
Beta Was this translation helpful? Give feedback.
All reactions
-
The board button, based on the example, would work after connecting to WiFi.
Beta Was this translation helpful? Give feedback.
All reactions
-
@SuGlider I'm using MatterOnOffLight.ino example,
step 1. with my iPhone and esp32s3 connected to the same WiFi (with iPhone running ios18 you can setup matter device without homehub)
2. I can use UI or a button to control LED (the devices are both connected in the same WiFi )
3. Turn OFF WiFi device(access point) only. don't disconnect the esp32 board, You can be able continue use the button to control the LED even if there is no Wifi.
Beta Was this translation helpful? Give feedback.
All reactions
-
For my understanding, if the matter is already commissioned that is the reason why I continue to use the button even if there is no WiFi.
What it can't work is UI because the board is not connected.
The issue comes when you restart the esp32 board when no internet.
For my understanding, as before the device run without internet (before restarting), the device should check if it is already commissioned before and let the code run locally.
Beta Was this translation helpful? Give feedback.
All reactions
-
- Turn OFF WiFi device(access point) only. don't disconnect the esp32 board, You can be able continue use the button to control the LED even if there is no Wifi.
Yes, it has been commissioned and WiFi was active. After turning off WiFi AP, the device will continue to work using the esp32s3 onboard button because it will update its internal matter clustter information, but it won't be synchonized with the matter controller or iphone APP.
But if the WiFi AP is off and reset button is pressed, it won't connect and the sketch will be kept in the WiFi connection Loop until a suitable WiFi SSID is found and it is able to connect to the network.
In that case the sketch I presented in some other place here solves it. That sketch runs a separated Task just for the button that detects when Matter is not active and overrides it.
Beta Was this translation helpful? Give feedback.
All reactions
-
@SuGlider this was my question, if esp32 can able to update its internal cluster information without WiFi because it has been commissioned.
that it is why I asked you if there something like this if( matter.isCommisioned && !matter.isWifiConnected ) to let the board use internal cluster. plus removing the while loop to let the system continue without internet connection.
//while (WiFi.status() != WL_CONNECTED) {
//delay(500);
// Serial.print(".");
// }
the project I made all code run in void loop() to use thishttps://github.com//discussions/10531#discussioncomment-11142747 type will somehow not easy for the big project, because the main code will be in void setup .
Thank you for the quick responce and guidance
Beta Was this translation helpful? Give feedback.
All reactions
-
Matter, as a protocol, will first stablish point to point connection from the Accessory to the Controller. That connection may be interrupted.
But when it has not yet stablished such connection, the cluster can't be internally manipulated.
Therefore after a reset, it will fail to call the internal attribute change callback to turn onn/off the GPIO that controls the physical light.
Beta Was this translation helpful? Give feedback.
All reactions
-
Ok, I understand the reason
Beta Was this translation helpful? Give feedback.