d-link DCS-935L motion and sensor detect

Moderator: leecollings

Post Reply
st4chuu
Posts: 5
Joined: Wednesday 07 August 2019 9:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

d-link DCS-935L motion and sensor detect

Post by st4chuu »

Hello
if anyone know if there is in some way solution to get info about detect motion or sound by camera d-link?
I used this camera at baby room, and i would like to connect this signal with light in my bedroom.
Maybe there is some way to get status
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: d-link DCS-935L motion and sensor detect

Post by FireWizard »

hello @st4chuu

A solution is described in the Wiki.
See: https://www.domoticz.com/wiki/Camera_Setup.

See chapter 1.4 for Motion and 1.5 for Sound detection.

Personally I own a number of DLink DCS930LB camera's and use them in a larger project, I'm currently working at, for intrusion detection and I use a different approach, described below:

Step 1. Configure the area, in which motion should be detected and configure the sound level, using the standard built-in web server.
(For my purpose, I do not use the sound functionality, as it resulted in too many unwanted "alarms")

Step 2. Install IPCam2MQTT https://github.com/svrooij/ipcam2mqtt.
Take care, that you have installed Node.JS

To check if you have installed it already, issue the following command:

Code: Select all

node -v
If not, follow the procedure, as described at: https://linuxize.com/post/how-to-instal ... pberry-pi/

If everything is installed you will see, e.g in MQTT Explorer:

Screenshot_MQTT Explorer.png
Screenshot_MQTT Explorer.png (114.97 KiB) Viewed 2157 times
It will tell you, whether Motion was active or inactive. Beside that it will also send the camera image.

3. From here you have 2 options.
- 1. Insert some kind of script (dZVents, Lua. or whatever), to read that data.
- 2. Install Node Red and read that data and control with MQTT the switch, you want to set to "ON".

If you need more support, please ask.

Regards
Last edited by FireWizard on Wednesday 25 May 2022 23:45, edited 1 time in total.
lost
Posts: 616
Joined: Thursday 10 November 2016 9:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: d-link DCS-935L motion and sensor detect

Post by lost »

st4chuu wrote: Thursday 04 February 2021 15:54 if anyone know if there is in some way solution to get info about detect motion or sound by camera d-link?
I used this camera at baby room, and i would like to connect this signal with light in my bedroom.
Maybe there is some way to get status
Some IP cams may provide a custom http trigger in their setup pages, so able to change a virtual switch/PIR in Domoticz using http/json API. But I don't think dlink provides this.

So, as this is mostly the case, there is IMO no easy way & you'll have to rely on the most common feature in the IP cam world: Ability to transfer captures resulting from events (cam motion/sound internal detection) to an FTP server.

And, after setup an FTP server (on the machine already hosting Domoticz, for instance), design or use an existing service that'll be able to monitor this FTP directory to handle new captures (archive/send/erase them) & report to Domoticz.

Problem is this'll not be very responsive to handle a lightning: I have done such setup, with alarm system integration in mind instead of lightning, and I monitor FTP every 10s for new files. So this may be up to 10s delay to have a switch done!

My system is much more complex (archiving/cyphering/e-mailing captures, handling some alarm weighting mechanism + virtual PIRs feeding linked with my domoticz managed alarm system, for several IP cams with individual tunable depending on their location) so I need a time-frame able to handle capture management so for something very simple1s check period may be used... but you'll always have internal camera+FTP send delays!

FTP protocol does not manage received in progress files natively, as well. So take care to use a FTP server that implement some "tricks" to handle this (usually a naming prefix for in-progress files). Otherwise the risk is to detect/remove in progress files on server side that may have unexpected effects on camera client side (hang client or camera), especially when reducing check period for responsiveness!

And what to expect as a result: Coming in, waiting 2 or 3s for light to switch on... Forget it IMO. Too complex and not very friendly at use vs setting a real PIR in the room that'll interface natively to Domoticz.

This may fit other use cases, but IMO not yours.
st4chuu
Posts: 5
Joined: Wednesday 07 August 2019 9:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: d-link DCS-935L motion and sensor detect

Post by st4chuu »

@FireWizard
First of all thank you for your response and clearly description.
Yea shame on me . There was description in wiki :)
I thought that there will be posible to use some d-link api to dont use additionale module. But if there is no other chance i will do this in that way.

@lost
Yea your solution will be not the best for my case. but it's preaty clear for me.
I've got simple motion sensor. But it detection also movment in the bed. I did't find proper place to leave motion sensor.
I thingthat solution showed by FireWizard will be the best for my aplication.
lost
Posts: 616
Joined: Thursday 10 November 2016 9:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: d-link DCS-935L motion and sensor detect

