Using Pushover with Electric Imp

Here I will show how to easy be able to use with an Electric Imp.

It can be done a few ways, and be triggered by the device, but in this first example I am only going to show how to interface with the Pushover API.

function pushover(message)
  local token = "insert application token";
  local user = "inser user token";
  local priority = 1; // -1 = low, 0 = normal, 1 = high

  local request ="", {"Content-Type": "application/x-www-form-urlencoded"}, "token=" + token + "&user=" + user + "&message=" + message + "&priority=" + priority);
  local response = request.sendsync();
  server.log("Pushover response: " + response.body);
pushover("This message was send from the Electric Imp Agent");

On the front page of (after logging in) you will find your user token. At the bottom of the page you then find a link to create a new application. You will then find the application token under the application you just created.

Inser the two tokens into the function in the agent, “Build and Run” and you should get a message looking something like this.


2 thoughts on “Using Pushover with Electric Imp”

  1. How would you get the code to be triggered from the device? (device code) Here is the example code from the Electric Imp site:

    // Alias the GPIO pin as ‘button’
    button <- hardware.pin1;

    function buttonPress() {
    local state =;
    if (state == 1) {
    // The button is released
    } else {
    // The button is pressed


    // Configure the button to call buttonPress() when the pin's state changes
    button.configure(DIGITAL_IN_PULLUP, buttonPress);


Leave a Comment