[ST Edge] ONVIF-compliant IP Camera Motion Detection & Video Streaming - Testers Wanted!

For anyone with an ONVIF camera or NVR – I made a fork of Todd’s driver that adds NVR support. Big thanks to Todd for the original work!

Driver: ONVIF Camera NVR SD
Channel invite: SmartThings. Add a little smartness to your things.

It’s still a generic ONVIF driver: it keeps all of Todd’s single-camera features (discovery, motion, line-cross/tamper, video streaming), so it should work with standalone ONVIF cameras too. On top of that it adds:

  • NVR support – one SmartThings device per NVR channel, created automatically
  • Motion per camera (each device reacts only to its own camera)
  • Live video per channel in a Camera Group (home Wi-Fi only, same as the original)
  • Login entered once on the main device; channels inherit it
  • Optional separate RTSP user for video
  • Manual IP setting if discovery doesn’t find the device
  • Clear error messages in the Status field (no logcat needed)

For a Hikvision NVR, these NVR settings were required:

  1. Network → Platform Access → ONVIF: enable, Authentication = Digest & WS-UsernameToken, add an ONVIF user (simple password – letters and numbers only)
  2. User Management: add an Operator user for video (RTSP)
  3. Video Parameter → Sub-Stream: H.264, 1280x720, Video Stream (no audio)
  4. Event → Motion Detection → Linkage Method: “Notify Surveillance Center” ON, arming schedule 24/7

In SmartThings: Scan nearby → on the main device set UserID/Password (ONVIF user), RTSP UserID/Password (video user), Motion Rule = VideoSource/MotionAlarm, Auto motion revert = Auto-revert → Refresh. On an NVR, channels 2..N appear within a minute.

Tested so far on a Hikvision DS-7604NXI-K1/4P(D) NVR – feedback from single-camera and other NVR users is very welcome. Illustrated guide (Hebrew, but the screenshots are self-explanatory): https://drive.google.com/file/d/1Fa85ONi1-vCEJM2XgqUfpzJeWmk1VLq4/view?usp=sharing

Questions or issues with this version – please message me rather than Todd.

Thanks for the clear step by step details.

I have installed the driver and when searching I got the three cameras connected to my hikvision NVR discovered in Smartthings app. I set already the user and password for both user Id and RTSP ID as well. All cameras showed responding and then subscribed to event then ready chX.

But no cameras streaming after creating the camera group, and event for bot line crossing and motion is not working while both events are triggered in hikvion app.

please advice…

@hezqeel
Thanks for the details and the screenshot – very helpful.

Your History shows the hub connects fine (Ready ch 1/3, Subscribed to events). Two things to try:

  1. Video – use a separate RTSP user
    The RTSP URL is using your ONVIF user (“Smartthings”). On Hikvision NVRs the ONVIF user often can’t open RTSP streams.
    • NVR → System Configuration → User Management → Add a new Operator user (letters + numbers only in the password)
    • In SmartThings, main device → Settings → RTSP UserID / RTSP Password = that new user → Refresh all channel devices
    • Test first from your phone (same Wi-Fi) in VLC:
    rtsp://USER:PASS@192.168.0.157:554/Streaming/Channels/102
    If VLC doesn’t play, SmartThings won’t either.
    • Sub-stream for each camera: H.264, 1280x720, Video Type = Video Stream (no audio)
    • Video only plays in a Camera Group while the phone is on your home Wi-Fi

  2. Motion – change the motion rule
    Your NVR doesn’t report a VideoSource event topic (only RuleEngine), so “VideoSource/MotionAlarm” won’t fire on your model.
    • Each device → Settings → Motion Rule Selection = RuleEngine/CellMotionDetector → Refresh → turn Events off and on
    • On the NVR, for each camera: Event → Motion Detection → Linkage Method → “Notify Surveillance Center” ON, and the Arming Schedule covering the times you want
    • Do the same “Notify Surveillance Center” setting for Line Crossing if you want those events

