Created
October 17, 2022 21:57
-
-
Save CarltonHenderson/e47419484030d4182a8a4b1d552f4867 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
/* User Config */ | |
$TrapLocations := { | |
"2037335832365003002c0047": "Garage", | |
"203733583236500375754859": "Basement" | |
}; | |
$from := "+18505551212"; /* My Twilio account phone number */ | |
$to := "+14015551212"; /* My cellphone number */ | |
/* End Config*/ | |
$shouldRoute := $contains(file, "#motion.qo") ? true : $doNotRoute(); | |
$sparrowNodeId := $substringBefore(file, "#"); | |
$location := $lookup($TrapLocations,$sparrowNodeId); | |
$timestamp:= $fromMillis(when*1000, '[H01]:[m01]:[s01] [z]', '-0400'); | |
$body := "There's movement in the " & $location & " mousetrap! " & $timestamp; | |
"&Body=" & $body & "&From=" & $from & "&To=" & $to & "&" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment