twrecked / hass-aarlo

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

Feature Request: Service to Reset Base #329

Open TheDK opened 3 years ago

TheDK commented 3 years ago

Sometimes cams stop working and can be brought back by tapping Restart Base in the Arlo app. I assume that this should be a pretty simple command to send to Arlo Backend. It would be great of there would be a service for that so that when snapshots or recordins fail or even at a certain point scheduled during the day the base can be resettet.

twrecked commented 3 years ago

It's there I just forgot to document it. I'll update the docs. Look for aarlo.restart_device.

TheDK commented 3 years ago

Ah, good to know! I guess the data payload is entity_id: alarm_control_panel.aarlo_base ?

twrecked commented 3 years ago

Yes.

TheDK commented 3 years ago

I tried today, but didn't work:

2020-10-22 13:32:54 INFO (SyncWorker_35) [custom_components.aarlo] restart_device service called
2020-10-22 13:32:54 DEBUG (SyncWorker_35) [pyaarlo] RESTART didnt send
2020-10-22 13:32:54 INFO (SyncWorker_35) [custom_components.aarlo] alarm_control_panel.aarlo_baseback restarted

Restart via App did work and brought the Cams back...

twrecked commented 3 years ago

I'll try and reproduce it here.

twrecked commented 3 years ago

It working for me. So I need some more debug from you end. Can you add these to your configuration and retry:

aarlo:
  ...
  packet_dump: True
  verbose_debug: True

And what kind of camera/base station is it?

TheDK commented 3 years ago

So finally got around to prep the info for you:

Base: VMB4500r2 / FW: 1.16.3.4_3505_c289687 Cameras: all Arlo Pro 2

2020-11-06 10:33:57 INFO (SyncWorker_19) [custom_components.aarlo] restart_device service called
2020-11-06 10:33:57 DEBUG (SyncWorker_19) [pyaarlo] post+response running
2020-11-06 10:33:57 DEBUG (SyncWorker_19) [pyaarlo] request-url=https://my.arlo.com/hmsweb/users/devices/restart
2020-11-06 10:33:57 DEBUG (SyncWorker_19) [pyaarlo] request-params=
{'deviceId': '####'}
2020-11-06 10:33:57 DEBUG (SyncWorker_19) [pyaarlo] request-headers=
{}
2020-11-06 10:33:57 DEBUG (SyncWorker_19) [pyaarlo] request-end=200
2020-11-06 10:33:57 DEBUG (SyncWorker_19) [pyaarlo] request-body=
{'data': {'error': '2712',
          'message': 'Reboot not permitted',
          'reason': 'Reboot not permitted'},
 'success': False}
2020-11-06 10:33:57 WARNING (SyncWorker_19) [pyaarlo] error in response={'data': {'error': '2712', 'message': 'Reboot not permitted', 'reason': 'Reboot not permitted'}, 'success': False}
2020-11-06 10:33:57 DEBUG (SyncWorker_19) [pyaarlo] RESTART didnt send

Nothing in the Packet Dump for that time stamp.

Permissions are granted for the account for all cameras and bases, also admin permissions (radio button at the bottom of the permissions page).

My problem is that every now and then 3-4 cams on the base loose connection, I can bring them back be restarting the base. This I wan to automate. Proximity is not an issue, one is only a couple of meters away and has full network strength.

TheDK commented 3 years ago

I just logged in using the account HA / aarlo is using - in the Web Interface I do not find an option to reset the base. On the main account every base has a level "above" (so it's shown two times) the level that is shared, there I can trigger the restart. Could it be that restarting the base is not a permission you can grant to a different account?

twrecked commented 3 years ago

Sorry for the delay, been busy else where. Buy you are correct, it's an Arlo limitation. I tried and got the same results here.

edit: I'll add a note to the README

TheDK commented 3 years ago

Thanks for the feedback! Is that a dead end if you don't use the "primary" owner account for the devices? Or do you think one could use the owner account and the "rest" platform from HA to just trigger a reboot? I am trying to work around that by fixing the underlying issue (intermittent connection loss from singular cams) but am running out of ideas.

twrecked commented 3 years ago

I think it has to be the main account, I can't think of a way around it from inside HA.

It gets even more complicated. If you use your main account on the Arlo app and use it inside HA you can't select email as the 2fa choice. You have to approve the login on your phone.

One way that might work:

There is hass-aarlo's sister project pyaarlo. I'll think if we can use that.

As a side note, I have a camera exhibiting the same behavior.

TheDK commented 3 years ago

As a side note, I have a camera exhibiting the same behavior.

I know that restarting the base is treating the symptom, not the issue, but I am running out of ideas and Arlo really doesn't leave much room for tweaking network connectivity of the cams. Given that it is also an intermittent issue it's hard to track...

For the time being I will monitor how often it stops working - if push comes to shove I can still use an smart socket to power cycle the base every now and then...

twrecked commented 3 years ago

Strangely, my camera needed its software upgrading and has been working pretty great since.

TheDK commented 3 years ago

I have all cams on latest firmware (just rechecked) usually lose connection after 1-2 days after restarting the base. Because I didn't want to go through the hassle with changing the accounts, so I just bought a 15 EUR smart plug and use HA to power cycle the base (remove power for 10 seconds) a couple of minutes before the system is armed at night. So far, things are looking better.

From my observations with 6 cams and 2 bases and the literally hundreds of complaints I read at the Arlo forums I would suspect that at some point (happening more often to battery powered cams than ones with power supply attached) the camera is (temporary) losing connection to the base. Then when it comes back it is not possible to trigger streaming. It shows battery level etc. but when I start streaming in the Arlo app it tries for every and then says the device is offline (aarlo then recognizes it as unavailable). Sometimes it works again after a couple of hours, sometimes a restart is necessary. It appears that it is somehow "deregistered" from the cloud service and therefore cannot be activated.

I haven't managed to test a cam in this state is triggered by motion and can record to the service. At least once I saw motion detected events for a cam in the logbook but no recordings, so my guess is that Arlo is not reliably recording.

As I said, there are hundreds of posts at the Arlo boards about this, I would also suspect, that most non-power users do not even recognize that. I only know because I trigger a snapsot of the cams 3x daily (just so it looks nice in HA :)) and I always see snapshots failing 12-24hrs after restarting the base. If I then try this cam in 50% of the cases it can also not be triggered with the App.

I will continue to monitor this, but right now I have to say I am rather disappointed with the babysitting the system needs. Arlo really needs to step up their game with regard to reliability of the cloud services.