DYI: Notifications from SGPro to an electricimp device

Posted on Updated on

This is a quick way to send notifications from SGPpro to a device. Depending on the type of message the SGpro sends to the device, the device will light up a certain color LED. I am using an electricimp, if you are nor familiar with this particular device start here. SGP sends emails with the following titles:

  1. SGPro Error
  2. SGPro Warning
  3. Test Message from SGPro
  4. SGPpro….Completed

The messages will be from SGPro through a mailgun account and routed to the electricimp. The imp will parse the message subject and accordingly will display:

  • Green – All good
  • Red – Error
  • Yellow – Warning
  • Blue – Test
  • All – Unknown message

First you need to setup a free mailgun account. Follow the steps in this post. After completing this step you need to set up a route. Effectively, mailgun receives your message then sends an HTTP Post with details to your imp. There are four parts:

  1. Hardware Setup
  2. Electricimp code
  3. Mailgun routing setup
  4. SGpro Setup

1. Hardware Setup

You need an electric imp device. I also connected a LiPo battery since I wanted it to be portable. However, that is not a necessary step as you can power your imp through USB. You can also put the device in a case to make it more visually appealing.


Hardware list

  1. Electricimp
  2. Electricimp breakout
  3. Red,Blue,Yellow,Green Led
  4. Mini Breadboard
  5. Jumper wire
  6. Optional: Polymer Lithium Battery
  7. Optional: LiPo USB charger
  8. Resistors (I used 200KΩ)

There is plenty room to adjust components in the list. I just used my spare parts.

The first step is to assemble and power your electricimp. Read this.

Then connect your leds to the pins via a resistor as follows. Read this first.

  1.  Blue led goes to pin 7
  2. Red led goes to pin 8
  3. Yellow led goes to pin 9
  4. Green led goes to pin 5

All the cathodes are connected to ground.


This step might take awhile, be patient.

2. Electricimp code

The imp uses an online IDE. Read this to understand how to setup and program the imp.


My code is available here. Finally make a note of the agent’s address (the one circled) It should look like this:


3. Mailgun routing setup

Before this step you need to have a mailgun account setup. See my post and follow instructions.

Now lets set up the routing options. Read more about routes here.  In mailgun, select the following routes:


Create a new route


The rules are pretty simple.

  1. Filter Expression =
  2. Actions : Store(Notify:

4. SGPro Setup


In SGPro add a new Address, which is the Press Test and you should see :


Enjoy!!!! 😉

DYI: Notifications from SGPro to your iphone

Posted on Updated on

SGPro added notifications through email. This is a quick way to get notifications in Prowl (and Growl) on your iphone.


First you need to purchase Prowl form the iTunes store here. Or through your iPhone’s store

You also have to have a mail account. I created a mailgun account so I do not clutter my main mailbox.

To create a mailgun account, and get the settings go to Sign up for a free account. Then form the mail panel:


You will be given API Keys and the default account. You will need to create a new account.

click on activate:


click Manage SMTP credentials


and create a new account. I used and password. You will need this to configure the SGP mail settings

You next have to create a Prowl email account. So go to


Select API Keys and generate a new key. Name it SGPPro:


And generate:


Now you have an API Email for your app ( Now lets tailor it together.

Start SGPro and Select Tools/Configure Notifications/Settings


For address enter the prowl email you created above


and for you settings add the settings from your mailgun server.

Use for SMTP Server

Username and password are the ones you created  (


Press test and watch for the notification in your iPhone. Enjoy!!!! 😉