ebaauw / homebridge-deconz

Homebridge plugin for deCONZ
Apache License 2.0
134 stars 7 forks source link

Notification on device unreachable #228

Closed cosmo84 closed 1 month ago

cosmo84 commented 2 months ago

Hi,

I have a question concerning reachability notifications. Let me give you an example: I have a camera in Homekit, integrated with another plugin. When the camera goes offline for whatever reason, I get a push notification in HomeKit.

I see that the Deconz API gives the information lastseen for devices, like here for one of my smoke detectors:

"lastseen": "2024-08-25T10:14Z"

Is it possible to work with this in a way that I get a notification when a device is no more seen, e.g. after 24h?

Best regards,

Stephan

ebaauw commented 2 months ago

Are you sure you get this notification from HomeKit and not from the camera's native app? If so, what plugin is this? I'd like to have a look at the code.

Notifications are handled by Apple's HomeKit runtime, and set through Apple's Home app. Accessories (incl. Homebridge plugins) have no influence on that, other than exposing devices using services/characteristics on which Apple supports notifications). It could be a feature specific to camera accessories - I have no experience with these.

You can always create a CLIPPresence or CLIPOpenClose sensor in deCONZ, and a deCONZ rule to activate the sensor when lastseen is over 24h ago. Then expose the CLIP sensor using Homebridge deCONZ and enable notifications in Home. I use this approach to get notifications when my washing machine has finished my laundry: I set a CLIPOpenClose when the washer's smart plug no longer registers any power consumption.

cosmo84 commented 2 months ago

I use homebridge-unifi-protect to expose my Unifi cameras to HomeKit. This is a photo of the config option in HomeKit to notify when the device gets offline.

image

I was thinking too that it is mainly a limitation in HomeKit, as long as it doesn't offer this also for other devices than cameras.

The hint with CLIP sounds promising, I will have a look at this. Many thanks for your help!!

ebaauw commented 2 months ago

Does the Unify plugin create bridged camera accessories, or do you need to pair each camera accessory individually to HomeKit?

cosmo84 commented 2 months ago

By default it brings all cameras that are managed by the Unifi controller into HomeKit. In the plugin settings you can then choose to exclude specific devices based on their MAC address.