xannor / ha_reolink_rest

ReoLink REST/Web Camera Integration for Home Assistant
24 stars 3 forks source link

[DUO 2 POE] Unavailable Camera Streams #18

Closed ridl8349 closed 2 years ago

ridl8349 commented 2 years ago

Using Reolink Discovery it discovered the Reolink Duo 2 POE I have installed. Can access the camera through the web interface and login and see the image from the camera. The camera streams are unavailable. Multiple errors in logs.

image

image

xannor commented 2 years ago

Ok, under the hood my code tries to be "smart" about detecting https redirects, however I dont think I make the config_flow smart enough to change the config from it. This could be why things are off. I have not tested much with https enabled as I dont use it on my network.

xannor commented 2 years ago

Also load the full logs and look for error messages, I think the issue maybe something else that is getting masked by the entries above.

xannor commented 2 years ago

I have a new release v0.6.2 (4dd68dd) that may address some of your issues, I have tested with my 810A and It is error free (with https on and rtmp/rtsp disabled)

You will see warnings in the logs if onvif, rtmp, and or rtsp ports are disabled. This is something they added to a recent firmware upgrade. You will need to enable at least rtmp for the system to pull a stream, or enable the MJPEG streams.

JasperTresidder commented 2 years ago

@xannor If you have time... Could you review my reolink viewer implementation. It requires a camera with an sd card recording the motion. And VLC to view media. Developed on Linux. I'm not sure if it will work for others. https://github.com/JasperTresidder/Reolink_Camera_Viewer.

xannor commented 2 years ago

@JasperTresidder please do not usurp issues with unrelated topics. You can start a discussion if you want to talk about what you created.

ridl8349 commented 2 years ago

I have a new release v0.6.2 (4dd68dd) that may address some of your issues, I have tested with my 810A and It is error free (with https on and rtmp/rtsp disabled)

You will see warnings in the logs if onvif, rtmp, and or rtsp ports are disabled. This is something they added to a recent firmware upgrade. You will need to enable at least rtmp for the system to pull a stream, or enable the MJPEG streams.

I will try to update tonight and re-add the camera to see if it improves.

xannor commented 2 years ago

I just release a new version that should fix this issue v0.6.5, give it a try and let me know.

ridl8349 commented 2 years ago

Updated through HACS to v0.6.5, re-added the camera and here is the full log snippet repeating over and over. 2022-09-18 18:27:49.549 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration reolink_discovery which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2022-09-18 18:27:49.550 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration reolink_dev which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2022-09-18 18:27:49.551 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration reolink_rest which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2022-09-18 18:28:04.594 ERROR (MainThread) [custom_components.reolink_rest] Unexpected error fetching reolink_rest-3D Printer data: 'int' object has no attribute 'value' File "/config/custom_components/reolink_rest/__init__.py", line 81, in _update_data File "/config/custom_components/reolink_rest/entity.py", line 453, in async_update File "/config/custom_components/reolink_rest/entity.py", line 309, in _execute_commands File "/config/custom_components/reolink_rest/entity.py", line 261, in _processes_responses File "/usr/local/lib/python3.10/site-packages/async_reolink/api/commands/system.py", line 81, in utcoffset File "/usr/local/lib/python3.10/site-packages/async_reolink/api/commands/system.py", line 71, in _get_start_end File "/usr/local/lib/python3.10/site-packages/async_reolink/api/system/typings.py", line 71, in to_datetime 2022-09-18 18:28:04.597 WARNING (MainThread) [homeassistant.config_entries] Config entry '3D Printer' for reolink_rest integration not ready yet: 'int' object has no attribute 'value'; Retrying in background 2022-09-18 18:28:04.686 WARNING (MainThread) [async_reolink.rest.connection] Got https redirect from camera (http://192.168.1.121), please verify configuration

Also error on device. image

xannor commented 2 years ago

I remove that release, I rushed it out and shouldn't have, I know what I need to fix but I wont have time to do it tonight, and proplery test. please "downgrade" to v0.6.4 (d6d323d) until I can make a 0.6.6, which may take a few days due to limited time.

ridl8349 commented 2 years ago

I remove that release, I rushed it out and shouldn't have, I know what I need to fix but I wont have time to do it tonight, and proplery test. please "downgrade" to v0.6.4 (d6d323d) until I can make a 0.6.6, which may take a few days due to limited time.

No problem. Thanks for taking a look at it.

xannor commented 2 years ago

I have a new, better tested, version (v0.6.6), let me know if this works better.

ridl8349 commented 2 years ago

I have a new, better tested, version (v0.6.6), let me know if this works better.

2022-09-19 21:48:08.096 WARNING (MainThread) [custom_components.reolink_rest.push] Camera (3D Printer) refused subscription renewal, probably was rebooted. 2022-09-19 21:48:08.674 WARNING (MainThread) [custom_components.reolink_rest] Channel (Driveway) is H265 so skipping (RTMP) (MAIN) as it is not supported 2022-09-19 21:48:08.675 WARNING (MainThread) [custom_components.reolink_rest] (RTMP) is disabled on device (Driveway) so (SUB) stream will be disabled 2022-09-19 21:48:08.676 WARNING (MainThread) [custom_components.reolink_rest] (RTSP) is disabled on device (Driveway) so (MAIN) stream will be disabled 2022-09-19 21:48:08.678 WARNING (MainThread) [custom_components.reolink_rest] ONVIF not enabled for device Driveway, forcing polling mode 2022-09-19 21:48:08.869 ERROR (MainThread) [custom_components.reolink_dev.base] Host 192.168.1.121 subscription failed to its webhook, base object state will be set to NotAvailable 2022-09-19 21:48:08.876 ERROR (MainThread) [custom_components.reolink_dev.base] Host 192.168.1.121 error renewing the Reolink subscription 2022-09-19 21:48:14.778 ERROR (MainThread) [homeassistant.components.automation.hasp_core_functionality] Error rendering variables: ValueError: Template error: int got invalid input 'unknown' when rendering template '{%- set activepage = namespace() -%} {%- for entity in device_entities(haspdevice) -%} {%- if entity|regex_search("^number\..*_active_page(?:_\d+|)$") -%} {%- set activepage.entity=entity -%} {%- endif -%} {%- endfor -%} {% if states(activepage.entity)|lower == "none" %}-1{% else %}{{ states(activepage.entity) | int }}{% endif %}' but no default was specified 2022-09-19 21:48:14.824 ERROR (MainThread) [homeassistant.components.automation.hasp_core_functionality] Error rendering variables: ValueError: Template error: int got invalid input 'unknown' when rendering template '{%- set activepage = namespace() -%} {%- for entity in device_entities(haspdevice) -%}

The camera shows in devices with no errors but it does not show the stream. Logs contain errors.

I am also having issues getting this camera to communicate with BlueIris. I am tempted to return it and try another one.

xannor commented 2 years ago

From your logs, the camera is a 4k camera so RTMP is not possible for the main stream, RTSP is the only option. Also the RTMP network port has a disabled so no RTMP stream is available. HA kinda supports RTSP but you have to use a RTSPtoWebRTC proxy, and I have had little luck with the proxy on my hardware. Also ONVIF and is disabled so motion detection has to poll the camera constantly.

I would first go into the camera settings and make sure the network ports for RTMP and ONVIF are enabled, then try again.

xannor commented 2 years ago

No follow up after a few days, assuming fixed, create a new issue if you still have problems.