Can the matter switch be aware of the matter light bulb's status (On or Off)

Hi,


Can the matter switch be aware of the matter light bulb's status (On or Off)?

For the matter light switch example the on/off cluster doesn't have an on/off attribute, and it seems that it doesn't store the status value of the switch (On or Off).

So this api doesn't exist for the matter switch

status = Clusters::OnOff::Attributes::OnOff::Get(endpointID, &storedValue);


Is there a way to enable the light switch to be aware of the light bulb status?


Note that I can't Implement my logic to store the switch status on the NVS, because the bulb's status might be changed from a source other than the switch like a mobile app, so the stored switch's status will be different from the bulb's status, because the switch store its status depending on the button toggling.

So I need a way to get the bulb's status from within the matter light switch example.

Best regards,

Basem

Parents Reply
  • In the matter light bulb example I found the same API used in the zcl_callbacks.cpp to get the endpoint status.

    Also I used this API to get the light bulb status from the NVS, within the matter light bulb example.

    I do that in the matter light bulb example, because the light bulb example uses the onoff cluster (server) but the switch use the on/off cluster as a client, where the on/off cluster of the matter light switch example doesn't have an on/off attribute where I can read/get its value using this API.

    Or I misunderstand.

    I need the light switch to be aware of the light bulb status.

    Regards,

Children
Related