reolink_dev icon indicating copy to clipboard operation
reolink_dev copied to clipboard

Motion sensor timeout

Open vmonkey opened this issue 2 years ago • 24 comments

Describe the bug Occasionally, both of my RLC-410 5MP cameras report an "unknown" motion sensor state. I have verified it in the Synology Surveillance Station (which is used for recording the streams) that no motion indeed occurred and that the cameras were available. Cameras and the HA device are in the same network.

To Reproduce I am not able to reproduce the error 'on demand'. In HA logs, I can see

2022-02-03 18:02:55 ERROR (MainThread) [custom_components.reolink_dev] Timeout fetching reolink.Kamera 2.motion_states data 2022-02-03 18:02:55 ERROR (MainThread) [custom_components.reolink_dev] Timeout fetching reolink.Kamera 1.motion_states data

Expected behavior The motion sensor to be available always.

Screenshots Not applicable

Environment: Please provide useful information about your environment, like:

  • Home Assistant version: 2022.2.0
  • Reolink camera model: RLC-410-5MP
  • Camera firmware number: v3.0.0.136_20121100

Additional context None.

I would be happy to provide more details - feel free to request anything needed.

vmonkey avatar Feb 04 '22 08:02 vmonkey

Hi,

This is happening to me as well a few times every day. Reolink's management HTTP service seems to be quite unstable. (video stream can still work properly). There is nothing I can do with what. I noticed that rebooting cameras once a day was keeping them stable.

cpainchaud avatar Feb 04 '22 09:02 cpainchaud

I am getting the same error as the OP whenever I restart HA core.

DarwinData avatar Feb 15 '22 15:02 DarwinData

Same here unfortunately. Any tips other than a reboot? Disable some services maybe? Don't use https?

skynet01 avatar Feb 21 '22 19:02 skynet01

Same issue here with camera RLC-820A

marek787 avatar Feb 22 '22 08:02 marek787

Hi, I tried to use HA's AIOHTTP's provided HTTP in recent push 0.50 to ensure they are all in same event loop. If that doesn't solve your issue then I am clueless about what is going on

cpainchaud avatar Mar 05 '22 14:03 cpainchaud

@cpainchaud Thanks for the update. Unfortunately, half an hour after HA restart the issue is back again for me.

vmonkey avatar Mar 05 '22 14:03 vmonkey

you keep getting "Timeout fetching reolink.Kamera 1.motion_states data" error messages?

If that is the case, I just can't tell what is wrong, I am not able to reproduce that behavior at home. The only reason for a timeout would be the camera not answering fast enough (30 seconds, that tons of time already...) or some deep HA knowledge which I have am missing because what it does is really dumb : just ask the camera for its status via HTTP, no dark magic ... :/

cpainchaud avatar Mar 05 '22 15:03 cpainchaud

I have the same issue here, also with v0.50. Yesterday I restarted HA core and the errors started to come. Two maybe interesting error messages with traceback are also in my log:

2022-03-13 00:21:07 ERROR (MainThread) [custom_components.reolink_dev] Timeout fetching reolink.Carport.motion_states data
2022-03-13 00:30:37 ERROR (MainThread) [custom_components.reolink_dev] Timeout fetching reolink.Carport.motion_states data
...
2022-03-13 01:38:37 ERROR (MainThread) [custom_components.reolink_dev] Timeout fetching reolink.Carport.motion_states data
2022-03-13 01:52:07 ERROR (MainThread) [custom_components.reolink_dev] Timeout fetching reolink.Carport.motion_states data
2022-03-13 02:00:37 ERROR (MainThread) [custom_components.reolink_dev] Timeout fetching reolink.Carport data
2022-03-13 02:00:37 ERROR (MainThread) [custom_components.reolink_dev.binary_sensor] Motion states could not be queried from API
2022-03-13 02:00:37 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

2022-03-13 02:01:37 WARNING (MainThread) [reolink.subscription_manager] Subscription process ended with wrong HTTP status: 400: Bad Request
2022-03-13 02:01:37 ERROR (MainThread) [custom_components.reolink_dev.base] Host 192.168.1.69 error renewing the Reolink subscription
2022-03-13 02:02:07 ERROR (MainThread) [custom_components.reolink_dev] Timeout fetching reolink.Carport.motion_states data
2022-03-13 02:03:37 ERROR (MainThread) [custom_components.reolink_dev] Timeout fetching reolink.Carport.motion_states data
...
2022-03-13 05:39:07 ERROR (MainThread) [custom_components.reolink_dev] Timeout fetching reolink.Carport.motion_states data
2022-03-13 05:59:07 ERROR (MainThread) [custom_components.reolink_dev] Timeout fetching reolink.Carport.motion_states data
2022-03-13 06:03:37 ERROR (MainThread) [custom_components.reolink_dev.binary_sensor] Motion states could not be queried from API
2022-03-13 06:03:37 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 609, in get_all_motion_states
    json_data = json.loads(response)
  File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

2022-03-13 06:04:37 ERROR (MainThread) [custom_components.reolink_dev] Timeout fetching reolink.Carport.motion_states data
2022-03-13 06:27:07 ERROR (MainThread) [custom_components.reolink_dev] Timeout fetching reolink.Carport.motion_states data

herrfrei avatar Mar 13 '22 07:03 herrfrei

same here...

2022-03-26 21:11:48 ERROR (MainThread) [custom_components.reolink_dev] Timeout fetching reolink.Front door.motion_states data 2022-03-26 22:00:18 ERROR (MainThread) [custom_components.reolink_dev] Timeout fetching reolink.Front door.motion_states data 2022-03-26 23:11:48 ERROR (MainThread) [custom_components.reolink_dev] Timeout fetching reolink.Front door.motion_states data 2022-03-26 23:27:18 ERROR (MainThread) [custom_components.reolink_dev] Timeout fetching reolink.Front door.motion_states data 2022-03-26 23:37:48 ERROR (MainThread) [custom_components.reolink_dev] Timeout fetching reolink.Front door.motion_states data

