Arlo: replacement pyarlo module

@woodmoose I could do a web socket, can you hook into one of those?

If anyone wants to try the new stream: functionality this branch contains a test implementation: camera-stream

A couple of notes:

  • it only works in virtualenv, the ffmpeg in the docker image doesn’t support the stream types
  • I’ve only tried it with chromecast devices but it looked like it worked
  • you will need to have the ffmpeg dev libraries installed for stream to install, the following works in Ubuntu
sudo apt install libavformat-dev
sudo apt install libavdevice-dev

You can try a different stream type by changing the user-agent:

aarlo:
  username: !secret arlo_username
  password: !secret arlo_password
  user_agent: linux

@sherrell Oh man, I feel so sorry - it’s beyond my knowledge - might be something possible but I’m not the one who can answer such question… sorry …

Everything is merged to the master branch. virtualenv users can stream to a picture-glance card now.

@sherrell might be a crazy and impossible request but would be totally amazing to add a face/person detection, using an external library? Is that a stupid request?

Also, is the stream new feature available for hassio?

You should be able to hook this into the Arlo cameras Face and person detection with Deepstack - local and free! I say should, I haven’t actually tried.

And stream doesn’t work in hassio (and docker) because ffmpeg is broken in the distribution, I think they need to change the way it builds. I’ll work out how to raise a bug about this.

sorry to bother you but how would I do that? does this work with the generic picture card as well?

This only works if you’re using virtualenv.

You just upgrade to the latest home-assistant - 0.90 and it provides the streaming interface - enable it by adding stream: into your configuration.yaml - and when you click on a picture-glance image it will start live streaming. You can all also call camera/stream to send the stream to another device.

The aarlo-glance card doesn’t support it yet. I have it working in a dev branch I’m just finishing up the configuration options.

Got it - not sure about the user-agent stuff - chrome on my Mac just waits … - well I am not using chrome so I guess again a feature thats not supposed to work in Safari …

I really hope there is a way to make streaming work on hassio. Other than that the component is absolutely great. I have completely replaced the Arlo app with it. Streaming is the only thing missing…

I should have explained the user-agent better, the user-agent doesn’t affect your browser but how the back end connects to the Arlo servers. And this in turn determines what kind of live stream Arlo sends you went you start streaming.

The default returns an rtsps stream and the alternative returns an rtmp stream. I added the option to see if I (or anyone) could get ffmpeg to work in the docker or hassio images.

If you’re using virtualenv you don’t need to worry about it.

@ffm777 I’ll keep playing around and see if I’m missing something but I think it needs the ffmpeg in the image tweaking. I use a docker image for my main system so I’d like it working as well.

And, just give it a go. If it fails you’ll see an ffmpeg trace in the logs

First, thanks for all your work on this, it is great!
I updated to the latest code and I am trying to get stream to work. I am running on hassbian and I included the stream component and using linux as the user agent. I created a picture glance card for the camera. When I click on it, I can see from the aarlo glance card it is streaming and I can see in the log it opening the rstp stream to my camera, the arlo glance card will eventually update its snap shot. What I cant see is the video stream, I get a pop up that has the spinning circle.52%20PM

Thats what I get as well in chrome but as I dont use chrome I didnt bother fiddling around with it… doesnt even get this in Safari just a not found placeholder

@stogs @collse I’m seeing the same thing from my docker installation. I get an error like this for both user_agent: linux and no user_agent:

Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/hass/ha/homeassistant/lib/python3.6/site-packages/homeassistant/components/stream/worker.py", line 53, in stream_worker
    container = av.open(stream.source, options=stream.options)
  File "av/container/core.pyx", line 275, in av.container.core.open
  File "av/container/core.pyx", line 227, in av.container.core.Container.__cinit__
  File "av/container/core.pyx", line 129, in av.container.core.ContainerProxy.__init__
  File "av/container/core.pyx", line 195, in av.container.core.ContainerProxy.err_check
  File "av/utils.pyx", line 105, in av.utils.err_check
av.AVError: [Errno 1313558101] Unknown error occurred: 'rtmps://vzwow01-z1-prod.ar.arlo.com:80/vzmodulelive?egressToken=f525acba_8c94_495b_a4e0_f2ea7889813f&userAgent=web&cameraId=4XXXXXXXXXXXXXXXXXXX' (16: rtmps)

I think now we need to raise the fact that ffmpeg doesn’t support rtmps and rtsps streams with whoever builds the image.

There is a another issue I will raise with the stream author, but currently there is no way to stop the streams. I don’t think this is an issue for local cameras but the wireless Arlo ones will get drained pretty fast.

1 Like

I use a venv environment on ubuntu no docker so cant help in this one

@collse

If you’re using venv there is a good change you can get it working. You have to install the libav development modules otherwise the stream component won’t install. You can install manually the av library to catch any other issues:

source your-env/bin/activate
sudo apt install libavformat-dev
sudo apt install libavdevice-dev
pip install av==6.1.2

You also can try this branch - aarlo-glance-stream - which makes the click on the picture start streaming instead of showing the last recorded clip. There is a small delay after clicking before the stream appears, I’m working on that.

If everything works you’ll see a reference to an rtsps: stream in the logs and a message about serving an address to 127.0.0.1.

But remember, the stream doesn’t stop so you might have to restart your environment to stop the streaming.

I took a stab at adding support for custom_updater/tracker card. Check out my fork here: https://github.com/rccoleman/hass-aarlo

@rccoleman

Firstly, thanks for doing this, I started looking at this but a few bugs popped up that needed dealing with so I had to keep putting it off.

Secondly, I wasn’t ignoring you, I just had a hectic weekend of travelling so I’ll take a look tonight!

No problem at all :). Just wanted to make sure that it wasn’t buried in an old issue.