Blink Camera's discontinuing "legacy" login

Yeah, known issue. Blink seems to be throttling calls very aggressively. I’ve got a fix in to catch that specific error (https://github.com/fronzbot/blinkpy/pull/268), and plan on improving the way the library handles throttled calls. No idea on when I’ll be able to get the changes into home-assistant though

I have similar error.
I just updated to version 1.10.3 from 1.10.0 and blink integration stopped working. Insted the alam panel didn’t work with blink in any 1.10.x version.
I get this error

Logger: homeassistant.config_entries
Source: components/blink/init.py:67
First occurred: 20:28:50 (1 occurrences)
Last logged: 20:28:50

Error setting up entry blink for blink
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 217, in async_setup
hass, self
File “/usr/src/homeassistant/homeassistant/components/blink/init.py”, line 97, in async_setup_entry
_blink_startup_wrapper, entry
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/src/homeassistant/homeassistant/components/blink/init.py”, line 67, in _blink_startup_wrapper
blink.setup_params(entry.data[“login_response”])
File “/usr/local/lib/python3.7/site-packages/blinkpy/blinkpy.py”, line 189, in setup_params
self.networks = self.get_networks()
File “/usr/local/lib/python3.7/site-packages/blinkpy/blinkpy.py”, line 195, in get_networks
response = api.request_networks(self)
File “/usr/local/lib/python3.7/site-packages/blinkpy/api.py”, line 82, in request_networks
return http_get(blink, url)
File “/usr/local/lib/python3.7/site-packages/blinkpy/api.py”, line 301, in http_get
is_retry=is_retry,
File “/usr/local/lib/python3.7/site-packages/blinkpy/helpers/util.py”, line 104, in http_req
if json_resp and “code” in response.json():
File “/usr/local/lib/python3.7/site-packages/requests/models.py”, line 898, in json
return complexjson.loads(self.text, **kwargs)
File “/usr/local/lib/python3.7/site-packages/simplejson/init.py”, line 525, in loads
return _default_decoder.decode(s)
File “/usr/local/lib/python3.7/site-packages/simplejson/decoder.py”, line 370, in decode
obj, end = self.raw_decode(s)
File “/usr/local/lib/python3.7/site-packages/simplejson/decoder.py”, line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Connessione persa. Riconnessione…

Hey @fronzbot it works for a few hours but then trips out. I’m using config yaml for now with user, pwd & scan interval. If I go to HA Integrations, remove Blink, then restart HA (it automatically picks up config file entries), then it works for a few hours max… after which it dies. Looks like so:

image

With this log entry that looks eerily similar to ones above:

Log Details (ERROR)

Logger: homeassistant.config_entries
Source: components/blink/__init__.py:67
First occurred: 2:33:58 AM (1 occurrences)
Last logged: 2:33:58 AM 

Error setting up entry blink for blink

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 217, in async_setup
    hass, self
  File "/usr/src/homeassistant/homeassistant/components/blink/__init__.py", line 97, in async_setup_entry
    _blink_startup_wrapper, entry
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/blink/__init__.py", line 67, in _blink_startup_wrapper
    blink.setup_params(entry.data["login_response"])
  File "/usr/local/lib/python3.7/site-packages/blinkpy/blinkpy.py", line 189, in setup_params
    self.networks = self.get_networks()
  File "/usr/local/lib/python3.7/site-packages/blinkpy/blinkpy.py", line 195, in get_networks
    response = api.request_networks(self)
  File "/usr/local/lib/python3.7/site-packages/blinkpy/api.py", line 82, in request_networks
    return http_get(blink, url)
  File "/usr/local/lib/python3.7/site-packages/blinkpy/api.py", line 301, in http_get
    is_retry=is_retry,
  File "/usr/local/lib/python3.7/site-packages/blinkpy/helpers/util.py", line 104, in http_req
    if json_resp and "code" in response.json():
  File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 898, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/simplejson/__init__.py", line 525, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.7/site-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/local/lib/python3.7/site-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I’ve addressed this a few comments up. Known issue. Working on it.

3 Likes

Thanks for the info and apologies for the delay replying. I’ve been on vacation; just got back home and updated and sure enough all my Blink stuff works again.

Fantastic news.

Would it make sense to make the scan interval fuzzy, meaning if you say check every 60 seconds, have it actually check some random number of seconds plus or minus from 60 seconds? Seems that if the Blink guys are analyzing data looking for illegal automations, having requests come in at set intervals would be a serious red flag.

1 Like

I have another issue. Since getting my blink cameras setup via the configuration interface (they were in yaml before), I just noticed that only one camera is associated with my alarm control panel that was originally created when I first setup the blink cameras in HA about a year ago. How can I get the second camera associated with that alarm panel again?

1 Like

@brucehvn - I never saw the Blink Camera trigger a alarm control panel… the only panel I have seen is the HA delivered control panel… which is not associated to any camera per say…
Would be interested to see the yaml raw for that panel.

Re: fuzzy refresh- yeah that’s not a bad idea. I’m working on a pretty big overhaul of the library so will add that to the to-do list.

As for the second one- I was scratching my head as to why you’d have that problem and then I realized- 0.110.0+ saves the login response from when you set up the cameras. So if you add cameras/re-associate/etc, you won’t get those new components set up. I didn’t think of that when I added that functionality into the component, so that’s a bug.

With that said, there’s been a lot of work done on the library so when the new version is finally released (hopefully within the next week or so) that will be fixed and rolled into home-assistant.

@fronzbot having issues today after latest HA update, getting this in the logs. Is there anything I can do to fix it before next update comes out?

2020-06-12 10:02:56 ERROR (MainThread) [homeassistant.components.script] Script - Blink Trigger Camera 1: Error executing script. Invalid data for call_service at pos 1: extra keys not allowed @ data['name']
2020-06-12 10:02:56 ERROR (MainThread) [homeassistant.components.automation] Take Camera 1 Snapshot: Error executing script. Invalid data for call_service at pos 1: extra keys not allowed @ data['name']
2020-06-12 10:03:00 ERROR (MainThread) [homeassistant.components.script] Script - Blink Trigger Camera 2: Error executing script. Invalid data for call_service at pos 1: extra keys not allowed @ data['name']
2020-06-12 10:03:00 ERROR (MainThread) [homeassistant.components.automation] Take Camera 2 Snapshot: Error executing script. Invalid data for call_service at pos 1: extra keys not allowed @ data['name']

Yeah, that service has been updated. Scroll down to the section labeled “Blink”: https://www.home-assistant.io/blog/2020/06/10/release-111/#breaking-changes

Alternatively, you can take a look at the updated docs: https://www.home-assistant.io/integrations/blink/#blinktrigger_camera

3 Likes

It’s in the docs for Blink integration:

Once Home Assistant starts and you authenticate access, the blink integration will create the following platforms:

  • An alarm_control_panel to arm/disarm the whole blink system (note, alarm_arm_home is not implemented and will not actually do anything, despite it being an option in the GUI).

I never had yaml for the alarm control panel, just the entity that was created. When I look at it in developer tools/states, it has an attribute called associated_cameras.

I updated to 0.110.7 the other day and now both cameras are associated with the alarm panel. So it seems to be all good now.

2 Likes

Looking with a clear head was finally able to see the wood for the trees - changed the Script from name: to entity: with new values and working OK now :grinning:

It seems the bug is here again.
This morning I updated HA to the last version and now I get again this error in the log

2020-07-11 09:20:37 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry blink for blink

Traceback (most recent call last):

  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 220, in async_setup

    hass, self

  File "/usr/src/homeassistant/homeassistant/components/blink/__init__.py", line 98, in async_setup_entry

    _blink_startup_wrapper, entry

  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run

    result = self.fn(*self.args, **self.kwargs)

  File "/usr/src/homeassistant/homeassistant/components/blink/__init__.py", line 66, in _blink_startup_wrapper

    blink.setup_params(entry.data["login_response"])

  File "/usr/local/lib/python3.7/site-packages/blinkpy/blinkpy.py", line 189, in setup_params

    self.networks = self.get_networks()

  File "/usr/local/lib/python3.7/site-packages/blinkpy/blinkpy.py", line 195, in get_networks

    response = api.request_networks(self)

  File "/usr/local/lib/python3.7/site-packages/blinkpy/api.py", line 82, in request_networks

    return http_get(blink, url)

  File "/usr/local/lib/python3.7/site-packages/blinkpy/api.py", line 301, in http_get

    is_retry=is_retry,

  File "/usr/local/lib/python3.7/site-packages/blinkpy/helpers/util.py", line 104, in http_req

    if json_resp and "code" in response.json():

  File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 898, in json

    return complexjson.loads(self.text, **kwargs)

  File "/usr/local/lib/python3.7/site-packages/simplejson/__init__.py", line 525, in loads

    return _default_decoder.decode(s)

  File "/usr/local/lib/python3.7/site-packages/simplejson/decoder.py", line 370, in decode

    obj, end = self.raw_decode(s)

  File "/usr/local/lib/python3.7/site-packages/simplejson/decoder.py", line 400, in raw_decode

    return self.scan_once(s, idx=_w(s, idx).end())

simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

any idea?

This morning all my cameras are gone again.

There’s an open issue for this over on the HA github site https://github.com/home-assistant/core/issues/37693.

The good news is that it sounds like it can be fixed.

1 Like

Any idea when it will be released?

Already in 0.112.5

I dont see it as available update in supervisor. I’m still on 0.112.4 eagerly looking every 5 mins for the update to restore my displays. :smile: