Arlo: replacement pyarlo module

@htvekov Many thanks for those kinds work and glad it’s working for you!

@grantc It should turn off automatically after trigger_time seconds. You can also set alarm_volume to 0 to silently test the trigger. For example:

alarm_control_panel:
  - platform: aarlo
    alarm_volume: 0
    trigger_time: 30

Thanks for the response - so I am assuming the only way it will turn off is from timing out?

Yes.

It’s easy enough to add some logic to do it on a mode change. I’ll take a look and see how other alarms do it.

I have never been able to get streaming to work. At times I get different errors and thanks for all the help to get past those. I seem to always get back to the point where the aaarlo glance card shows the spinning circle and I see multiple entries in the log with the following error:

019-06-14 08:11:39 ERROR (stream_worker) [libav.rtmps] Unknown connect error (unsupported authentication method?)
2019-06-14 08:11:39 ERROR (stream_worker) [libav.rtmps] Server error: Connection failed: Application rejected connection.

I am on the latest version of HA 0.94.3 and the aarlo component. I am running hassbian inside a virtual env for HA.

Streaming will work but it can be a pain to get going, it’s to do with ffmpeg not supporting secure streams by default. The following links show how some people got it working:


Also, did you change the user_agent value, I’ve actually had more success leaving it as default.

Hi,

first of all: great work and big thanks @sherrell!

I did find some time today to dig into the “Docker ffmpeg not being able to stream RTSPS”-issue. After some pocking around I realized that apparently the stream component of HA does not use ffmpeg itself (so a replacement with a static build does not work), but rather uses pyav that is bound to the (within the docker container) available shared libav* libraries (as intended through the pip install command).

So, in order to make streaming work with docker, these libraries need to be upgraded to newer versions.

Sadly, this is easier said than done. The libraries are directly installed through the apt system from the underlying docker-base image (python-3.7) that HA chose to use. This base image is based off of Debian Stretch, which -bad for us- only offers the old versions.

Hopefully, after Debian Buster is being released in July 2019, also the python docker-base images will be upgraded to Buster.

Until then, only compiling a version of ffmpeg within the docker file itself is a suitable solution.

To do so, run the following commands in a terminal of THE (running) HOME-ASSISTANT DOCKER CONTAINER:

cd

apt-get update

apt-get -y install build-essential autoconf automake cmake libtool git
apt-get install checkinstall yasm libass-dev libfreetype6-dev libtool libvorbis-dev texinfo wget zlib1g-dev gnutls-dev libmp3lame-dev libssh-dev libtheora-dev libvorbis-dev libx264-dev libx265-dev opencl-dev

wget https://ffmpeg.org/releases/ffmpeg-4.1.3.tar.bz2
tar -xf ffmpeg-4.1.3.tar.bz2
cd ffmpeg-4.1.3

./configure --enable-gpl --enable-nonfree --enable-shared --enable-libtheora --enable-libvorbis --enable-libxcb --enable-libfreetype --enable-libass --enable-gnutls --enable-libx264 --enable-libmp3lame --enable-opencl --enable-libdrm

make

apt-get remove ffmpeg
apt-get -y purge ffmpeg "libav*" "libpostproc*"
apt-get -y autoremove

checkinstall -y --deldoc=yes --pkgversion=10:4.1.3-1
apt-get install libpostproc-dev

pip uninstall av
pip install av==6.1.2

Beware: this takes some time, can break your HA installation and should only be done by people who know what they are doing… :slight_smile:

When running ffmpeg, the output should now be something like

ffmpeg version 4.1.3 Copyright © 2000-2019 the FFmpeg developers
built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
configuration: --enable-gpl --enable-nonfree --enable-shared --enable-libtheor
a --enable-libvorbis --enable-libxcb --enable-libfreetype --enable-libass --enab
le-gnutls --enable-libx264 --enable-libmp3lame --enable-opencl --enable-libdrm

libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100

Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfi
le}…

Use -h to get full help or, even better, run ‘man ffmpeg’

Of course this needs to be redone every time you download/use a new HA container. One could keep the created Debian package and use this to reinstall somewhat faster, though…

Maybe that helps someone. Next up for me is now the tensor-flow integration…

Cheers :beers:

#edit 1: incorporated sherrell‘s comments. Should make it work for most people now

1 Like

@holger2

It helps me and many thanks for figuring this out! I actually use a docker image for my real deployment and I’ve never had the time to get streaming working.

edit: it worked - but I found a couple of things:

After the cd I needed to call apt-get update otherwise it didn’t recognise the packages.

There is an extra space in apt-get -y purge ffmpeg "libav*" " libpostproc*", just before the libpostproc.

edit #2: I put a copy under the contrib directory in the repository.

Hi!

Just a quick note to let people know I’m heading off on vacation for the next 3 weeks. I’ll check in occasionally but I can’t guarantee to fix any issues for while.

Having said that, and because I like to live dangerously, I just checked in a few changes to bring some long standing branches into the master branch. In theory you shouldn’t notice a thing, they all need a configuration change to modify the default behaviour, but you never know… so I recommend backing up your current code before updating. A quick list of changes:

  • You can specify a different HTTPS pool size; this might help with connections not working
  • You can ask for a device refresh every few hours; this might help with mode changes locking up
  • You can get the battery and WiFi level from doorbells now; I noticed I’d completely missed these sensors

Finally, thanks everybody for trying this, putting up with the odd issue (or two), and helping make the module a lot better. When I get back I’ll start working to get this brought into the official home-assistant repository.

Steve

3 Likes

Thanks for all your efforts and have a great vacation!

I upgraded yesterday or so not restarting again… have a good vacation mate and thanks for all the effort so far - I say dont fix anything while taking a break and enjoy the time instead

Hello,

@sherell: first, have a good vacation!
When you’re back, maybe you can add your integration to be visible in teh HACS store?

HACS Store - Develeper Requirements

Many thanks in advance for your integration and for the above!
/ Ralf

Can someone help me out? I dont understand the install of this thing.

I have HomeAssistant on Ubuntu in Docker.
I can login to bash on docker after copying the github to a folder lets say /usr/share/hassio/homeassistant/aarlo

I then run the steps provided install go /config. Which installs but i cannot get integration.
It constantly states Setup Failed for aarlo: Integration not found.

What am i doing wrong. I have setup everything in configuation.yaml, cameras and binary sensors. ETC. i just cant it to pick up the add on…

Can anyone please give me a step by step. Cause none of this works for me. if you want logs configs.etc ill be glad to share but i cant get this to work.

Sorry for the short reply but I’m traveling.

Change the /config to the directory your configuration.yaml is in. The code will be installed under custom_components in there.

1 Like

my config is located like this.

/config/configuration.yaml

So what you are saying is do this?

aarlo:
username: “user”
password: !secret aarlo_pw
db_motion_time: 30
recent_time: 10
last_format: ‘%m-%d %H:%M’
no_media_upload: True
config: /config ?

i tried config: “/config”

image

Here is winscp


image
image
image

Here is the configuration.yaml

When browsing bash in docker
I had /config/config/custom_components.

I think that was the issue. ill confirm soon

Your configuration.yaml is in /use/share/hassio/homeassistant according to your winscp.

If someone is interested in my setup with tensorflow and aarlo - I posted a description of how I set everything up here.

1 Like

Sorry guys. I got it working. There was also a permissions issue on the folder. I got it working but now my battery_level is reporting in the camera but on the card its just yellow. Anyone experiencing that?

@Ben_Ellis

If you hover your mouse over it or click what does it show?