Arlo: replacement pyarlo module

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.

I tested the automation at the end of this message and found a few things.

  • Arlo has started throwing out these errors. I’ve not seen these before and last night they appeared about 50% of the time. Just increasing the timeout from 3 seconds to 5 second didn’t seem to help, feel free to try some other values.
020-06-07 21:50:28 INFO (ArloEventStream) [pyaarlo] error: code=4015,message=The camera has just detected motion and is preparing to record. Please try again
  • Even with the errors, the snapshot file always updated. It may have had the previous picture in it but the timestamp on the file always changed.

I’m working on version 0.7 so I’ll address the snapshot failure issue in there. I improved the internal state machine so it’s going to be easier to get the fix in there.

One more thing I noticed is Arlo seems to be slowing down. The latest Lovelace card fixes a bug this exposed. It also means some of the hard-coded timeouts in the state machine are aren’t long enough. This might explain some missing updates. I’m fixing these in 0.7.

The automation:

- id: 'test-98'
  alias: Camera Snapshot
  trigger:
  - entity_id: camera.aarlo_street_camera
    for: 00:00:05
    from: 'idle'
    platform: state
    to: 'recording'
  - entity_id: camera.aarlo_street_camera
    for: 00:00:05
    from: 'recently active'
    platform: state
    to: 'recording'
  condition: []
  action:
  - data_template:
      entity_id: "{{ trigger.entity_id }}"
      filename: "/tmp/{{ trigger.entity_id }}"
    service: aarlo.camera_request_snapshot_to_file
1 Like

Has anyone gotten this to work properly with Arlo baby? Arlo baby is like the red headed step child of the Arlo collection. It’s such a terrible product, but I bought it a while back on sale and I’m stuck with it and use it as the secondary camera. I believe it has now been discontinued.

Anyways, the aarlo component DOES work with Arlo Baby, but when it is enabled for Arlo baby, using the Arlo native app struggles. Typically the native app won’t be able to stream video, and only shows a white screen when you hit play, though I can still see the sensor stats and hear sound from the native Arlo app.

If I remove the Arlo baby access from the user that I have tied to HA, restart HA, then Arlo baby seems to work fine from the native app. It’s almost like the aarlo component is hijacking the feed where it won’t play nice with other users of the app. I’ve never gotten live streaming to work with aarlo (either with Arlo Baby or Arlo Ultra), so not sure if streaming works via HA to Arlo Baby or not.

Anyone else run into this issue with Arlo baby?

Latest from 0.112
`

2020-07-02 19:15:39 WARNING (MainThread) [homeassistant.components.media_player] MediaPlayerDevice is deprecated, modify ArloMediaPlayerDevice to extend MediaPlayerEntity

`

It’s fixed in the 0.7 release which I’ll try and get out of alpha pretty soon.

If that looks like it might take too long I’ll bring it into 0.6 release.

2 Likes

Apologies if this is a dumb question, but is there a different latest-snapshot-url I can use other than one that ends with ‘token=XXX’? Unless I’m mistaken, my token keeps changing. One minute the url works fine on both http://mylocalurl:8123/api/camera_proxy… and https://mysecureurl.duckdns.org/api/camera_proxy… but if I want a few minutes and refresh I’ll suddenly get hit with a 401: Unauthorized error. I’m trying to get a direct snapshot url to use to send for person detection via amazon rekognition. I already have non-arlo PoE cameras set up perfectly with rekognition by creating simple mjpeg cameras along with a mjpeg_url. Having trouble coming up with the url for these arlos. Thanks!

There’s no snapshot-url. With the Arlo cameras have to deal with a 3rd party server so things are little more complicated than a local camera. And truthfully, I’ve never noticed how often the token changes before. It seems like it flips every minute.

Could you use the last_thumbnail from the camera state? I think it lasts longer than the entity_picture url.

One other way to do this is to write the snapshots (using snapshot_to_file) into /config/www and they will be accessible at your-url://local/file-name.jpg.

We also might be able to use the event stream or appdaemon. I’ll see if there is something I can do.

As part of its move away from flash, it looks like Arlo is moving from rtsps streams to mpeg-dash streams. One upshot is we can stream directly from Arlo instead of going via Home Assistant, this might cure problems people were seeing with Arlo Q and Arlo Ultra cameras.

Here’s a link with some instructions if anybody fancies giving it a try:

@sherrell does their API expose the camera mode of night vision status? I am thinking of moving away from motion sensors instead use cameras but obviously lack the ability to detect the light levels for automations to be more precise - I could work with timeframes to determine if its day or night but obviously this would fully enable a detection on the current light level in the area of a camera - as I couldnt see this is the current attributes I was wondering if this is available and if so if you could expose it as an attribute?