Martin's corner on the web

Installing emoncms’s “events” module

I use emoncms to log telemetry readings from various sources (wireless sensor nodes, software bots etc), the so logged data helps my IoT connected gadgets make decisions, based on pre-defined rules. For example, my heat pump monitors outside weather conditions (temperature, humidity, wind, time of day, day of week) and adjusts its operation accordingly. Adding notifications when feed readings match a criteria is quite an useful feature that the “events module” provides – you can setup actions to occur when a feed goes above, below or is equal a set value. Prowl, NMA, Curl, Twitter and Email notifications are supported. I needed to set up threshold values for some of the feeds, for example

  • Solar hot water tank temperature exceeding 85 degrees C ( I need to dump the excess hot water before it boils)
  • Solar water tank temperature lower than 5 degrees C (I need to start the electric heater to prevent freezing)
  • Some of my battery operated wireless nodes stops reporting (needs battery replacement)
  • Room temperature exceeds 40 degrees (possible fire)
  • Flood sensor reports flood event
  • My wireless doorbell is activated
  • and so forth

Setting up the events module is easy

sudo apt-get update
sudo apt-get install php5-mcrypt php5-curl
cd /var/www/emoncms/Modules
sudo git clone https://github.com/emoncms/event.git

and then you need to visit “http://YOUREMONCMS/admin/view” to create the database structure required for the module to operate.

If all goes good, a new menu “Extras” appears:

extras

Lets set it up, this is done by visiting the ‘event settings’ hyperlink that appears on the top right corner of events module. It takes you to the this screen:eventI only need to setup email notifications, since I can do Twitter, Facebook, SMS  and so forth notifications from IFTTT, it only requires gmail access.

Here is how setting up the rules looks, this particular rule will send me an email if the solar water tank temperature exceeds 85 degrees C:

newevent

There is a ‘mute’ parameter: it specifies how long to keep quiet about this event after initially sending a notification. If you don’t set it, you will get notifications on every feed update. I have set mine to only alert me once every 3 hours on this particular feed.

So basically this is it, quite easy and very practical, “must-have” feature.

5 thoughts on “Installing emoncms’s “events” module

  1. Paul

    IIFTT looks promising, but is still in beta, and reliability is not proven. Have you considered Boxcar for such critical alerts?
    You can miss out gmail completely and send ‘push’ alerts to an iphone from the ‘events’ module via Boxcar by calling a URL in the events module such as;

    http://yourdomain/emoncms/Modules/event/scripts/boxcar/boxcar_send.php?msg=Feed%20Value%20is%20{value}%20degC&title={feed}%20feed%20Alert%20

    Boxcar announced today on it’s new site that it’s uptime is officially 99.95% which is good enough for me, and same as IIFTT – it’s free.

    Paul (and no, I’m not a Boxcar salesman!!)

  2. Mattia

    Hi Martin, great post, and very nice projects you keep yourself busy with.
    If you feel like you need the event module to have some more functionality just drop a line on the OEM forum and we’ll see what can be done.
    Regards

  3. Pingback: Door sensor | Martin's corner on the web

  4. Perico

    Hi.

    I have installed it, but something is wrong, it doen’t notifies me, in the “last true”field the data is always 1970-1-1 01:00:00.

    🙁