Post by lost »

st4chuu wrote: Friday 05 February 2021 10:32 @lost
I thingthat solution showed by FireWizard will be the best for my aplication.
Looking at this solution, that's also FTP server side monitoring based: No cam API to send a custom frame on events, no other way!
So that's still a question of switch delay that fits your needs... or not.

If you have a PIR, orientation & sensitivity tuning matters. But you can mask some sections of the Fresnel's lens to blind detection angles also: IMO, if you can't get something reliable from a true movement detector, don't expect to do better from an IP cam motion.

Spider/insects passing close to device won't trigger a PIR. For a cam lens, most picture will be affected so this'll fool the best tuned motion zones/sensitivity you can think about!

Anyway, that's always funny to test&try... but you're warned. ;)
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: d-link DCS-935L motion and sensor detect

Post by FireWizard »

Hi, @st4chuu and @lost,

This question raises a controversy between a solution with motion detection from a camera and a Passive Infra Red detector (PIR).

1. @st4chuu raises the following question:
if anyone know if there is in some way solution to get info about detect motion or sound by camera d-link?
I used this camera at baby room, and i would like to connect this signal with light in my bedroom.
Maybe there is some way to get status
I answered that question.

We should keep in mind that the application used by @st4chuu is a different one than that @lost describes.

@lost came with a very detailed explanation on why not to use a camera as motion detector. In my opinion the view was based on a intrusion system.(burglar).

He wrote:
Some IP cams may provide a custom http trigger in their setup pages, so able to change a virtual switch/PIR in Domoticz using http/json API. But I don't think dlink provides this.
As, I own a number of DLink DCS930LB camera's, I think that the whole series of DCS930 - DCS936 camera' s have some functionality in common and indeed there is no way to trigger a http request in case of motion. That would be the easiest way, but that does not exist.
So, as this is mostly the case, there is IMO no easy way & you'll have to rely on the most common feature in the IP cam world: Ability to transfer captures resulting from events (cam motion/sound internal detection) to an FTP server.
Indeed and we do.
And, after setup an FTP server (on the machine already hosting Domoticz, for instance), design or use an existing service that'll be able to monitor this FTP directory to handle new captures (archive/send/erase them) & report to Domoticz.
That is exactly. what the IPCam2MQTT application does. This application sets up its own FTP server and monitors the changes, which results in publishing an MQTT message. The user has not to worry about that. Install that script and subscribe to that topic. That is all.
My system is much more complex (archiving/cyphering/e-mailing captures, handling some alarm weighting mechanism + virtual PIRs feeding linked with my domoticz managed alarm system, for several IP cams with individual tunable depending on their location) so I need a time-frame able to handle capture management so for something very simple1s check period may be used... but you'll always have internal camera+FTP send delays!
My experience is that a motion in the configured camera frame, triggers the MQTT publish rather quick. A few seconds are important in an intrusion system but less important if you monitor your baby. An intruder may have left the room within seconds, so quick detection and signalling is important, but the baby will stay in his/her bed until the father or mother will pick him/her up. So a delay of a few seconds is not that important.
Problem is this'll not be very responsive to handle a lightning: I have done such setup, with alarm system integration in mind instead of lightning, and I monitor FTP every 10s for new files. So this may be up to 10s delay to have a switch done!
No, the MQTT solution does not give you a delay of 10 seconds. It is almost immediately. If you do alarm verification in order to discriminate between a person or a dog or cat, that will take some time, But this is not needed, if you monitor your baby. If something moves in the baby bed, it is the baby. If it is something else, you also want to go.
FTP protocol does not manage received in progress files natively, as well. So take care to use a FTP server that implement some "tricks" to handle this (usually a naming prefix for in-progress files). Otherwise the risk is to detect/remove in progress files on server side that may have unexpected effects on camera client side (hang client or camera), especially when reducing check period for responsiveness!
The picture itself is not important. It is the motion in a certain area. In case of baby monitoring, you don't need a camera stream or a number of pictures. You want a command and if this command is delayed with 1 or 2 or even 5 seconds, does not matter.
And what to expect as a result: Coming in, waiting 2 or 3s for light to switch on... Forget it IMO. Too complex and not very friendly at use vs setting a real PIR in the room that'll interface natively to Domoticz.
Does not matter. This motion detector is used when the baby wakes up, moves, makes noise, cries for food, etc. to switch on the lamp in the parents room, not in the baby room. Time, 2 or 3 seconds, doesn't matter.
It's perfectly suited for monitoring the motion of a baby in his/her bed. PIR is not necessary and a camera has the advantage that you always can take a look.
Looking at this solution, that's also FTP server side monitoring based: No cam API to send a custom frame on events, no other way!
So that's still a question of switch delay that fits your needs... or not.
Yes, it uses FTP. You can define the frame, the motion sensitivity and the sound level. As soon as it is properly adjusted (It needs some testing) it gives you simple a signal "Motion active"(or "Motion inactive") A delay (if there is any) is not significant.
Spider/insects passing close to device won't trigger a PIR. For a cam lens, most picture will be affected so this'll fool the best tuned motion zones/sensitivity you can think about!
Okay, if so, I would think that some cleaning in the baby room would be a good idea, But honestly, I never saw that in the neighborhood of the camera's I have installed.

