Tariff Trade-off Analyzer using Sense Data

I’m gonna try to build an R-based calculator that reads in a few key things, including Sense export files and produces a bill-by-bill comparison for all active, residential tariffs from any given power company.

Inputs

  • The OpenEI US Utilities Rates Database
    https://openei.org/apps/USURDB/
  • Sense hourly export for one or more years
  • A billing cycle table for one’s specific billing cycle
  • A holiday table that lists holiday dates that correspond to weekend rate scheduled for one’s utility
  • Other data that is required to compute tiered billing (i.e. baseline usage for one’s specific home)

I’m going to try to do it for PG&E for two reasons:

  1. That’s the company I know best
  2. Also the utility with the most residential rates.

Here’s a view of the utilities with the most active, residential rate scheduled in descending order…

10 Likes

I’m surprised there’s only 20 residential rates for SDG&E as a year or 2 ago I believe there were close to 50.

This is interesting but unfortunately for me I only have a Sense Monitor on my vacation rental house in the CA desert. My utility there is IID and I pay a flat rate of 13 cents per kWh. SDG&E would be far more interesting but I don’t have a sense and have a really good handle on pricing. I’m a NEM 1.0 customer with 6 more months to go before the Peak Period shifts to 4pm - 9pm. When that shift occurs, I’ll be going back on the old tiered rates!

@kevin1, this would be really awesome. I commend your interest and dedication for such endeavors.

Are you thinking also of layering on support for the various net metering programs that various utilities provide?..does the OpenEI Utilities Rates Database include these? e.g. for PG&E, are you planning to handle the NEM1* and NEM2* net metering programs?

What about handling the various options/rates that Community Choice Aggregation (CCA) providers for electricity generation? E.g., even though I have the EV-A tariff from PG&E (and NEM2 program too, though I’m ignoring that for this paragraph), my electricity charges is not based on PG&E’s EV-A tariff table, rather it is slight less because the CCA’s (Silicon Valley Clean Electric’s) EV-A GreenStart program’s electricity generation is a bit cheaper that what PG&E’s generation would be.

There is a utility provider in Arizona that has been testing out a residential tariff that includes demand charges. Over the years, I could see demand charges slip more and more into residential rates. Such tariffs could require 15-minute energy usage intervals, rather than just 1-hour intervals.

Anyway, “perfect is the enemy of done”, and any progress towards getting more accurate energy cost info is welcomed. I hope it is a priority for Sense to provide some additional support for more accurate energy cost within the Sense app; I believe it is one of the highest voted “wishlist items” (e.g. TOU pricing). Perhaps your efforts could serve as a catalyst for Sense development of something similar. Good luck.

1 Like

Thanks @james_reilley,
Haven’t started coding yet, but poking through the OpenEI database. You have hit on another level of complexity - CCA/utility combo pricing. I’m on a similar combo plan between PG&E for distribution and transmission, with Peninsula Clean Energy for generation. The OpenEI database doesn’t include mixes like this, just the base bundled PG&E tariffs. My thinking is that the base bundled PG&E plans are a good proxy for the best rate structure regardless of the generator since the PG&E base plan imposes the structure ( tiered, NEMs, TOU) on the CCA pricing.

Here’s a distilled version of the 67 PG&E active, residential rate plans, once I collapsed all the different flavors of the same plan for different PG&E “Regions” to just unique names. I got rid of all but my Region T, except in the cases where there were special plans for Region P. Not sure why Region P, which is the Sierra Foothills and around Clear Lake, is special.

The three parameters that contribute to the hourly prices are broken out.

  • Net Metering - indicates whether a plan is eligible for Net Metering. But there’s also a hidden factor here of whether a customer is on NEM1 or NEM2. If NEM1, the net is calculated and billed yearly via the true-up. With NEM2, folks have to be on a TOU plan and usage is netted hourly. In this case, I think users are paid wholesale prices against any hourly net to-grid. Anyone with more knowledge than me on this one, let me know.
  • Periods - the number of pricing periods the plan divides the year into. Can be divisions within days and also within years.
  • Tiers - number of pricing tiers within a period

Fixed Monthly is the minimum monthly charge. The other columns are data that might indicate something important, or not, beyond the fact that all rates are per kWh.

1 Like

This is an unofficial dare (@kevin1?) to port pricing to, say, a spare Solar CT input or a “device” so we can graph it at at least 1Hz! :trophy: :beer::trophy: :beer::trophy: :beer:

@2uskiwis, try querying the data to see if the tariffs you expect are in there. Each tariff has a 4 web page set of tabs covering all possible pricing components.

https://openei.org/wiki/Utility_Rate_Database

@ixu, right now, I’m just challenged to wade through all the hourly tariff craziness.

OK - starting to analyze all the active, residential plans in the entire database, since I have unpacked the database a bit more. I’m trying to take a look at all the plans, but focusing in on the utilities with the most plans for discussion here:

Top 25 Utilities - Distribution of ToU periods/time domains
Here’s a view of the top 25 utility and their distribution of rate plans by period. Zero periods means the rate plan relies on something other than time to calculate rates. Many utilities have plans that are mostly just 1 rate period - a straight tariff, though they might also have tiering on top of that (next section). My PG&E EV rate plan has 6 different pricing periods, 3 time periods per day x 2 seasons (winter/summer). Based on this matrix, there are some rate plans, not associated with the top 25 utilities, that have 9 periods.

Top 25 Utilities - Distribution of Tiers
Here’s the same chart looking at the distribution of tiering across utilities. Yes there are some rate plans that have up to 9 tiers. As I have seen earlier in evaluating PG&E plans, there are a number that have both ToU and usage tiering components. In the database, tiering is expressed as a kWh/day breakpoint, but I know in the case of PG&E, the tiering calculation is only performed on a billing cycle basis (not daily) and the daily breakpoints are summed over the billing period, to form billing period breakpoints. This is a a good example of one of the places where the OpenEI database is probably not sufficient to get the calculation right.

Top 25 Utilities - Distribution of Net Metering Plans
Here’s the same view for distribution of Net Metering eligible plans. I say Net Metering eligible because, in some states/utiltiies, the number of solar installs might have surpassed certain limits. In those cases, not all Net Metering plans are available to post-limit customers. In California, the initial net meting plan, NEM1, has one set of rules, while newer customers entered under NEM2 rules which limited them to a smaller set of ToU plans.

Top 25 Utilities - Demand Charges
Here are the top 25 by the number of rate plans with demand charges.

I have also included my master spreadsheet here for anybody who wants to play around and examine.

ResRates.xlsx (482.6 KB)

@kevin1 … it doesn’t seem to be current, at least to my untrained eye.

I’m on EV-TOU-2 (GF) and I don’t see it when I run the query. What I do see is this for EV-TOU-2

This looks to be about 18 months out of date…06/30/2018 specifically.

Here’s all the current and past SDG&E rates. I see 36 that do not have “Closed” or “Eliminated” next to them.
https://www.sdge.com/total-electric-rates

Click on this one and the rates match from the query…

Because it affects me, I created and maintain a SS with the various rates so I can see how they’ve changed over time. The following shows the current and past rates for EV-TOU-2 and EV-TOU-2 (GF)

@2uskiwis,
I don’t think the OpenEI databases is completely current either… I was just switched from the EVA EV rate to an EV2A rate which isn’t listed… But that was fairly recent. Not sure how often this database is refreshed but it does include rates that only started in 2019. Even if it is out of date, I’m finding it instructive in how to do a massive comparison - how data needs to be structured to so I can run all the rates in the database.

1 Like

OK, I managed to muscle my way through a calculation using my Sense hourly net usage (Total Usage - Solar Production) for as much of 2019 as I have (Apr. 6 - Dec 31), for ALL 67 active PG&E tariffs. I have also done a comparison against my my matching 2019 billings, though there are still some ambiguities given I use a separate CCA (Community Choice Aggregation) supplier for generation.

So comparison first. For 2019, I was on the EV-A EV Time of Use plan, but with a different generation supplier so I was subject to PG&E’s Power Indifference Adjustment fee. I also chose a premium plan, ECO100, that is 100% renewable. That hybrid rate structure (separate generation + premium ECO100) isn’t in the OpenEI database so I had to emulate it by adding my PG&E NEM charges to my PCE charges, then subtracting off the ECO100 premium fees. Generally the numbers were close on a monthly basis though they occasionally did differ by more than 10% of the total bill. I’ll have to look a little bit more closely, but there isn’t an easy way to peek inside the highly variable PG&E “indifference charge”.

The upshot is that I think the calculator script is working though I’m going to have to do the hard work of confirming everything this weekend.

For those of you who want to see the broader comparison, here’s the whole spreadsheet kicked out by the R script. It’s clear that there are some rate plans that might be better for me, but I would really need to look over a whole year. I can see that my move from E1 for Region T, to EV-A has saved me around 1300$ for 2/3 of year, or maybe 2000$ over the course of year.

The Partial Start and Partial End columns reflect the partial months, in Apr’19 before the first full billing period, and the remainder of Dec’19, after the last full billing period in the year. The other thing that occurs to me is that this comparison is not very “diagnostic”. It really doesn’t give you a good view of why your bill is so high or so low. It probably would be useful highlighting billing periods where you spent the highest % of the time in the higher pricing tiers or pricier TOU periods.

Results.xlsx (20.1 KB)

Anyway, after doing a little more checking, it’s going to be time to expand to other utilities.

For anyone who wants to look at some junky but operational code, here’s a look. No attempt to functionalism, though I did work hard to use R parallel computations whenever possible.

PGEbilling.R (5.4 KB)

Excellent work @kevin1

Indeed, the “diagnostic” aspects add yet another layer of intractability, especially when you start to consider the real relevance (and realtime relevance especially especially) to (and of) Sense.

“Simple” case: Sense detects new EV and recommends “You should switch your TOU plan to X or I could delay charging until 3am or your gonna get a whopping bill”

“Hard” case: Optimistically, Utility EV plans are crafted, for obvious reasons, to distribute load throughout the day and across the months and seasons. Pessimistically, Utilities are often driven by profit, at best to improve infrastructure. Those optimizations (plan changes!) get faster and Sense gets in an optimization battle. Sense is also forced into a battle with opposing end-user requirements: lowering energy use and cost reduction vs. spending money to add solar AND storage capacity (Note: this is also at odds with said Utility infrastructure!). I say “AND” here because it seems like adding storage capacity really throws things into the realm of intractability.

You’ve taken a giant leap here. Props.

2 Likes

Now it’s time for the detailed study of differences between my bill and my calculations, for my EVA plan… I have painstakingly pulled kWh data from my bills by TOU rate period for comparison against the same from my calculator. The top are kWh values from my calculator and middle is from my bills. The last table shows the % difference usage between comparable periods. Very weird ! Most periods are extremely close but a few have ugly differences !

Why the differences ? There are 3 possible reasons:

  • Sense source data different than PG&E’s revenue data.
  • Incorrect entries in the OpenEI databases tables (or bad matching on my program’s part)
  • Some other systemic factor that would only affect a few months

On the first, differences between Sense and PG&E, I could try running the same calculation on my PG&E data (where’s the fun in that ?), but fortunately, I’ve already done some analysis of Sense vs. PG&E and found the time periods where I had the biggest differences, either due to dropouts or the monitor going crazy. That would explain some of the discrepencies in the 2019-04 and 2019-07 bills. But I haven’t had many errors in Nov.

Is there something wrong with the tables or my algorithm ? I don’t think so, because so many months look so good. The big issues seem to occur during billing periods that are split between seasons.

That leads me to my third possibility, some kind of systemic issue, that only affects a couple of billing periods in transition. It could be that the summer/winter periods don’t fall neatly on monthly boundaries as the OpenEI tables assume, but that would show issues on both sides of the season split. In the case here, it’s only the “from” season that is showing big errors. I’m betting that the issue is related to treatment of DST. If I look at my November billing period, my calculated Partial Peak is 25kWh too big, while my Peak is 16.5kWh too small, and my Off Peak is 8kWh too small. But everything looks good again in December… Any thoughts ?

Time to investigate the usage differences between the calculator and my bill during a few select periods. As boring as it is, I’m feeding my PG&E hourly data into my R calculator to see how the usage compares per TOU period and per billing period. It should be nearly perfect, rounding error excluded. As near as I can tell, PG&E exports power information with 2 decimal places of kWh accuracy, while they keep around 8 decimal places internally and in their calculations.

When I do the comparison, though, three billing periods have significant differences and the rest are near perfect. What’s more, is that even for the months with the big deviation between calculated and bill usage in some periods, the total usage still remains accurate. That means that the usage is misdistributed within those 3 billing months, but accurate for the monthly total.

Looking closely at the calendar and those three billing months, 2/21-3/21, 3/22-4/22 and 10/22-11/19, I can see a pattern. Daylight saving time 2019 began on 3/10 and ended on 11/3, right in the middle of two of the months with accuracy issues. The official start of the summer schedule for the EVA rate plan per the table is 5/1 and the official start of winter is 11/1, both again in the middle of billing periods that have issues.

The weekday rate grid from the OpenEI database - rows are months, columns are hours and the numbers correspond to TOU periods.

Guess I’m going to have to poke deeper into those billing months and the rate table…

Edit: OK - one quick answer. A clause buried deep in the tariff document for EVA and EVB rate schedules points out a non-standard time adjustment…

“DAYLIGHT SAVING TIME ADJUSTMENT: The time periods shown above will begin and end one hour later for the period between the second Sunday in March and the first Sunday in April, and for the period between the last Sunday in October and the first Sunday in November.”

