Skip to content

Trigger . Go to ptz position.

hello . is it possible during a trigger, to activate a camera and ask it to go to a specific ptz position? Thanks.


  • I know you can make an apple script to make it do that.

  • Yes, this is best done via AppleScript. Create a script using the Script Editor app, like this:

    tell app "SecuritySpy"
        ptz preset1 camera number 0
    end tell

    Make sure the preset number is the one you want, and that the camera number corresponds to the number shown for the camera you want to control in the Camera Info window in SecuritySpy (if you don't see this column, click on the header bar where you see the column names for a menu that will allow you to add it).

    Then save the script to the ~/SecuritySpy/Scripts folder (i.e. the Scripts folder within the SecuritySpy folder within your Home folder), and then set the script as an Action for the camera that you want to invoke the script when triggered.

  • Great ! Thanks it works great!

    What if I want the PTZ to return to another position after a while?

    Or maybe you have a list of models or examples of scripts or functions!? I don't know many.

    Thanks anyway, you are efficient.

  • Sure, you can add a delay before returning the camera to another preset, like this:

    tell app "SecuritySpy"
        ptz preset1 camera number 0
        delay 10
        ptz preset2 camera number 0
    end tell

    There are more examples of other things you can do with AppleScript on the SecuritySpy AppleScript Examples page.

  • edited July 24

    Parfait 👌🏼 Thanks

  • I have a camera that I want to go to position 2 when "HomeKit Bulb A" turns off. Then wait 4 hours, and return to position 1.

    • I made an AppleScript that moves to 2 delays then moves back to 1.
    • I made a trigger for Homekit Bulb A in that camera settings for Trigger
    • I made action = run script
    • I turned off the HomeKit Bulb A and script did not trigger.

    Feels like I'm missing something... how does SS know that trigger should cause this action? I have other triggers for motion that trigger an action of record.

  • Hi @jimmyjohnson check that Actions mode for this camera is armed (e.g. set to the schedule "Armed 24/7"). If this doesn't do it, please email us and include screenshots of all these settings and we'll take a look for you.

Sign In or Register to comment.