Python script to import Octopus Agile consumption data into emoncms

I’ve added the script to the usefulscripts repository as @borpin suggested.

Here are the steps to use the new location:

1. Run Emoncms update to pull in the latest version of the usefulscripts repository

2. SSH onto the Pi and navigate to the agile script directory:

cd /opt/emoncms/modules/usefulscripts/octopus

3. Create config file from default:

cp default.agile.conf agile.conf

4. Enter configuration including emoncms apikey and authentication and meter details from Octopus

nano agile.conf

5. Run script for the first time to pull in data:

python3 agile.py

6. Run script from crontab every morning to pull in latest data:

30 9 * * * /usr/bin/python3 /opt/emoncms/modules/usefulscripts/octopus/agile.py > /dev/null 2>&1

This example runs the script at 9:30am every morning, consider changing the exact timing to reduce simultaneous load on the octopus servers from lots of pi’s calling this script at the same time (Probably not an issue but hey…)

1 Like