Blink Integration stopped working and can't login

Fix is in https://github.com/home-assistant/core/pull/37755

Well… “in”. Still needs to be merged and added to HA.

5 Likes

Manually making the change worked for me.

2 Likes

That’s awesome to see that a fix has already been identified - thanks for that.
Do you know when this would be merged into HA or whether it’s best to perform the change manually in the meantime?

Thanks!

It’s slated for the 0.112.5 bugfix release. Not sure when that’ll be in but I imagine within the next couple days

1 Like

Same problem here. Thanks fronzbot for your work!

+1 for the whole thread, I changed the 3 files to up the version of blinkpy as described in the github link above and it now works again.

For those of you on docker who want to fix it, log on your docker container with

docker exec -it <name of your HA container> /bin/bash

then cd to /usr/src/homeassistant/ and change the requirements_all.txt and requirements_test_all.txt files so that the line for blinkpy==0.15.1 instead of 0.15.0

next go to /usr/src/homeassistant/homeassistant/components/blink and change manifest.json to the same version

"requirements": ["blinkpy==0.15.1"], 

exit and restart your container and it works!

Thanks a lot @fronzbot for the great work!

1 Like

Worked like a charm. Thanks @dels78. And thanks @fronzbot for all the great work on this integration!

[NEVER MIND! My error was during authentication – I didn’t even make it to the other end-point calls. Turns out it was a remote certificate error, so I ignore all cert errors in C# via:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;

and that fixed the issue. I do not have an issue with the “Host” header on subsequent requests because I never had it there in the first place. Whatever changes they made last Friday seem to have messed with multiple aspects of the integration, and python connections must not have a problem with the certificate issue.]

@fronzbot, Excellent. I am not seeing what I need to change, though (I have my integration written in C#). My GitHub skills are weak and I am not seeing an easy way to find out what you recently changed. Can you summarize, or point me to the files I need to diff and see what I need to change in my code? I am referring to the blinkpy project…

THANK YOU!

sutekh137

I have made these manual updates and was able to get re-connected (thanks @fronzbot @dels78).

Is anyone else having issues with the actual sensor/entity updates? I am seeing lots of these types of errors in the logs. I am also now unable to toggle motion (per camera).

2020-07-14 09:24:55 ERROR (MainThread) [homeassistant.helpers.entity] Update for binary_sensor.blink_XXXX_XXXXX_motion_detected fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 272, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 466, in async_device_update
    self.update  # type: ignore
  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/binary_sensor.py", line 59, in update
    self.data.refresh()
  File "/usr/local/lib/python3.7/site-packages/blinkpy/helpers/util.py", line 203, in wrapper
    result = method(*args, *kwargs)
  File "/usr/local/lib/python3.7/site-packages/blinkpy/blinkpy.py", line 242, in refresh
    sync_module.refresh(force_cache=force_cache)
  File "/usr/local/lib/python3.7/site-packages/blinkpy/sync_module.py", line 159, in refresh
    self.get_network_info()
  File "/usr/local/lib/python3.7/site-packages/blinkpy/sync_module.py", line 148, in get_network_info
    self.network_info = api.request_network_status(self.blink, self.network_id)
  File "/usr/local/lib/python3.7/site-packages/blinkpy/api.py", line 93, in request_network_status
    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)

2020-07-14 09:29:34 ERROR (MainThread) [homeassistant.helpers.entity] Update for binary_sensor.blink_XXXX_XXXXX_camera_armed fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 272, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 466, in async_device_update
    self.update  # type: ignore
  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/binary_sensor.py", line 59, in update
    self.data.refresh()
  File "/usr/local/lib/python3.7/site-packages/blinkpy/helpers/util.py", line 203, in wrapper
    result = method(*args, *kwargs)
  File "/usr/local/lib/python3.7/site-packages/blinkpy/blinkpy.py", line 242, in refresh
    sync_module.refresh(force_cache=force_cache)
  File "/usr/local/lib/python3.7/site-packages/blinkpy/sync_module.py", line 159, in refresh
    self.get_network_info()
  File "/usr/local/lib/python3.7/site-packages/blinkpy/sync_module.py", line 148, in get_network_info
    self.network_info = api.request_network_status(self.blink, self.network_id)
  File "/usr/local/lib/python3.7/site-packages/blinkpy/api.py", line 93, in request_network_status
    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)

