Arlo: replacement pyarlo module

I updated and haven’t seen that error since. Guess you worked it out :slight_smile:

Excellent. There was a timing issue, I guess it was related to that. I was asking because somebody posted a bug report on github with a similar back trace.

Thanks @sherrell

Using Google Chrome 76.0.3809.100 (Official Build) (64-bit) if that helps
Home Assistant 0.97.1
hass-aarlo version 0.0.7
custom card verson 0.0.10
The card configuration below produces the error, but no matter what i put in:

entity: camera.aarlo_front_door
name: Front Door
show:
  - motion
type: 'custom:aarlo-glance'

@sherrell Good news! I finally got it working! I had to put it in the Raw Config editor section like you suggested. I tried that the other day without luck, but persisted and i can see the card now. Looks like there may be an issue then with using ui-lovelace.yaml?

Excellent. Glad it’s working for you. The UI had gotten easier to use because getting the card to refresh on mobile on older versions was damn near impossible.

Cross posting here. Any ideas on what I am doing wrong to get aarlo working on my homeassistant 0.97.2 within Hassio? I’ve never been able to get the legacy arlo component to work either.

It looks like it’s not returning any devices. Was there anything in the debug coming from pyaarlo before this.

What do you see if you use the component username and password on the Arlo web page?

And:

  • what version of home assistant?
  • what version of Aarlo?

I’ve had the same results with arlo and aarlo, and also same results between various HA versions (I think I also tried with 0.94). Currently, I have HA 0.97.2 installed via Hassio. I am trying to use the aarlo component with a set of Arlo Ultra cameras and an Arlo baby camera. I am using my master account that I registered with to test, and will eventually give it its own account, as when I tried it with its own account, that also gave me problems so figured perhaps it was a permissions thing.

I installed aarlo from HACS yesterday, and it shows this is “0.0.7-test02”.

More logging messages, including debug from pyaarlo:

2019-08-17 18:43:10 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for aarlo which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-08-17 18:45:14 INFO (MainThread) [homeassistant.setup] Setting up aarlo
2019-08-17 18:45:14 DEBUG (SyncWorker_16) [pyaarlo] Cfg started
2019-08-17 18:45:14 DEBUG (SyncWorker_16) [pyaarlo] starting
2019-08-17 18:45:14 WARNING (SyncWorker_16) [pyaarlo] file not read
2019-08-17 18:45:14 DEBUG (SyncWorker_16) [pyaarlo] custom connections 5:10
2019-08-17 18:45:15 DEBUG (SyncWorker_16) [pyaarlo] finish request=401
2019-08-17 18:45:15 DEBUG (SyncWorker_16) [pyaarlo] login failed
2019-08-17 18:45:15 WARNING (SyncWorker_16) [pyaarlo] failed to log in
2019-08-17 18:45:15 INFO (SyncWorker_16) [pyaarlo] pyaarlo starting
2019-08-17 18:45:15 DEBUG (SyncWorker_16) [pyaarlo] finish request=401
2019-08-17 18:45:16 ERROR (MainThread) [homeassistant.setup] Error during setup of component aarlo
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 172, in _async_setup_component
    component.setup, hass, processed_config  # type: ignore
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/aarlo/__init__.py", line 128, in setup
    http_connections=http_connections, http_max_size=http_max_size)
  File "/config/custom_components/aarlo/pyaarlo/__init__.py", line 65, in __init__
    self._parse_devices()
  File "/config/custom_components/aarlo/pyaarlo/__init__.py", line 107, in _parse_devices
    for device in self._devices:
TypeError: 'NoneType' object is not iterable
2019-08-17 18:45:16 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform aarlo.alarm_control_panel: Unable to set up component.
2019-08-17 18:45:16 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform aarlo.camera: Unable to set up component.
2019-08-17 18:46:16 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform aarlo.binary_sensor: Unable to set up component.
2019-08-17 18:46:20 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform aarlo.sensor: Unable to set up component.

If I login to my.arlo.com, I have cameras listed here. I am simply placing the username and password in cleartext in the configuration as pasted in the other link. I am NOT utilizing the secret option, so perhaps it is not parsing correctly?

It should work, if you can see it on the web interface you should be able to see it on the Aarlo component.

One thing I can see on the debug is the login is failing. Can you double check the username and password.

I’ve checked and rechecked the username/password. I’ve tried a few different account on both arlo and aarlo, same issues. I see in the debug that it gets a 401. Is there a way to try a login from CLI, perhaps with curl on the python scripts?

