LUNATICOASTRO.COM

How to send a push message to your smartphone

using the Cloudwatcher windows software

… using the PushBullet app www.pushbullet.com

PushBullet is a great and free app that allows you to receive instant notifications in 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 messages to you.

Assume you want to be notified when Dragonfly sensor 8 goes off (it may be a power off alarm, or any other thing).

You just have to copy the following text in a file, and save it with name “SensorOff8.vbs” (be sure to avoid the “.txt” extension if you’re using the Notepad). The file has to be placed in the same folder as all Dragonfly scripts ( c:\program files (x86)\dragonfly\dfscripts” ).

Pushbullet and dragonfly

Just modify the 3 lines with “tit”, “bod” and “key” – it is correct “tit” and “bod” having a pair of triple double quotes each. A lot of quotes.

The “key”, of course, refers to the key you’ll obtain when registered in PushBullet.com

Don’t forget to enable the sensor scripts in your 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