Skip to content

Run a Script on Motion Capture Trigger

I've built a DIY alarm system that integrates with SecuritySpy, enabling my cameras when Apple HomeKit detects no family members are home. When interior cameras detect motion, the system:

  • Triggers a siren and flashing alarm
  • Sends me a text alert
  • Plays a unique sound on my phone

I'm now implementing a logging system to track when the system activates or deactivates and when SecuritySpy triggers camera actions (via Run Script in the Actions tab). I'd also like to log Motion capture events that don't trigger actions, but there's no Run Script option in the Motion Capture tab.

I'd like to log all detected motion, not just events that trigger actions. Since SecuritySpy doesn't offer Run Script for motion capture, I'm looking for a workaround-perhaps scanning SecuritySpy's logs for motion events?

Any suggestions would be much appreciated! Thanks!

Comments

  • Unfortunately i have no idea, but i´d like to know:

    How do you play a sound on your phone?

  • To trigger a sound on an iPhone you can create a shortcut to do so:

    1. Run a shortcut from SecuritySpy's "Run shell command:" field in Settings-Cameras-Actions. Example: 'shortcuts run "[your shortcut name]"'
    2. Have that shortcut send a text message to your iPhone via the 'Send Message' action. Send something like "play my sound".
    3. Open the shortcuts app on your phone and tap "Automation" at the bottom of the screen. Tap "+" to add a 'Personal Automation', then scroll down and choose 'Message.' Select the sender (probably yourself) and the text to respond to, "play my sound" or whatever text you sent. Then play the sound in the 'Do' part of your Personal Automation. My 'Do' part looks like: Receive messages as input; Set Media volume to 50%; iCloudDrive-SecuritySpy Sounds-Sounds-mysound.mp3; Play sound

    I've been able to log motion events on my system as follows: For my cameras that trigger actions they also trigger identical motion capture triggers so I can log them using SecuritySpy's Triggers 'Run script' field to use my AppleScript log script. For my cameras that do not trigger actions but do trigger motion capture I add action triggers identical to their motion triggers and use those action triggers to log as above. This works because I do not have any cameras that have Action Triggers that differ from their Motion Triggers.

  • Thanks for sharing!!

Sign In or Register to comment.