I know, this is not the best baby motion detection system, but is is good enough for the purpose. It is not an intruder detection system in a museum.

If you need support for Node Red, just ask.

Best regards.
lost
Posts: 616
Joined: Thursday 10 November 2016 9:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: d-link DCS-935L motion and sensor detect

Post by lost »

FireWizard wrote: Friday 05 February 2021 18:58 This question raises a controversy between a solution with motion detection from a camera and a Passive Infra Red detector (PIR).
That's no controversy: IP cams have anti-dither times and FTP send delays that can't be optimized. These devices are blackboxes and you can't optimize this side. If delay is not an issue (not sure intended use was still a baby cam, IMO this was reusing the cam as light control were you expect minimal delay, but I may be wrong) this may do the job. That's what I wrote.

But that's complex and in my experience, motion from cams just can't do better than a PIR. Maybe with more complex devices (with IA), but even those with classic face recognition/tripwire etc, on top of usual basic motion detection areas with fine tuning show issues that'll show up over months depending on conditions (up to misbehaving: Capture start conditions met and end never reached ; this can happen 2 times/year with tripwire, but yes, shit happens).

And let's avoid talking about issues linked to FTP: A very old protocol. Even if the image is not important, hanging remote device silently until next power cycling is. I have cams that do not cope with all servers, using commands that are usually not supported or not able to recover from a server side removing of a part file.

Making something reliable with these constraints is not so easy. That's not controversy, just facts.
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: d-link DCS-935L motion and sensor detect

Post by FireWizard »

@lost,
IP cams have anti-dither times and FTP send delays that can't be optimized. These devices are blackboxes and you can't optimize this side. If delay is not an issue (not sure intended use was still a baby cam, IMO this was reusing the cam as light control were you expect minimal delay, but I may be wrong) this may do the job.
As I understood the post, a movement of a baby in his/her bed should activate the lights in the parents room.
I don't think that delays of a few seconds are an issue.

But I agree with you that using a Motion function on an IPCam is less reliable than using a PIR, but then we talk about intrusion detection.
They are definitively not better than a PIR for intrusion detection. But do we need them for monitoring the motion of a baby. I don't think so.

Agree, FTP is an old protocol, but that applies also to TCP and UDP. Usely my FTP connection works fine (Wired is better than Wireless).

Let's see what the original poster wants.
I just answered his question.

Best regards
Last edited by FireWizard on Tuesday 12 April 2022 23:28, edited 1 time in total.
st4chuu
Posts: 5
Joined: Wednesday 07 August 2019 9:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: d-link DCS-935L motion and sensor detect

Post by st4chuu »

@FireWizard , @lost Very interesting discussion. Maybe i will be leave more information about my case. Electronic and programing (general engineering) is my passion i tried to find solution for problems where anyone others say "that's a problem? comon". Domoticz and many others giving me a lot of satisfaction of improvement part of my live.
My daughter has 2 years old. Until she sleept in closed bed simple sound detector was enaught. At this moment she sleeping in open bed and she knows how to open door from the room. It starting to be praty danger because she is preaty strong and high according to years. At night when we are sleaping she can travel around all flat.

I tested build in function of camera and it warking preaty well it detection movment in sectors where my doughter should not be.
I tried fo tind function when i will catch this signal it don't has to be in one moment. time like 5-10 s also will be ok. I wanted to ommit saving a lot of unncecesery files. This camera we used only as online. Like simple nanny.
lost
Posts: 616
Joined: Thursday 10 November 2016 9:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: d-link DCS-935L motion and sensor detect

Post by lost »

st4chuu wrote: Monday 08 February 2021 0:28 At night when we are sleaping she can travel around all flat.

I tested build in function of camera and it warking preaty well it detection movment in sectors where my doughter should not be.
I tried fo tind function when i will catch this signal it don't has to be in one moment. time like 5-10 s also will be ok. I wanted to ommit saving a lot of unncecesery files.
Well, this brings me 14 years back... at the end of a 11 hours international night flight, when an attendant told me she caught my 18 month daughter visiting the 777 after I finally fall asleep: She managed to escape the belt & get out of the cradle in front of my kees :?

So the cam may do the job, whatever you choose. The hassle-free existing solution if this does the job (if no FTP issue, as this embeds the server) in your case or the DIY (mine is an infinite loop monitoring FTP subdirectories for each cam, with a 10s processing budget for captures managemend & interfacing with Domoticz using virtual PIR switches, all done in python & started as a Linux service).

For your use-case, as you'll remove files immediately, just take care of this:
-Camera able to send capture images, not only videos that may be longer to show-up on server side (usually, the cam stores shorts video slices before sending).
-Setup ftp directory on a tmpfs (in ram), to avoid wearing flash storage.
-If you have issues, you may need a FTP server that brings some atomicity to the FTP protocol if you observe camera FTP client silently (depends on devices) hanging: This may happen if file is removed while upload still in progress. On my side, proftpd proved to be reliable on this, due to it's HiddenStore trick:
http://www.proftpd.org/docs/directives/ ... tores.html

Proftpd also provide a good range of tuning on session/idle/stall timeouts & good support of FTP command set, even those not so common: That's the only FTP server that proved to cope with several brands of IP cams in my system (I have dlink/edimax/dahua).
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: d-link DCS-935L motion and sensor detect

Post by FireWizard »

Hi, @lost, @st4chuu
Camera able to send capture images
This camera is capable of doing that, although the picture itself is not that important.
Setup ftp directory on a tmpfs (in ram), to avoid wearing flash storage.
This is important. I run this IPCam2MQTT in a TrueNas (FreeBSD) jail on my NAS and not on a SDcard in my Raspberry Pi.

I suggest: Just start and see how it works,

Regards
st4chuu
Posts: 5
Joined: Wednesday 07 August 2019 9:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: d-link DCS-935L motion and sensor detect

Post by st4chuu »

Hi @lost and @FireWizard
I found easier solution. Solution with fpt works preaty well, i decided to share this solutionif some one else will need this info
After downgrade firmware i have simple http api.
I made more complication events. It babe will be wake up but not leave the bed, the soft light will be on. When babe will leave bed we have notification in our bedroom.
"/config/notify_stream.cgi" this is stream with info about sound and motion
I don't have to use ftp just run sctipt which will be analized data from stram
it looks:
md1=on
mdv1=7

audio_detect_val=51

audio_detect_val=43

md1=off
mdv1=0
audio_detect_val=51

audio_detect_val=48

audio_detect_val=68

audio_detect_val=65

audio_detect_val=68

audio_detect_val=61

audio_detect_val=60

audio_detect_val=59

audio_detect_val=57

audio_detect_val=50

audio_detect_val=36

md1=on
mdv1=7
Thats all what i need.
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: d-link DCS-935L motion and sensor detect

Post by FireWizard »

Hello @st4chuu,

Great, that you found a solution that satisfies your needs.

Regards
rezzalex
Posts: 49
Joined: Thursday 24 September 2020 14:30
Target OS: NAS (Synology & others)
Domoticz version: Beta
Contact:

Re: d-link DCS-935L motion and sensor detect

Post by rezzalex »

st4chuu wrote: Sunday 21 March 2021 12:26 Hi @lost and @FireWizard
I found easier solution. Solution with fpt works preaty well, i decided to share this solutionif some one else will need this info
After downgrade firmware i have simple http api.
I made more complication events. It babe will be wake up but not leave the bed, the soft light will be on. When babe will leave bed we have notification in our bedroom.
"/config/notify_stream.cgi" this is stream with info about sound and motion
I don't have to use ftp just run sctipt which will be analized data from stram
it looks:
md1=on
mdv1=7

audio_detect_val=51

audio_detect_val=43

md1=off
mdv1=0
audio_detect_val=51

audio_detect_val=48

audio_detect_val=68

audio_detect_val=65

audio_detect_val=68

audio_detect_val=61

audio_detect_val=60

audio_detect_val=59

audio_detect_val=57

audio_detect_val=50

audio_detect_val=36

md1=on
mdv1=7
Thats all what i need.
Hello @st4chuu, could youshare your script please ?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest