Skip to content

Added tool to read the smart_plug_mini.py generated csv files and write a summary for each device to a separate Google spreadsheet

Compare
Choose a tag to compare
@ZuinigeRijder ZuinigeRijder released this 05 Feb 14:21
· 6 commits to main since this release

Simple Python3 script to read the smart_plug_mini.py generated csv files and write a summary for each device to a separate Google spreadsheet.

Note: you need to install the package gspread and configure gspread

Usage:

python csv_to_google_sheet.py

INPUTFILES:

  • smart_plug_mini.cfg
  • for each configured DEVICE_NAME:
    • DEVICE_NAME.csv
    • DEVICE_NAME.days.csv
    • DEVICE_NAME.weeks.csv
    • DEVICE_NAME.months.csv
    • DEVICE_NAME.years.csv

Standard output:

  • progress of what is done

OUTPUT SPREADSHEET:

  • DEVICE_NAME.SP (for each configured DEVICE_NAME)

So the smart_plug_mini.py tool runs on my Raspberry Pi server, but I want to look at the results, without having to login to my server. So another tool has been made, which copies a summary to a google spreadsheet for each device: csv_to_google_sheet.py

The Google spreadsheet contains kWh usage, including nice diagrams, when you import the example Badkamer.SP.xlsx spreadsheet in Google Spreadsheet:

  • last written Date, Time, kWh, Hour, Day, Week, Month, Year
  • last 48 hours
  • last 32 days
  • last 27 weeks
  • last 25 months
  • last 25 years ;-)

A short video of how it can look on an Android phone, can be found here.
Of course you can also view the Google Spreadsheet on your computer or tablet, e.g. Windows or Mac.

Broadlink Smart Plug Mini showing csv results in Google Spreadsheet