Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blink alarm_control_panel.blink_sync shows always status disarmed #18341

Closed
md-reddevil opened this issue Nov 9, 2018 · 15 comments · Fixed by #18603
Closed

Blink alarm_control_panel.blink_sync shows always status disarmed #18341

md-reddevil opened this issue Nov 9, 2018 · 15 comments · Fixed by #18603

Comments

@md-reddevil
Copy link

Home Assistant release with the issue:
0.81.6

Last working Home Assistant release (if known):
0.80

Operating environment (Hass.io/Docker/Windows/etc.):
Raspberry PI, Hass.io

Component/platform:
Blink component:
https://www.home-assistant.io/components/blink/

Description of problem:
Blink alarm_control_panel.blink_sync shows always status "disarmed". Even if I arm it using service or from Blink mobile application the blync_sync status remains "disarmed". I tried to the service "blink.blink_update", but doesn't help.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

blink:
username: !secret blink_user
password: !secret blink_pass

Traceback (if applicable):


Additional information:
@fronzbot

@fronzbot
Copy link
Contributor

fronzbot commented Nov 9, 2018

Do you have anything in your logs? There were no changes to Blink between 0.80 and 0.81.x

@md-reddevil
Copy link
Author

Hi,
I can see this error in log:

Fri Nov 09 2018 21:02:47 GMT+0200 (Eastern European Standard Time)

Cannot connect to server with url https://rest.prde.immedia-semi.com/events/network/18390.

@fronzbot
Copy link
Contributor

fronzbot commented Nov 9, 2018

Is that the only error? That is normal to be logged when your token expires and blink needs to reauthorize (it should have never been an error in the first place, that was a mistake in the way the library does its logging).

Two follow up questions:

  1. How many sync modules do you have?
  2. What is the syntax you are using to call the arm service? Be as specific as you can as it will help with debug.

@md-reddevil
Copy link
Author

md-reddevil commented Nov 10, 2018

Yes, it is the only error related to Blink.
Below are my answers:

  1. I have just one module
  2. I doesn't matter how I arm the service: using mobile application or calling the service from Home Assistance the result is the same. Always shows disarmed. The script from HA to arm blink is below:

blink_alarm_on_script:
alias: Arm Blink
sequence:
service: alarm_control_panel.alarm_arm_away
data:
entity_id: 'alarm_control_panel.blink_sync'

I have created a group to display Blink cameras:

blink_cameras:
name: Blink Cameras
entities:
- alarm_control_panel.blink_sync

Let me know if you need other details, or to perform any test.

@fronzbot
Copy link
Contributor

Thanks for the info! I'm still not quite sure what's going on, so unfortunately I have another request for you. If you go into the states tab under "Developer Info" in the front end (the icon looks lik e< >), could you find the following information and let me know what it says?

  • alarm_control_panel.blink_sync
    • network_id
    • status
    • network_info
  • camera.blink_cameranamehere
    • motion_detection
    • motion_enabled

@md-reddevil
Copy link
Author

Here are the attributes related to blinc_sync, state = "disarmed":

code_format: null
changed_by: null
name: My Blink Sync Module
id: 35540
network_id: 18390
serial: 210515880
status: online
region: Europe
region_id: prde
network_info: {
"18390": {
"name": "Home",
"onboarded": true
},
"48754": {
"name": "Terrace",
"onboarded": false
}
}
attribution: Data provided by immedia-semi.com
friendly_name: blink sync
icon: mdi:security

Camera status="Idle":

access_token: 2c.....2
brand: Blink
motion_detection: true
name: Blink Terrace
camera_id: 51843
serial: 600277585
temperature: 44
temperature_c: 6.7
battery: 92
thumbnail: https://rest.prde.immedia-semi.com/media/p....3/clip_56iVQNsG_2018_05_19__13_00PM.jpg
video: https://rest.prde.immedia-semi.com/media/p...3/clip_urNBg4VI_2018_11_09__09_17AM.mp4
motion_enabled: true
motion_detected: false
wifi_strength: 3
network_id: 18390
last_record: 2018_11_09__09_17AM
friendly_name: blink Blink Terrace
entity_picture: /api/camera_proxy/camera.blink_blink_terrace?token=2c171.....da2
supported_features: 0

@fronzbot
Copy link
Contributor

Hmm... all of that looks ok. Perhaps a dumb question, but have you tried restarting home assistant to see if it fixes itself post-restart? That still wouldn't explain why the arm/disarm functions aren't working, but maybe it will work as a temporary solution.

@md-reddevil
Copy link
Author

I restarted few times, no help. :)
I was hoping with every update, starting from 0.8, that it will be fixed. But nothing :(

@fronzbot
Copy link
Contributor

Darn. I'll be honest, I'm pretty stumped. It seems like everything has initialized properly and that you're making the correct service calls. You mentioned that the last working version was 0.80- have you tried reverting to ensure that it works on that old version? Another possibly useful bit of info: do you have and DNS level blockers on your system (such as pihole) that may be denying requests to immedia-semi.com?

@md-reddevil
Copy link
Author

It is strange because other services seems to work just fine:

  • blink trigger camera
  • blink arm/disarm

Indeed I have pi-hole, but I installed it just yesterday. So I don't think it is the issue. What is strange, I haven't seen any request in pi-hole log to "immedia-semi.com", neither blocked or forwarded.

Any idea how I can trace this request from Home Assistant ?

@fronzbot
Copy link
Contributor

Yeah, the pi-hole idea was just a thought. You would've had to manually add a list containing immedia-semi to actually block it, which I would find strange (although not impossible). I run pi-hole on my network and Blink works just fine, so you should have zero problems out-of-the-box.

Given that some of the API calls work, I have a theory (especially based on the comments from this repository which my library is based upon). Basically, Blink implemented their API rather haphazardly, so in Europe not all of the API endpoints are implemented in the same way. Some api calls are to the rest.prde subdomain and others... well, I don't know. As far as I'm concerned, this is something that could be solved in the blinkpy library, so I'm going to add an issue there to track it, but I don't know what the solution would be without having some help testing.

After I create the issue in the blinkpy repo, it will link here. If you'd like to help with testing (or anyone else reading this that is having a similar issue) just add a comment there (it will involve some command line work). I'll add a list of initial debug steps to try and narrow down what the API calls should be as well.

@md-reddevil
Copy link
Author

Yeah, that was my thought also, that the issue is related to region. At least now you know what is the root cause and could work to fix it. :)
I will help with testing, just let me know which test to perform.

@md-reddevil
Copy link
Author

Seems I found a small bug in the blinkpy api: api.py

def request_command_status(blink, network, command_id): """Request command status.""" url = "{}/network/{}/command_id/{}".format(blink.urls.base_url, network, command_id) return http_get(blink, url)

Instead of "command_id" in path should be "command"

@md-reddevil
Copy link
Author

I found the issue related to my case. I found it executing Homescreen. I received no info, and I realized it was the info for the last system I created.
It was because of multiple systems I had configured. Just for testing, I created a new system in the App some times ago.

I removed that system and after that the homescreen endpoint returned correct information about the status of the main system.
It could be a bug in their API becuase it returned just the last SYSTEM, not both. Or the homescreen command should have some additional parameter we don't know yet.

@md-reddevil
Copy link
Author

Just found the right API endpoint to check the status of the Network (System):
GET: https://rest.prde.immedia-semi.com/network/<network_id>
It solves the issue with multiple available systems, so instead of calling to check the status, iI would recommend to use the above endpoint, hope this should solve the issue.

@ghost ghost added the in progress label Nov 21, 2018
@ghost ghost removed the in progress label Nov 21, 2018
@balloob balloob mentioned this issue Nov 29, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Mar 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants