Issuing HTTPS post to send event outside system

Where would I put an HTTPS post to an outside “alternate” server that can receive and log the JSON content that your application collects.
I have an AppService running that will accept HTTPS post events and would like to use your plug in to correctly pull the events but I want to send them to my AppService for advanced analytics over time.
Thoughts?
thanks in advance - Scott.

Vera Alerts supports a SYSLOG profile … to send to a SYSLOG server.

The Alternate Event Server functionality of EventWatcher does not, alas, work under UI7, since that firmware has a flawed implementation of the event handler.

The syslog capability of EventWatcher, however, would be a possible alternative, although it uses a UDP protocol, rather than HTTPS.

Other options rather depend on what events you are after.

Same events you are exposing here. Instead of using a SYSLOG server I want to send each event to an HTTPS service endpoint. It is close to what was being done with the alternate event log server in the past so that is why I reference it.
In your plug in I am assuming I could create a function to send almost exactly what the SYSLOG is receiving. I was wondering if you had any other advice since it is your code base.

Yes, that should be straight-forward. You simply need to send the request with the following line of Lua:

ssl.https.request (your_url_request)

What you actually put into your_url_request will depend entirely on your server’s requirements.

Every event calls this function:

local function event (time, devNo, name, var, arg)		-- constructor and formatter for event types

and you will see where it optionally calls syslog and also writes the event to a file. All the event data is in a variable e and you can model your output on the format routine that the file write uses .

perfect! Was looking into doing just that.
I actually want the event to be a JSON string just like the format of the old Alternate Events Server this way I would not have to change my receiving code. If not it is not the end of the world I can make the changes on either side.

FYI - I take the events and send them to a Web Service in Azure for processing and machine learning on my events.

The documentation from Vera that I included in EventWatcher says:

UI5: 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; in Lua you can get it with luup.pk_accesspoint] &HW_Key=[hardware key of Vera; in Lua you can get it with luup.hw_key] &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]
and

[code]
–local AlertType = {“Image”, “Video”, “Trigger”, “Variable”, “Logon”, “Gateway Connected”,
– “System Error”, “Validate Email”, “Validate SMS”, “System Message”}

–local SourceType = {“User”, “Timer”, “Trigger”, “Variable”}

–local FileFormat = {“JPEG”, “MJPEG”, “MP4”}
[/code]

You should be able to construct the required string quite easily, but ask again if you have trouble.

Hi,

I am a newbie and trying to understand the system and it working so that I could use it fully. I have installed eventwatcher (has got a Vera edge with Ui7). I really don’t know how to use it For example under conditions I have Links to reports:Variable and Event Log etc… When I click the link I get the data. The data is only from last Vera restart. Csn you tell me or show the links where the information such as how to capture this info continuously somewhere ? I did some search but not getting to the correct location. Thanks for the plug in anyway as I have the info what I am looking for.

It rather depends on what sort of logging you want to do as to whether EventWatcher is the plugin for you, or not. For long-term storage and plotting of sensor-like data (temperature, humidity, etc.) then either DataYours or dataMine are worth looking at: http://forum.micasaverde.com/index.php/board,43.0.html

However, EventWatcher is able to send events elsewhere for external storage (across restarts) either using the standard (Unix) application ‘syslog’ or just writing it to a flat file on a remote file system (eg. network mount or USB.) On its own, EventWatcher is really just a tool which gives much simpler event information than the Vera logs, and allows you to investigate some aspects of the system (scenes, etc.)

Rather than struggling with the awful UI7 interface to Vera, you might also consider the AltUI plugin, http://forum.micasaverde.com/index.php/board,78.0.html, which provides an alternative, much more functional, and prettier interface than the native Vera one. It also allows easy access to logs, scene scripts, and the like.

HI @akbooer

Thank you very much for your prompt response. Appreciated. Let me go through this so that I could digest it. I may have to take some more of your valuable time, should I need some more info. Regards,

Best Home Automation shopping experience. Shop at getvera!

© 2020 Vera Control Ltd., All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules