Close

Script Disabling of video and alerts

Having trouble with Sighthound Video? Post here for help.

Moderator: Staff

no avatar
whoamib
 
Posts: 12
Joined: Sun Oct 24, 2010 1:17 pm

Script Disabling of video and alerts

by whoamib » Thu Jan 10, 2013 1:53 pm

I have a huge need to be able to script the disabling of video recording and sending email alerts. Right now I use AutoIT do manually do the mouse clicks to get the locations to disable the video but I'm really having trouble disabling only alerts. Right now I have setup AutoIT to do all of the mouse clicks to get all of the way to change the username on the account used to log in to the email server but this doesn't work reliably at all. I would really appreciate a way to get it to disable the alerts without having to use AutoIT.

I can't even find a registry key where the username field is stored. Scripting a registry key update would be easy if I knew where that username was stored.

Any help would be appreciated.

Thanks,
-Ben

User avatar
ryan
 
Posts: 1015
Joined: Wed Aug 25, 2010 2:52 pm
Location: Palo Alto, California

Re: Script Disabling of video and alerts

by ryan » Sat Jan 12, 2013 2:19 pm

Hiya,

This information is not stored in the registry, but instead in .rule files in the vdv data directory (I'm traveling with my phone right now so I'm afraid I can look this location up). You could make a copy of the rule file with the action turned on and off, and have your script replace these as desired, but you would need a way to tell VDV this happened (it doesnt expext this and would be terribly inefficient to constantly reload rules from disk or registry). Off the top of my head you could either turn the camera or rule off and on again in the monitor view (inconvenient for scripting) or you could quit and restart the app (also not great). I'll think on this and see if I can come up with a better workaround.
Learn more about Sighthound Video in our support pages - Reference Guide | All Articles
Are you a developer? Check out our cloud APIs - Demo | Docs

no avatar
JPElectron
 
Posts: 48
Joined: Tue May 31, 2011 12:52 am

Re: Script Disabling of video and alerts

by JPElectron » Tue Jan 15, 2013 4:03 pm

I handle this a little differently, in my case I leave the rule in there which always runs a script (cam2detect.bat), but drop or delete another file (on.txt) to control whether the script continues execution or not. For example...

---------------------------------------------------------------------------------------------------

cam2detect.bat...
@ECHO OFF
IF NOT EXIST C:\SWMON\on.txt goto done

:run
START "cam2run" /D "C:\SWMON" "C:\SWMON\cam2run.bat"

:done
EXIT

REM This script is configured to run, under each camera rule, in VDV

---------------------------------------------------------------------------------------------------

cam2run.bat...
@ECHO OFF
CD\
CD C:\SWMON

IF EXIST C:\SWMON\marker-cam2lockout.txt goto lockout
ECHO %DATE% %TIME% Lockout >> C:\SWMON\marker-cam2lockout.txt
ECHO %DATE% %TIME% VDV Motion on cam2 >> C:\SWMON\sys-log.txt
SLEEP 1
C:\SWMON\sendEmail.exe -f [email protected] -t [email protected] -u "cam2 motion detected" -m "VDV running on servername detected cam2 motion." -s smtp.example.com
"C:\Program Files\VideoLAN\VLC\vlc.exe" file:///C:\SWMON\sound\motiondet.wav vlc://quit
SLEEP 20
DEL C:\SWMON\marker-cam2lockout.txt
goto done

:done
EXIT

:lockout
EXIT

:faulterr
ECHO %DATE% %TIME% cam2run error >> C:\SWMON\sys-log.txt
EXIT

REM This script runs only if the system is on

---------------------------------------------------------------------------------------------------

P.S. My real script is a little more complex cause it's integrated with a home automation / alarm system. For example, I've configure on.txt to get created when the homeowner turns the alarm system on (keyswitch or numberpad hardware), and it gets deleted when the alarm system is disarmed. Sometimes I will also configure the second batch file grab 3 still .jpg's from the IP camera and attach them to the email, so the homeowner has an idea of if it's a false alarm/someone they know vs. an intruder such that it's worth using RDP to go into the system and check.

no avatar
james.elson
 
Posts: 4
Joined: Thu Apr 04, 2013 7:38 pm

Re: Script Disabling of video and alerts

by james.elson » Wed Apr 10, 2013 9:13 am

I'd like to do pretty much the same thing - enable the cameras when I set my alarm system, and disable them when I'm home.

There are two ways I can hook into my alarm system - poll it's webservice every five minutes or so, or get it to send an email to an address I can check as more of a "push" system. But unless I can enable/disable the cameras within Vitamin D Video, there's not a lot of point.

I use the Mac version, so was sort of hoping the application exported an API via AppleScript so I could "tell application "Vitamin D Video enable cameras", but it doesn't look like it's exporting anything. Any plans to do so?

James

User avatar
ryan
 
Posts: 1015
Joined: Wed Aug 25, 2010 2:52 pm
Location: Palo Alto, California

Re: Script Disabling of video and alerts

by ryan » Thu Apr 11, 2013 9:17 pm

Hi James, All I can say at the moment is that I would love to add more remote interaction, both for users and developers, but I unfortunately can't comment on a timeline.

no avatar
james.elson
 
Posts: 4
Joined: Thu Apr 04, 2013 7:38 pm

Re: Script Disabling of video and alerts

by james.elson » Tue Apr 16, 2013 2:07 pm

Thanks for the response Ryan.

Hmm, given that the application is written in Python, a simple scripting approach might be to just expose certain methods so that they can be called from another python script. That would have the advantage of being cross platform. At the moment the modules are all compiled versions and I'm not about to start decompiling them, but would happily help out in any testing.

All I really need is the ability to import a module which can then arm_cameras(), turn_off_cameras() (and yes, I know it's never that simple). My alarm system has a simple JSON-based REST API, so can also be called via Python. This would tie them together nicely.

With that functionality I'd happily fork out for the Pro Edition.

James


Return to Technical Support