Sensors go Unavailable periodically
Describe the bug The sensors generated by the integration go Unavailable every x hours : x minutes with (mostly) exactly 1h delay between the occurrences.
To Reproduce Use the integration, there is nothing you have to do this has been happening ever since I start using it about 6 months ago, which is coincidentally also the length of time it took me to procrastinate and submit the issue.
Expected behaviour Sensors available all the time camera is online
Screenshots

Environment: Please provide useful information about your environment, like:
- Home Assistant version 2022.2.1
- Reolink camera model 410W
- Camera firmware number v3.0.0.136_20121102
Additional context Does not seem to cause any issues, but I presume any automations depending on the sensor fail if the trigger happens on the second exactly while the sensor is unavailable.
+1
seems to be a mix of groups of 1 hour up to 3 hours between the "unavailable"


Have been trying various configs but the issue seems to remain (direct connection to the camera, moving vlans, remove intermediate firewalls etc). One of the above is an NVR ( RLN8-410 Build No. build 2110099) and the other is a RLC-1220A Firmware: v3.1.0.764_21121705
I can see errors in the logs for "[custom_components.reolink_dev] Timeout fetching reolink.Front.motion_states data" or even indications of credential errors but the events are not as frequent as the "unavailable"
2022-02-09 14:21:08 ERROR (MainThread) [custom_components.reolink_dev] Unexpected error fetching reolink.Garage-Rear data: File "/config/custom_components/reolink_dev/__init__.py", line 98, in async_update_data File "/config/custom_components/reolink_dev/base.py", line 250, in update_states File "/usr/local/lib/python3.9/site-packages/reolink/camera_api.py", line 453, in get_states File "/usr/local/lib/python3.9/site-packages/reolink/camera_api.py", line 1710, in send reolink.exceptions.CredentialsInvalidError
As the camera seems to be still working and recording at the time of at least one of the "unavailable"'s not convinced the camera/nvr are crashing/rebooting
I have the same issue with RLC-820A and RLC-520 cameras. I'm going to try to find a workaround, as this bug makes the Last Event sensor essentially worthless.
the same problem. thanks
Same with RLC520
Same with RLC520A..
Same issue with my 6 cameras. Also triggers a motion event in node red when they reconnect
This is because you are supposed to ignore events in NodeRed if previous value was not available.
Has anyone figured out why this behavior is happening? with my 820A, I noticed that at regular intervals (about 1 hour) the sensors became unavailable for a while.
It's still happening with latest ha + hacs. One of my cameras recently died and I noticed it now happens in 2-3 hour intervals instead of 1-2hours. No idea if that is relevant.
I have the same issue where the camera and sensors becomes unavailable. It is an E1 Zoom

@cpainchaud If it is due to camera limitations, would it be possible to filter similar messages in the log?
About a year later and issue is happening for me on a new Reolink Trackmix POE install w/ latest firmware. Any workarounds to this yet?