I got it working. Not sure how/why. I commented out nearly everything so that it only had username/password in the config and nothing else. I also removed any quotes from username and password and it seemed to create the config. Now on to testing the work here!

That was going to be my next question - are there any special characters in the password or quotes or anything. I think the code would have sent the quotes because the config is a YAML file and it just assumes everything is part of the string.

Glad you’ve gotten further. I know other people have the Baby Cam camera working but Arlo Ultras might be untested. Let me know if anything strange happens or any features are missing.

Thanks. Yea, off the bat looks like the Ultra struggles a bit with this component. I immediately noticed that the battery life is incorrect (always shows 100%) in the stats it pulls, but will have to tinker with the rest of the component to see how it works.

@sherrell

Reading through this looks like I am having a similar issue but I am very inexperienced and I would greatly appreciate a pointer to get my aarlo-glance card working.

Problem: glance card displays in lovelace with red “Custom element doesn’t exist: aarlo-glance.” box. I see the aarlo entities in the states screen with data and the default cards seem to be fine. The biggest problem is I am a very new user :wink:

I tried installation both by manual and via HACS. Below I will add my versions, home assistant log, my configuration.yaml entries and my raw config editor UI entires from the web interface…

Can you spot the problem? Thank you so much for you help here!

Firefox Quantum 68.0.2 64 bit
aarlo integration: Installed version: v0.0.7-test02
card: Installed version: v0.0.10

Lovelace raw config editor from browser:

resources:
  - type: module
    url: /local/aarlo-glance.js
title: Farm Bell
views:
  - badges: []
    cards:
      - entity: camera.aarlo_pool
        image_click: play
        name: Pool
        show:
          - motion
          - sound
          - snapshot
          - battery_level
          - signal_strength
          - captured_today
          - image_date
        top_date: false
        top_status: false
        top_title: false
        type: 'custom:aarlo-glance'
    icon: 'mdi:camera'
    path: camera
    title: Camera

Config.yaml:

aarlo:
  username: username
  password: password
  packet_dump: True
  db_motion_time: 30
  db_ding_time: 10
  recent_time: 10
  last_format: '%m-%d %H:%M'
#  conf_dir: /config/.aarlo
  no_media_upload: True
  mode_api: auto
  refresh_devices_every: 0
  http_connections: 5
  http_max_size: 10

camera:
  - platform: aarlo
    ffmpeg_arguments: '-pred 1 -q:v 2'

alarm_control_panel:
  - platform: aarlo
    home_mode_name: home
    away_mode_name: armed
    trigger_time: 30
    alarm_volume: 8

binary_sensor:
  - platform: aarlo
    monitored_conditions:
    - motion
    - sound
    - ding

sensor:
  - platform: aarlo
    monitored_conditions:
    - last_capture
    - total_cameras
    - battery_level
    - captured_today
    - signal_strength

HA log:

2019-08-18 08:44:16 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for aarlo which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-08-18 08:44:16 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-08-18 08:44:20 WARNING (SyncWorker_18) [homeassistant.components.isy994] Bad ISY Request: http://192.168.1.160:80/rest/vars/definitions/1
2019-08-18 08:44:20 WARNING (SyncWorker_18) [homeassistant.components.isy994] Bad ISY Request: http://192.168.1.160:80/rest/vars/definitions/2
2019-08-18 08:44:20 ERROR (SyncWorker_18) [homeassistant.components.isy994] ISY Could not parse variables, poorly formatted XML.
2019-08-18 08:44:22 ERROR (MainThread) [homeassistant.components.unifi] Unknown UniFi communication error occurred
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/unifi/controller.py", line 210, in get_controller
    await controller.login()
  File "/usr/local/lib/python3.7/site-packages/aiounifi/controller.py", line 42, in login
    await self.request('post', url, json=auth)
  File "/usr/local/lib/python3.7/site-packages/aiounifi/controller.py", line 68, in request
    'Invalid content type: {}'.format(res.content_type))
