fwestenberg / reolink_dev

Home Assistant Reolink addon
MIT License
550 stars 102 forks source link

Motion detection subscription got response status: 400 #115

Open badabing2005 opened 3 years ago

badabing2005 commented 3 years ago

I reported this in another thread that got close.

After a while, the integration stops working, camera is no longer available, even though the logs show that the integration managed to establish a connection and get a proper token

image

I tried to narrow this down, and have managed to reproduce even with a single Camera added (initially I thought adding multiple cameras was causing the issue) How long the camera works is not very predictable, but it eventually stops working.

bs42 commented 3 years ago

I also have been having this issue. If there is anything I can do to help diagnose, I'd be glad to help. I've had to readd my cameras numerous times. I believe the issue started with the version of this plugin that changed from manual configuration in the yaml and was moved into the Integrations interface, but I'm not 100% sure of that timing.

badabing2005 commented 3 years ago

For me unfortunately, this integration has become non-functional. It doesn't last a day, constantly removing / adding has become non-viable.

Same here, anything I can do to help out?

fwestenberg commented 3 years ago

Why do you say you have to re-add? Beside: I am trying to build you guys a working NVR solultion, do I ask too much? As a said: I don't have a NVR, so I can only test with your help.

fwestenberg commented 3 years ago

The issue with the webhook should be fixed if you update the files in custom_components/reolink_dev with the files from this branch. No need to re-add the camera's. Just update and reboot.

kaaspad commented 3 years ago

@fwestenberg let me know what you need, I'm one of the ones having an issue with the NVR, so anything you need me to check I'm happy to. Thanks

badabing2005 commented 3 years ago

Why do you say you have to re-add? Beside: I am trying to build you guys a working NVR solultion, do I ask too much? As a said: I don't have a NVR, so I can only test with your help.

I'm sorry @fwestenberg if you got the reporting of the issue the wrong way, by no means I'm complaining about your efforts to get us a working solution, I'm merely reporting what I'm observing in terms of this integration's operation, in fact I even offered how in any way I could help.

Here is what I mean by, I need to re-add After a while, the Integration stops working image

Even with a single camera added image

Notice the status image

The only way I know how to get it back to working condition is by removing the camera / integration and adding it back. That is what I mean by re-adding And it doesn't last a day before it stops working again.

The issue with the webhook should be fixed if you update the files in custom_components/reolink_dev with the files from this branch. No need to re-add the camera's. Just update and reboot.

You might have missed including the files link

I'll be happy to test and please, there is no complaint in any sense, I know you're doing this out of your goodwill.

badabing2005 commented 3 years ago

Update: I found a branch named NVR-Webhook-subscription Replaced the files with those, restarted HASS and the above camera which was unavailable, showed up properly.

I will update in a day or two (or sooner if it stops working again) if the camera stays functional.

Thanks for all your efforts. BB

bs42 commented 3 years ago

I have the same scenario exactly as @badabing2005

Also agree 100%, thank you @fwestenberg for all your work making this plugin, no complaints from me just wanting to offer to help in any way I can to make this even better. This plugin is so much nicer than using plain RTSP, so I appreciate all your work.

fwestenberg commented 3 years ago

@badabing2005 no problem, great you've found the right branch. In stead of removing/add the camera's again, this button should also work, does it?:

image

From what I hear, the API and/or subscription break down for some reason. In the logging it should report (debug mode) something like:

