Author Topic: PLUGIN: VeraFlux - Send Device Data to InfluxDB  (Read 483 times)

Offline Spanners

  • Sr. Member
  • ****
  • Posts: 257
  • Karma: +16/-5
PLUGIN: VeraFlux - Send Device Data to InfluxDB
« on: May 24, 2018, 05:58:22 am »
---- CURRENT STATUS: BETA / This ones for the homelabbers and experimenters ----


Hi All,

To use this plugin you'll need a working local InfluxDB instance and a database created with appropriate retention policy. Default name is "vera".

Copy the Plugin files to Apps->Develop Apps->Luup Files. Then create a device using device file D_VeraFlux1.xml and implementation file I_VeraFlux1.xml then reload Luup.

Use the Settings menu in the device to set the IP, Port and other stuff for the plugin to use.

It currently pulls in data from Vera itself and these services.

   servicesTable['urn:micasaverde-com:serviceId:HaDevice1'] = {}
   servicesTable['urn:micasaverde-com:serviceId:ZWaveDevice1'] = {}
   servicesTable['urn:upnp-org:serviceId:SwitchPower1'] = {}
   servicesTable['urn:upnp-org:serviceId:Dimming1'] = {}
   servicesTable['urn:micasaverde-com:serviceId:DoorLock1'] = {}
   servicesTable['urn:upnp-org:serviceId:TemperatureSetpoint1'] = {}
   servicesTable['urn:upnp-org:serviceId:TemperatureSensor1'] = {}
   servicesTable['urn:upnp-org:serviceId:TemperatureSetpoint1_Heat'] = {}
   servicesTable['urn:upnp-org:serviceId:TemperatureSetpoint1_Cool'] = {}
   servicesTable['urn:micasaverde-com:serviceId:GenericSensor1'] = {}
   servicesTable['urn:micasaverde-com:serviceId:LightSensor1'] = {}
   servicesTable['urn:micasaverde-com:serviceId:HumiditySensor1'] = {}
   servicesTable['urn:micasaverde-com:serviceId:EnergyMetering1'] = {}
   servicesTable['urn:micasaverde-com:serviceId:WaterMetering1'] = {}
   servicesTable['urn:cd-jackson-com:serviceId:SystemMonitor'] = {}
   servicesTable['urn:micasaverde-com:serviceId:SecuritySensor1'] = {}
   servicesTable['urn:upnp-org:serviceId:IPhoneLocator1'] = {}

Known limitations in current beta:

- http only
- Username/Password for InfluxDB don't do anything yet.
- UI Buttons for Info/Debug logging and Enable/Disable don't work due to a serviceID error. But you can change the variables manually and the buttons reflect the status. Icon also greys out when disabled. -- Fixed in 0.2, a very big thank you to @akbooer for his help identifying the problem.
- Only way to change what Services/Values get logged to Influx is by editing the implementation file.
- Logs contain cheesy references to Back to the Future.

Future:

-Add watch capability for status variables (switch, sensor etc) so they are reported immediately to Influx rather than on the polling loop. (Implemented 6/6/18)

Download the Plugin Files from Github: https://github.com/livehouse-automation/veraflux

And for those that like voiding warranties and time series data. I wrote this blog about installing collectd on Vera to send OS performance metrics straight to Influx:

https://www.livehouseautomation.com.au/blogs/news/vera-performance-dashboard-using-collectd-and-grafana


« Last Edit: June 06, 2018, 10:45:46 pm by Spanners »

Offline Spanners

  • Sr. Member
  • ****
  • Posts: 257
  • Karma: +16/-5
Re: PLUGIN: VeraFlux - Send Device Data to InfluxDB
« Reply #1 on: May 27, 2018, 09:03:47 am »
Updated the download to v0.2 which fixes the UI buttons.

Special thanks to @akbooer for identifying the error in my S_VeraFlux1.xml file. He's truly a man of <action> ;)

I owe you another one.

Offline Spanners

  • Sr. Member
  • ****
  • Posts: 257
  • Karma: +16/-5
Re: PLUGIN: VeraFlux - Send Device Data to InfluxDB
« Reply #2 on: June 06, 2018, 10:50:43 pm »
Updated the plugin to have variable watch capabilities for certain devices/variables so that changes are sent immediately to InfluxDB, rather than waiting for the polling period.

SecuritySensor1
IPhoneLocator1
DoorLock1
SwitchPower1

Also fixed the debug logging so that works properly now.

Latest version is available on GitHub - https://github.com/livehouse-automation/veraflux

Offline Spanners

  • Sr. Member
  • ****
  • Posts: 257
  • Karma: +16/-5
Re: PLUGIN: VeraFlux - Send Device Data to InfluxDB
« Reply #3 on: June 21, 2018, 08:15:26 am »
Plugin is working pretty well now in terms of logging data to Influx. After a bit of heavy development (adding bugs) and testing (removing bugs) I'd describe it as pretty stable.

Now it's Grafana Time - all of these are based on data from Vera.

« Last Edit: June 21, 2018, 08:33:26 am by Spanners »

Offline hellovn

  • Sr. Member
  • ****
  • Posts: 268
  • Karma: +19/-46
Re: PLUGIN: VeraFlux - Send Device Data to InfluxDB
« Reply #4 on: July 07, 2018, 10:50:32 am »
Great. Thanks. This is what I am looking for. I will install VeraFlux and let you know if I have any problems.