Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

ERROR (MainThread) [custom_components.reolink_dev.binary_sensor] Motion states could not be queried from API #482

Open
garry0garry opened this issue Apr 4, 2022 · 5 comments

Comments

@garry0garry
Copy link

HA 2022.3.8, HACS 1.24.3, Home Assistant Reolink addon 0.51
Reolink RLC-520A fw 3.1.0.764_21121700

36 records for 11 hours:

2022-04-04 20:53:34 ERROR (MainThread) [custom_components.reolink_dev.binary_sensor] Motion states could not be queried from API
2022-04-04 20:53:34 ERROR (MainThread) [custom_components.reolink_dev.binary_sensor] Traceback (most recent call last):
File "/config/custom_components/reolink_dev/binary_sensor.py", line 122, in handle_event
await self._base.api.get_all_motion_states()
File "/usr/local/lib/python3.9/site-packages/reolink/camera_api.py", line 608, in get_all_motion_states
response = await self.send(body)
File "/usr/local/lib/python3.9/site-packages/reolink/camera_api.py", line 1721, in send
raise CredentialsInvalidError()
reolink.exceptions.CredentialsInvalidError

@garry0garry
Copy link
Author

garry0garry commented Apr 24, 2022

binary_sensor.cam_person_detected in HA is displayed very rarely. There were no big problems with the binary_sensor.cam_motion.

HA 2022.4.6, HACS 1.24.5, Home Assistant Reolink addon 0.52
RLC-511WA fw v3.1.0.764_2112170

`2022-04-24 19:26:35 ERROR (MainThread) [custom_components.reolink_dev.binary_sensor] Motion states could not be queried from API
2022-04-24 19:26:35 ERROR (MainThread) [custom_components.reolink_dev.binary_sensor] Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1056, in create_connection
raise exceptions[0]
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1041, in create_connection
sock = await self._connect_sock(
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 955, in _connect_sock
await self.sock_connect(sock, address)
File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 502, in sock_connect
return await fut
File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 537, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('192.168.50.27', 80)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/config/custom_components/reolink_dev/binary_sensor.py", line 122, in handle_event
await self._base.api.get_all_motion_states()
File "/usr/local/lib/python3.9/site-packages/reolink/camera_api.py", line 608, in get_all_motion_states
response = await self.send(body)
File "/usr/local/lib/python3.9/site-packages/reolink/camera_api.py", line 1696, in send
async with session.post(
File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1138, in aenter
self._resp = await self._coro
File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 535, in _request
conn = await self._connector.connect(
File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 542, in connect
proto = await self._create_connection(req, traces, timeout)
File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 907, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection
raise last_exc
File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.50.27:80 ssl:default [Connect call failed ('192.168.50.27', 80)]`

@cpainchaud
Copy link
Collaborator

cpainchaud commented Apr 24, 2022 via email

@garry0garry
Copy link
Author

binary_sensor.cam_motion is available on port 80, but binary_sensor.cam_person_detected is not?..

@cpainchaud
Copy link
Collaborator

cpainchaud commented Apr 24, 2022 via email

@garry0garry
Copy link
Author

Is this a different error?

2022-04-24 21:24:27 ERROR (MainThread) [custom_components.reolink_dev] Timeout fetching reolink.cam10.motion_states data
2022-04-24 21:24:57 ERROR (MainThread) [custom_components.reolink_dev] Unexpected error fetching reolink.cam5 data: 
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 190, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 150, in _async_update_data
    return await self.update_method()
  File "/config/custom_components/reolink_dev/__init__.py", line 98, in async_update_data
    await base.update_states()
  File "/config/custom_components/reolink_dev/base.py", line 255, in update_states
    await self._api.get_states()
  File "/usr/local/lib/python3.9/site-packages/reolink/camera_api.py", line 460, in get_states
    response = await self.send(body)
  File "/usr/local/lib/python3.9/site-packages/reolink/camera_api.py", line 1721, in send
    raise CredentialsInvalidError()
reolink.exceptions.CredentialsInvalidError

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants