reolink_dev
reolink_dev copied to clipboard
Motion Sensors do not work - Usually Unavailable
Hi,
Can't get the sensors to operate. Connected via RLN16-410 NVR with the latest firmware 3.0.0.148. Cameras are RLC-810A and RLC-820A with the latest firmware 3.0.0.494. Have set internal URL, and enabled ONVIF on the NVR.
In the log I can see the following: Logger: reolink.subscription_manager Source: /usr/local/lib/python3.9/site-packages/reolink/subscription_manager.py:103 First occurred: 18:57:00 (126 occurrences) Last logged: 19:02:00
Subscription process ended with wrong HTTP status: 400: Bad Request
And the following: Logger: custom_components.reolink_dev.base Source: custom_components/reolink_dev/base.py:376 Integration: Reolink IP camera (documentation, issues) First occurred: 18:57:00 (42 occurrences) Last logged: 19:02:00
Host 192.168.1.248 error renewing the Reolink subscription
Occasionally, I can see some data from the sensors, but these are mostly unavailable.
What I could be missing? What additional information/log can I provide?
Thanks.
Please provide full logs, this is just a summary
Could you please instruct me how to do it?
Same issue here. will be happy to provide any logs (don't know how to do it)
Hello,
i have the same problem. It never worked for me with nvr16ch last hardware and firmware with any camera.
The error i have is : [homeassistant.components.stream.worker] Error opening stream rtmp://192.168.1.101:1935/bcs/channel2_main.bcs?channel=2&stream=0&user=mycorrectuser&password=mycorrectpwd
Futhermore, this rtmp url doesn't worl on my lan with vlc.
Could you please instruct me how to do it?
Go to 'Supervisor > System >'log provider??' > Core and look for reolink line.
Same. NVR16Channels. It only works with substream. Motion sensor or switches does not work.
I have same model NVR with 810A cameras, was getting same errors as above when using version 0.34 and 0.35, switched out to master version and picked the AI sensors, now sensors are reporting clear all the time even when there is motion, am getting push notifications from NVR, no errors in home assistant log, the person sensors stay constant clear, the actual main motion sensor will sometimes register motion but not reliably
Same issue here. will be happy to provide any logs (don't know how to do it)
See https://github.com/fwestenberg/reolink_dev/blob/master/TSHOOT.md
Thanks for the link. @cpainchaud, here is my log: https://controlc.com/7fe0c5e4
Hope you can find the issue :). Thanks in advance.
Your NVR replies with error: 'Reolink host 192.168.1.248 (Subscription) got response status: 400. Payload: ....' but gives no error message so I can't tell what is wrong. How many cameras do you have ?
7 cameras. 4 RLC-810A, 3 RLC-820A.
Did someone with the 16 channels 4k NVR got the sensors working?
Is it related to the User? I can see in the NVR the option of 3 types of users (regular, admin and super admin). Is there any difference for the integration? Just guessing what might be wrong.
I haven't tried using another login, using admin default but will do, I was able to use Rest to extract motion states
Have tried with General Account and a created Admin neither of these work either, only log entry is "User test has authorisation level guest. Only admin users can change camera settings! Switches will not work.", test is the general user
I can find no way to creat a Super Admin, it looks like only the built in default account has that
As a workaround I used rest to get states i.e
binary_sensor:
- platform: rest
resource: http://<NVR IP>/api.cgi?cmd=GetMdState&channel=<channel cam is on -1>&user=
&password= name: <Name of Sensor> scan_interval: 2 value_template: "{{ value_json[0].value.state }}" device_class: motion
This works fine for Motion haven't been able to find any AI ones being exposed Note: channel id is same channel cam is on -1.
Upgraded to version 0.36 (was on Master), now have lost my AI and Motion Sensor States all together all saying "Unavailable", with previous master I was getting "off" most of the time but not "Unavailable", after upgrading I got the following log entries
Subscription process ended with wrong HTTP status: 400: Bad Request 7:52:56 PM – (WARNING) /usr/local/lib/python3.9/site-packages/reolink/subscription_manager.py - message first occurred at 7:43:54 PM and shows up 120 times
Host "my NVR IP" error renewing the Reolink subscription 7:52:56 PM – (ERROR) Reolink IP camera (custom integration) - message first occurred at 7:43:54 PM and shows up 40 times
Host "my NVR IP" subscription failed to its webhook, base object state will be set to NotAvailable 7:43:54 PM – (ERROR) Reolink IP camera (custom integration)
Port 80 is used, USE_HTTPS set back to False 7:43:53 PM – (WARNING) Reolink IP camera (custom integration) - message first occurred at 7:43:53 PM and shows up 3 times
I changed the connection on one of the cameras to use 443, however this didn't make any difference to the Motion states
because of the number of cameras you have, subscription system is failing randomly. initial code written by @fwestenberg seems to register to the hook once per camera while Reolink doesn't allow this (God I want to slap them) and they merge all triggers into same webhook. The fix won't be easy and I do lack time to write it this week.
No problems I am using the following workaround in my configuration.yaml
binary_sensor:
- platform: rest resource: http://(NVR IP)/api.cgi?cmd=GetAiState&channel=00&user=(my login)&password=(my password) name: Motion_(camera position)_person scan_interval: 2 value_template: "{{ value_json[0].value.people.alarm_state }}" device_class: motion
replace people with vehicle/pet for the others, as I'm using via the NVR then I need to specify channel this is equal to the NVR channel -1, just need to duplicate for each channel and AI being used.
excuse me, how do you do it? I have RLN8-410 and when requested http://192.168.1.26/api.cgi?cmd=GetAiState&channel=00&user=hass&password=paaaasssswwwwoooorddd I get the response [ { "cmd" : "Unknown", "code" : 1, "error" : { "detail" : "not support", "rspcode" : -9 } } ] on any channel
check the NVR Hardware version (cog, system,info) and confirm your NVR hardware version support access to the AI sensors, H3MB18 may need Firmware upgrade N2MB02 & N3MB01 support it but H3MB02, H3MB16 do not. basically any that have the new interface.
I seem to have the same problem with the motion sensor. My setup has been working from time to time, but has never been stable. A while it seemed to be working ok with motion callbacks, but then the main problem was that the "clear" notification never arrived. With the current version it seems to have trouble to get any kind of callbacks. The setup is described in this old ticket (but now running version 0.38 of this integration and NVR firmware v3.0.0.148_21100909).
I just tried enabling the debug logs and this seems to the most interesting logs:
2021-11-20 22:09:03 DEBUG (MainThread) [reolink.subscription_manager] Reolink host 10.0.1.15 (Subscription) request data:
<soap:Envelope xmlns:add="http://www.w3.org/2005/08/addressing" xmlns:b="http://docs.oasis-open.org/wsn/b-2" xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header><wsse:Security soap:mustUnderstand="true" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-a5a1c11e-7d7b-40f5-a38e-ea1bef572450">
<wsse:Username>hass</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">lDmEqK1PlQ1cUzO7sYiuMKX1eS0=</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">P29Pb6ryTf62sNjO/lQmMw==</wsse:Nonce>
<wsu:Created>2021-11-20T21:09:03.000Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
<soap:Body>
<b:Subscribe>
<b:ConsumerReference>
<add:Address>http://10.0.1.8:8123/api/webhook/b0cc68f1dc70ac9019c4e24255f7028bfaf091abd53a8258fd4414e176bc6351</add:Address>
</b:ConsumerReference>
<b:InitialTerminationTime>PT15M</b:InitialTerminationTime>
</b:Subscribe>
</soap:Body>
</soap:Envelope>
2021-11-20 22:09:03 DEBUG (MainThread) [reolink.subscription_manager] Reolink host 10.0.1.15 (Subscription) got response status: 400. Payload: <?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsdd="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xmime5="http://www.w3.org/2005/05/xmlmime" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2" xmlns:ns1="http://www.onvif.org/ver10/actionengine/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:ns10="http://www.onvif.org/ver10/events/wsdl/PullPointBinding" xmlns:ns11="http://www.onvif.org/ver10/events/wsdl/CreatePullPointBinding" xmlns:ns12="http://www.onvif.org/ver10/events/wsdl/PausableSubscriptionManagerBinding" xmlns:ns13="http://www.onvif.org/ver10/network/wsdl/RemoteDiscoveryBinding" xmlns:ns14="http://www.onvif.org/ver10/network/wsdl/DiscoveryLookupBinding" xmlns:tdn="http://www.onvif.org/ver10/network/wsdl" xmlns:ns3="http://www.onvif.org/ver20/analytics/wsdl/RuleEngineBinding" xmlns:ns4="http://www.onvif.org/ver20/analytics/wsdl/AnalyticsEngineBinding" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:ns5="http://www.onvif.org/ver10/events/wsdl/PullPointSubscriptionBinding" xmlns:ns6="http://www.onvif.org/ver10/events/wsdl/EventBinding" xmlns:ns7="http://www.onvif.org/ver10/events/wsdl/SubscriptionManagerBinding" xmlns:ns8="http://www.onvif.org/ver10/events/wsdl/NotificationProducerBinding" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:ns9="http://www.onvif.org/ver10/events/wsdl/NotificationConsumerBinding" xmlns:tad="http://www.onvif.org/ver10/analyticsdevice/wsdl" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tls="http://www.onvif.org/ver10/display/wsdl" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:trc="http://www.onvif.org/ver10/recording/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:trv="http://www.onvif.org/ver10/receiver/wsdl" xmlns:tse="http://www.onvif.org/ver10/search/wsdl" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><SOAP-ENV:Header><wsa5:To SOAP-ENV:mustUnderstand="1">None</wsa5:To><wsa5:Action SOAP-ENV:mustUnderstand="1">http://docs.oasis-open.org/wsn/bw-2/SubscriptionManager/UnsubscribeRequest</wsa5:Action></SOAP-ENV:Header><SOAP-ENV:Body><SOAP-ENV:Fault><SOAP-ENV:Code><SOAP-ENV:Value>SOAP-ENV:Sender</SOAP-ENV:Value></SOAP-ENV:Code><SOAP-ENV:Reason><SOAP-ENV:Text xml:lang="en"/></SOAP-ENV:Reason></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
2021-11-20 22:09:03 WARNING (MainThread) [reolink.subscription_manager] Subscription process ended with wrong HTTP status: 400: Bad Request
2021-11-20 22:09:03 ERROR (MainThread) [custom_components.reolink_dev.base] Host 10.0.1.15 error renewing the Reolink subscription
I have an ongoing support ticket with Reolink regarding the missing "clear" callbacks and they asked if I could provide Wireshark captures, but since I'm running HA on a RasberryPi I'm thinking that will be kind of tricky? Anyone running HA on an ordinary computer that could provide these?
Have decided to move away from this integration, not the integrations fault as I'm sure they will eventually fix the AI sensors webhook subscription issue, I am moving away as the streams are 10 sec behind actual (and regualry freeze), instead am using rest (as above) for the sensors and rtsp for the streams as combining with webrtc card I can get pretty close to realtime streams that don't freeze, combining this with condition cards gives me a display that shows my cameras 4 at a time and then changes to full screen on person/vehicle motion, I setup a couple of helpers to use as triggers to change which 4 are shown at a time that way the 8 cameras I have all get shown over a time period and switch to full screen on motion, I cast this to my google hub max and use a button at bottom of screen combined with helper to switch between control dashboard view and camera view works pretty well but ocassionally drops out on the hub just need to rerun script to cast again if it does, will eventually combine all this into a tablet instead as casting to hub means I cannot send it anything else like tts without the cast dropping.
@bfeige , I have implemented your proposal. Works great. Just kept the cameras as a generic platform to be able to play in Homekit. One point, the pet option gives an error, people and vehicle work. Could you please verify whether pet is correct? Thanks.
@bfeige or @Fannangir can you share the configuration you used as you described? Sounds like it's the way to go.
@spf13, refer to some examples. Replace {IP-Address}, {User-Name}, {Password} and {Name} fields to meet your NVR/Cameras settings and desired cameras/sensors names.
camera:
Reolink High Quality Stream
- platform: generic name: Parking South Generic still_image_url: "http://{IP-Address}/cgi-bin/api.cgi?cmd=Snap&channel=00&rs=wuuPhkmUCeI9WG7C&user={User-Name}&password={Password}" stream_source: "rtsp://{User-Name}:{Password}@{IP-Address}:554/h264Preview_01_main"
Reolink Low Quality Stream (Sub Stream)
- platform: generic name: {Camera Name} still_image_url: "http://{IP-Address}/cgi-bin/api.cgi?cmd=Snap&channel=00&rs=wuuPhkmUCeI9WG7C&user={User-Name}&password={Password}" stream_source: "rtsp://{User-Name}:{Password}@{IP-Address}:554/h264Preview_01_sub"
binary_sensor:
Reolink Motion Sensor
- platform: rest resource: http://{IP-Address}/api.cgi?cmd=GetMdState&channel=00&user={User-Name}&password={Password} name: {Camera Motion Name} scan_interval: 2 value_template: "{{ value_json[0].value.state }}" device_class: motion
Reolink AI Person Sensor
- platform: rest resource: http://{IP-Address}/api.cgi?cmd=GetAiState&channel=00&user={User-Name}&password={Password} name: {Camera Motion Person Name} scan_interval: 2 value_template: "{{ value_json[0].value.people.alarm_state }}" device_class: motion
Reolink AI Vehicle Sensor
- platform: rest resource: http://{IP-Address}/api.cgi?cmd=GetAiState&channel=00&user={User-Name}&password={Password} name: {Camera Motion Vehicle Name} scan_interval: 2 value_template: "{{ value_json[0].value.vehicle.alarm_state }}" device_class: motion
I'm having the same issue. Also connected via RLN16-410 NVR with the latest firmware 3.0.0.148. Cameras are RLC-520A with the latest firmware 3.0.0.494. Have set internal URL.
(Don't know how to check if Onviff is enabled or disabled, but haven't seen any option to turn it on or off either)
Same issue. Motion constantly reported as clear. Reolink RLN8-410-E hw version H3MB16 fw version 2.0.0.274.
** In my case, this issue was resolved by setting the internal and external URLs of home assistant to static IP addresses.
@DIYtechie , onviff setting is seen only if you connect an external monitor to the NVR. It is not exposed via web interface.
Same issue. Motion constantly reported as clear. Reolink RLN8-410-E hw version H3MB16 fw version 2.0.0.274.
** In my case, this issue was resolved by setting the internal and external URLs of home assistant to static IP addresses.
I read about this solution, but tell me, where exactly do I need to set the ip?
@DIYtechie , onviff setting is seen only if you connect an external monitor to the NVR. It is not exposed via web interface.
Thanks. I noticed that in the ReadME, but cannot find it in the NVR menu (on the screen connected via HDMI)?