fronzbot / blinkpy

A Python library for the Blink Camera system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blink Video Doorbell Support

funkybunch opened this issue · comments

Describe the bug
Related to home-assistant/core#58662

Blink recently introduced video doorbells. After installation of hardware and activation on my existing Blink local system, the Video Doorbell does not appear in Home Assistant. No errors were logged by the home assistant integration.

To Reproduce
Steps to reproduce the behavior:

  1. Install video doorbell hardware.
  2. Follow instruction in Blink Home Monitor to add to existing setup.
  3. Once added, reload and re-install Blink Integration in Home Assistant.
  4. Other Blink cameras appear normally (including Mini) but Video doorbell is not recognized at all.

Expected behavior
Would expect the video doorbell to appear with functionality similar to other Blink cameras.

Home Assistant version (if applicable): 2021.10.6

Log Output/Additional Information
If using home-assistant, please paste the output of the log showing your error below. If not, please include any additional useful information.

Integration logged no errors.

Yeah it's a new product so the API endpoints have to be discovered by somebody and then it can be implemented. There's no timetable for that, unfortunately and I don't own one so I can't do any investigation on my own.

@fronzbot Seems to be the same API endpoint, just a different child object in the response.

I can grab the API endpoints and sample responses for you. Just let me know what you need!

Any update on this? I would also be happy to try and help with anything since I have the device as well, although I am very much a novice with home assistant/programming.

I have sample API responses and endpoints. I'm not too keen on python, but I could take a crack at a PR @fronzbot if it would be helpful. May need some help smoothing it over, but I'm happy to give it a shot if it would help.

I'm also interested in adding support for this camera. It should be relatively straightforward to add if @funkybunch has the responses and endpoints. I'm guessing the child object would at least differ in that the doorbell doesn't report temperature like the other cameras. What can we do to help move this along?

@justinmbrock hows your Python? I'll be available to work on this more tomorrow but I could use some help since my Python is beginner level at best.

My Python is beginner level as well but as a new Blink Doorbell owner, I'd love to get this working. So how can we proceed?

Hey everyone- appreciate the enthusiasm to get this feature added. Unfortunately I have zero time to work on this and won't have any for the foreseeable future, so your best bet is to peruse the code and try to get the endpoints added. Here's a link to the docs: https://blinkpy.readthedocs.io/en/latest/?badge=latest

To start, my guess is the following will need to be added:

  • endpoints added to api.py module
  • new class to represent a doorbell (possibly using a camera as a parent object?). Might make sense to separate this into its own module
  • unit tests to check all new functionality

As someone starts developing the feature, they can open a WIP pull request and we can move and Q&A + debug help there.

EDIT- and this is just step one. Step two will be editing the HA code to get the doorbell added there which should be straightforward

Hey guys, sorry it took me until now to reply, I've had a rough few days. My python is decent enough for an amateur and I'm willing to take a crack at it. @funkybunch, think you can toss the info you have into a repo? I can review those docs from @fronzbot tonight to get up to speed then see what I can make of it tomorrow morning.

@justinmbrock yup for sure. Let me redact them once I get home and then I'll toss them in a gist and post the link here.

@justinmbrock Here are the sample API responses. The first one is the config API endpoint. The 2nd is the homescreen which is already queried by blinkpy in api.py.

Config URL:
{base_url}/api/v1/accounts/{account_id}/networks/{network_id}/doorbells/{camera_id}/config.json

Take picture:
{base_url}/api/v1/accounts/{account_id}/networks/{network_id}/lotus/{camera_id}/thumbnail

Liveview:
{base_url}/api/v1/accounts/{account_id}/networks/{network_id}/lotus/{camera_id}/liveview

Homescreen:

url = f"{blink.urls.base_url}/api/v3/accounts/{blink.account_id}/homescreen"

Alright, blinkpy 0.18.0 released with support for the doorbell thanks to @magicalyak! Should be available via pip now.

Thank you @fronzbot & @magicalyak! What would be the next step to moving this to general availability in Home Assistant?

Next step is for someone to submit a PR to the HA repo to update the blinkpy library version to 0.18.0 and then add the code required to create a doorbell instance (should look similar to the blink mini camera implementation)

Okay cool, sounds relatively straight forward. I can take a crack at that unless @magicalyak beats me to it. @fronzbot mind if I tag you in for code review to make sure I'm on the right track?

I'll actually be auto-tagged once you submit one since I'm the codeowner for the blink integration 👍

Looked through the integration code and it looks like it pulls in camera entities as returned by blinkpy regardless of type. Tested it locally by just bumping the version and sure enough it worked.

PR on home-assistant/core is up: home-assistant/core#61538

Oh yeah I forgot that's how I coded it up 😅 Perfect! Nice and simple, so hopefully because it's a small change it gets approved quickly.

Don't forget to sign the CLA though (I noticed that in the HA pull request so wanted to bring it to your attention in case you missed it)

Cool, yeah I signed the CLA. Hopefully it gets approved soon!

@funkybunch did it get approved? Did it get pushed in one of the recent releases? I'm not seeing my doorbell.

Thanks. I'll try beta.

Yes @ryborg it had been merged into dev.

Thanks for the heads up @magicalyak. I had been keeping an eye on the rc branch which did not have the changes yet.

The Home Assistant maintainers aren't doing a January major release, and there have been a number of minor releases to come out since home-assistant/core#61538 was merged into dev. So my assumption is they are waiting for the next major release in February to release this for general availability. Seems like the beta release channel is the way to go for now.

I'm already on beta. I'll check my logs. I guess I could check to see which blink container is running, or would it all be running in core?

@magicalyak are you running the dev channel by chance? Looks like dev is separate from beta.

https://www.home-assistant.io/common-tasks/os/#run-a-development-version

Screenshot_20211226-140946_Home Assistant
Sorry, my screenshot didn't attach.

@ryborg I switched to the dev release channel and that made my doorbell show up (docs in my post above).

#514 (comment)

It is supported alright, but nothing is triggered when the doorbell is pressed. Is this by design?

pressed

Is somebody successfully working on this topic? Recognize pressed doorbell and to handle this event in blinkpy or home assistant? Thank you very much

I gave up on this. I use the following solution:

  • created an input boolean helper in HA
  • set input helper to sync to alexa
  • create Alexa routine to set it to true
  • create an automation in HA to turn it back to false

I abandoned Blink altogether and moved to Amcrest. All local system, no Amazon middleman, and better HA support (including streaming video feeds).

There's currently no open feature request for doorbell presses, so this wasn't even on my radar. Just open a new feature request issue so I can at least track it. Locking this thread since new feature shouldn't be discussed in old issues