aiounifi.errors.ResponseError: Invalid content type: text/html
2019-08-18 08:44:22 ERROR (MainThread) [homeassistant.components.unifi] Unknown error connecting with UniFi controller: 
2019-08-18 08:44:22 WARNING (MainThread) [homeassistant.components.heos] 192.168.1.250 is not logged in to a HEOS account and will be unable to retrieve HEOS favorites: Use the 'heos.sign_in' service to sign-in to a HEOS account
2019-08-18 08:45:43 ERROR (MainThread) [aiohttp.server] Unhandled exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 447, in start
    await resp.prepare(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_response.py", line 353, in prepare
    return await self._start(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_response.py", line 667, in _start
    return await super()._start(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_response.py", line 410, in _start
    await writer.write_headers(status_line, headers)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/http_writer.py", line 112, in write_headers
    self._write(buf)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/http_writer.py", line 67, in _write
    raise ConnectionResetError('Cannot write to closing transport')
ConnectionResetError: Cannot write to closing transport
2019-08-18 08:51:11 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 37, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 69, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 228, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 124, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 493, in get
    return await self.handle(request, camera)
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 528, in handle
    return await camera.handle_async_mjpeg_stream(request)
  File "/config/custom_components/aarlo/camera.py", line 222, in handle_async_mjpeg_stream
    'multipart/x-mixed-replace;boundary=ffserver')
  File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 130, in async_aiohttp_proxy_stream
    data = await stream.read(buffer_size)
AttributeError: 'CameraMjpeg' object has no attribute 'read'
2019-08-18 08:51:11 ERROR (MainThread) [aiohttp.server] Unhandled exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 447, in start
    await resp.prepare(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_response.py", line 353, in prepare
    return await self._start(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_response.py", line 667, in _start
    return await super()._start(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_response.py", line 410, in _start
    await writer.write_headers(status_line, headers)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/http_writer.py", line 112, in write_headers
    self._write(buf)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/http_writer.py", line 67, in _write
    raise ConnectionResetError('Cannot write to closing transport')
ConnectionResetError: Cannot write to closing transport
2019-08-18 08:56:26 ERROR (MainThread) [custom_components.aarlo.camera] Video not found for Pool. Is it older than 30 days?
2019-08-18 08:56:37 ERROR (MainThread) [custom_components.aarlo.camera] Video not found for Pool. Is it older than 30 days?
2019-08-18 09:04:28 ERROR (MainThread) [aiohttp.server] Unhandled exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 447, in start
    await resp.prepare(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_response.py", line 353, in prepare
    return await self._start(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_response.py", line 667, in _start
    return await super()._start(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_response.py", line 410, in _start
    await writer.write_headers(status_line, headers)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/http_writer.py", line 112, in write_headers
    self._write(buf)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/http_writer.py", line 67, in _write
    raise ConnectionResetError('Cannot write to closing transport')
ConnectionResetError: Cannot write to closing transport

you may have missed the Arlo integration changed via HACS: your resource is no longer pointing to the correct resources, when using HACS it should be:

  - url: /community_plugin/lovelace-hass-aarlo/hass-aarlo.js
    type: module

apart from that it should work fine

The battery should be ok but I know motion and audio detection won’t be enabled. Can you get some information from the Developer Tools >> States page for me? Find one of your Ultra cameras and can you tell me what the following fields say?:

model_name: 
battery_level:
battery_tech:
charging: 
charger_type:
wired: 
wired_only: 

This will help me get the motion and audio detection working and hopefully figure out the battery issue.

To add to @collse points - you shouldn’t need no_media_upload so you can comment out that line. That fixes a very specific issue seen by 1 person.

@sherrell, here is the state dump of one of the Ultra cameras. Actual battery level is 80% right now. From the Arlo app, it says this camera is a model “H6”. Let me know if there is anything else you’d like me to send to you.

camera.aarlo_front_porch:

state: idle
access_token: <redacted>
model_name: VMC5040
brand: Netgear Arlo
battery_level: 100
battery_tech: None
signal_strength: 3
unseen_videos: 86
recent_activity: false
image_source: capture/08-17 21:02
charging: false
charger_type: None
wired: false
wired_only: false
attribution: Data provided by arlo.netgear.com
friendly_name: Front Porch
entity_picture: /api/camera_proxy/camera.aarlo_front_porch?token=<redacted>
supported_features: 0

Most of the separate sensors have similar information, mostly useless information as of now, some showing unknown, such as signal strength, recent activity, battery level.

Thanks that fixed it. This card is AWESOME!

Where should I have read that? I was looking an install instructions but I suspect I am looking in wrong place.

@collse and @sherrell you guys are both gentlemen and scholars

I’ve just created a new test release 0.0.7-test3 that should enable motion and audio detection on the cameras.