If it still doesn’t work, please post a screenshot of the History after changing the motion rule – the Status line will show what the NVR answers.

Thank you for your reply..

All cameras are responding, but when tried to switch event on, A network or server error occurred.

Thanks for the screenshots – they showed a driver bug: your NVR (DS-7608NXI-K2, fw V4.83) reports its motion rules in two separate groups (“RuleEngine[1,2]”), and the driver only looked in one. So it found no motion rule (motion:no) and refused the Events switch, which caused the “network or server error”.

Fixed in driver version 2026-11-03T22:18:

  1. Hub → Drivers → ONVIF Camera NVR SD – check the version. It updates automatically within a few hours; no need to delete anything.
  2. On each channel: Settings → Motion Rule Selection = RuleEngine/CellMotionDetector
  3. Tap Refresh, then turn Events on.

The Status line should now show “motion:yes”. If it still says motion:no, please post the Status line again.
Also – for video, did the separate Operator RTSP user / VLC test work?

After couple of days of troubleshooting, some issues found and below is break down of the findings:

1- motion is triggered successfully, but it kept motion active for ever until event turning off and on manually, and motion never trigger again unless this done.

2- Line crossing is triggered in Hikvision app but nothing at all in SmartThings.

3- Video streaming is working in VLC but not working in SmartThings camera group.

Thanks for the detailed report. I’ve just published an update to the channel; it should reach your hub within a few hours, or you can remove and re-add the driver from the channel.

───────────────────────────────────────────────────
Driver Id 198b7d65-e3ae-420e-b8e8-7d8a2b512c03
Name ONVIF Camera NVR SD
Package Key onvif_nvr_sd
Version 2026-11-06T21:02:15.331077391
───────────────────────────────────────────────────

1 & 2 – Motion stuck / no re-trigger, and line crossing: the NVR was dropping the event subscription after a few minutes, which is why it only worked again after toggling Events. The update renews the subscription properly and re-subscribes automatically if it’s lost. It also writes every received event to the device Status, for example Motion event: IsMotion=true or Ignored event: ….
For line crossing, please check on the NVR: Configuration → Event → Line Crossing (per camera) → Linkage Action → tick Notify Surveillance Center, with a 24/7 arming schedule.

3 – Video: SmartThings plays the stream from your phone straight to the NVR, so it only works when the phone is on your home Wi-Fi, and it’s pickier than VLC.

  • Set RTSP UserID/Password in the driver settings to a separate NVR user with Operator rights. Hikvision often blocks the ONVIF user from RTSP.
  • Sub-stream: bitrate type Constant, 15 fps, I-frame interval 30, H.264 at 720p.
  • Then tap Refresh on the device and reopen the camera tile.

After updating, please trigger motion and a line crossing, then post a screenshot of the device History (the Status lines) and the “Video URL sent” line. Hide the password if it appears.

As of now with the new published driver update, motion is working just fine.

1- line crossing event still no event received by SmartThings while event already triggered in Hikvision, note that I made sure Notify Surveillance Center is ticked and chosen with a 24/7 arming schedule.

2- video still working in VLC while connected to same network but in SmartThings camera group it’s not. Note that all settings you advanced are already deployed.

I sent you a PM

I just realized that I accidentally posted this in the wrong thread, relating to one of your other drivers. I should have paid closer attention before posting. My apologies! :sleeping_face: :blush:

I’m reposting it here in the correct thread, both for documentation purposes and in case others encounter the same issue and find the information useful.


Hi Shai!

First of all, thanks for your work on this driver!

I’m having trouble connecting two D-Link DCS-8627LH cameras using your ONVIF Camera NVR SD Edge driver.

I previously tried TAustin’s original driver with the same result: The camera is successfully discovered, but remains “Not responding”.

I’ve been troubleshooting the issue and believe I’ve narrowed it down to the GetSystemDateAndTime request.

