Arlo: replacement pyarlo module

This is my error:

Error while setting up platform aarlo
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, line 126, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.7/asyncio/tasks.py”, line 416, in wait_for
return fut.result()
File “/config/custom_components/aarlo/camera.py”, line 97, in async_setup_platform
cameras.append( ArloCam(hass, camera, config) )
File “/config/custom_components/aarlo/camera.py”, line 146, in init
self._ffmpeg = hass.data[DATA_FFMPEG]
KeyError: ‘ffmpeg’

Why?
Solution?

@c-scoot The cameras don’t take regular snapshots but the image will update if:

  • the camera is armed, set to record and motion is detected
  • you click the snapshot button in Home Assistant or the Arlo app

@danielsjoo I checked in an incorrect manifest.json file, can you update and try again?

@Macke If you are using the aarlo-glance card you can use image_date in the show section. top_date: true will put it at the top.

show:
    - motion
    - snapshot
    - signal_strength
    - captured_today
    - battery_level
    - image_date
top_date: true
2 Likes

Thank you @sherrell for this - it’s really good and you’re doing a brilliant job supporting people here.

I had a problem with the old component that I was hoping this new one would fix: I renamed some of my cameras (so e.g. “Back” became “Garage”) in the Arlo UI, but in Home Assistant it’s still using the old names (e.g. “Battery Level Back”).

Since both arlo and aarlo have this problem, I’m guessing the Arlo name is fixed from when the camera was set up and that when I rename it in the UI that’s just changing an alias. Does that make sense?

Is there some way in Home Assistant / aarlo to override camera names for the UI? It’s quite confusing right now because I’ve moved the cameras around to different parts of the house so the names are quite wrong (e.g. “Drive” is actually in the rear garden!).

@optilude I have the same issue, as I buy new cameras I move the old ones around, a quick scan of the logs shows the name still coming from Arlo but it may be the way I ask for the devices. For now customize.yaml should work, the following is an example entry:

sensor.aarlo_battery_level_shed:
    friendly_name: Battery Level Basement

Thank you! I think editing it in the entity registry GUI has the same effect (the old arlo module didn’t list sensors there, but yours does).

Currently having a hard time getting streaming to work. I run in a FreeBSD jail on a FreeNAS server. pip install av==6.1.2 fails due to missing dependencies / assumptions about the build environment that aren’t trivial to install on BSD. There is a package for py36-av that would work but it’s at 6.1.0 instead of 6.1.2. :frowning:

Sorry but I’m new to this, how do you mean I should do? Don’t get it.

@danielsjoo I think he just means, get the code from GitHub afresh and try again - he fixed a problem in the code.

@sherrell can you clarify one thing? In the README, you show an example of an automation that updates the snapshot image 3 seconds after recording starts.

Is that just a somewhat arbitrary example, or is it necessary to get the snapshot images on the camera glance card to update after each recording?

I figured out how to make streaming work on FreeBSD in case anyone is interested:

pkg install ffmpeg
pkg install pkgconf

It should then be possible to run pip install av==6.1.2 from the virtualenv where Home Assistant is installed. I did it manually but I believe it is actually done automatically when the stream component is loaded.

@optilude I’m actually running HA in a freebsd jail as well and yes I ran those two command and have the stream working. Mine for some reason only has video, no audio. How’s yours looking?

Now it’s working, thank you!

Unfortunately my cameras don’t have microphones so I don’t know if the stream has sound or not!

Spot on! Makes sense thank you!

The last piece of the puzzle is how I turn individual cameras on and off. I’m sure I’ve done it accidentally when playing and I’m probably missing something obvious!

There is a service called camera.turn_on and another called camera.turn_off. You pass them the camera name as a parameter, e.g.:

{
  "entity_id": "camera.aarlo_garden"
}

You can test this from within the Services page under Developer tools in the Home Assistant GUI.

@sherrell I’m seeing an issue where the library and latest clip snapshot will only update (in the aarlo-glance card) after an HA restart.

I enabled debug logging whilst running a test. See https://gist.github.com/optilude/d5b29346359cc861abf1d3f77be7ce9f.

I also get this error in the Safari web console (unsure if related to Aarlo or not):

[Error] Failed to load resource: the server responded with a status of 404 () (hls.min.js.map, line 0)

(I think this is a red herring, actually, looking at it, since it’s just a source map file it’s failing to find)

During the test, the binary sensors for motion on each camera works as expected. The aarlo-glance card also shows the correct status in real time (Idle, Recording, etc). A new library video + front page snapshot image appear in the Arlo app straight away.

Could this be a regression?

@optilude Thanks for the info on getting the BSD jail working! I have a FreeNAS server at work but I have more experience with Linux and would have had a hell of a time tracking that down.

As for the automation, it’s an example and entirely optional and the camera image will update without it. The normal order of things is:

  • Arlo detects motion has started
  • Arlo start recording
  • Arlo detects motion has stopped
  • Arlo stops recording
  • Arlo updates the image associated with the camera
  • This image update appears on the aarlo-glance card

The automation just shortcuts the image update by asking Arlo to take a snapshot at the beginning of the recording. What this means is you get an image update before the recording has finished so you can (hopefully) get a better idea of what’s going on.

@danielsjoo Glad it working! Sorry for being brief, I was typing on a lunch break.

Interesting, I’m not seeing a media upload notification telling me the image has changed. I would expect something like this:

2019-04-28 20:55:57 DEBUG (EventStream) [pyaarlo] Front Camera CAMERA got one mediaUploadNotification

I also had one person who’s Arlo server would never send them an upload notification, you could try adding this you your config:

aarlo:
  (your-usual-options)
  no_media_upload: True

If you want to delve further and have packet dumps turned on, can you look for something with the following text around the time your last test ran? It’s usually in a mediaUploadNotification I use to trigger the image change.

'recordingStopped': True,

Did a quick test this morning. Setting the no_media_upload flag helps. Will keep testing.

@sherrell I have the HD (non-pro) cameras. They don’t have a “record until motion stops” feature. All I can set is a timeout, so if motion is detected on camera A record 20s on camera A and record 10s on camera B etc.

Is this the reason?

I am getting an error for aarlo. I run Hassio in Docker on and Ubuntu server. Any idea why I get this error?

Error while setting up platform aarlo
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, line 126, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.7/asyncio/tasks.py”, line 416, in wait_for
return fut.result()
File “/config/custom_components/aarlo/camera.py”, line 97, in async_setup_platform
cameras.append( ArloCam(hass, camera, config) )
File “/config/custom_components/aarlo/camera.py”, line 146, in init
self._ffmpeg = hass.data[DATA_FFMPEG]
KeyError: ‘ffmpeg’

Thanks

You need to pull the latest version from the repository, I checked in a version with a broken manifest.json file.