Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alarm Panel modes fail to read #77

Open
hanskroner opened this issue Oct 25, 2021 · 8 comments
Open

Alarm Panel modes fail to read #77

hanskroner opened this issue Oct 25, 2021 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@hanskroner
Copy link

For the last few weeks I've been facing an issue where the Alarm Panels that represent the Arlo base stations within Home Assistant fail at reading their state:

Logger: pyaarlo
Source: custom_components/aarlo/pyaarlo/__init__.py:583 
Integration: Arlo Camera Support (documentation, issues) 
First occurred: 19 October 2021, 0:00:25 (15 occurrences) 
Last logged: 7:00:19

failed to read modes (v2)
job-error=TypeError Traceback (most recent call last): File "/config/custom_components/aarlo/pyaarlo/background.py", line 34, in _run_next job["callback"](**job["args"]) File "/config/custom_components/aarlo/pyaarlo/base.py", line 159, in _event_handler self.update_mode() File "/config/custom_components/aarlo/pyaarlo/base.py", line 347, in update_mode for mode in data: TypeError: 'NoneType' object is not iterable

When using service calls to set the Alarm Panel's mode, the Arlo Base Stations do actually change mode (verified from within the App) but the Alarm Panels in Home Assistant do not. The particular error I pasted above started happening 6 days ago, and happens each time I tried to change modes on the Panels.

Restarting Home Assistant, which will reestablish a connection to the Arlo Cloud seems to fix the problem for a while. After observing it for a while, it seems the panels get stuck most often after a change from an "armed" mode to another "armed" mode (e.g., changing to "night" while on "home").

This is on hass-aarlo v0.7.1.7 configured with:

aarlo:
  refresh_devices_every: 1
  stream_timeout: 90
  reconnect_every: 180
  request_timeout: 120
  db_ding_time: 10
  recent_time: 30
  last_format: '%d-%m %H:%M'
@m0urs
Copy link

m0urs commented Oct 25, 2021

I can confirm that I do see the same issue here since some days.Setting modes is working, reading modes is working after re-connecting for some time and then fails (not with hass-arlo but with pyaarlo)

@twrecked twrecked self-assigned this Oct 25, 2021
@twrecked twrecked added the bug Something isn't working label Oct 25, 2021
@twrecked
Copy link
Owner

Can either of you turn on packet debug? I'm guessing they've changed the return packet.

I'll try and reproduce it here.

@m0urs
Copy link

m0urs commented Oct 25, 2021

It seems that in "debug.log" nothing happens if I issue a "get-mode" command. If I issue a "set-mode" command I can see new entries in "debug.log" Anything special I need to set for debugging besides "logging.basicConfig(level=logging.DEBUG,"?

Update: Guess that is a problem with my code.

" elif command == 'get-mode':
base = getDeviceFromName("Base",arlo.base_stations)
statusHome = base.mode"

My code does nothing than just checking and returning the current state. So I guess the issue is already that after setting the mode the state is not correctly updated.

I will send you later the debugging of my "set-mode" command. Maybe you can see something in it. However I need to wait until it fails again. Directly after reconnecting everything is fine for some time.

@m0urs
Copy link

m0urs commented Oct 25, 2021

Not sure if this is helpful. Please let me know if I should try anything different.

log.txt

@hanskroner
Copy link
Author

hanskroner commented Oct 27, 2021

Here's mine. Note that I have two base stations. The end of the log corresponds to me trying a few times to change panel modes. Again, the base stations did change modes, and it's reflected on the App, but the Home Assistant panels remain in their previous state.

packets.txt

@twrecked
Copy link
Owner

Apologies. I haven't had much spare time to look at this stuff. Arlo just made some changes that might making debugging this stuff a little easier.

Firstly, thanks for the logs, I'll take a look.

@twrecked
Copy link
Owner

Neither of you is getting the activeAutomations reply I was expecting. What should happen is we send POST a request to https://myapi.arlo.com/hmsweb/users/devices/automation/active and we get an activeAutomations response back.

@m0urs Can you paste your pyaarlo.PyArlo() settings (minus any sensitive data obviously).

@hanskroner Can you add the following to you configuration.yaml and send me the logs. It just needs to be around the time things stop happening.

aarlo:
  ... your existing config
  verbose_debug: True

logger:
  default: info
  logs:
    custom_components.aarlo: debug
    custom_components.aarlo.alarm_control_panel: debug
    custom_components.aarlo.binary_sensor: debug
    custom_components.aarlo.camera: debug
    custom_components.aarlo.light: debug
    custom_components.aarlo.media_player: debug
    custom_components.aarlo.sensor: debug
    custom_components.aarlo.switch: debug
    pyaarlo: debug

@m0urs
Copy link

m0urs commented Nov 30, 2021

After upgrading my code to version 0.8.0.alpha.12, I do no longer see these issues. Reading the states is now working again for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants