Arlo: replacement pyarlo module

Thanks sherrell

I have tried refreshing and still the same error. I struggle to understand how it can be a caching issue when the issue is occurring on multiple browsers. I am seeing the same issue on both chrome on my android phone as well as in firefox.

Can you confirm what you mean by using the Config UI/Raw Config Editor? Is that just adding those lines directly to the lovelace card rather than putting it into the config file?

@Bruskey27 Click on the three dots on the tip right then select ‘Configure UI’. It will give you a warning about controlling the UI (I can’t remember the exact wording), click to continue and then click on the three dots again and select ‘Raw Config Editor’.

But I’m sure it should work from the ui-lovelace.yaml. Do the browser developer tools show anything suspicious?

Still the same thing. I am struggling to understand how this error suggests it’s a caching issue? Anything to do with the “custom_cards.json” file? Why is that in the repository of files yet I dont have that anywhere?

My previous experiences here always end up having extra steps or prerequisites which seem to be assumed as you know about them and I end up having to dig around to find the missing steps. Is this the case here as well?

@Bruskey27 It’s not caching, that was my first thought based on the original bug report and previous issues people have seen.

I’ll set up a test install here and try and reproduce the issue by editing the yaml file directly, can you tell me:

  • the home-assistant version
  • the hass-aarlo version
  • the custom card version
  • and an example of a custom card configuration you are trying to use

Thanks

edit: the custom_cards.json is for an old installation system but you are using HACS so don’t need it.

@roddydesu Did you give the guest user read and write permission?

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