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.



Add a Comment

Your email address will not be published. Required fields are marked *