twrecked / hass-aarlo

Asynchronous Arlo Component for Home Assistant
GNU Lesser General Public License v3.0
372 stars 77 forks source link

Modes not updating on alarm control panel #620

Open titatom opened 1 year ago

titatom commented 1 year ago

Hello ! For the past week I've noticed the modes are not updating in the alarm control panel anymore. When arming/disarming the cameras,the mode updates in the Arlo app but not in Home Assistant. Adding backend : sse a few weeks back had fixed this problem when I did the initial setup but that is not the case anymore. Here is a section of the log after arming the cameras via the control panel.

2022-08-10 20:42:33.433 DEBUG (SyncWorker_3) [custom_components.aarlo.alarm_control_panel] Jardin set mode to home 2022-08-10 20:42:33.433 DEBUG (SyncWorker_3) [pyaarlo] activeSchedule: OLD None 2022-08-10 20:42:33.433 DEBUG (SyncWorker_3) [pyaarlo] Jardin:new-mode=home,id=mode3 2022-08-10 20:42:33.433 DEBUG (SyncWorker_3) [pyaarlo] v2 arming 2022-08-10 20:42:43.338 DEBUG (ArloEventStream) [pyaarlo] sseclient-error=ChunkedEncodingError 2022-08-10 20:42:46.539 DEBUG (ArloEventStream) [pyaarlo] fetching device list after ev-reconnect

I've read @twrecked mentioning Arlo are playing with their backend which could be the cause of this ?

Cheers !

squirtbrnr commented 1 year ago

I occasionally see the states out of sync. Usually when this happens I just need to arm/disarm from the Arlo app a couple times and they sync up again in HA. Worst case, I just restart HA and it's fixed.

titatom commented 1 year ago

Yes, when I restart HA the status updates. Also when I arm/disarm in HA, it updates in the Arlo app.

Unfortunately the fact that the status does not update in HA when changing it in HA itself makes the whole add on unusable for automations (I can't restart HA everytime I want to arm/disarm the cameras for example).

It seems I am not the only one with the issue as per this convo I was having with another user on reddit.

https://www.reddit.com/r/homeassistant/comments/wpvz7g/aarlo_cameras_armdisarm_without_base_station/?utm_medium=android_app&utm_source=share

Alex6fr commented 1 year ago

Hello, The same for me. after a HA restart everything works well and refreshes well but after a while or some automation, the alarm sensors no longer refresh. The same for the entity picture after an picture snapshot.

I'm in HA 2022.8.7, plugin v0.7.2b8.3 and sse backend.

titatom commented 1 year ago

Probably something going on with Arlo's backend as @twrecked mentionned. Also I suspect he is busy with work and does not have time to look into it. I'd have a look but my python skills are not up to par unfortunately. Perhaps well see a fix when 0.8 is released in HA ?

paul123paulnz commented 1 year ago

I have had the same issue and was able to resolve it by changing to the "sse" backend

aarlo: ..your current config.. backend: sse

titatom commented 1 year ago

@paul123paulnz thanks for your reply. I have it setup with sse like in your example. I was discussing with a reddit user and it worked for him as well for a while but then stopped working (same for me actually, worked for a week or so). I suspect it will be the same in your case. Please keep me updated. I am considering switching to Poe cameras and frigate at this point.

The error I see on the logs seems SSE related :

2022-08-10 20:42:43.338 DEBUG (ArloEventStream) [pyaarlo] sseclient-error=ChunkedEncodingError

twrecked commented 1 year ago

Sorry, late getting to this. You still seeing the issue?

And I get those ChunkedEncodingError errors all the time.

titatom commented 1 year ago

Hello ! Yes I still have the issue unfortunately. The status in HA does not reflect the Arlo status. Arming disarming in HA changes the status in the Arlo app but does not update in HA.

Thanks for having a look.

twrecked commented 1 year ago

Can you do a couple of things:

  1. Can you paste in your main configuration - minus the sensitive bits obviously.
  2. Can you turn on debug, you'll need to restart after changing the config, and try changing the alarm modes. I need to see the debug around the time you try to change to mode. You can use this webpage to encrypt the logs so only I can see them.

Thanks.

titatom commented 1 year ago

Thank a lot for having a look !

Here is my config as well as my most recent logs. I arm the "Avant" camera at the very bottom of the log.

Cheers !

aarlo: username: !redacted password: !redacted stream_timeout: 120 tfa_source: imap tfa_type: email tfa_host: imap.gmail.com tfa_username: !redacted tfa_password: !redacted backend: sse

alarm_control_panel:

logs.txt

twrecked commented 1 year ago

Sorry to be a pain but can you add verbose_debug: True to the aarlo: section.

I can see the request going in and then you get the Chunk error, turning on verbose debug will let me see if any packets come in as well.

Spiff1 commented 1 year ago

I have the same issue, it works fine for a few hours and the status updates is not updating in HA, Arlo will change status if alarm mode is changed but nothing is sent back. I just updated to 0.7.2b10 but the issue remains. A restart fixes the issue but only for a few hours.

twrecked commented 1 year ago

@Spiff1 can you turn on debug and attach the output when it happens. See my earlier comment on how to enable it.

Spiff1 commented 1 year ago

Not much is added in the log file when trying to disarm arlo, it will be disarmed but nothing is sent back to home assistant. Hope this helps

2022-10-23 11:06:49.383 DEBUG (SyncWorker_11) [custom_components.aarlo.alarm_control_panel] Stamberga set mode to disarmed
2022-10-23 11:06:49.383 DEBUG (SyncWorker_11) [pyaarlo] set:ArloBase/A0E2057LA0F74/activeSchedule=None
2022-10-23 11:06:49.384 DEBUG (SyncWorker_11) [pyaarlo] Stamberga:new-mode=disarmed,id=mode0
2022-10-23 11:06:49.384 DEBUG (SyncWorker_11) [pyaarlo] v2 arming
twrecked commented 1 year ago

@Spiff1 Did you have verbose_debug: True in your config? I'd expect to see a message going to Arlo.

Spiff1 commented 1 year ago

Sorry, my bad. this is the log when also verbose debugging is on

2022-10-24 19:19:55.000 DEBUG (SyncWorker_11) [custom_components.aarlo.alarm_control_panel] Stamberga set mode to disarmed
2022-10-24 19:19:55.001 DEBUG (SyncWorker_11) [pyaarlo] set:ArloBase/A0E2057LA0F74/activeSchedule=None
2022-10-24 19:19:55.001 DEBUG (SyncWorker_11) [pyaarlo] Stamberga:new-mode=disarmed,id=mode0
2022-10-24 19:19:55.002 DEBUG (SyncWorker_11) [pyaarlo] deduced v2 api
2022-10-24 19:19:55.002 DEBUG (SyncWorker_11) [pyaarlo] v2 arming
2022-10-24 19:19:55.002 DEBUG (SyncWorker_11) [pyaarlo] post+response running
2022-10-24 19:19:55.002 DEBUG (SyncWorker_11) [pyaarlo] request-url=https://myapi.arlo.com/hmsweb/users/devices/automation/active
2022-10-24 19:19:55.004 DEBUG (SyncWorker_11) [pyaarlo] request-params=
{'activeAutomations': [{'activeModes': ['mode0'],
                        'activeSchedules': [],
                        'deviceId': 'A0E2057LA0F74',
                        'timestamp': 1666631995002}]}
2022-10-24 19:19:55.004 DEBUG (SyncWorker_11) [pyaarlo] request-headers=
{}
2022-10-24 19:19:55.229 DEBUG (SyncWorker_11) [pyaarlo] request-body=
{'success': True}
2022-10-24 19:19:55.230 DEBUG (SyncWorker_11) [pyaarlo] request-end=200
twrecked commented 1 year ago

@Spiff1 Can you post your aarlo: config from configuration.yaml? Without the sensitive bits obviously.

Spiff1 commented 1 year ago

Here it is:

aarlo:
  username: xxx@xxx.com
  password: *******
  tfa_source: imap
  tfa_type: email
  tfa_host: imap.gmail.com
  tfa_username: xxx
  tfa_password: xxxx
  verbose_debug: True
twrecked commented 1 year ago

@Spiff1 Can you try adding a couple of pieces of config to it:

aarlo:
  ...
  refresh_devices_every: 2
  stream_timeout: 120
  reconnect_every: 90
Spiff1 commented 1 year ago

Thank you, it has now worked for 4 days, it seems like it solved the problem.

github-actions[bot] commented 1 week ago

This issue is stale because it has been open for 365 days with no activity. This issue will be automatically closed within 28 days if there is no further activity.