2020-12-29 12:14:22 DEBUG (MainThread) [reolink.subscription_manager] Host 192.168.1.23 should renew in: 348 seconds...
2020-12-29 12:14:29 DEBUG (MainThread) [reolink.subscription_manager] Host 192.168.1.24 should renew in: 342 seconds...
2020-12-29 12:14:31 DEBUG (MainThread) [custom_components.reolink_dev] Finished fetching reolink data in 2.249 seconds
2020-12-29 12:14:31 DEBUG (MainThread) [reolink.subscription_manager] Host 192.168.1.24 should renew in: 340 seconds...
2020-12-29 12:15:22 DEBUG (MainThread) [reolink.subscription_manager] Host 192.168.1.23 should renew in: 289 seconds...
2020-12-29 12:15:22 DEBUG (MainThread) [reolink.subscription_manager] Reolink host 192.168.1.23 got response status: 200. Payload: .........
2020-12-29 12:15:22 DEBUG (MainThread) [reolink.subscription_manager] Local time: 2020-12-29 11:15, camera time: 2020-12-29 11:15 (difference: -0.0017991065979003906), termination time: 2020-12-29 11:35
2020-12-29 12:15:23 DEBUG (MainThread) [custom_components.reolink_dev] Finished fetching reolink data in 1.679 seconds
2020-12-29 12:15:23 DEBUG (MainThread) [reolink.subscription_manager] Host 192.168.1.23 should renew in: 1187 seconds...
2020-12-29 12:15:31 DEBUG (MainThread) [reolink.subscription_manager] Host 192.168.1.24 should renew in: 280 seconds...

The first two lines are for the subscription manager of the motion detection of my two camera's. It's counting back to the renew call. The at 12:15:22 the second call is the renew call. Right below is the call to the API to fetch the device states.

The subscription manager also reports the camera time: Local time: 2020-12-29 11:15, camera time: 2020-12-29 11:15 (difference: -0.0017991065979003906), termination time: 2020-12-29 11:35. This is important because we need to translate the time difference. And after that, you see 192.168.1.23 got a new renew timer of 1.679 seconds.

Is this working in your case?

badabing2005 commented 3 years ago

Status report: This latest version has been very solid, my I haven't yet needed to re-add / reload a camera, it's been available and solid. Not only that, whatever magic you pulled, the motion detection is also working. And it's working very fast, I have automation to take snapshot on motion detection, and the snapshot are perfect. I have couple of snapshots that had errors, the jpg content were the following

[
   {
      "cmd" : "Snap",
      "code" : 1,
      "error" : {
         "detail" : "get config failed",
         "rspCode" : -12
      }
   }
]

But in general most have worked good.

One thing to take note of, my tests are only with a single camera (channel 1) added It remains to be confirmed, but I believe Reolink NVR onvif motion detection is only triggering channel 1 events (I'm in touch with Reolink support about this)

Tomorrow I will add more cameras and see if it remains solid. Thanks

BB

badabing2005 commented 3 years ago

Another status Report. After adding multiple Cameras, Motion detection unfortunately broke.

There are motion detection events on all of the cameras, however they don't correlate to true events, it's really hard to make any sense of the recorded events.

Also, HTTP 400 response is back after adding multiple cameras. Although unlike in the past, the cameras continue to work, so I'm not sure what is the effect of those Bad Request Responses

2021-01-03 09:26:51 DEBUG (MainThread) [custom_components.reolink_dev] Finished fetching reolink data in 0.615 seconds
2021-01-03 09:26:51 DEBUG (MainThread) [custom_components.reolink_dev] Finished fetching reolink data in 0.727 seconds
2021-01-03 09:27:50 DEBUG (MainThread) [reolink.subscription_manager] Host 192.168.1.100 should renew in: 956 seconds...
2021-01-03 09:27:50 DEBUG (MainThread) [reolink.subscription_manager] Host 192.168.1.100 should renew in: 956 seconds...
2021-01-03 09:27:50 DEBUG (MainThread) [custom_components.reolink_dev] Finished fetching reolink data in 0.413 seconds
2021-01-03 09:27:50 DEBUG (MainThread) [custom_components.reolink_dev] Finished fetching reolink data in 0.487 seconds
2021-01-03 09:27:51 DEBUG (MainThread) [reolink.subscription_manager] Host 192.168.1.100 should renew in: 955 seconds...
2021-01-03 09:27:51 DEBUG (MainThread) [reolink.subscription_manager] Reolink host 192.168.1.100 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/RenewRequest</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-01-03 09:27:51 DEBUG (MainThread) [reolink.subscription_manager] Reolink host 192.168.1.100 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-01-03 09:27:51 ERROR (MainThread) [custom_components.reolink_dev.base] Host 192.168.1.100 error renewing the Reolink subscription
2021-01-03 09:27:51 DEBUG (MainThread) [reolink.subscription_manager] Reolink host 192.168.1.100 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></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-01-03 09:27:51 DEBUG (MainThread) [custom_components.reolink_dev] Finished fetching reolink data in 0.445 seconds
2021-01-03 09:27:51 DEBUG (MainThread) [custom_components.reolink_dev] Finished fetching reolink data in 0.600 seconds
badabing2005 commented 3 years ago

Just to update that I got this 400 on 0.12 as well, but only after adding my 4th camera

kaaspad commented 3 years ago

@badabing2005 I'm wondering if its because its the 4th camera - or does possibly the 4th camera have a name that has the first substring as one of the other cameras? I also had this issue on the third camera. The second camera is called "Front North" and the third is "Front South" so I'm wondering if that might be causing the problem. BTW on 0.12 on NVR I'm still getting the flood of messages like before about subscription and motion detection is still not working for all the cameras

badabing2005 commented 3 years ago

@badabing2005 I'm wondering if its because its the 4th camera - or does possibly the 4th camera have a name that has the first substring as one of the other cameras? I also had this issue on the third camera. The second camera is called "Front North" and the third is "Front South" so I'm wondering if that might be causing the problem. BTW on 0.12 on NVR I'm still getting the flood of messages like before about subscription and motion detection is still not working for all the cameras

@fwestenberg is aware about this, in fact this is his take of it, which makes a lot of sense

For some reason (bug) it still creates a new subscription for each camera added. While I tried to reuse single subscription! I'm sure I can fix this. I also think, the NVR accepts 3 subscriptions at max, and then terminates the first or maybe even all subscriptions.

fwestenberg commented 3 years ago

If you just connect one camera, subscription should work right? If you remove the cam's, wait let's say 20 minutes, all subsciptions will be over due. Now connect one camera only to HA. My question is: do you see anything in the log from ALL of the camera's connected to the NVR?

My theory is: one subscription should receive motion from all camera's connected to the NVR. And at motion, I will create a fix to check which camera triggered the motion.

badabing2005 commented 3 years ago

I will test it, but I doubt it, I have never seen motion events in here or even using onvif device manager other than camera1 I will do as you suggested and report back

badabing2005 commented 3 years ago

@fwestenberg You're right on the money

Even though motion is enabled on camera 7, no motion events are detected Then I moved in front of camera 1 Even though Camera 1 was not added Motion events were triggered and captured in debug log

2021-01-14 17:15:54 DEBUG (MainThread) [reolink.subscription_manager] Host 10.1.20.52 should renew in: 840 seconds...
2021-01-14 17:15:54 DEBUG (MainThread) [custom_components.reolink_dev] Finished fetching reolink data in 0.225 seconds
2021-01-14 17:16:54 DEBUG (MainThread) [reolink.subscription_manager] Host 10.1.20.52 should renew in: 780 seconds...
2021-01-14 17:16:54 DEBUG (MainThread) [custom_components.reolink_dev] Finished fetching reolink data in 0.223 seconds
2021-01-14 17:17:54 DEBUG (MainThread) [reolink.subscription_manager] Host 10.1.20.52 should renew in: 720 seconds...
2021-01-14 17:17:54 DEBUG (MainThread) [custom_components.reolink_dev] Finished fetching reolink data in 0.219 seconds
2021-01-14 17:17:54 DEBUG (MainThread) [custom_components.reolink_dev.base] Reolink webhook triggered
2021-01-14 17:17:55 DEBUG (MainThread) [custom_components.reolink_dev.base] <?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:Action SOAP-ENV:mustUnderstand="1">http://docs.oasis-open.org/wsn/bw-2/NotificationConsumer/Notify</wsa5:Action></SOAP-ENV:Header><SOAP-ENV:Body><wsnt:Notify><wsnt:NotificationMessage><wsnt:Topic Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet">tns1:RuleEngine/CellMotionDetector/Motion</wsnt:Topic><wsnt:Message><tt:Message UtcTime="2021-01-14T22:17:48Z" PropertyOperation="Changed"><tt:Source><tt:SimpleItem Name="VideoSourceConfigurationToken" Value="VideoSourceToken"/><tt:SimpleItem Name="VideoAnalyticsConfigurationToken" Value="VideoAnalyticsToken"/><tt:SimpleItem Name="Rule" Value="MyMotionDetectorRule"/></tt:Source><tt:Data><tt:SimpleItem Name="IsMotion" Value="true"/></tt:Data></tt:Message></wsnt:Message></wsnt:NotificationMessage></wsnt:Notify></SOAP-ENV:Body></SOAP-ENV:Envelope>

2021-01-14 17:17:58 DEBUG (MainThread) [custom_components.reolink_dev.base] Reolink webhook triggered
2021-01-14 17:17:58 DEBUG (MainThread) [custom_components.reolink_dev.base] <?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:Action SOAP-ENV:mustUnderstand="1">http://docs.oasis-open.org/wsn/bw-2/NotificationConsumer/Notify</wsa5:Action></SOAP-ENV:Header><SOAP-ENV:Body><wsnt:Notify><wsnt:NotificationMessage><wsnt:Topic Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet">tns1:RuleEngine/CellMotionDetector/Motion</wsnt:Topic><wsnt:Message><tt:Message UtcTime="2021-01-14T22:17:52Z" PropertyOperation="Changed"><tt:Source><tt:SimpleItem Name="VideoSourceConfigurationToken" Value="VideoSourceToken"/><tt:SimpleItem Name="VideoAnalyticsConfigurationToken" Value="VideoAnalyticsToken"/><tt:SimpleItem Name="Rule" Value="MyMotionDetectorRule"/></tt:Source><tt:Data><tt:SimpleItem Name="IsMotion" Value="true"/></tt:Data></tt:Message></wsnt:Message></wsnt:NotificationMessage></wsnt:Notify></SOAP-ENV:Body></SOAP-ENV:Envelope>

2021-01-14 17:18:02 DEBUG (MainThread) [custom_components.reolink_dev.base] Reolink webhook triggered
2021-01-14 17:18:02 DEBUG (MainThread) [custom_components.reolink_dev.base] <?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:Action SOAP-ENV:mustUnderstand="1">http://docs.oasis-open.org/wsn/bw-2/NotificationConsumer/Notify</wsa5:Action></SOAP-ENV:Header><SOAP-ENV:Body><wsnt:Notify><wsnt:NotificationMessage><wsnt:Topic Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet">tns1:RuleEngine/CellMotionDetector/Motion</wsnt:Topic><wsnt:Message><tt:Message UtcTime="2021-01-14T22:17:56Z" PropertyOperation="Deleted"><tt:Source><tt:SimpleItem Name="VideoSourceConfigurationToken" Value="VideoSourceToken"/><tt:SimpleItem Name="VideoAnalyticsConfigurationToken" Value="VideoAnalyticsToken"/><tt:SimpleItem Name="Rule" Value="MyMotionDetectorRule"/></tt:Source><tt:Data><tt:SimpleItem Name="IsMotion" Value="false"/></tt:Data></tt:Message></wsnt:Message></wsnt:NotificationMessage></wsnt:Notify></SOAP-ENV:Body></SOAP-ENV:Envelope>

So your expectation of registering any camera should receive all motion events is correct. And I strongly believe that there is a bug in NVR that does not trigger motion events on onvif on any camera other than camera 1 This is exactly what I also observed using onvif device manager.

Time for all of us Reolink NVR users reaching out to Reolink support and reporting this in hopes that they would fix it.

@fwestenberg I think the only issue that you need to address (can address) is multiple subscriptions issue.

Many thanks BB

gerardsyd commented 2 years ago

Hi - was there an update on this issue? It sounds like the workaround is to only have 3 cameras max at this stage if connected via NVR? Thanks!

Electronlibre2012 commented 2 years ago

Hi - was there an update on this issue? It sounds like the workaround is to only have 3 cameras max at this stage if connected via NVR? Thanks!

Hello @gerardsyd

no, i have 5 cameras at this time on my NVR and it works. It disconnect every 3-5 hours for motion and recording, its related to the NVR or Network, not to HA.