So for those two periods following the advent of DST, and prefacing the change back to standard time, PG&E is really using a different table.

Arrrrgh ! I have just been reminded why TOU pricing is so hard.

I’m going to put the problems with my particular TOU rate schedule on hold (maybe an issue with all PG&E TOUs), and push on with running through all utility rates since my script seems to be working well within the limits of the OpenEI data. So I’m going to strip all the tariffs that I haven’t implemented yet, then try a near-full run. The two forms of tariffs I’m going to strip out for now are:

  • Tariffs with demand charges - the code will be similar to the the TOU code, but applied a little differently.
  • Tariffs without any TOU periods (53 of them below) - What the heck are those ? Looks like there are rates that are pure unlimited usage for fixed monthly fees in that category. Perhaps others.

Update
Cranking through the huge list of 6,460 tariffs has guided me make a few more changes in my program and rate database:

  • Adjusted the code to handle tariffs that are a mix of tiers plus flat rates (some TOU periods have tiers, others are flat rates)
  • Removed one tiered rate in the OpenEI database that had multiple rates, but was missing the breakpoints. Reported this to OpenEI.
  • Cleaned up ratenames so they could be used as filenames - I store away each and every simulated “bill summary” for each rate.

Update 2
Slowly chugging through every active tariff in the database, discovering new things along the way.

  • Removed all the tariffs that have ‘sell’ (sellback) prices but no buy prices (‘rate’) - what the heck are these ?
  • Realize that I still have to add code for computing tariffs in solar sellback situations beyond yearly net metering.
  • Have pulled another 11 rates with malformed pricing structures.

But more than halfway through the 6,400 or so tariffs…

Shared this with the larger team, @kevin1. Thank you for the amount of detail here, as always.

1 Like

Wahooo ! My calculator made it through all 6305 tariffs of the edited list after the removal of a few more rate-tables/rates that had problematic structure (at least for my calculator). Now time to look at the results. The first thing I’m going to do is do a sanity check by plotting all the billing period costs for all the rates, by billing period with as little jitter… This is the fun part.

Sanity check useful. Two things discovered:

  • Some costs are way outside the realm of possibility on the high side. Either there are crazy rates, or some rates have other units besides kWh.
  • I also a message during plotting that means at least 10 billing period costs were not available (NA), probably for a single tariff (10 billing periods). Somehow, some NA data sneaked in.

If I sort by billing periods costs, from highest to lowest, there are clearly problems, but this shows where I should start first.

The same on the low end. I love the “residential” tariff I moused over - Off season grain-drying rate ! Lost of negative an zero costs to be investigated.

Plus here are all the rates I had to remove because they were blowing up or crashing my computations.

2 Likes

Thanks @JustinAtSense,
I have two reasons for doing this…

  • It something that I really want to use. And some energy consultants have some similar tools, but from what I can tell, they are all swags because of the complexity.
  • I also wanted to see what the complexity looks like. Just scratching the surface right now. I think a lot of people see TOU and tiering as simple, at least for their own rate structure, but when it comes time to implement a general solution, I’m guessing most would be dumfounded.

Can you factor in what the bill would be if there’s a peak period shift coming up?

I’ll attempt to explain so you know what I’m referring too.

I’m with SDG&E but I assume both PG&E and SCE are similar so it will probably also apply to them. I’m almost 5 years since getting my PTO and I snuck in under on the NEM 1.0 rules. My “peak time” period is currently 11am to 6pm, but on the 5 year anniversary of my PTO, that’ll shift to 4-9pm. Obviously a lot of my generation today is during this peak period but in the future only a small part of it will be. SDG&E has a “pricing plan” feature on their site, that shows what your bill would be under the different plans but it doesn’t take into account this shift.

image

So, what I’ve been trying to do is estimate what my bill would be on my current plan, assuming the peak period has already shifted.

I download the 15 minute data from SDG&E daily and run a macro against it using the applicable rates today vs what they will be after my 5 year anniversary. I don’t know what the rates will be, but I know when the “load” occurred…I hope that makes sense.

Here’s an example from Feb 10:
image

This shows that my peak time usage is -4.015 kWh but after the Peak shift, I’ll actually be consuming 20.815 kWh @ the applicable peak rate. The impact of this in the winter is fairly small but when summer rolls around it’s another story.

At the end of the month I’m very close to my actual bill and have a pretty good handle on what it will be in the future but only because I run this macro to calculate it. From what I have seen so far, I’ll be switching back to the old tiered rates.