homebridge / HAP-NodeJS

Node.js implementation of the HomeKit Accessory Protocol (HAP)
Apache License 2.0
2.68k stars 631 forks source link

Suggestions for doorbell component #373

Closed brownad closed 7 years ago

brownad commented 7 years ago

Hi,

Referencing this #856

Is there a way to add a Doorbell component, which is connected to a restful GET call, to check for "has been pressed", to the push the iOS notification to the user (with camera screenshot)? The example with https://github.com/Samfox2/homebridge-doorbell works as a test, but missing ability to natively bring it together with a doorbell, any suggestions on how to do this? This is for the DoorBird device:

https://www.doorbird.com/downloads/api_lan.pdf?rev=0.15

mrose17 commented 7 years ago

@brownad - i don't have one of these doorbells, but i wrote the plugin for the ring doorbell ...

based on the API document, i think the strategy is:

  1. if you are polling, then you want to very frequently make the CHECK REQUEST and use the doorbell value (0 or 1) as the setValue for the ProgrammableSwitchEvent
  2. if you want the doorbell to push to your plugin, make the NOTIFICATION REQUEST and use the event=doorbell parameter to determine when to do a setValue(1) with presumably a debounced timeout to do a setValue(0) a few seconds later
  3. if you want the plugin to connect to the doorbell and then have the doorbell respond over a long-lived HTTP connection when an event occurs, make the MONITOR REQUEST.

the easiest is approach 1. approach 3 is more efficient, but requires good exception handling (e.g. a keepalive on the HTTP connection and re-establishing the connection whenever it fails.

approach 2 is elegant, but probably failure prone.

does that help?

brownad commented 7 years ago

That is very helpful thank you

ygageot commented 7 years ago

For "homebridge/homewizard" plugin, I developed recently an accessory using the basic Doorbell service. It was working well with the Home app.

Since 11 January evening, Home app was displaying the doorbell as "non supported".

With the "Homekit Accessory Simulator", I can't create a simple accessory with this service but I am obliged to create a "Video doorbell" including an IP camera.

I suspect changes in HomeKit framework about this point.

Have you some information around that ?

mrose17 commented 7 years ago

@ygageot - that is odd, generally an update "adds things". can you include a screen shot of what you're seeing with the "non supported" screen?

ygageot commented 7 years ago

Sorry, in French...

img_4944

brownad commented 7 years ago

Same issue I noted before where it is not supported.

Sent from my iPhone

On 13 Jan 2017, at 19:53, Gageot Yves notifications@github.com wrote:

Sorry, in French...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

Samfox2 commented 7 years ago

My doorbell plugin shows the same message but nevertheless notifications to ios devices are submitted.

ygageot commented 7 years ago

@Samfox2 it is funny because before 11 January evening it was working well !! I suspected change where the doorbell service can't be the alone service of an accessory but be on service for video doorbells.

brownad commented 7 years ago

I have this working on doorbird so closing