Send monthly electricity usage reports from SolarCity, aligned to Orange & Rockland billing cycles.
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.
I wrote a program that can be run periodically to send an email report of electricity usage statistics for both Orange & Rockland and SolarCity.
DadsEnergyReporter.exe
Settings are stored using JSON in %LOCALAPPDATA%\Dad's Energy Reporter\settings.json
.
{
"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
}
All properties are required unless they have a default value.
SolarCityUsername
is the email address you use to log in to MySolarCity.SolarCityPassword
is the password you use to log in to MySolarCity.OrangeRocklandUsername
is the username you use to log in to Orange & Rockland My Account.OrangeRocklandPassword
is the password you use to log in to Orange & Rockland My Account.ReportSenderEmail
is the email address that will appear in the From
field of report emails that are sent to you.ReportRecipientEmails
is an array of one or more email addresses to which report emails will be sent.SmtpHost
is the hostname or IP address of the server that you use to send outgoing email. The server must support STARTTLS authentication.SmtpPort
is the TCP port number of the server that you use to send outgoing email, by default 25
.SmtpUsername
is the username that you use to log in to the server that sends your outgoing email. Required, no anonymous SMTP allowed.SmtpPassword
is the password that you use to log in to the server that sends your outgoing email. Required, no anonymous SMTP allowed.HttpProxy
is an optional HTTP forward proxy for this program to use when making outbound connections. The value can be a string containing the hostname or IP address and port of the proxy server, e.g. "192.168.1.100:8888"
, or null
if this program should instead make direct HTTP requests, which is the default.MostRecentReportBillingDate
is used by this program to keep track of the billing date of the billing cycle that most recently triggered the generation of a report. If you are setting up this program for the first time, omit this field from your settings. The value is stored as an ISO-8601 datetime string, e.g. "2017-08-16T04:00:00Z"
. The default behavior when this value is missing is to interpret it as if no reports have ever been sent, so if you want to force a report to be resent, remove this key-value pair from your settings.