hjdhjd / homebridge-doorbird

Homebridge plugin for Doorbird
Apache License 2.0
54 stars 14 forks source link

API configuration #21

Closed BillS11 closed 6 years ago

BillS11 commented 6 years ago

Hi there

Thanks so much for building and maintaining this plugin, I just got my flush mount intercom yesterday and I'm super excited! I've managed to get the DoorBird to show up in HomeKit but each accessory (lock, light, motion) is displaying "No Response" and my guess is I didn't configure the API notifications properly.

How do I configure the API within the DoorBird app? Within Administration >>> HTTP Calls, what is the actual URL that I put there?

I've currently just put the following in my DoorBird app (note I'm running Homebridge on my Mac):

http://_/bha-api/notification.cgi?http-user=&http-password=&event=doorbell&subscribe=1&url=http://_:5005>/doorbell.html

Terminal log shows the following error when running Homebridge:

[2018-6-2 21:46:09] DoorBird is running on port 49618. DoorBird is listening on port 5005 Snapshot -i http://_:80/bha-api/image.cgi?http-user=&http-password=_ -t 1 -s 480x270 -f image2 - events.js:183 throw er; // Unhandled 'error' event ^

Error: spawn ffmpeg ENOENT at _errnoException (util.js:1022:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19) at onErrorNT (internal/child_process.js:372:16) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickCallback (internal/process/next_tick.js:180:9)

bombadiltom commented 6 years ago

Is ffmpeg installed? https://github.com/KhaosT/homebridge-camera-ffmpeg/wiki/Raspberry-PI

BillS11 commented 6 years ago

Yep, I installed v4.0. I tried removing the DoorBird plugin and just running both DoorBird configs in the tested configurations link below but both gave the same error. Seems like something's wrong with the ffmpeg component instead. Any clues? https://github.com/KhaosT/homebridge-camera-ffmpeg/wiki/Tested-Configuration

bombadiltom commented 6 years ago

Is ffmpeg in $PATH, seems like it cannot be started. Can you start in the shell?

BillS11 commented 6 years ago

Yep, you are correct. I've now installed ffmpeg properly and the video stream is working - progress! Thank for your help.

The light switch and lock is working but pressing the doorbell button doesn't trigger a notification, nor is the motion sensor triggering HomeKit notification. Do you see anything wrong with what I've put as the HTTP call? Should the Homebridge IP address at the end of the string be my Mac's IP address?

I don't have any wget lines either in my config file, is this incorrect? The only thing I've done is add HTTP calls in the DoorBird iPhone app. Is there another step in registering the end point?


For future reference and for other newbies like myself, you have to install ffmpeg 'properly.' It's not as simple as downloading ffmpeg and double clicking the file and running it (this is what I did initially...). I installed it through terminal via home-brew which you can easily google how to. Once this was installed, the Homebridge plugin works without errors!

brownad commented 6 years ago

Your DoorBird needs to have registered the endpoint for your homebridge - motion and doorbell separately.

The doorbird api will call them on the event..

Sent from my iPhone

On 3 Jun 2018, at 07:35, BillS11 notifications@github.com wrote:

Yep, you are correct. I've now installed ffmpeg properly and the video stream is working - progress! Thank for your help.

The light switch and lock is working but pressing the doorbell button doesn't trigger a notification, nor is the motion sensor triggering HomeKit notification. Do you see anything wrong with what I've put as the HTTP call? Should the Homebridge IP address at the end of the string be my Mac's IP address?

For future reference and for other newbies like myself, you have to install ffmpeg 'properly.' It's not as simple as downloading ffmpeg and double clicking the file and running it (this is what I did initially...). I installed it through terminal via home-brew which you can easily google how to. Once this was installed, the Homebridge plugin works without errors!

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

BillS11 commented 6 years ago

I've added two HTTP Calls in the iOS DoorBird app. Is this what you mean by registered endpoint?

HTTP call for Doorbell is: http://_/bha-api/notification.cgi?http-user=&http-password=&event=doorbell&subscribe=1&url=http://_:5005/doorbell.html

brownad commented 6 years ago

Hmm you can test them directly by calling the url in a browser it will fire the event in homekit. Then you’ll know if it’s on the plugin setup side or the doorbird side, if it works then plugin is correct and what you did on doorbird is wrong. I found using wget in a terminal was better than the doorbird app if you wanted to ensure it’s all good. Do check the app afterwards as there are time slots against the api which you need to make all blue in the app - make sense when you see it.

Sent from my iPhone

On 3 Jun 2018, at 08:12, BillS11 notifications@github.com wrote:

I've added two HTTP Calls in the iOS DoorBird app. Is this what you mean by registered endpoint?

HTTP call for Doorbell is: http:///bha-api/notification.cgi?http-user=&http-password=&event=doorbell&subscribe=1&url=http://:5005/doorbell.html

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

BillS11 commented 6 years ago

Thanks brownad, didn't know about the schedule step where you have to make it all blue. I've since done this and it still doesn't work. What's interesting is I tested the line in my web browser as you suggested and got some interesting results. I feel I'm very close so hoping you can help me get across the line here.

The entire line I'm using is:

http://__/bha-api/notification.cgi?http-user=<_Login_>&http-password=<_password_>&event=doorbell&subscribe=1&url=http://192.168.0.57:5005/doorbell.html

When I test this entire line in my browser, I receive the following output but no HomeKit notification on my iPhone.

{"BHA": { "RETURNCODE": "1", "NOTIFICATIONS": [{"event": "doorbell1","subscribe": "1","url": "http://192.168.0.57:5005/doorbell.html","user": "","password": "","relaxation": "10"}]}}

However, when I tested the back end of the line (as below) in my browser, I receive a HomeKit notification on my iPhone.

http://192.168.0.57:5005/doorbell.html

BillS11 commented 6 years ago

Happy to say that it's magically fixed itself! I am a very, very happy man! Thank you Brownad and Bombadiltom, much appreciated!

The iOS app automatically created two new HTTP Calls labeled "legacy_api_http_notification_doorbell" and "legacy_api_http_notification_motionsensor." No idea why or how it did this...

For other's reference, the URL for it became just:

http://<_Mac_IP_>:5005/doorbell.html http://<_Mac_IP_>:5005/motion.html

brownad commented 6 years ago

Happy days, enjoy 😎

It’s a bit of a pain to setup but worth it. I hope one day it’s all native... promises promises

Sent from my iPhone

On 3 Jun 2018, at 15:25, BillS11 notifications@github.com wrote:

Closed #21.

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