stevenewey / octograph

Python tool for extracting Octopus Energy meter readings to InfluxDB
98 stars 49 forks source link

Add docker run instructions, and pre-provision some grafana #11

Open Notaphish opened 3 years ago

Notaphish commented 3 years ago

Thanks for making this, would super easy to add to my existing dashboard project! I've made some tweaks/additions, would love to get your input and happy to cut out where you think I've over stepped.

Changes:

Questions:

Woes: Having problems with the readme... can't get the bottom section to appear - I've never used rst markdown before! Would appreciate any pointers :P

jrothlis commented 3 years ago

How do you do the daily update? The initial load of meter data works fine, but in my short time trying to figure it out, I was unable to get a scheduled task (cron) to run every day to keep the data up to date.

Notaphish commented 3 years ago

Really don't know much about cron but below is my file ( used as part of my dashboard project ) and its calling this Makefile command https://github.com/Notaphish/nota_smarthome_dashboard/blob/main/Makefile#L19 -- basically the command I added to the README in this PR, just different influxdb container name.

SHELL=/bin/bash

* 8 * * * make -f /home/pi/projects/home_dashboard/octograph/Makefile run-docker >> /home/pi/logs/cron.log 2>&1

I had trouble with it because cron didn't know where docker was, so I needed to specify the absolute path to it in the Makefile command, also log forwarding was painful too! Not sure if you've done it already but if you haven't make sure you add a volume for InfluxDB so the data persists after a restart!