PLUGIN: VeraFlux - Send Device Data to InfluxDB

---- 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: [url=https://github.com/livehouse-automation/veraflux]https://github.com/livehouse-automation/veraflux[/url]

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:

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

2 Likes

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 :wink:

I owe you another one.

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 -[url=https://github.com/livehouse-automation/veraflux] https://github.com/livehouse-automation/veraflux[/url]

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.

Great. Thanks. This is what I am looking for. I will install VeraFlux and let you know if I have any problems.

Hi,

I am having dificilties in running the collectd on Vera. I have install it but it seems that data are not sent towards Infludb.
Any chances for hints?

[quote=“halo, post:6, topic:199197”]Hi,

I am having dificilties in running the collectd on Vera. I have install it but it seems that data are not sent towards Infludb.
Any chances for hints?[/quote]

Happy to try and help you troubleshoot - will need a lot more info about what you’ve got set up so far, what components you’ve been able to validate as working, config etc before I can give you anything specific.

Hi. I have installed and configured Veraflux, Influxdb and Grafana and I see Data are sent. But how can I select a variable in a concrete device to plot it in Grafana?

Concrete device? Or was that an autocorrect for certain device?

This is an example of how to show a temperature sensor value in Grafana.

Thanks BlueSmurf
That´s what I needed. Gafana is working fine and ploting my sensors info.

Hi,
Does the plugin transmit stats/metrics from the Vera (plus) device itself ?? (eg. CPU / MEM / …) because I can’t seem to find them. without the collectd thing installed I mean.

I read in the description : It currently pulls in data from Vera itself and these services.

Also, my list is a bit smaller, when working on a dash-board I can’t see in the dropdown-list items like ZWaveDevice1 , SystemMonitor etc,etc.

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'] = {}

For the rest it works well!

Install the System Monitor plugin and it pulls data from there for CPU/MEM

urn:cd-jackson-com:serviceId:SystemMonitor - is the service ID.

{“memoryFree”, “memoryTotal”, “memoryUsed”, “memoryAvailable”, “cpuLoad1”, “cpuLoad5”, “cpuLoad15”, “systemLuupRestartUnix”, “systemVeraRestartUnix”, “cmhLastRebootUnix”, “uptimeTotal”}

Are the values it’s looking at.

You’ll only see drop downs in Grafana if something has actually been logged for a particular service or field. Some of them like ZWaveDevice1 only watches a single value and I’m not sure it actually gets used. Health: A rating from 0-5. A large number means that MiOS can communicate with it easily.

It was included originally because the definition indicated it might be of interest on a device dashboard.

1 Like

Thanks. works like a charm.

Hi,
Does the plugin has a notion of queuing when the InfluxDB would be unavailable for a short time? Eg. I could store some values for X amount of cycles ?

The plugin doesn’t have any store and forward capability - it would need to be rewritten for that.

It uses the Influx HTTP API to send data on every polling cycle, or for certain devices, whenever they change state (they are watched luup variables). If the API call fails, the error code is logged and the data is discarded.

1 Like

@BlueSmurf, thanks for this good plugin! It works well for the sensordata, but i’m struggling with collectd. It seems to be working on the vera, but i get “502 Bad Gateway” when i try to enable it in InfluxDB… The config of influxdb for collectd isn’t included in your (good) install guide, can you show some example of working settings in the influxdb.conf?

In influxdb.conf I have this section for collectd:

[collectd]
  enabled = true
  bind-address = ":25826"
  database = "collectd"
  typesdb = "/etc/influxdb/types.db"

the types.db file you grab from your collectd install on Vera and copy it to a folder that influx can access (tells influx about the datatypes). Make sure you create the “collectd” database.

I’ve attached my file for convenience.

types.zip (1.8 KB)

Right… I tried that now, putting types.db in the same folder as the .conf file.
When I start the service windows reports an unidentified error, putting the service to “Paused”. when I # the lines again, the service starts up fine.

I did make the collectd database in InfluxDB using Chronograf, so it should be OK on that side.

Any hints on how to debug this? InfluxDB and Grafana is running as a services on a win10 computer…

No Win10 firewall shizzle ?

Don’t think so, the port is open for local communication… And if that was the case, it should result in no data, and not inhibiting influxDB to come up, right?

When I insert/uncomment the lines in .conf, the service won’t start, which seems to be some issue with the conf file…