Arlo: replacement pyarlo module

@Muttly It’s a known issue. It started happening recently, I thought it was my code but I’m now starting to think some part of the backend is timing out and causing the problem. I think we’re using the webapi in ways it wasn’t designed to be used.

There is a bug report about it here: https://github.com/twrecked/hass-aarlo/issues/68

But if you don’t want to read that there is new branch you can try - https://github.com/twrecked/hass-aarlo/tree/reconnect - that forces HASS to logoff and back on.

You will need to add reconnect_every to your config and set it to the number of minutes between logoff/login cycles. The example below is very 70 minutes.

aarlo:
  username: !secret arlo_username
  password: !secret arlo_password
  reconnect_every: 70

Excellent!

Thanks Steve, I’ll have a look.

Hi Stephen,

Just a heads up, the alarm control panel is not showing after 0.97 beta install.

2019-08-01 09:28:09 ERROR (MainThread) [homeassistant.config] Failed to get platform alarm_control_panel.aarlo
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/config.py", line 795, in async_process_component_config
    platform = p_integration.get_platform(domain)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/loader.py", line 235, in get_platform
    "{}.{}".format(self.pkg_path, platform_name)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/homeassistant/.homeassistant/custom_components/aarlo/alarm_control_panel.py", line 16, in <module>
    from homeassistant.components.alarm_control_panel import (
ImportError: cannot import name 'ATTR_ENTITY_ID' from 'homeassistant.components.alarm_control_panel' (/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/alarm_control_panel/__init__.py)

Nothing listed in the breaking changes - https://rc.home-assistant.io/blog/2019/07/31/release-97/

but could be related to this?

Definitely that. Think I need to make it ATTR_CODE.

Thanks, Steve

edit: I just pushed a fix to the master branch.

Have run the upgrade. No change unfortunately
image

> 019-08-01 10:57:44 ERROR (MainThread) [homeassistant.config] Failed to get platform alarm_control_panel.aarlo
> Traceback (most recent call last):
>   File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/config.py", line 795, in async_process_component_config
>     platform = p_integration.get_platform(domain)
>   File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/loader.py", line 235, in get_platform
>     "{}.{}".format(self.pkg_path, platform_name)
>   File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
>     return _bootstrap._gcd_import(name[level:], package, level)
>   File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
>   File "<frozen importlib._bootstrap>", line 983, in _find_and_load
>   File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
>   File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
>   File "<frozen importlib._bootstrap_external>", line 728, in exec_module
>   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
>   File "/home/homeassistant/.homeassistant/custom_components/aarlo/alarm_control_panel.py", line 16, in <module>
>     from homeassistant.components.alarm_control_panel import (
> ImportError: cannot import name 'ATTR_ENTITY_ID' from 'homeassistant.components.alarm_control_panel' (/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/alarm_control_panel/__init__.py)
> ```
> type or paste code here
> ```

Sorry, I left it in master. 0.5.4 should be there now.

1 Like

:slight_smile: Thanks, everything appears to be working

Any way to update snapshot image every 30 seconds? I tried making an automation, that does that, but the image in the frontend is not updating …

I want the alarm to be set to off, but in the frontend always having a quite fresh picture.

@onkelfarmor An automation is the best way to go - configuring individual cameras from the configuration.yaml file would get messy, fast.

It should work but a couple of things:

  • try slower than 30 seconds, the snapshot functionality can take a long time to run, and once you get it going try faster speeds
  • upgrade to the latest custom aarlo-glance card (it should be on HACS by now), it does a much better job of tracking image updates

I was trying to get a new nodered workflow that would send a snapshot whenever it detected motion, but have so far been unsucessful (likley because of the problems outlined by @sherrell. Snapshots appear to take a long time to run, and when they do, you end up with snapshots littered through the history which isn’t that useful.

I wish there was a way to just quickly capture a temporary snapshot which could be used for sending alerts. I’m suprises that Arlo doesn’t do this automatically with their own alerts.

Hi Steve,

I have just upgraded to 0.7-reconnect from the previous but now I got weird scenarios:

not all sensors do populate only 1/5 batteries from the regular base has a state, the others have an unknown state.

all the additional sensors from the baby cam no longer work at all - dont get created, temperature, humidity, air quality unless I also set the sensor to

sensor:
  - platform: aarlo
    monitored_conditions:
    - last_capture
    - total_cameras
    - battery_level
    - captured_today
    - signal_strength
    - air_quality
    - humidity
    - temperature

previously I didnt had any monitored conditions which I assume did allow to create whatever was there to report on now I need to set it to have them appear in the first place but no values are being read.

attribution: Data provided by arlo.netgear.com
brand: Netgear Arlo
friendly_name: Humidity Nursery
model: ABC1000
unit_of_measurement: %
icon: mdi:water-percent
device_class: humidity

further streaming seems broken now:

Exception in thread stream_worker:
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 "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/stream/worker.py", line 49, 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 5] Input/output error: 'rtmps://vzwow94-z1-prod.ar.arlo.com:80/vzmodulelive?egressToken=[----token----]&userAgent=web&cameraId=[part1]_[part2]'

@collse What version did you upgrade from and what version of Home Assistant are you running? I’ll set up my test bed the same here. And nothing changed with respect to the sensor settings so I’m wondering if there was a crash. Can you get some debug and look for TraceBack or any crashes?

I think the streaming isn’t working because it’s using the wrong Agent type. Strange.

0.0.7 is a test build but it’s been working solidly for me for the last 2 weeks but I don’t have all the camera types.

@sherrell
must have been 0.5.5 via HACS - HASS 0.96.5 - just saw 0.97 is published … I havent disabled debug at all so if you let me know what files you want I am more than happy to supply them - they may have been grown a bit though :slight_smile:

Of course it works here… so I think it must be a bug I introduced to do with the baby cam.

Can you look around the startup? Look for lines with [pyaarlo] in them. And lines with ArloSensor and ArloBinarySensor, it should give you and idea of the sensors being created.

I suspect there will be a Traceback somewhere near that stuff.

logs via PM as usual … if there is anything else let me know

All of sudden I’m getting these errors in my log:

http://hassio.local:8123/community_plugin/lovelace-hass-aarlo/hass-aarlo.js:9:4 SyntaxError: fields are not currently supported

And this in the lovelace UI:

Custom element doesn't exist: aarlo-glance.

{
  "entity": "camera.aarlo_front",
  "name": "Front",
  "show": [
    "motion",
    "sound",
    "snapshot",
    "battery_level",
    "signal_strength",
    "captured_today"
  ],
  "top_status": false,
  "top_title": false,
  "type": "custom:aarlo-glance"
}

I’m running aarlo v0.5.5, lovelace-hass-aarlo v0.0.8, and HASS.IO 0.97.0 on an RPI3+. Anyone have any ideas? I’ve rebooted multiple times, refreshed my browser cache, etc. Not sure what to try next. Any ideas?

@krinehart Looks like a javascript issue. I’ve been tidying the code and I think I introduced some new code features not supported everywhere yet. Give me a few minutes and I’ll check in a possible fix.

Apologies for this, coding Javascript is relatively easy but making sure it works everywhere is… erm… fun.

For the record, what browser are you using?

edit: I just created 0.0.9, can you try that.

1 Like

That did the trick. I’m running firefox 68.0.1 (64-bit). I should have tried it in another browser but I was having the same problems with the iOS app as well so I didn’t even think to do that. Thanks for all your hard work and quick responses. Much appreciated!

Hi,

for everybody interested: home-assistant updated the docker image to Debian Buster with version 0.97. This means, streaming is now working out of the box (same as venv), if you use docker containers. No additional work is necessary.

With v0.98 a switch to Alpine Linux (for compatibility to hass.io) is planned. I would expect everything to still work, according to the list of available ffmpeg packages. I will verify once it is released.

Cheers :beers:

2 Likes

I wondered about the impact on ffmpeg support when I read about the Linux version change. Does this mean that streaming should now work in the frontend on Hassio, as well?