Looking for the simpler option? The DragonFly now has native PushOver & PushBullet notifications, so it can send them with no PC connected at all. The script below is the manual route, and works from almost any of our products.
Using the PushBullet app
PushBullet is a great and free app that allows you to receive instant notifications on your phone, computer, tablet…
We already use it in the Solo to warn of weather changes, and it is easy to have your DragonFly send this kind of message too.
Example: notify when a sensor goes off
Assume you want to be notified when DragonFly sensor 8 goes off (it may be a power-off alarm, or anything else).
You just have to copy the following text into a file, and save it with the name SensorOff8.vbs (be sure to avoid the .txt extension if you're using Notepad). The file has to be placed in the same folder as all DragonFly scripts:
The script
Just modify the 3 lines with tit, bod and key—it is correct that tit and bod each have a pair of triple double quotes. A lot of quotes.
The key, of course, refers to the key you'll obtain once registered at PushBullet.com.
Don't forget to enable the sensor scripts option in your DragonFly software.
The code:
Dim objXmlHttpMain , URL
tit = """Message title"""
bod = """Body of the message"""
key = "your pushbullet key"
strJSONToSend ="{""type"": ""note"", ""title"": " & tit & ", ""body"": " & bod & "}"
URL="https://api.pushbullet.com/v2/pushes"
Set objXmlHttpMain = CreateObject("Msxml2.ServerXMLHTTP")
objXmlHttpMain.open "POST",URL, False
objXmlHttpMain.setRequestHeader "Authorization", "Bearer " & key
objXmlHttpMain.setRequestHeader "Content-Type", "application/json"
objXmlHttpMain.send strJSONToSend
set objJSONDoc = nothing
set objResult = nothing
