Looking for help to store persistent data; got no clue where to start

Hi,

I have my home-assistant configured the way I want it to work on my Ubuntu Server, but now I am looking to take it to the next level and start graphing data, and storing it persistently in some sort of database.

I have tried to setup grafana and the influxdb database before using tutorials I googled on the internet, but I can never get them to start, and when I do, I can never figure out how to get the data to be presented the way I want it to be (graphs, logs, etc).

Is there anyone here who has a working grafana/graphite/whatever sort of persistent database and graphing solution in place that can provide a nice step by step tutorial for a newb? I have not dealt with databases or any of the associated software before.

Thanks,

I don’t see you are going to get any better than this page

I followed it, and its quite straightforward.

I struggled quit a bit getting influxdb and grafana working but eventually was successful. I’m on a pi 3 with Hassbian.

Kudos to my friend Aaron for writing this up.

InfluxDB
curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
source /etc/os-release
test $VERSION_ID = “7” && echo “deb InfluxData - Package Repository wheezy stable” | sudo tee /etc/apt/sources.list.d/influxdb.list
test $VERSION_ID = “8” && echo “deb InfluxData - Package Repository jessie stable” | sudo tee /etc/apt/sources.list.d/influxdb.list

sudo apt-get update && sudo apt-get install influxdb
sudo systemctl start influxdb

CREATE DATABASE mydb

SHOW DATABASES
name: databases


name
_internal
mydb

*I went into config and enabled the admin page to confirm it was working.

Grafana

sudo apt-get install apt-transport-https curl
curl Service End for Bintray, JCenter, GoCenter, and ChartCenter | JFrog | sudo apt-key add -

For raspberry pi 2 and pi 3, use

echo “deb https://dl.bintray.com/fg2it/deb jessie main” | sudo tee -a /etc/apt/sources.list.d/grafana.list

change jessie for wheezy if you are on wheezy

change main for testing if you want to install beta release.
Install

sudo apt-get update
sudo apt-get install grafana

Once grafana is up and running at Port 3000, you connect the data source to influxdb and start creating graphs.

Sorry I’m not a developer by any means but thought I’d provide some hope because I struggled with this for a few weeks. G’luck!

1 Like

And in addition to the great write up from @Jeff_VoVillia do note that after a full reboot you should restart Homeassistant manually as influxdb takes a bit more time to start than Homeassistant Hass will not find influxdb the first time after reboot. This can, of course, be overcome through a script but as I hardly reboot my pi doing it manually works fine for me.

1 Like

Omg that worked perfectly! I can see my data coming into influx and grafana at last thanks to you!

Only got to figure out why I can’t see some of my sensors but other than that, it’s a great start. Thanks again!

You’re very welcome. Enjoy!

Thanks for the info. How would I create a script to handle this? I also have my homebridge instance running on the same server and would love to delay the start of it until a minute or two after HA just so that everything would load correctly after a power loss.I’m new to linux startup, so i’m not sure where to start. I now i’m running systemd and have jessie, but that’s about it.