What I’ve verified

  • Camera model: D-Link DCS-8627LH (ONVIF Profile S)

  • ONVIF discovery works correctly.

  • ONVIF credentials have been verified.

  • Date, time and time zones are correctly configured.

  • ONVIF port 80 is being used.

  • Both TAustin’s and your driver fail during initialization.

SmartThings Edge driver log

After pressing Refresh, I captured the following using SmartThings CLI/logcat:

DEBUG Sending GetSystemDateAndTime request
      to http://[CAMERA_IP]/onvif/device_service

DEBUG HTTP Response Header:
      HTTP/1.1 401 Unauthorized

DEBUG Sending GetSystemDateAndTime request
      to http://[CAMERA_IP]/onvif/device_service

DEBUG HTTP Response Header:
      HTTP/1.1 200 OK

ERROR Failed to get date/time from
      http://[CAMERA_IP]/onvif/device_service

ERROR Failed to initialize device

INFO  Status: Not responding @[CAMERA_IP]:80

What caught my attention is that the camera initially returns 401 Unauthorized, but the subsequent request receives 200 OK.

Nevertheless, the driver still fails to retrieve the date/time and aborts initialization.

Direct ONVIF test

I also sent a GetSystemDateAndTime SOAP request directly to the camera using PowerShell/curl with HTTP Digest authentication.

The camera responded with a SOAP fault instead of the expected date/time information:

<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">
      Data required for operation
    </SOAP-ENV:Text>
  </SOAP-ENV:Reason>
</SOAP-ENV:Fault>

This suggests that the problem may be related to the camera’s handling of the date/time request, although I cannot confirm whether the driver’s request produces exactly the same SOAP response.

Possible explanation / workaround

Interestingly, I found a discussion on the openHAB forum involving exactly the same D-Link camera model and a very similar ONVIF initialization problem:

In that case, the developer discovered that the camera required authentication for GetSystemDateAndTime.

The issue was eventually resolved by allowing initialization to continue even when the date/time request failed, provided subsequent ONVIF commands such as GetCapabilities succeeded.

The camera owner subsequently confirmed that the fix worked.

My question

Would it be possible to implement something similar in your driver?

For example:

  • Allow initialization to continue if GetSystemDateAndTime fails.

  • Attempt GetCapabilities and other relevant ONVIF requests before declaring the camera unresponsive.

  • Alternatively, is there a way to bypass the date/time check or use the hub’s own time?

I realize that date/time information may be important for authentication, so I don’t know whether bypassing the request is technically feasible in your implementation.

If additional diagnostic logging or a raw SOAP response would help, I’d be happy to provide it.

My ultimate goal is to receive motion detection events from these cameras in SmartThings.

Thanks in advance for any suggestions, and for maintaining the driver!

Best regards,
Leif

Hi Shai!

First of all, thank you again for your continued efforts and for taking the time to investigate these issues. I really appreciate your dedication to improving the driver! :+1:

I’ve carried out some additional testing, following your recommendations, and captured a new log using SmartThings CLI.

I think I’ve found something interesting regarding the Event Subscription method, although I’m not entirely sure how your implementation handles this.

Test procedure

To make the results easier to interpret, I started with the following configuration:

  • Motion Rule: MotionAlarm

  • Event Subscription: Base

  • Events: Off

I then started logcat, enabled Events, pressed Refresh, waited for initialization to complete, and triggered motion by walking in front of the camera.

Next, without stopping logcat, I:

  1. Changed Motion Rule to CellMotionDetector.

  2. Changed Event Subscription to Pull-point.

  3. Toggled Events Off, then On.

  4. Pressed Refresh and waited for initialization.

  5. Triggered motion in front of the camera again.

  6. Left logcat running for several additional minutes.

Observations

1. The driver correctly registers both configuration changes.

The log confirms:

Motion rule changed to cell
Event subscription method updated to pullpoint

After Refresh, the driver correctly selects:

Motion events enabled; using topic RuleEngine/CellMotionDetector/Motion, item IsMotion

2. However, the subscription behavior still looks like WS-Base Notification.

Even after selecting Pull-point, toggling Events off/on, and refreshing the device, the driver starts a local event server and sends Subscribe requests.

I would normally expect CreatePullPointSubscription followed by periodic PullMessages requests when using Pull-point.

Neither appears in the log.

Could you clarify whether Pull-point is implemented differently in your driver, whether these operations are logged under different names, or whether the selected method might not be taking effect?

3. Subscription renewal continues briefly after unsubscribing.

After switching Events off, the driver successfully unsubscribes and shuts down the event server.

However, a few seconds later, it attempts to renew the previous subscription, resulting in:

HTTP/1.1 500 Internal Server Error
SOAP ERROR: XML element tag was missing.

The SOAP fault also contains ter:NoProfile.

Could this be a previously scheduled renewal that wasn’t cancelled when Events was switched off?

4. Still no motion events.

Despite repeatedly walking in front of the camera during both configurations, I didn’t see any Motion event or Ignored event entries.

The driver successfully initializes, identifies CellMotionDetector, and creates subscriptions, but no actual motion notifications are received.

Relevant log excerpts

Below are selected excerpts from the logcat session, covering both configurations and the transition between them.

I’ve preserved the original UTC timestamps while omitting repetitive entries and anonymizing identifying information.

11:39:23.462 INFO  Event server started and listening on: [HUB_IP]:55951
11:39:23.620 DEBUG Sending Subscribe request
11:39:24.844 INFO  Successfully subscribed to events

11:40:03.026 INFO  Refresh requested
11:40:07.016 INFO  Motion events enabled; using topic VideoSource/MotionAlarm, item State
11:40:07.471 INFO  Successfully subscribed to events

11:41:36.349 INFO  Motion rule changed to cell
11:41:39.393 INFO  Event subscription method updated to pullpoint

11:41:54.622 DEBUG main switch command received: switchOff
11:41:55.875 INFO  Unsubscribed to events
11:41:55.880 INFO  Event server shutdown

11:41:57.113 DEBUG Sending RenewSubscription request
11:41:57.203 DEBUG HTTP Response Header: HTTP/1.1 500 Internal Server Error
11:41:57.247 WARN  SOAP ERROR: XML element tag was missing.
11:41:57.261 ERROR RenewSubscription request failed with HTTP Error 500

11:42:04.122 DEBUG main switch command received: switchOn
11:42:04.132 INFO  Event server started and listening on: [HUB_IP]:45451
11:42:04.319 DEBUG Sending Subscribe request
11:42:05.673 INFO  Successfully subscribed to events

11:42:24.872 INFO  Refresh requested
11:42:28.224 INFO  CellMotionDetector found
11:42:28.225 INFO  Motion events enabled; using topic RuleEngine/CellMotionDetector/Motion, item IsMotion
11:42:28.226 INFO  Ready ch 1/1 | video:yes | motion:yes | events: Device[Trigger] RuleEngine[CellMotionDetector]
11:42:28.411 DEBUG Sending Subscribe request
11:42:28.642 INFO  Successfully subscribed to events

11:42:57.415 DEBUG Sending Subscribe request
11:42:58.667 INFO  SD: re-subscribed to events

11:42:58.855 DEBUG Sending Subscribe request
11:43:00.105 INFO  SD: re-subscribed to events

11:44:15.846 DEBUG Sending RenewSubscription request
11:44:16.551 INFO  Successfully renewed subscription

[No Motion event or Ignored event entries observed]

Additional note

I’ve kept the log excerpts relatively short to avoid flooding the thread with repetitive entries.

If you need the complete logcat output or additional SOAP responses for debugging, I’ll be happy to provide a sanitized version in a follow-up post or through a private message.

I don’t know whether these observations point to a driver issue or some unusual behavior in the D-Link camera’s ONVIF implementation.

Hopefully, this will help narrow things down.

Thanks again for your help and patience. It’s greatly appreciated!

Cheers,
Leif