scs / smartmeter-datacollector

Smart Meter Data Collector
Other
57 stars 23 forks source link

consider adding a influxdb sink #42

Closed kafisatz closed 1 year ago

kafisatz commented 1 year ago

I added a sink for influxdb V2.0.

My motivation for this is that I don't want the data on the raspberry locally but in a database elsewhere. I was wondering whether it would be worth to include this in your software.

Also, I don't use MQTT, thus this solution does not rely MQTT.

You can find my commit here: https://github.com/scs/smartmeter-datacollector/compare/master...kafisatz:smartmeter-datacollector:master

I note that my python skills are rather limited and the configuration of the influxdb relies on a hardcoded constant (which appears in several places in the codebase): INFLUXDB_CONFIG_FILE = "/home/pi/.influxdb_config"

raymar9 commented 1 year ago

Hi Bernhard / kafisatz First of all, thank you for your commitment and the offer to contribute this extension to our project. I discussed this internally and with EKZ. Your extension would require some effort on our side to fully integrate into our project, adapt the configuration (& integrate into smartmeter-datacollector-configurator) and doing some clean-up. Also we already support a solution for using Influx-DB though MQTT like use it in our RPi-Demo. Your proposed setup (based on your motivation) can be achieved with our current software: Just install a local MQTT broker on the RPi and set the MQTT output to your remote Influx DB. You do not need a remote MQTT server/broker. It is just installed on the RPi and works as a bridge. Here is an example for a Telegraf / MQTT configuration for Influx DB (based on our Demo): https://github.com/scs/smartmeter-datacollector-pi-gen/blob/smartmeter-datacollector-demo/stage2/99-install-smartmeter-demo/files/telegraf/output_influxdb.conf Therefore, we do not see a strong reason to spend the effort for integrating a further data sink to InfluxDB right now. But thanks again for the proposition.