I was browsing around the documentation and am a little confused with the overall structure of Grafana. I have it installed, and running… but haven’t done anything else yet.
I know I have to add a data source (InfuxDB and others), but do I create a separate, say, InfuxDB data source for each thing I want to pull in? One for Home Assistant data, one for NTOP data? Or just one datasource and push everything into it?
The idea is is that I want to have this running, and push information from every system I have into it eventually, and I want to do it right from the start, rather than wish I did something different later. So I need a little direction.
Welcome. You are smart to think this through before diving right in. Having one datasource or many datasources is no problem for Grafana. Two (or ten) different datasources can produce 2 or 20 graphs (panels) on a single dashboard. Your HA data and NTOP data can be in the same database, but it would probably be easier to have two. If I was going to store my local outdoor weather data in an Influx db, I might want to create a separate Influx db (or Prometheus, or whatever) to store my server & router data, right?
If you are considering Influx, I found this webinar from Influxdb about Schema Design for IoT to be extremely helpful. Watch it all the way through, then think about your own data. Write down your field names & tag names, then go back and watch the video again to make sure it still makes sense.
I will certainly check that out, thanks.
I think the issue is the overwhelming flexibility. A good thing for sure, but it makes for so many choices. For example, home assistant shows support for at least four ways to get data out of it… InfluxDB, Prometheus, Graphite and Splunk to name a few…
It’s hard to make sense of which route to go without the experience of how it all works. I have no experience with any of those data sources, so you get a little paralyzed just figuring out which one to use. I guess the question is, which is the most widely used?
Time to research which data source to pick for Home Assistant and start there. This will give me some data to poke around through…
@antonio79 may be a great resource here. 60 days ago he was just starting out and now he’s a Jedi Master with Home Assistant, Influx and Grafana.
I could use a Jedi Master.
If @antonio79 could walk me through the basic setup of pushing my Home Assistant data into a Grafana data source, that would help a lot. I’m a visual learner, and once I have one data source in Grafana to play with, I’ll figure out the rest much quicker.
I currently have Home Assistant running on a Pi, no issues… The Grafana is running in a BSD jail inside TrueNAS. It, too, is up and stable, on the same network… It’s just empty at the moment. If I start with Home Assistant I can get an idea of how it’s all structured, and then add my other projects in down the road. Some of those data sources would be…
PFSense, NTOP, Emby, SyncThing, ZoneMinder…
My goal in Grafana is to provide an interface to quickly monitor the status of everything in one place. I’ll read through @antonio79 posts and see if there are any clues…
sounds like an interesting project.
I have Ubuntu PC that acts as a broker where I have Grafana and InfluxDB installed collecting data from Home Assistant (on Raspberry Pi 4) and another Raspberry Pi Zero for another data source.
If you have your HA running on an SSD with MariaDB running your database, technically, you can just install Grafana and InfluxDB (approved addons) on the HA RPi and run everything from there. You’ll have also install the Mosquitto (broker) as well from the add-on store so HA becomes the broker.
If you want to send data to an external broker (not HA-based) you’ll need to setup and install Grafana and InfluxDB on that computer, and with HA you can use NodeRed for example, to send data to the Grafana/influxDB.
place this in your configuration.yaml file to tell it where your broker is:
# Example configuration.yaml entry
this well accept data from another broker into HA and you can use that data for whatever you wish. When you restart HA, a new tile will show up as MQTT with entities and topics.
If you want to send data via mqtt out of HA into your other broker, then I recommend using NodeRED and set up a flow with influxDB nodes and the entity node. All your integration in HA have an entity that gives out data. With NodeRED you can send (and automate) data from your integrated sensors to another mqtt broker on your network, which then you can use influxDB and Grafana to visualize it.
I do not use my HA RPi for InfluxDB and Grafana (but you can if you want). What kind of processing power does your BSD jail system have?
Thanks for jumping in…
I think it’s an i3 6100 running TrueNAS with 32 GB of RAM. It runs all the other jails and the processor barely shows any activity. It’s been rock solid.
I think what I want to do is use grafana running in the jail. I think I’m supposed to add an InfluxDB data source for Home Assistant, and have Home Assistant push data to that data source? Do I have that right?
Which do I set up first? The data source in Grafana would be my guess, but I’m unclear on the user accounts and URLs, etc…. I really am just confused about where to start.
Once I see how one works, I can better understand how to get the others pushing into grafana also.
My thinking for grafana would be that it’s better to have things push data into it, rather than grafana reaching out. This way, if one system is offline grafana doesn’t get hung up requesting to something that might be offline. This is really just meant to act as a collection point for long term storage of metrics. I’m not looking currently at viewing anything from grafana inside home assistant, for example.
Any help getting Home Assistant set up would be great. Thanks!
one thing to know is what is going to provide the data?
Home Assistant has everything as an add-on, one of the great advantages of HA is that it can integrate all your sensors via integrations/addons. Once you’ve have them integrated, it actually automatically starts logging data from these sensors wthing HA via MySQL. However, because its a RPi you running on an SD card, the long-term reliability could be questionable. So you could do a couple of things is just use a SSD via USB for RPi home assistant (and MariaDB) for your database, and/or just dump the data to an external, more powerfuel computer. I assume you are going to the latter…HA has Grafana, InfluxDB and NodeRed and all the above, but if you want to get the data from HA that have your intergrated sensors to another computer…you could use NodeRED on HA then, you can set up a flow using the influxDB node and your broker information to send the data to InfluxDB on your other computer which can then feed Grafana.
Do you have HA installed on a RPi, yet? If not, its super simple. Check out the official instructions here (plus there are plents of YouTube people who are pretty awesome and also do it step-by-step:
So yes… I have Home Assistant running on the Pi just fine. My hope is that I can push this information from the Pi to Grafana for more long-term retention.
Grafana is running on a much more powerful machine. Inside a TrueNAS jail so it has all the benefits of the redundancy of the NAS, etc… Eventually, I want Grafana to be the repository for all these metrics from various things running elsewhere. HA seems like a good place to start.
This is a side project, so sorry for the late reply. I’m just working toward getting this done one step at a time.