Author Topic: AlternateEventServer events  (Read 353 times)

Offline pnm

  • Sr. Newbie
  • *
  • Posts: 30
  • Karma: +0/-0
AlternateEventServer events
« on: August 11, 2017, 01:35:09 pm »
I have a Vera Edge with the latest firmware and a Philio multisensor PST02.
I've written my own web server to accept events from the edge and configured the AlternateEventServer to point to it and it's receiving data.

I have a couple of questions:

1.  Should the response back to the edge be just "{"PK_Event":1234,"Key"":"1234"}" or should it have <HTML><BODY></BODY></HTML> around it?
2. I'm getting motion sensor events that come through as "DL_ARMEDTRIPPED" but no temperature or lux info.  How do I log those as well?  The Philo is just as added so there are no notifications or scenes setup.


Online akbooer

  • Master Member
  • *******
  • Posts: 5289
  • Karma: +229/-67
  • "Less is more"
Re: AlternateEventServer events
« Reply #1 on: August 11, 2017, 01:59:33 pm »
This is a tricky one.  I had an alternate event server running for UI5, but they completely changed the protocol with UI7.  The problem was specifically with what to send as a response.  It's been ages since I looked at this, but there were problems getting the system to clear the events.

Anyway, I'll take a look sometime soon and see exactly what I did.  The code, in fact, is in some versions of the EventWatcher plugin, which is available on GitHub https://github.com/akbooer/EventWatcher.  The event server started out being its major functionality, hence the name, but it morphed into a more general status/logging type application and the server fell by the wayside (particularly when UI7 came along.)
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P.
Razberry, MySensors Arduino, HomeWave, AltUI, DataYours, openLuup, ZWay, ZeroBrane Studio.

Offline pnm

  • Sr. Newbie
  • *
  • Posts: 30
  • Karma: +0/-0
Re: AlternateEventServer events
« Reply #2 on: August 11, 2017, 02:55:02 pm »
I'm currently sending the response without the HTML bits and I think it's working ok, but then it also appeared to work with the HTML bits as well.  Do you know if these events are queued if the response is wrong and it will keep trying or is it a one shot?

Also, if I lose the server will the edge care if it doesn't get a response back or fails to connect?

Online akbooer

  • Master Member
  • *******
  • Posts: 5289
  • Karma: +229/-67
  • "Less is more"
Re: AlternateEventServer events
« Reply #3 on: August 11, 2017, 03:19:57 pm »
Do you know if these events are queued if the response is wrong and it will keep trying or is it a one shot?

Also, if I lose the server will the edge care if it doesn't get a response back or fails to connect?

I don't know for sure, but both these things, IIRC, gave me problems.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P.
Razberry, MySensors Arduino, HomeWave, AltUI, DataYours, openLuup, ZWay, ZeroBrane Studio.

Offline pnm

  • Sr. Newbie
  • *
  • Posts: 30
  • Karma: +0/-0
Re: AlternateEventServer events
« Reply #4 on: August 12, 2017, 02:00:14 pm »
Is there another way of getting events off the controller then apart from using the AlternateEventServer function?

Online akbooer

  • Master Member
  • *******
  • Posts: 5289
  • Karma: +229/-67
  • "Less is more"
Re: AlternateEventServer events
« Reply #5 on: August 12, 2017, 02:34:37 pm »
There's any number of plugins which monitor logs and/or can send notifications via mail, alerts, or websites.  Or you can write your own to watch any variable(s) and do whatever you like.  This is not exactly what you asked, but often good enough.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P.
Razberry, MySensors Arduino, HomeWave, AltUI, DataYours, openLuup, ZWay, ZeroBrane Studio.

Offline pnm

  • Sr. Newbie
  • *
  • Posts: 30
  • Karma: +0/-0
Re: AlternateEventServer events
« Reply #6 on: August 12, 2017, 02:50:51 pm »
I want to do all the alerting and monitoring off the controller, so I'd like to get everything that is available sent elsewhere.  The AlternateEventServer function seems to be a start but it doesn't seem to be sending over temperature and lux levels from my test sensor.  Do you have any code examples or things I need to configure on the controller to get everything sent over?  Or if there is a better way of doing it I'd be open to suggestions.

Online akbooer

  • Master Member
  • *******
  • Posts: 5289
  • Karma: +229/-67
  • "Less is more"
Re: AlternateEventServer events
« Reply #7 on: August 12, 2017, 04:53:48 pm »
Take a look at plugins like VeraAlerrs, EventWatcher, DataYours, ...  all these things can, in some way of other, post events to the external environment bu email, messaging, syslog, ...
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P.
Razberry, MySensors Arduino, HomeWave, AltUI, DataYours, openLuup, ZWay, ZeroBrane Studio.

Offline pnm

  • Sr. Newbie
  • *
  • Posts: 30
  • Karma: +0/-0
Re: AlternateEventServer events
« Reply #8 on: August 14, 2017, 10:17:42 am »
Eventwatcher seems to have been last updated in 2014 from the store.  Is there a more recent version?

Online akbooer

  • Master Member
  • *******
  • Posts: 5289
  • Karma: +229/-67
  • "Less is more"
Re: AlternateEventServer events
« Reply #9 on: August 14, 2017, 12:23:58 pm »
Eventwatcher seems to have been last updated in 2014 from the store.  Is there a more recent version?

It's too difficult to update the MiOS store apps these days.  Look here (and then GitHub) for latest version information. http://forum.micasaverde.com/index.php/topic,38238.msg285858.html#msg285858

It's currently at 16.07.02.

It's also available from the Alternate App Store (which you can access through a plugin.)
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P.
Razberry, MySensors Arduino, HomeWave, AltUI, DataYours, openLuup, ZWay, ZeroBrane Studio.