Updated Event Module

Hi Folks.

Find updated Event module at https://github.com/XaroRSA/event

Need to figure out how to do pull or push request?

New SMS via Twilio and Pre-mute functionality!

XaroRSA Event Module additions:

Twilio SMS function

Pre-Mute function

Twilio:
How to use:
  1: Sign up for Twilio trail or full account at www.Twilio.com
  2: Enter ACCOUNT SID and AUTH TOKEN into event Settings.
  3: Look under Numbers tab in Twilio account page. They allocate a number to use. Enter number into "FromNumber" when creating new event in format of +12345124124(This works, not sure about brackets and dashes)
  4: On trail Twilio accounts, number you want to send to must be verified. Do this via Twilio page.
  5: Once number is verified, enter number into "ToNumber" tab when creating new event.

Pre-mute:
Set a pre-mute time before sending notification. After pre-mute time is reached, regular post-mute function runs eg. 15seconds pre-mute, after 15seconds, every 30seconds post-mute if alarm remains active.
Note: only works when values are continuously posted. Will not automatic "check" after time-outs are reached.

sumnerboy's picture

Re: Updated Event Module

Not sure if anyone has come across mqttwarn (https://github.com/jpmens/mqttwarn) but I think this would be an excellent tool for use with the event module. If we could update the event module to publish events to an MQTT topic then we can use mqttwarn for any number of notifications - e.g. twitter, Pushover, XBMC, even phone calls (via Freeswitch)!

I use mqttwarn extensively in my home automation system and it is a fantastic way to decouple notifications and alerts from the system generating the messages. 

All the event module would need is a way to publish the 'events' to an MQTT topic and then everything else is handled by mqttwarn. If you have a look at the Github readme for mqttwarn you will see there is a HUGE list of supported 'targets'. 

Any questions about mqttwarn sing out - I was involved in writing the early versions.

sumnerboy's picture

Re: Updated Event Module

BTW - mqttwarn already has support for Twilio...https://github.com/jpmens/mqttwarn#twilio

XaroRSA's picture

Re: Updated Event Module

Ill look into this, might be a fun implementation.

sumnerboy's picture

Re: Updated Event Module

Hey XaroRSA - did you have any joy implementing an MQTT event notifier? Very keen to see it if you have, cheers, Ben.

XaroRSA's picture

Re: Updated Event Module

Summerboy, did you have a look here http://openenergymonitor.org/emon/node/3634

sumnerboy's picture

Re: Updated Event Module

Yep - I was pretty active in that thread ;). That was talking about getting data into EmonCMS using MQTT. With the event module I am talking about getting events out of EmonCMS using MQTT. So currently I have a tweet configured to send if my solar PV generation goes about 10kWh in a day. I would prefer that to be an MQTT publish, which I can then monitor using mqttwarn and generate any number of notifications, i.e. tweet, mail, pushover alert, xbmc notification...twilio...

XaroRSA's picture

Re: Updated Event Module

O ok, I can look into it at a later stage. Still looking for a full time job, perhaps donations would be welcome.

I need to fix a few other modules that I work on

sumnerboy's picture

Re: Updated Event Module

Good luck with the job hunting. I will have a go at this myself when I get a chance.

Paul Reed's picture

Re: Updated Event Module

Any luck with this? I know it's on the radar for future development, but it would be great to get feed data OUT of emoncms, esp as a MQTT publish, so it can be processed in node-red.

Paul

sumnerboy's picture

Re: Updated Event Module

Sorry Paul, haven't had a chance to look at this, but I have zero experience with PHP so am not really sure where to start...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.