Monday, February 5, 2018

Grafana: So, how well does this thing work?

As it turns out, pretty darn well. For those of you just getting into house control and monitoring, Grafana is a general purpose set of graphing tools. However, its documentation is daunting. They start right off using terms I never heard of and I couldn't tell what I needed to do. So, in typical Dave form, I downloaded it and started playing around.

I actually followed the steps they suggested and had my first graph running in about an hour. Never mind that the data was mixed up and in the wrong order, I actually had a graph I could look at.

Unlike most folk that delve into this tool, I'm using MySQL as a database manager to store my data. Most folk use a time-value series that is faster and smaller than a full blown database manager. But, I started with sqlite and moved to MySQL because I wanted the flexibility that was available. Of course that meant I had to create queries to the data base for gathering data, but they gave me examples to modify and it was somewhat easier.

Once I got the hang of the basics, I added my room temperature sensors as a 'panel' inside a 'dashboard'. This was cool, I could isolate sections of the graph for examination and change the span of time displayed just by clicking. Then I added the chart I look at a lot: outside temperature vs power usage. This is the key chart I use to keep power usage down to a reasonable amount.

I had about five hours into this by now, so I just let it run, updating every minute overnight. It worked fine. First thing when I looked at it, it showed the temperature drop for the night and when the heater kicked on. Nice.

Now, the problem is that I have to make it work for real. By that I mean that I want to be able to get to it from any device I happen to be using. I use a tablet a lot for this kind of thing and occasionally my phone. Haven't made that stuff work yet.

My plan is to install the software on a Raspberry Pi and allow it to be seen outside the house. That means I have to worry about security since there are SQL queries in there that can be messed with. I'm not much worried about someone watching my data to see if I'm home, I live in the middle of nowhere down a dirt road, so getting here is beyond the effort most thieves are willing to invest. Plus, if they make a mistake and I'm home ... shotgun practice!

Since I installed it on my laptop for convenience, I get to start all over again, so I don't want to develop it too much further before getting it set up for real use.

Oh, I also remembered why I haven't looked deeply into this earlier. They only enabled it for use with MySQL last year. Every time I looked before, it wouldn't do the job for me. MySQL seems to work fine now.

Here's a screenshot of the very first panel I made:

Like I said, this took a about five hours to get going, but that included installing it and figuring out how to connect it to my data base. Quite a bit of time was spent playing with colors and text as well, so your mileage may vary.

Nice tool if I can make it work outside the house on a phone. We'll see.

No comments:

Post a Comment