fwestenberg/reolink_dev

Cannot re-add RLC511 in HA

Opened this issue · 1 comments

When i try to add my RLC511 camera to homeassistant I get this error " Errore inaspettato (unexpected error)" and cannot add it!
This camera was already in HA but, after a period (1month) that i leave it switched-off (with also others camera) and i power-up them i get errors in HA and all images was unavailables (from all cameras).. so i try to disable and re-enable the first one, in the hope to come back to the normal behaviour.. because this test on this camera failed i decided to remove all camera and re-install them in Homeassistant... For the other cameras this action has solved the problem but for the RLC511 i'm getting continously that error.. (the ip of the camera is correct and the ping to it works well)

my HA is: Home Assistant 2022.7.0 Frontend 20220706.0 - latest
the firmware of the cam is v3.0.0.0 142_20121803

this from the home-assistant.log when i try to re-add the camera (2 times, the second one without https enable):

_2022-08-14 11:13:25 ERROR (MainThread) [custom_components.reolink_dev.config_flow] Unexpected exception
Traceback (most recent call last):
File "/home/homeassistant/.homeassistant/custom_components/reolink_dev/config_flow.py", line 79, in async_step_user
self._abort_if_unique_id_configured()
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/config_entries.py", line 1309, in _abort_if_unique_id_configured
raise data_entry_flow.AbortFlow("already_configured")
homeassistant.data_entry_flow.AbortFlow: Flow aborted: already_configured
2022-08-14 11:14:04 ERROR (MainThread) [custom_components.reolink_dev.config_flow] Unexpected exception
Traceback (most recent call last):
File "/home/homeassistant/.homeassistant/custom_components/reolink_dev/config_flow.py", line 70, in async_step_user
self.info = await self.async_validate_input(self.hass, user_input)
File "/home/homeassistant/.homeassistant/custom_components/reolink_dev/config_flow.py", line 138, in async_validate_input
if not await self.base.connect_api():
File "/home/homeassistant/.homeassistant/custom_components/reolink_dev/base.py", line 220, in connect_api
if not await self.api.get_settings():
File "/srv/homeassistant/lib/python3.9/site-packages/reolink/camera_api.py", line 496, in get_settings
response = await self.send(body)
File "/srv/homeassistant/lib/python3.9/site-packages/reolink/camera_api.py", line 1652, in send
if not await self.login():
File "/srv/homeassistant/lib/python3.9/site-packages/reolink/camera_api.py", line 845, in login
response = await self.send(body, param)
File "/srv/homeassistant/lib/python3.9/site-packages/reolink/camera_api.py", line 1714, in send
raise ApiError(
reolink.exceptions.ApiError: API returned HTTP status ERROR code 400/Bad Request

_

Not sure if you found the proper answer to this issue. Solution is listed at #516

The final line in the error mentioning "API returned HTTP status ERROR code 400/Bad Request" is likely due to the Home Assistant's URL not be set at all/set incorrectly.

  • Click Settings on side navigation in Home Assistant
  • Click System
  • Click Network
  • Update the URL text field(s), located about 3/4 of the way down on the page

Mine were blank, adding in the same address as I access HA in a browser http://192.0.0.100:8123 resolved this error.

So I got passed the issue you have and now I'm at the following error, trying to find the answer in threads here:

File "/usr/local/lib/python3.10/site-packages/aiohttp/streams.py", line 616, in read await self._waiter aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected

Everything I'm coming across leads to a motion detection issue.