Arlo: replacement pyarlo module

As far as I’m aware you should be able to access the URL from anywhere. Just right-click on the camera image and copy the link and do:

wget "url-you-copied"

on a remote machine and it should work. Or paste it into an anonymous browser tab.

I’ve tried to achieve the same thing and am now stuck with the exact same problem: Old images delivered when motion occurs

Any updates on your side on this?

Unfortunately same issue. I was just thinking today maybe this is related to having the Local storage option enabled in Arlo? Do you have That enabled as well? I was planning on disabling and seeing if that makes a difference. I’m attaching my config in Arlo.

Seems not to cause the issue for me at least, since I have no USB device connected and this setting is therefore disabled in my setup.

@opentekhead @ParUnicycle
Can you paste the automation, I can try it here.

What mechanism are you using to retrieve the image?

I’ve tried two different methods. First I tried with the automation example on github https://github.com/twrecked/hass-aarlo/blob/master/README.md#advanced-automations but did not have any success. I then switched it up to another example I saw in the forums. Tensorflow, Arlo, Docker - Automate a secure(ish) home

I’ve turned off the local storage option with no success as well.

I have some blink cameras and I was able to get that to send the latest video.

I’ve also tested using dynamic content iOS notifications where I include the camera entity. That seemed to work once or twice then failed. The image in Lovelace is correct sometimes but I find it hangs within a day or so. The other challenge with the camera dynamic content is it only shows the latest image, if I had multiple notifications it does seem to show the history through the notifications.

I was planning testing send the camera_proxy URL however I get struggle with the wrong token and getting forbidden. Is there a way to send the camera URL attribute instead of typing it in? I believe I read that the token for camera proxy expires. I’ve tried a long lasting token but couldn’t get that to work by just adding it to the camera_proxy URL.

Mine looks like this - also mostly taken from samples and added a 3sec delay before sending the image to a telegram chat. I’ve already tried extending the delays without success

- id: automation-0100
  alias: Camera Snapshot
  trigger:
  - entity_id: camera.aarlo_entrance
    for: 00:00:03
    from: 'idle'
    platform: state
    to: 'recording'
  - entity_id: camera.aarlo_entrance
    for: 00:00:03
    from: 'recently active'
    platform: state
    to: 'recording'
  condition:
  - condition: device
    device_id: c1c079655a8e4d3a86c46b976a0
    domain: binary_sensor
    entity_id: binary_sensor.entrance_door
  action:
  - data_template:
      entity_id: "{{ trigger.entity_id }}"
    service: camera.aarlo_request_snapshot
  - delay: 00:00:03
  - data:
      data:
        photo:
        - capture: Snapshot
          file: /config/www/cameras/frontdoor/frontdoor_snapshot.jpg
      message: Movement detected
      title: Front Door
    service: notify.notify_group```

@sherrell started noticing an issue today with my state not updating in Home-assistant and my set mode command not working sometimes. I get the following log message

## Log Details (WARNING)

Logger: pyaarlo
Source: custom_components/aarlo/pyaarlo/__init__.py:273
First occurred: June 3, 2020, 9:50:30 PM (265 occurrences)
Last logged: 12:32:29 PM

* general exception HTTPSConnectionPool(host='my.arlo.com', port=443): Read timed out. (read timeout=120.0)
* attempt 1: error in response when setting mode={'data': {'error': 'AUTO-5010', 'message': "Device doesn't belong to the User", 'reason': "XXXXXXXXXXXXX doesn't belong to the User / Is not provisioned"}, 'success': False}

The “XXXXXXXXXXXXX” is my base station serial number. I logged in with the same user that I am using in Home-assistant with aarlo (not the primary user on the account) and I can’t see the base station in the list of devices. Could that have something to do with it? Did arlo change something?

As a note I am also seeing this in the standalone pyaarlo. It looks like it works fine with my primary user account, but the seconday account looks to not be working correctly. The first disarm call always seems to fail, but any arm/disarms after that work fine. However, I am not getting notifications back in a timely manner that the mode successfully changed.

Here are a few more error messages that I am getting:

## Log Details (WARNING)

Logger: pyaarlo
Source: custom_components/aarlo/pyaarlo/__init__.py:45
First occurred: 1:13:19 PM (1 occurrences)
Last logged: 1:13:19 PM

event loop failed to start
## Log Details (WARNING)

Logger: homeassistant.setup
Source: __main__.py:356
First occurred: 1:12:56 PM (1 occurrences)
Last logged: 1:12:56 PM

Setup of aarlo is taking over 10 seconds.

@ssilence what versions of Aarlo and Home Assistant are you on?

As for the "Device does not belong" issue, if it’s happening on the website it could be an Arlo issue. I noticed Arlo seemed to be a little slower the last few days - it exposed in the lovelace code - I wonder if it’s all tied together.

I should have some time to poke around later this week.

I am on home assistant version 0.110 and for Hass-arlo I have tried 0.6.19.1 and 0.7.0.alpha.4. I have tried with both a primary and secondary account. With the primary I get rid of the first error message related to the device does not belong to you. However I am still experience errors when I try to set the mode. Sometimes it works sometimes it doesn’t. I also get an error at startup related to timeout. Will investigate more tomorrow with just pyaarlo.

I’m seeing something similar here. And I know it was working yesterday.

It looks like Arlo has changed their back end host. If you are seeing strange issues - 10 seconds timeout errors, nothing updating - try this configuration:

aarlo:
  ... your old config ...
  host: https://myapi.arlo.com

This looks to have fixed my issues, everything is running smooth again. Do they change their host like this regularly?

Seconded that updating the host in my configuration.yaml appears to have corrected the lagging issues.

They’ve changed it a few times. I had a quick look in the returned packets and can’t see the new address so I guess it’s hard coded into the javascript.

@opentekhead @ParUnicycle I think this is a timing thing, I don’t think the snapshot is getting back in 3 seconds. And based on my recent observations I think the Arlo servers are slowing down.

I’ll try and get some example code up but there is an event aarlo_snapshot_ready that fires when the snapshot is complete, you can hook into that for the notification.

edit:

This event will fire when the snapshot is actually ready. When that will be depends on Arlo and the camera type. There is also a trigger.event.data.file you can get the filename from.

- id: 'your-id-here'
  alias: Snapshot Ready
  trigger:
    platform: event
    event_type: aarlo_snapshot_ready
  action:
  - service: notify.default
    data_template:
      message: '{{ trigger.event.data.entity_id }} has a snapshot'

I just add an event listener through the developer tools to see when the the aarlo_snapshot_ready fired and then check my local file created. Unfortunately, I saw the event correctly and checked the file created locally on the server it was an old image. Not the last image but one from multiple snapshots earlier. I will continue to try to narrow down the variables to make sure the file is not locked and not able to be written over or something.

One question, are you calling aarlo_request_snapshot or aarlo_request_snapshot_to_file?

aarlo_request_snapshot_to_file. I was going to try switching to just the snapshot. When I call just the snapshot through the services page it seems to update the Lovelace glance card successfully most times.