If the lock's status changes while the device is powered off, causing a mismatch between the lock and the Apple Hub, how can I immediately update the status upon powering on?
If the lock's status changes while the device is powered off, causing a mismatch between the lock and the Apple Hub, how can I immediately update the status upon powering on?
Hello,
If the real life state is different than the lock -- a write interaction on the LockState attribute is needed. If the Door Lock device is offline and has the correct state, a read interaction or a subscribe interaction is needed on reconnection to the hub. See the relevant sections in the Matter Specification, i.e. Chs. 8.2.2-8.2.4 in R1.3.
Best regards,
Maria
I tried to update the device status to the Hub when powering on, but it actually made the situation worse. It now takes even longer to connect to the Hub. As per your suggestion, how can I know when the device has reconnected to the network?
Hello,
SunHuang said:I tried to update the device status to the Hub when powering on, but it actually made the situation worse. It now takes even longer to connect to the Hub.
Could you tell me a bit more about how you implemented this? Your question indicates that you are on a good track with finding the reconnection state. Once the lock is connected to the hub, the attribute can be performed updated.
On power cycles, the device state can be unknown until the next actuation and still follow the Matter specification (Application Cluster R1.4 Ch. 5.2.9.1).
You can also look into using the LockOperation Event when there state on the device is different from the last recorded state (Matter Application Cluster specification R1.4 Ch. 5.2.11.3).
SunHuang said:how can I know when the device has reconnected to the network?
You can make use of the DefaultMatterEventHandler function which will be called when there is a connectivity event. When isNetworkProvisioned is true, the device is connected to the network.
Best regards,
Maria
Hello,
SunHuang said:I tried to update the device status to the Hub when powering on, but it actually made the situation worse. It now takes even longer to connect to the Hub.
Could you tell me a bit more about how you implemented this? Your question indicates that you are on a good track with finding the reconnection state. Once the lock is connected to the hub, the attribute can be performed updated.
On power cycles, the device state can be unknown until the next actuation and still follow the Matter specification (Application Cluster R1.4 Ch. 5.2.9.1).
You can also look into using the LockOperation Event when there state on the device is different from the last recorded state (Matter Application Cluster specification R1.4 Ch. 5.2.11.3).
SunHuang said:how can I know when the device has reconnected to the network?
You can make use of the DefaultMatterEventHandler function which will be called when there is a connectivity event. When isNetworkProvisioned is true, the device is connected to the network.
Best regards,
Maria