hi guys.
i have created a new plugin pimatic-influxdb
This implements an interface for influxdb.
The Plugin is available over the plugin manager.
The plugin provides two functions.
VariablesDevice to query the influx db
The new InfluxVariable device is like the normal Variable device.
You can define a query and a database to get values from the InfluxDB.
Push attribute to influx db
You can add to each pimatic device a config extension like this.
If the influxdb plugin is the first plugin, you can activate the extensions over the GUI.
"influx": {
"active": true
}
Now the plugin automatically pushes all numeric attributes in addition to the influxdb.
The influx database is pimatic and will be created at first start.
The measurement is “attribute”. The fields are the different attributes names. Each entry is taged by the device-id.
HINT:
The Plugin must be the first Plugin in the plugin section of the config.json. (like the echo plugin)
Otherwise you’ll get errors and you can’t enable the influx extension of all devices via the GUI.
The plugin is still alpha. It works…, but there is no warranty for production systems!
Why i use it?
influx is a time series database and interacts very well with grafana as a dashboard.
So you have very nice long-time graphs and you can make good analyses.
Where do I use it?
My vzlogger for the electricity meter measurements support sql or influx.
since i was unhappy with sql i have gone on influx and have a grafana dashboard.
But the data must also be in pimatic. So far I’ve done it via a ShellPlugin which did the query.
the other way around i queried the mysql-mariadb database (i don’t use the built-in database of pimatic) in grafana with the sql plugin to display pimatic graphs there as well
second reason: Meanwhile I use a lot of MQTT based devices.
With Telegraf and the mqtt adapter I have a super easy way to write all data from mqtt directly into influx without having to query all values.
(all fully automated with little configuration)
If you are interested I can write a small tutorial, how the whole stack looks like.