question

drogos avatar image
drogos asked

Looking for collaborators for Victron -> Grafana project

Hello! I am currently playing around with an off grid system for collecting victron data to display on grafana (with no internet). The system uses an influxdb server. At the moment it kind of works, but it is very hacky. It collects data via a cron job to query the dbus on the color control gx. Looking into mqtt now, and I was wondering if anyone wants to help out. I am not experienced in this field so it is a learning process for me. I want to end up with a guide for others to use that has the same or similar goals. Anyone interested?

offgridMQTTgrafana
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

3 Answers
mvader (Victron Energy) avatar image
mvader (Victron Energy) answered ·

Hey @Drogos! Nice project. You'll probably be quite happy to see this:

https://github.com/victronenergy/venus-docker-grafana

It has all you need, including influxdb & Grafana.


1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

mvader (Victron Energy) avatar image mvader (Victron Energy) ♦♦ commented ·

but, is not used a lot; so who knows what you run into. I'd be very happy if you try that out; all the work thats been put in there can do with some using & finishing.

0 Likes 0 ·
drogos avatar image
drogos answered ·

Got it installed! It works great! Thank you so much for the link, was unable to find this one in all my searching. Would you happen to know how this image talks to the mqtt to populate the db? Personally I want to set this up without using docker, and to learn, and know how every part of the system works. I can probably find that out from this great package, but a hint in the correct direction is nice if someone has it :)


btw, it worked amazingly well! Just clicked autoconfig, and it detected and set everything up perfectly. I strongly recommend this to anyone else reading this post that is not obsessed by setting up everything manually.

7 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

ben avatar image ben ♦ commented ·

It works by using telegraf’s mqtt plugin.

It is much easier/cleaner/more complete to set that up than to do it manually with dbus and a cron job — just a few lines of configuration, and you need a mechanism to make sure Venus’s MQTT keeps alive.

Good luck!

0 Likes 0 ·
drogos avatar image drogos ben ♦ commented ·

Are you sure? I have been looking over all the sources I could find, and I could not find anything related to the telegraf plugin. Did manage to set it up with telegraf, but not well. To me it looks like it is using node.js to do the job. Anyone able to point me in the right direction for where this happens?

0 Likes 0 ·
ben avatar image ben ♦ drogos commented ·

Hmm, I think you might be right. I used an early version of this project that I assumed (probably incorrectly) was using telegraf.

I see it has evolved a good bit since then, but it may have used a node client from the beginning, too. My bad.

Telegraf is trivial to set up, and it captures every published field from Venus with about five lines of configuration. I am surprised that you have it working but only "not well." Let me know if you want help on that path.

0 Likes 0 ·
drogos avatar image drogos ben ♦ commented ·

I have no former experience in this, so I just tried this config:

[[inputs.mqtt_consumer]]
servers = ["tcp://192.168.1.2:1883"]
qos = 0
connection_timeout = "30s"
topics = [
    "N/<victron_id>/solarcharger/0/State",
    "R/<victron_id>/solarcharger/0/State"
]
persistent_session = true
client_id = "od2"
data_format = "json"

[[outputs.influxdb]]
database = "victron"

I get data points from the N/ topic, but I assume that is not the proper way. The R/ topic gives no data in my setup.

I do agree that setting this up with telegraf is a tempting thought, not sure why Victron chose another path. And yes, I would love to have some help :)

0 Likes 0 ·
ben avatar image ben ♦ drogos commented ·

The data points all come on the N topics. Now you just need to tell it to subscribe to everything using an MQTT wildcard topic, and you'll see them fully populate.

0 Likes 0 ·
drogos avatar image drogos ben ♦ commented ·

Yeah, looking more into the documentation I figured the N/R things out. I have decided to end my telegraf path. I could not figure out how to organize the data, or how to send the keep alive. The node.js path was in my mind so clean and simple, so I have chosen that one where I feel more comfortable. Got it running nicely, but still have a lot of coding and setup to do.

0 Likes 0 ·
ben avatar image ben ♦ drogos commented ·

Sounds good. There are definitely advantages to having the loader under your own control instead of some automated blob.

Just for clarity, in case others come along and read this thread: the node and telegraf importers both bring the data in in the same format and structure. So seen from the Grafana side, the same fields are all there, structured in basically the same way. I'm not sure there is much choice of organizing to be done either way.

0 Likes 0 ·
masterov avatar image
masterov answered ·

I solved this problem without docker and without VenusOS. Here are all the details: https://masterov.blogspot.com/2020/03/connect-vedirect-to-raspberry-pi.html

Let me know if you have any questions.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.