Nadav-K avatar Mar 26 '22 21:03 Nadav-K

For what it is worth I am getting the same errors appearing in my logs, despite rebooting my cameras every 24 hours. Error returns no matter how many times I restart Core.

jone9618 avatar Mar 27 '22 16:03 jone9618

Same error here with RLC-410W, Firmware: v3.0.0.136_20121102

2022-04-08 06:54:54 ERROR (MainThread) [custom_components.reolink_dev] Timeout fetching reolink.East Camera.motion_states data

DarwinData avatar Apr 08 '22 11:04 DarwinData

same here. I have a very stable lan/network with no lag. My 2 RLC-811A cams are connected wired by LAN cable. Even with a 1GB network cable I have 10 days a day on both cams these timeouts.

gilbert-grape avatar Apr 08 '22 13:04 gilbert-grape

Same cameras as @gilbert-grape on lan connection and just like him random timeouts. I know it's probably really hard to trace but it sounds like everyone experiences this

skynet01 avatar Apr 08 '22 19:04 skynet01

@cpainchaud I still have the issue- it occurs occasionally and can not be avoided with increased timeout. Maybe, would it be possible to retry a timed out request once more? If the reason is an unstable reolink API, this might eliminate most of the cases.

vmonkey avatar Apr 13 '22 17:04 vmonkey

Thats a good idea. What about a number in the settings next the timeout in seconds with how many retry it should do?

gilbert-grape avatar Apr 14 '22 04:04 gilbert-grape

That's great idea, you can also increase the time-out dynamically? So at first try it after 2 seconds then 5 then 15 etc.

skynet01 avatar Apr 14 '22 21:04 skynet01

jumping on the bandwagon with the same in my logs `This error originated from a custom integration.

Logger: custom_components.reolink_dev Source: helpers/update_coordinator.py:196 Integration: Reolink IP camera (documentation, issues) First occurred: 18:47:22 (6 occurrences) Last logged: 19:14:54

Timeout fetching reolink.Garage East.motion_states data Timeout fetching reolink.Crouton Cam.motion_states data Timeout fetching reolink.Garage West.motion_states data Timeout fetching reolink.Lounge.motion_states data`

angrycatmeowmeow avatar Apr 21 '22 23:04 angrycatmeowmeow

Have the same problem when my automation is triggered to record a video. Video is recorded but I get Timeout fetching reolink.ReolinkE1Z-Flur.motion_states data in the logs.

shyney7 avatar Aug 02 '22 17:08 shyney7

I have hundreds of these errors in my log too 2022-08-05 03:27:12 ERROR (MainThread) [custom_components.reolink_dev] Timeout fetching reolink.frontdoor.motion_states data

redpizza69 avatar Aug 05 '22 11:08 redpizza69

Hello, same boat, but if i look in my nvr410 history,there is "grey" times in the timeline for 1 min every 2 hours and when sensors have a lot of activity, for example when its winding and trees in my garden are moving a lot, that seem to spam a lot the motions sensor and the nvr crash.

i have send my logs to Reolink and they reply that i have to remove my Nvr from HA, and check my network, and even lower the bit rate of my cam...

i have a Nvr410 kit with 4 D520 cams and even that is they are only 5Mp quality, they said my bandwith is not enough...

i have a fresh Lan network with Cat6a cable and i have verify all my connexions with a tester, and succeed to have a 2,5Gb Lan on several points in my house. I have 24 outlet Rj45, and most of them are on 1Gb, some works at 2,5Gb with my switch 2,5Gb (only 5 Rj45).

For my camera they are directly connected to my NVR with the patch cable of 10 meter provide in the kit. For the 5th and the 6th i have bought a cat5e 15 meters long. I think Cat5e is enought for 7000Kbits of data transfert...hope so.

The only thing i notice in the log was the packets dropped in the Wan port of the NVr. No dropped packets in the lan side of the NVR,no errors packets.

The dropped packets are 67826, seems to be huge...dont know if its to ha when they are dropped...

Is someone has a NVR410 and see grey period in the timeline please ? (under APP android or reolink APP PC or webserver)

Electronlibre2012 avatar Aug 23 '22 08:08 Electronlibre2012

Hello folks. Is there any news on this?

I do also have the issue with the v 0.57 of this repo, and latest HA version (Home Assistant 2022.12.1, Supervisor 2022.11.2, Operating System 9.3, Frontend 20221208.0 - latest)

This error originated from a custom integration.

Logger: custom_components.reolink_dev
Source: helpers/update_coordinator.py:168
Integration: Reolink IP camera (documentation, issues)
First occurred: 2:46:02 PM (1 occurrences)
Last logged: 2:46:02 PM

Timeout fetching reolink.Reolink - RLC410 - 1.motion_states data

I would rather not go for the forked repo linked just above my message as this one as many more contributors.

albanleandri avatar Dec 10 '22 14:12 albanleandri

This repo hasn't been updated in 3 month 🙄 the fork you don't want to try receives updates often. And yes it has this specific issue fixed.

skynet01 avatar Dec 11 '22 09:12 skynet01

Which fork are we switching to? I see 98 of them.

angrycatmeowmeow avatar Dec 11 '22 14:12 angrycatmeowmeow

Which fork are we switching to? I see 98 of them.

https://github.com/JimStar/reolink_cctv

shyney7 avatar Dec 11 '22 16:12 shyney7