AppleScript for Active and Passive Modes
  • I’m creating two AppleScript applications that will put cameras in passive mode or active mode. My goal is to integrate IFTTT with SS so that when I leave home the cameras are turned to active mode, and when I get home they are turned to passive.

    I have the IFTTT Side working flawlessly, but when I run the activate script, it only activates for a few seconds and then sets the camera back to passive. I’ve seen other users with this issue and I read through the forum. I don’t have any schedules setup to conflict with the scripts. Any thoughts?

    Here are the scripts I am using:

    tell application "SecuritySpy"
    passive mode camera number -1
    end tell

    tell application "SecuritySpy"
    active mode camera number -1
    end tell

    Any thoughts?
  • Those commands are deprecated - SecuritySpy version 4 has done away with the "active" and "passive" terminology.

    The new way to set camera modes is via schedules, and the commands for this are as follows:

    set schedule "Armed 24/7" camera number -1 mode All

    set schedule "Unarmed 24/7" camera number -1 mode All

    Also, you should make sure that you are using the latest version of SecuritySpy

    Please report back and let us know about your integration with IFTTT as I'm sure this will be helpful to other users.
  • Perfect! I’ll test these commands out and post my findings
  • Are there more commands I can trigger? For example, if I want to trigger motion capture but NOT actions?
  • Actually, I figured out the different system commands.

    So my workflow is as follows:

    To ARM
    I have a recipe in IFTTT that creates a text file in Dropbox folder named "Armed" when I leave home (using the Location applet).
    I have Automator on my SS Server watching that Dropbox folder for changes. When Automator detects any change to that folder, it runs an application I wrote that tells SS to arm the cameras.

    Here's the application code to turn on Actions and Motion Capture (but not Continuous capture):

    tell application "SecuritySpy"
    set schedule "Armed 24/7" camera number -1 mode Actions
    set schedule "Armed 24/7" camera number -1 mode MotionCapture
    end tell

    Conversely, to UNARM:

    I have an IFTTT recipe that creates a text file in a Dropbox folder named "Unarmed" when I get home.

    Again, Automator watches this folder and runs an application that disarms my interior cameras and turns Actions off while still leaving motion capture on the external cameras.

    Here's the application code I'm using to achieve this:

    tell application "SecuritySpy"
    set schedule "Unarmed 24/7" camera number -1 mode Actions
    set schedule "Unarmed 24/7" camera number 3 mode MotionCapture
    end tell


    I'm still working on this but it works!
  • Sounds great, thanks for posting this!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!