ptz0n / homebridge-verisure

 Platform plugin for Homebridge allowing to manage and control Verisure devices.
https://www.npmjs.com/package/homebridge-verisure
MIT License
65 stars 15 forks source link

Support for motion sensor/camera #53

Closed olofbokedal closed 5 years ago

olofbokedal commented 5 years ago

I'd like support for the motion sensors (cameras). It's not possible to watch a live feed through the cameras so obviously we can't support the cameras, but could it be possible to support the motion detectors within them?

Has these already been excluded for some technical reasons or are there any possibilities to support them?

ptz0n commented 5 years ago

I'm guessing you are referring to the "Smart Camera". It seem possible to capture and download image series which in turn would enable us it to expose it as a camera accessory in Homebridge.

Regarding the motion detector in it, we don't yet have a way to receive events from your Verisure installation. Instead we rely on polling every 30 seconds or so. Do you think this will be fast enough for your needs?

PS. Increasing the poll interval to more frequent than twice per minute might result in rate limiting by Verisure. DS.

olofbokedal commented 5 years ago

I actually refer to the “regular” camera:

https://www.verisure.se/images/18.57a56f0415a5b66451c4cd24/1516800968373/kamera-ny-400x328.jpg

Good to know about the polling limits. It might still work though, depending on how long it takes for the motion detection to reset. I have another D-link camera which can reset the motion detection after a user specified time, for example.

Anything I can do to investigate further?

skegget commented 5 years ago

Regarding the smart camera I’m interested in showing it as a camera accessory. But how would that work? Can you trigger the camera to take a picture every 30 seconds? Or are you forced to pull pictures only when motion is detected by the camera?

ZEEN0j commented 5 years ago

Also wondering if possible with the security camera. Not the smart camera. I’m guessing the former might not work as only Verisure can view that feed in the case of the alarm going off.

olofbokedal commented 5 years ago

It'll be impossible to view a live feed through the camera, yes. Otherwise Verisure really messed things up... :)

But the motion detection might be possible to expose as a sensor though.

ptz0n commented 5 years ago

To clearify; we are talking about the following device:

ptz0n commented 5 years ago

Using the Verisure iOS app, I'm unable to read any motion sensor state. Are you sure that the sensor will detect anything unless the system is armed "away"?

Taking photos also require the system to be armed.

What's your main use case?

olofbokedal commented 5 years ago

I'm not sure of anything, haven't explored the API at all and I'm not sure how to actually explore it.

I'd like to try lights automation around the house based on motion, so that rooms without any motion for e.g. 30 minutes gets dark and whenever motion gets detected, they light up. I figured, since I've got these motion detectors already, I might not need to purchase additional detectors with native HomeKit support.

So my use case is basically to create automatic scenarios based on motion.

olofbokedal commented 5 years ago

But since I just learned about the polling limitations, I'm guessing that my use case isn't doable? Fetching motion with an interval of 30 seconds won't trigger scenarios as expected.

I'm guessing these kinds of sensors are depending on native HomeKit integration since they'd need to push their event rather than a plugin via HomeBridge polling for them?

ptz0n commented 5 years ago

Unfortunately, Verisure motion detectors does not seem optimal for your use case.

What kind of lights are you controlling? If you have Hue, I'd personally recommend their indoor motion sensor. Works great with homebridge-hue.

olofbokedal commented 5 years ago

Hue at the moment yes, but will also control Plejd once their bridge has support for HomeKit. Regardless, a motion sensor with support for HomeKit will cover all of my uses cases.

But agreed that the ones from Verisure doesn't seem like the best approach, although it'd be nice to spend money on something else than additional sensors.

ptz0n commented 5 years ago

I'm closing this one, as we cannot use Verisure devices to cover requested use case.