AlternateEventServer

From MiOS
Revision as of 22:34, 8 May 2012 by Micasaverde (Talk | contribs)

Jump to: navigation, search

Vera calls Mios's event servers to report events, like sensor tripped, triggers, etc. Mios's event servers send out text messages and emails to report these events.

Some very advanced users have asked to setup their own event server that Vera will call to report events. If you add your own, alternate event server, Vera will still send events to Mios's event server unchanged, however Vera will also post the same event to the alternate server of your choice.

Vera will send the event as a standard HTTPS (secure) GET to yourserver/alert with the arguments passed on the URL, like this (assuming your server is myserver.me.com):

 https://myserver.me.com/alert?
  PK_AccessPoint=[serial number of Vera]
  &HW_Key=[hardware key of Vera]
  &DeviceID=[device id that is associated with the alert]
  &LocalDate=[the time the alert happened as human readable text]
  &LocalTimestamp=[the time the alert happened as a unix timestamp in UTC]
  &AlertType=[one of the alert types below]
  &SourceType=[one of the source types below]
  &Argument=[an optional argument depending on the alert type]
  &Format=[a file format, not normally used]
  &Code=[a code for the alert, usually the variable that changed]
  &Value=[the value corresponding to the code above]
  &Description=[a human readable description of the event, or comments regarding it]
  &Users=[a comma separated list of user id's that should be notified of the event]

To turn this alternate event logging set the top level user_data tag "AltEventServer" to the domain of your server. If your server is: myserver.me.com do this by changing the 'ip' to be the IP of Vera, and opening this URL:

http://ip:3480/data_request?id=variableset&Variable=AltEventServer&Value=myserver.me.com

Then click reload in Vera's UI to reload the engine with the changes. You can watch Vera send the data by logging into Vera's console as explained in Logon_Vera_SSH and then typing:

tail -f /var/log/cmh/LuaUPnP.log | grep 'RAServerSync::SendAlert'

To stop logging to your own server, call the variableset again but leave the Value empty.

Personal tools