Aldaviva / DadsEnergyReporter

Send monthly electricity usage reports from SolarCity, aligned to Orange & Rockland utility billing cycles.
GNU Affero General Public License v3.0
0 stars 0 forks source link
coned electricity-bill electricity-consumption electricity-meter solar-energy tesla

Dad's Energy Reporter

Send monthly electricity usage reports from SolarCity, aligned to Orange & Rockland billing cycles.

Problem

My parents' house gets its electricity from both Orange & Rockland, a public utility company, and two arrays of roof-mounted solar panels leased from SolarCity.

My dad wants to know how many kilowatt-hours of electricity were generated by the solar panels compared to how many were bought from the utility each month, so that he can tell how much of an impact the solar panels are making on his electricity cost.

Challenges

Solution

I wrote a program that can be run periodically to send an email report of electricity usage statistics for both Orange & Rockland and SolarCity.

Algorithm

  1. Log in to Orange & Rockland
  2. Log in to MySolarCity
  3. Download ESPI Green Button Data from Orange & Rockland
  4. Extract the start and end date and billing amount from the Green Button data for the most recent billing interval
  5. Download the PDF of the latest bill earlier than the billing interval end date
  6. Extract the energy consumed from the bill PDF, which may be negative if the solar panels generated surplus electricity
  7. Download PowerGuide measurements from MySolarCity
  8. Extract the kWh generated from the PowerGuide data for the most recent billing interval
  9. Send an email report containing this information, as well as the sum of the electricity generated and bought which gives the total house usage
  10. Log out of Orange & Rockland and MySolarCity
  11. Persist the billing date to avoid resending the report for the same billing interval the next time this program runs
  12. Exit

Usage

  1. Make sure you have .NET Framework 4.7 or later installed
  2. Download the latest release (the ZIP file, but not the source code one)
  3. Extract the ZIP file
  4. Create a settings file according to Settings
  5. Run DadsEnergyReporter.exe
  6. Check your email for the usage report

Settings

Settings are stored using JSON in %LOCALAPPDATA%\Dad's Energy Reporter\settings.json.

Example

{
  "SolarCityUsername": "solarcityUser",
  "SolarCityPassword": "solarcityPass",
  "OrangeRocklandUsername": "oruUser",
  "OrangeRocklandPassword": "oruPass",
  "ReportSenderEmail": "sender@mail.com",
  "SmtpHost": "mail.com",
  "SmtpPort": 25,
  "SmtpUsername": "hargle",
  "SmtpPassword": "blargle",
  "ReportRecipientEmails": [
    "recipient1@mail.com",
    "recipient2@mail.com"
  ],
  "HttpProxy": null
}

Properties

All properties are required unless they have a default value.

Project Information