This project automates the process of downloading and processing smart meter energy data from ESB Networks, converting it into .csv files ready to be used in Grafana with the Infinity Data Source plugin.
I'm not a programmer and don’t know much about databases—but I needed some scripts to work in Grafana. With help from AI, I was able to build them step by step.
These scripts came together through questions, experiments, and learning as I went. I hope they help someone else just like AI helped me!
With a single terminal command, the scripts will:
- Download your energy data.
- Adjust the timestamps.
- Organize data into Day/Night/Peak buckets.
- Add pricing based on your energy rate.
- Create weekly breakdowns.
- Output
.csvfiles for easy visualization in Grafana.
| Script | Purpose |
|---|---|
energy.py |
Main controller script. Runs all other scripts in order. |
energy_download.py |
Downloads your energy data and saves it to a file. (Original source credit: badger707/esb-smart-meter-reading-automation, adapted by Raydex.) |
energy_timeshift.py |
Shifts all timestamps back by 30 minutes to match your local time. I have an Energia as a provider and the first reading starts at 00:00 |
energy_dnp.py |
Organizes readings into Day, Night, and Peak buckets and groups by day. |
energy_30min_eur.py |
Multiplies each 30-min reading by your electricity rate and adds a Price column. |
energy_dnp_eur.py |
Converts DNP (Day/Night/Peak) usage into price-based data. |
energy_30min_kwh_week.py |
Adds a 'Week' column to your 30-min usage file. |
energy_30min_eur_week.py |
Adds a 'Week' column to your price-based usage file. |
- Clone or download this repository.
- Open a terminal in the project folder.
- Run the main script:
sudo python3 energy.py💡 Raydex runs this automatically with Task Scheduler on a Synology NAS for full automation.
To run a Python script (energy.py) on your Synology NAS using Task Scheduler, follow these steps:
- Log in to DSM (Synology's web interface).
- Open Control Panel → Task Scheduler.
- Click Create → Scheduled Task → User-defined script.
- In the General tab:
- Give your task a name (e.g., Run
Energy Script). - Set User to
root.
- Give your task a name (e.g., Run
- In the Task Settings tab, enter the command:
cd /your_folder_path
python3 energy.py- (Optional) Set a schedule under the Schedule tab.
- Click OK to save.
You must update some settings in the scripts:
- Your MPRN, username and password in
energy_download.py. - Your price per kWh in
energy_30min_eur.pyandenergy_dnp_eur.py. - Folder paths.
- Filenames if you want to use differnet name for your input and ouput files
Open the scripts in any text editor and look for comments like:
# TODO: Change thisEach script produces a new .csv file that gets more refined. These files can be imported directly into Grafana using the Infinity data source to create energy usage dashboards.
- Script adapted from badger707/esb-smart-meter-reading-automation
- Developed and maintained by Raydex