Sending Pushover notifications from Openremote

pushover summarypushover listPushover is a simple mobile notification system available for Android and iOS. It is similar to the Notify My Android however it is not free. Its API makes it possible to configure messages with custom icons (see images left) and notifications are easily send from within OpenRemote.

To send a message first you need to create a command:

  • name
  • protocol HTTP
  • URL${param}
  • HTTP method POST

There are more parameters available and described in details on Pushover API’s page.
Note that the call uses ${param} to pass the message text from a rule:

rule "System start"
when eval(true)
  execute.command("", "System start");

Temperature sensor’s calibration

Recently I’ve purchased EnOcean starting kit as I think that energy harvesting solutions have big potential. They are batteries free therefore maintenance free. This is a big advantage comparing to other technologies. Anyway, the set has a temperature sensor which I’ve added to my OpenRemote controller and after linking it to a label I’ve noticed that its value has 2.5 centigrade offset comparing to my thermostat. Although, EnOcean claims that the sensor is calibrated I trust more my thermostat, the offset is simply too much!

Luckily for OpenRemote this is not a big problem. The solution is as follows:

  1. have 2 sensors, the real that’s read from the device and a virtual linked to the user interface. Both should be custom sensors with the empty custom states list;
  2. for the virtual sensor, you would have “In-memory Virtual Command” VTEMP, command: STATUS and address: VTEMP;
  3. have a rule on the real value, do your computation, then call the write command.

The rule is (checked and tested to work correctly):

rule "Correct Temperature"
  CustomState(source=="Temperature", $v: value)
  double correctedValue = Double.parseDouble($v.toString()) - 2.5;
  double fahrenheit = (correctedValue*9) / 5 + 32;
  execute.command("VTEMP", String.format("%.1f \u2103 / %.1f \u2109", correctedValue, fahrenheit));

Note that the above code does more than only temperature correction. It also adds Fahrenheit so the final UI display is: