Page 1 of 2

VStarcam Motion Detection

Posted: Monday 08 August 2016 19:55
by simon_rb
Hi all,

Just starting out in the IP Camera world and bought a cheap £40 VStarcam for trying out, going to use these mainly for inside, like the garage and babies room. I have got it working in Domoticz, can view the feed (had to use the jpeg screen shot feed). In the software in the camera they have removed the motion detection setting that used to let you send a http command which would have been great to switch a dummy switch so I know there is movement in the garage. That way I can set Domoticz to turn the music on in the bedroom if it detects motion at 3am or when we are not home.

The two options I am left with is sending an FTP screen shot or an email to myself. I was wondering if there is anyway of getting an FTP command to somehow switch a dummy switch in domoticz or even maybe could an email being sent switch a dummy switch. I don't think either is possible but there are some great minds on this forum and maybe there is a solution?

Thanks for reading!

Cheers

Re: VStarcam Motion Detection

Posted: Monday 08 August 2016 21:44
by Egregius
Mayve email and IFTT?

Re: VStarcam Motion Detection

Posted: Monday 08 August 2016 22:48
by simon_rb
Egregius wrote:Mayve email and IFTT?
Looks interesting. Have you got this to work with Domoticz?

Cheers

Edit:- Found some info on it - shall give it a go now..

Thanks!

Re: VStarcam Motion Detection

Posted: Tuesday 09 August 2016 13:30
by safi78

Re: VStarcam Motion Detection

Posted: Tuesday 09 August 2016 20:45
by simon_rb
I thought that maybe too labour intensive for a Raspberry Pi, I have found a way to add a url that the camera can send however I'm having issues. The code I send is:-

http://<IP ADRESS:PORT/set_alarm.cgi?alarm_http_url=http://<IP ADDRESS:PORT/json.htm?type=command&param=switchlight&idx=2&switchcmd=On&user=USER&pwd=PASSWORD


But it only saves the file up until the & at the end of command&, I think its to do with the & as that seems to be an indication to move onto the next item under the set_alarm.cgi? I have tried with " " and ' ' but with no luck. Any ideas?

Re: VStarcam Motion Detection

Posted: Thursday 11 August 2016 10:45
by Marci
Percent encode the &'s in the Domoticz URI... so change each & to %26

See https://en.m.wikipedia.org/wiki/Percent ... characters

Or use nodeJS to "bridge" the camera to Domoticz... see https://github.com/PatchworkBoy/domoticz-cam-bridge

Re: VStarcam Motion Detection

Posted: Thursday 11 August 2016 17:14
by simon_rb
Thanks Marci, I have the server up and running. Test by going to 192.168.1.26:8091 and the switch in domoticz turned on. However using the camera it doesn't. I'm thinking that it doesn't have a http url option even though I have set it. Another odd thing is that it sets it as http:/192.168.1.26:8091 rather than http:// even though thats what I set it too.. I am getting notifications on my phone pushed from the camera so I know its detecting people. Snippet of the get_params.cgi

var alarm_motion_armed=1; var alarm_motion_sensitivity=1; var motion_plan1=0; var motion_plan2=0; var motion_plan3=0; var motion_plan4=0; var motion_plan5=0; var motion_plan6=0; var motion_plan7=0; var motion_plan8=0; var motion_plan9=0; var motion_plan10=0; var motion_plan11=0; var motion_plan12=0; var motion_plan13=0; var motion_plan14=0; var motion_plan15=0; var motion_plan16=0; var motion_plan17=0; var motion_plan18=0; var motion_plan19=0; var motion_plan20=0; var motion_plan21=0; var alarm_input_armed=0; var alarm_ioin_level=0; var alarm_mail=0; var alarm_audio=0; var alarm_temperture=0; var alarm_iolinkage=0; var alarm_ioout_level=0; var alarm_upload_interval=0; var alarm_presetsit=0; var alarm_snapshot=1; var alarm_record=1; var alarm_schedule_enable=1; var alarm_http=1; var alarm_http_url="http:/192.168.1.26:8091"; var alarm_schedule_sun_0=-1; var alarm_schedule_sun_1=-1; var alarm_schedule_sun_2=-1; var alarm_schedule_mon_0=-1; var alarm_schedule_mon_1=-1; var alarm_schedule_mon_2=-1; var alarm_schedule_tue_0=-1; var alarm_schedule_tue_1=-1; var alarm_schedule_tue_2=-1; var alarm_schedule_wed_0=-1; var alarm_schedule_wed_1=-1; var alarm_schedule_wed_2=-1; var alarm_schedule_thu_0=-1; var alarm_schedule_thu_1=-1; var alarm_schedule_thu_2=-1; var alarm_schedule_fri_0=-1; var alarm_schedule_fri_1=-1; var alarm_schedule_fri_2=-1; var alarm_schedule_sat_0=-1; var alarm_schedule_sat_1=-1; var alarm_schedule_sat_2=-1; var alarm_note=1; var alarm_server=""; var alarm_user=""; var alarm_pwd=""; var alarm_port=0;

Cheers!

Re: VStarcam Motion Detection

Posted: Thursday 11 August 2016 18:36
by simon_rb
I have managed to get it to say http://192.168.1.26:8091 but its not working. If I copy the http://192.168.1.26:8091 and paste it in my web browser my lights come on. So I suspect my camera doesn't support url! Doh! What cam are you using Marci?

Edit:-I think its working now, there is just a delay in the camera sending the url. Woohoo.

Edit 2:- False positive lol. It doesn't work. My browser was refreshing in the background which was turning on the lights. Never mind, was worth a shot.

Thanks everyone.

Re: VStarcam Motion Detection

Posted: Thursday 11 August 2016 21:50
by Marci
Several DBPower ones, a few magyon ones, and some custom ones using USB capture sticks / Sony eviD100 on spare RaspberryPis.

Re: VStarcam Motion Detection

Posted: Thursday 11 August 2016 22:55
by simon_rb
Cheers, gonna have to keep searching as my VStartcam isn't sending the http url when it detects motion. Shame really.

Re: VStarcam Motion Detection

Posted: Thursday 11 August 2016 22:58
by simon_rb
Only other way is if I can upload a screenshot via FTP to domoticz or another program that could in turn send the url to your cam bridge or directly to the switch. Most IP cameras have the ability to upload a screenshot to FTP. Hmmmm....

Re: VStarcam Motion Detection

Posted: Thursday 11 August 2016 23:05
by Marci
Yup, I have a node_module that handles that too... tomorrow.

Re: VStarcam Motion Detection

Posted: Thursday 11 August 2016 23:20
by simon_rb
Marci wrote:Yup, I have a node_module that handles that too... tomorrow.
Haha why am I not surprised... I'd love to see your house! Thanks mate!

Edit:- I found homebridge smtpsensor that looks promising for HomeKit purposes
https://www.npmjs.com/package/homebridge-smtpsensor

Re: VStarcam Motion Detection

Posted: Sunday 14 August 2016 13:02
by simon_rb
Sorry to be a pain Marci, any chance of that node_module. I know your very busy with MQTT integration for eDomoticz :)

Re: VStarcam Motion Detection

Posted: Sunday 14 August 2016 19:12
by Marci
Soz - family visiting today - will get it online tomorrow!

Re: VStarcam Motion Detection

Posted: Sunday 14 August 2016 23:21
by simon_rb
Haha, no probs mate.. Have a day off! :) You deserve it lol

Re: VStarcam Motion Detection

Posted: Monday 15 August 2016 19:28
by Marci
Have updated the above git repo... https://github.com/PatchworkBoy/domoticz-cam-bridge

Now contains two separate server files: one for http, one for ftp... and instructions modified. Just delete everything you created first time round and redo with these versions - probably easiest.

Re: VStarcam Motion Detection

Posted: Monday 15 August 2016 20:56
by simon_rb
Excellent.. thanks mate!!!!

Whats the best way to remove the old one before I install this one?

Re: VStarcam Motion Detection

Posted: Wednesday 17 August 2016 16:40
by simon_rb
I tried the server_ftp and it doesn't appear to work for me. Is there a log I could send to you?

Cheers

Re: VStarcam Motion Detection

Posted: Wednesday 17 August 2016 19:05
by Marci
See foreverjs GitHub repo for commands to view logs of anything run with forever... https://github.com/foreverjs/forever/bl ... /README.md