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.