2020-07-14 09:32:49 ERROR (MainThread) [homeassistant.components.script] blink_driveway_motion_on: Error executing script. Unexpected error for call_service at pos 1: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 153, in _async_step
    self, f"_async_{cv.determine_script_action(self._action)}_step"
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 656, in _async_call_service_step
    *self._prep_call_service_step(), blocking=True, context=self._context
  File "/usr/src/homeassistant/homeassistant/core.py", line 1260, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1295, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 209, in handle_service
    self._platforms.values(), func, call, required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 454, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 595, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 485, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 437, in async_enable_motion_detection
    await self.hass.async_add_executor_job(self.enable_motion_detection)
  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/camera.py", line 69, in enable_motion_detection
    self._camera.set_motion_detect(True)
  File "/usr/local/lib/python3.7/site-packages/blinkpy/camera.py", line 88, in set_motion_detect
    self.sync.blink, self.network_id, self.camera_id
  File "/usr/local/lib/python3.7/site-packages/blinkpy/helpers/util.py", line 203, in wrapper
    result = method(*args, *kwargs)
  File "/usr/local/lib/python3.7/site-packages/blinkpy/api.py", line 265, in request_motion_detection_enable
    return http_post(blink, url)
  File "/usr/local/lib/python3.7/site-packages/blinkpy/api.py", line 316, in http_post
    blink, url=url, headers=blink.auth_header, reqtype="post", 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)
2020-07-14 09:32:49 ERROR (MainThread) [homeassistant.components.automation] Blink Driveway Motion On/Off: Error executing script. Unexpected error for call_service at pos 1: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 153, in _async_step
    self, f"_async_{cv.determine_script_action(self._action)}_step"
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 656, in _async_call_service_step
    *self._prep_call_service_step(), blocking=True, context=self._context
  File "/usr/src/homeassistant/homeassistant/core.py", line 1260, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1295, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 204, in service_handler
    await script.async_turn_on(variables=service.data, context=service.context)
  File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 280, in async_turn_on
    await self.script.async_run(kwargs.get(ATTR_VARIABLES), context)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 831, in async_run
    await run.async_run()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 555, in async_run
    await self._async_run()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 572, in _async_run
    await self._async_step(log_exceptions=not propagate_exceptions)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 153, in _async_step
    self, f"_async_{cv.determine_script_action(self._action)}_step"
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 656, in _async_call_service_step
    *self._prep_call_service_step(), blocking=True, context=self._context
  File "/usr/src/homeassistant/homeassistant/core.py", line 1260, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1295, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 209, in handle_service
    self._platforms.values(), func, call, required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 454, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 595, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 485, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 437, in async_enable_motion_detection
    await self.hass.async_add_executor_job(self.enable_motion_detection)
  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/camera.py", line 69, in enable_motion_detection
    self._camera.set_motion_detect(True)
  File "/usr/local/lib/python3.7/site-packages/blinkpy/camera.py", line 88, in set_motion_detect
    self.sync.blink, self.network_id, self.camera_id
  File "/usr/local/lib/python3.7/site-packages/blinkpy/helpers/util.py", line 203, in wrapper
    result = method(*args, *kwargs)
  File "/usr/local/lib/python3.7/site-packages/blinkpy/api.py", line 265, in request_motion_detection_enable
    return http_post(blink, url)
  File "/usr/local/lib/python3.7/site-packages/blinkpy/api.py", line 316, in http_post
    blink, url=url, headers=blink.auth_header, reqtype="post", 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)

Hi,

Keen to get my blink working again. I see there has been a release today, but the https://version.home-assistant.io/stable.json file is still pointing to the 0.112.4 release. Expect an update on this soon?

Thanks

To tag onto my previous post, every time I do a HA restart, my entire Blink integration gets nullified. All of the entities. I have to then delete the integration, restart HA agin, and then add it back.

Anyone else experiencing this?

I have been waiting for 0.112.5 to show up in the supervisor. It was released 17 hrs ago. Tried a manual update but no joy. :frowning:

Same here! I don’t know if minor releases like 0.112.5 show up in the Supervisor. Maybe we’ll have to wait for 0.113 :frowning:

Aha, so it seems there was a build fail and they are holding off until 0.113 … see this post

1 Like

The issue kicked in for me this morning after a reboot. Implemented the fix and all is working perfectly again. Thanks @fronzbot

Did this get added to the 0.113.0b0 beta that is released now? I missed it if its in the notes.

It does appear so, I went ahead with the beta and I has blink! Thanks so much @fronzbot!

Hi I’m new here and was just wondering if this was still working? I am on Home Assistant version 0.113.0b3 with docker container on UnRaid server (all files reflect the blinkpy==0.15.1 changes.) I get passed the login username/password however the 2FA is never emailed to me. I tried to read through everything but can’t get it to work, sorry if the fix was already mentioned.

The first thing to check is to see if your email is verified. 2FA will not work with blink without verified email. In your blink app go to settings and manage account. There you should see a little check mark, like in the below screenshot.