hjdhjd / homebridge-doorbird

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

Upgrade to latest api v.19+ #20

Closed brownad closed 6 years ago

brownad commented 6 years ago

Key components will be deprecated: notifications being one. Needs work to keep motion and ring alive. Rest of the components still work. Firmware update to be rolled out introduces breaking change.

mrhund commented 6 years ago

Well, we have to check what really needs to be done. The API says: „Hint: entries from the old “notification.cgi” configuration get migrated to schedule entries“. If we are lucky only the documentation needs to be updated.

Von meinem iPad gesendet

Am 19.02.2018 um 19:40 schrieb brownad notifications@github.com<mailto:notifications@github.com>:

Key components will be deprecated: notifications being one. Needs work to keep motion and ring alive. Rest of the components still work. Firmware update to be rolled out introduces breaking change.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/brownad/homebridge-doorbird/issues/20, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AZzg6wfhbaVxgpbbEwNx4rSx2z6rqaV1ks5tWb_-gaJpZM4SK9sF.

brownad commented 6 years ago

Good spot, am already on latest firmware. Not quite working yet for me.

But it might be isolated. The schedule is 24 hours by default so but odd it’s not triggering yet

Sent from my iPhone

On 21 Feb 2018, at 20:08, mrhund notifications@github.com wrote:

Well, we have to check what really needs to be done. The API says: „Hint: entries from the old “notification.cgi” configuration get migrated to schedule entries“. If we are lucky only the documentation needs to be updated.

Von meinem iPad gesendet

Am 19.02.2018 um 19:40 schrieb brownad notifications@github.com<mailto:notifications@github.com>:

Key components will be deprecated: notifications being one. Needs work to keep motion and ring alive. Rest of the components still work. Firmware update to be rolled out introduces breaking change.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/brownad/homebridge-doorbird/issues/20, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AZzg6wfhbaVxgpbbEwNx4rSx2z6rqaV1ks5tWb_-gaJpZM4SK9sF. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

brownad commented 6 years ago

I think the migrated config isn’t quite right, I’ll need to spend more time on it.

Sent from my iPhone

On 21 Feb 2018, at 20:08, mrhund notifications@github.com wrote:

Well, we have to check what really needs to be done. The API says: „Hint: entries from the old “notification.cgi” configuration get migrated to schedule entries“. If we are lucky only the documentation needs to be updated.

Von meinem iPad gesendet

Am 19.02.2018 um 19:40 schrieb brownad notifications@github.com<mailto:notifications@github.com>:

Key components will be deprecated: notifications being one. Needs work to keep motion and ring alive. Rest of the components still work. Firmware update to be rolled out introduces breaking change.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/brownad/homebridge-doorbird/issues/20, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AZzg6wfhbaVxgpbbEwNx4rSx2z6rqaV1ks5tWb_-gaJpZM4SK9sF. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

brownad commented 6 years ago

"There can be only one schedule entry for each output type, time slot and event slot. Example: just one HTTP trigger for ring events at 8 o'clock. But an SIP call at the same time is possible. If more events are needed, one needs to implement eventmultiplexing. Exceptions are relays, where more can be triggered for the same event."

That makes it interesting, only one HTTP event allowed...

brownad commented 6 years ago

Few reboots later and events are back. The change on doorbird prevents receiving both doorbell and motion events at the same time schedule set in the app or http update. Closing until this surfaces as a need, motion still works but needs to be against a time slot not occupied by doorbell http calls.

mrhund commented 6 years ago

Hi, checked my doorbird configuration and I’m already on the new firmware. The notification was migrated correctly and is working fine. But I have only configured “doorbell” as “motion” is not interesting for me...

My idea is to check if they send some payload with the notification so we could parse if the event is motion or doorbell. Will do that on the weekend.

PS. Found that the favorites and schedules can be configured in the Doorbid App in the Admin menu. Very comfortable 😊

brownad commented 6 years ago

That would be cool. The App is far easier to navigate than the single JSON response from favorites.

Sent from my iPhone

On 22 Feb 2018, at 19:26, mrhund notifications@github.com wrote:

Hi, checked my doorbird configuration and I’m already on the new firmware. The notification was migrated correctly and is working fine. But I have only configured “doorbell” as “motion” is not interesting for me...

My idea is to check if they send some payload with the notification so we could parse if the event is motion or doorbell. Will do that on the weekend.

PS. Found that the favorites and schedules can be configured in the Doorbid App in the Admin menu. Very comfortable 😊

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

mrhund commented 6 years ago

Well, well... doorbird and I had some intersting hours ;) There is good news and bad news, but the good news prevails.

First the bad news: The new schedule.cgi does not send any information about the event in the header or the content. Both are empty. But when digging further in the API I noticed that this is not neccessary.

So we come to the good news: Yes, there is a limitation of only schedule entry for each output type, time slot and event slot. But as doorbell and motion are two different events there can be a seperate http output types for doorbell and motion at the same time :)

Here my schedule JSON:

[ { "input":"doorbell", "param":"1", "output":[ { "param":"", "enabled":"1", "schedule":{ "weekdays":[ { "to":"82799", "from":"82800" } ] }, "event":"notify" }, { "event":"http", "param":"1000", "schedule":{ "weekdays":[ { "to":"82799", "from":"82800" } ] } } ] }, { "input":"motion", "param":"", "output":[ { "enabled":"1", "event":"notify", "param":"", "schedule":{ "weekdays":[ { "from":"0", "to":"604799" } ] } }, { "enabled":"1", "event":"http", "param":"1001", "schedule":{ "weekdays":[ { "from":"0", "to":"604799" } ] } } ] } ]

As you can see there are two http output actions with different params (=favourite URLs, in this case our motion.html and doorbell.html in homebridge) and this works fine. So it is confimed that our implementation is also working fine with Firmware >110 and API >0.20.

One thing that cost me a lot of time: It is not possible to set the motion event via the admin APP GUI, only doorbell is supported. You have to set the motion event it via the API. But I was not able to send a new configuration to the doorbird as described in the API documentation. They say you need to send the config JSON via http POST to the doorbird. Well I did that, the doorbird said "200 OK", but the configuration was not updated. Fortunately it is possible to use the "old" notfication.cgi to register for an event and the doorbird converts it to a schedule JSON as seen above.

brownad commented 6 years ago

Brilliant insight, feels like you had some fun.

I think if /when the app is more controllable then this might get a bit easier.

I’ve also had to go back to the old notifications api thankfully it’s still around.

Sent from my iPhone

On 4 Mar 2018, at 12:17, mrhund notifications@github.com wrote:

Well, well... doorbird and I had some intersting hours ;) There is good news and bad news, but the good news prevails.

First the bad news: The new schedule.cgi does not send any information about the event in the header or the content. Both are empty. But when digging further in the API I noticed that this is not neccessary.

So we come to the good news: Yes, there is a limitation of only schedule entry for each output type, time slot and event slot. But as doorbell and motion are two different events there can be a seperate http output types for doorbell and motion at the same time :)

Here my schedule JSON: [ { "input":"doorbell", "param":"1", "output":[ { "param":"", "enabled":"1", "schedule":{ "weekdays":[ { "to":"82799", "from":"82800" } ] }, "event":"notify" }, { "event":"http", "param":"1000", "schedule":{ "weekdays":[ { "to":"82799", "from":"82800" } ] } } ] }, { "input":"motion", "param":"", "output":[ { "enabled":"1", "event":"notify", "param":"", "schedule":{ "weekdays":[ { "from":"0", "to":"604799" } ] } }, { "enabled":"1", "event":"http", "param":"1001", "schedule":{ "weekdays":[ { "from":"0", "to":"604799" } ] } } ] } ] As you can see there are two http output actions with different params (=favourite URLs, in this case our motion.html and doorbell.html in homebridge) and this works fine. So it is confimed that our implementation is also working fine with Firmware >110 and API >0.20.

One thing that cost me a lot of time: It is not possible to set the motion event via the admin APP GUI, only doorbell is supported. You have to set the motion event it via the API. But I was not able to send a new configuration to the doorbird as described in the API documentation. They say you need to send the config JSON via http POST to the doorbird. Well I did that, the doorbird said "200 OK", but the configuration was not updated. Fortunately it is possible to use the "old" notfication.cgi to register for an event and the doorbird converts it to a schedule JSON as seen above.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.