Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

Time-Based Control?

This site may earn commission on affiliate links.
I'm a software engineer. I know this is a challenging problem and perhaps I just don't have the visibility to just how complex it really is, but it seems relatively solvable to me. I'm not looking for 100% perfection here, but ever since the summer rolled in, TBC has been making the biggest mistake it can make: consuming peak power from the grid because it used too much during shoulder times (or undercharging the powerwalls during shoulder resulting in not enough available to take me through peak). That should really never, ever happen.

And when I say this, I'm not suggesting this is some crisis or anything...lol, I love the powerwalls. I'm just want it to be better.

I'd think the following factors could be used, over time, to develop great outcomes:

*) weather
*) usage history
*) rate schedule

Weather should help the system understand/predict both production (solar) and consumption. Obviously everyone uses their AC differently, so these factors are pretty specific to each installation -- but again, Tesla has all that data so I'd guess they are already using this information.

If we're expecting rain the next few days, I don't want my power wall to discharge anything other than peak. If it's clear blue but 108 degrees tomorrow, I want it to play it a little safe and discharge at peak and as far into the shoulder as it lasts. If it's a "normal" day without AC, I want it to cover everything that isn't super-off peak. I mean, the bottom line is that I want it to just "do the right thing" without me having to think about it at all.

Again, I'm not saying that is reasonable. I don't even mean this as criticism -- I love these things (and my solar, and my car)! I'm just saying as a customer, that's how I think it should work and I think they can get it there. I'd be happy to help them if they want it. :)

On a side note, I think it would be cool to also work in even more localized data, specifically, integration with the smart home devices, in particular thermostats. I'd think that could really help them understand the demand side of the equation and improve their predictions re: consumption.

But yeah...maybe I'll just switch back to balanced.
 
  • Like
Reactions: abasile
I'll grant you that it may be solvable, but I think it would be much easier to ask for a little more user input. This strikes me as analogous to the over-automation they did in the factory. I think human judgment can handle the forecasting much more easily than an algorithm, learning or not.

I'm a software engineer too, but one of the things I've learned is that you don't need to solve every problem with an algorithm. There is a thin line that separates engineering from over-engineering. I've definitely crossed that line before, so I'm sensitive to the issue.

A UI that just asks for one number - the amount of energy you want to reserve for peak - would go a long way to eliminating the issue of running out of capacity before the peak period is over. If you just set that to the maximum peak usage during the summer, I think you'd get a large part of the possible benefit from the Powerwalls.
 
Well, it is in my nature to over-engineer so I'm certainly not going to say you are wrong -- I fully admit it. :) And my commentary is probably more about my own interest in thinking about how I could solve the problem than anything else; the system works reasonably well as it exists today.

I guess my counter to the your point re: having a human set another number is that balanced mode might already amount to what you are suggesting. If I have to reserve a given capacity to cover maximum peak demand, I'm basically giving up on the maximizing cost efficiency. My consumption and generation vary markedly from day to day -- a single number seems like a complexity that isn't going to add more value...so, if I were siding with your position, I'd leave it like it is now or even better, simplify it further (for the user).

re: algorithms...I guess I was thinking more an AI than an algorithm. Train an AI and see how it does. I bet it could do pretty well if you pick the right 6-8 inputs to consider. I guess if I build it on my own I'd get to put in the thermostat data...darn, I'm never going to get my startup off the ground at this rate!
 
  • Disagree
Reactions: Ampster
I have already written software to run my system that downloads a weather forecast, and uses that for an initial estimate of the solar energy available the next day. Based on that it decides whether to charge from the grid during the off peak early hours of the morming. During the day it takes the observed solar power and compares it with the expected solar power based on the position of the sun in the sky and the angle and orientation of the solar panels. It uses that to improve the estimate of solar energy available later in the day during the peak time. It also tracks usage over the previous two weeks, to estimate the energy requirements for each period.The idea is to reserve energy for peak time, but to use energy, if required, during medium cost period, as long as that won't eat into the reserve for peak time. It helps that where I live, there's a period in the evening between the peak time and the off peak time, so if it turns out that too much was reserved for peak time, it can be used during that later medium cost period, which minimises the loss due to overestimating.

Unfortunately, this has all come crashing down because Tesla have blocked my access to the UI.
 
I have already written software to run my system that downloads a weather forecast, and uses that for an initial estimate of the solar energy available the next day.

I've done a similar thing, if not slightly less elaborate. ;) I also use PW2 API data to allow me to vary the charge rate of my EV to match my excess. Losing access to this telemetry would mess up several significant investments. :(
 
This week I'm going to try Balanced mode to see if it avoids non-peak discharging on Monday. A few more thoughts on Time Based Control:

With 2 different rate levels (peak and off-peak), the cost optimization problem is simple. Charge during off-peak and discharge during peak. With 3 different rate levels, those two rules still apply, and the complexity is in determining the proper shoulder behavior. Unnecessarily charging and then discharging during shoulder should be avoided, as that just wastes 10% of the energy due to round-trip inefficiency.

The descriptions from Tesla of shoulder behavior listed on Powerwall Modes of Operation with Solar don't make any sense to me. The optimal shoulder behavior is:

- Charge during shoulder only if there would not otherwise be sufficient available energy to cover usage during the next peak period.
- Discharge during shoulder only if there would not otherwise be sufficient available charging capacity to cover generation during the next off-peak period.

That's it. Obviously these rules require forecasts of usage during peak periods and generation during off-peak periods. So that aspect will require some learning and/or user input.

[To keep it simple, the above assumes that the intervening periods are long enough that looking ahead just one period is sufficient. In the case of "long shoulder -- peak 1 -- short shoulder -- peak 2", if generation during "short shoulder" is insufficient to cover usage during "peak 2", then extra charging during "long shoulder" would be appropriate.]

Cheers, Wayne
 
Last edited:
I like the idea of an option to use weather data, but I'm not sure if I'd personally want to turn this on. Like many others who live in or near hills or mountains, we're in a micro-climate that's quite often not in sync with the local weather forecast, both temperature-wise and in terms of cloud cover. Even while homes 1.5 miles away may be socked in with fog for much of the day, it can be bright and sunny here.

It's also good to have a "default" plan based on usage history, but our peak usage can be quite variable depending on when we end up using our electric appliances and/or doing daytime EV charging (mainly our short-range 2011 LEAF). Also, we don't currently have air conditioning (though this will change when we eventually install a heat pump for HVAC instead of burning natural gas to heat the house).

Overall, I find that there's little to complain about, as our two Powerwalls store significantly more energy than we tend to need during a given day's peak period. But I would prefer to be able to configure the behavior of the Powerwalls more explicitly, rather than relying on an algorithm that can't possibly know what we're going to do next.

I'd think the following factors could be used, over time, to develop great outcomes:

*) weather
*) usage history
*) rate schedule

Weather should help the system understand/predict both production (solar) and consumption. Obviously everyone uses their AC differently, so these factors are pretty specific to each installation -- but again, Tesla has all that data so I'd guess they are already using this information.
 
This week I'm going to try Balanced mode to see if it avoids non-peak discharging on Monday.
Unfortunately, Balanced mode charges during shoulder from excess solar. It looks like the strategy is to keep the grid flow at zero during all non-peak periods, exporting solar only if the Powerwalls are fully charged, and importing from the grid only if the Powerwalls have hit the lower reserve. In which case it will cost you money by charging during the shoulder period and discharging during off-peak. [I haven't observed that myself, it is my understanding of the Tesla's description which includes under Discharging Priority "3. Net usage (off-peak)".]

So I'm going to switch back to Cost Savings, as I think it will be less suboptimal.

Cheers, Wayne
 
Unfortunately, Balanced mode charges during shoulder from excess solar. It looks like the strategy is to keep the grid flow at zero during all non-peak periods, exporting solar only if the Powerwalls are fully charged, and importing from the grid only if the Powerwalls have hit the lower reserve. In which case it will cost you money by charging during the shoulder period and discharging during off-peak. [I haven't observed that myself, it is my understanding of the Tesla's description which includes under Discharging Priority "3. Net usage (off-peak)".]
We're using "balanced" mode and I've never observed our Powerwalls discharging during off-peak ("super off peak" in SCE-speak). But I have seen them charging during the shoulder periods while using the grid to meet our home loads. I'd actually prefer to be able to use the equivalent of "self consumption" mode during the shoulder periods and thus avoid drawing from the grid, primarily for philosophical reasons - I want to rely on the grid as little as possible.

Of course, we're heavy users of the grid when we charge our EVs late at night, a concession to the fact that we don't generate enough solar energy to offset all of our driving. Still, I'd much rather rely on the grid for transportation than have to buy gasoline! (We own no ICE of any sort so that's actually not really an option.)

Also, across all Powerwall modes, I'd still like to be able to set a maximum target percentage charge, probably 80% or 90%. I see little point, particularly during the warmer months, in constantly charging the Powerwalls to 100% and thus sacrificing a bit of battery longevity. Yes, I know that we're warranted at 70% remaining capacity during the ten year warranty period, but I would hope to do better than that.

I only want to charge to 100% in the following scenarios:

1. If the grid goes down. I'd rather "fill up" the Powerwalls from excess PV generation than completely waste the energy!

2. Close to the winter solstice when there's less PV generation.

3. In response to an occasional, manual override when I know in advance that we're going to have an unusually large electrical load (such as EV charging) during peak hours.
 
Unfortunately, Balanced mode charges during shoulder from excess solar. It looks like the strategy is to keep the grid flow at zero during all non-peak periods, exporting solar only if the Powerwalls are fully charged, and importing from the grid only if the Powerwalls have hit the lower reserve. In which case it will cost you money by charging during the shoulder period and discharging during off-peak. [I haven't observed that myself, it is my understanding of the Tesla's description which includes under Discharging Priority "3. Net usage (off-peak)".]

So I'm going to switch back to Cost Savings, as I think it will be less suboptimal.

Cheers, Wayne
My Powerwalls in Balanced Mode never discharge during Off-Peak. That would be ridiculous. On weekdays, I only have meaningful generation during Part-Peak, so that is the only opportunity to charge the Powerwalls. The problem I had with Cost Saving is that it would discharge during Part-Peak which is pointless cycling. It is better to just let the Powerwalls go to 100% during Part-Peak then export the surplus until Peak starts. On a weekday, the Powerwalls will start charging from All Solar, then at some point, probably depending on SOC and household load, it will change to Surplus Solar charging, dropping the grid to zero. Depending on how low it discharged the previous day, they frequently won't reach 100% before Peak starts, even if it might have if it had charged from All Solar during the morning Part-Peak period. I'm OK with that. On weekends, the behavior is different because the morning generation is all during Off-Peak and it just lets the grid power the house while it's charging.
 
The problem I had with Cost Saving is that it would discharge during Part-Peak which is pointless cycling.

I don't think cost-saving does this any more unless there is surplus power from a prior off-peak period. I do have off-peak power during the week, but even so I do not see a lot of discharging except on Mondays when the Powerwalls are full from the weekend. The big difference is that the Powerwalls don't charge to 100% during the week on cost-saving, unlike balanced mode. They seem to aim to charge just enough to get through the peak period.
 
  • Like
Reactions: arnolddeleon
My Powerwalls in Balanced Mode never discharge during Off-Peak. That would be ridiculous.
I agree it would be ridiculous. So it sounds like the documentation at Powerwall Modes of Operation with Solar is inaccurate, as it clearly states Balanced may discharge for "Net usage (off-peak)".

On weekdays, I only have meaningful generation during Part-Peak, so that is the only opportunity to charge the Powerwalls.
Likewise.

The problem I had with Cost Saving is that it would discharge during Part-Peak which is pointless cycling. It is better to just let the Powerwalls go to 100% during Part-Peak then export the surplus until Peak starts.
It's not immediately clear to me which is worse, unnecessarily discharging during Part-Peak, or unnecessarily charging during Part-Peak. I'll have to think about that some more. Unfortunately, those are the only two options that currently seem to be available.

On weekends, the behavior is different because the morning generation is all during Off-Peak and it just lets the grid power the house while it's charging.
From your experience with Balanced mode, if it sometimes charges to 100% during Part-Peak, does it always start the weekend with enough headroom to capture all the Off-Peak Solar? Or does it sometimes hit 100% during weekend Off-Peak and end up exporting Off-Peak?

Thanks,
Wayne
 
I don't think cost-saving does this any more unless there is surplus power from a prior off-peak period.
What's the definition of surplus off-peak stored energy? Admittedly I've only given my Powerwalls one crack at this so far, but in my case with no weekday off-Peak, Cost Savings incorrectly discharged during Monay Part-Peak, even though the available stored energy wasn't enough to cover the full week's Peak consumption. So later in the week it charged during Part-Peak, a wasteful round-trip.

Cheers, Wayne
 
I don't think the Powerwalls currently look at anything but the current day, so "surplus" is defined as more energy than needed to meet the current day's peak period. I see what you're saying about the wasted round-trip, though. I was only thinking with a one-day horizon too. I guess the optimal scenario would be to discharge during part-peak only on Saturday (presuming there will be enough energy on Sunday to fill the Powerwalls) and try to finish Friday at the backup reserve level.
 
It's not immediately clear to me which is worse, unnecessarily discharging during Part-Peak, or unnecessarily charging during Part-Peak. I'll have to think about that some more. Unfortunately, those are the only two options that currently seem to be available.
The problem I had with Cost Saving was that the Part-Peak discharge and/or export without charging was drawing down the battery to the point that it could not make it through the Peak period before hitting the Reserve. That was a problem that I could not overlook.

From your experience with Balanced mode, if it sometimes charges to 100% during Part-Peak, does it always start the weekend with enough headroom to capture all the Off-Peak Solar? Or does it sometimes hit 100% during weekend Off-Peak and end up exporting Off-Peak?
With weekend Off-Peak going all morning and to 3pm, even my small solar system can fill the Powerwalls this time of year and it's left with no choice but to export the remaining solar. If I didn't have net metering, or maybe NEM 2.0, I would try to charge my cars from that energy, but with NEM 1.0, it just doesn't matter to me.

The only interesting and unexpected thing I've observed is that it will continue discharging through Peak and into Part-Peak on Friday evenings. Presumably it knows that the cheap Saturday Off-Peak generation will be available to replace that energy.
 
I guess the optimal scenario would be to discharge during part-peak only on Saturday (presuming there will be enough energy on Sunday to fill the Powerwalls) and try to finish Friday at the backup reserve level.
What Saturday Part-Peak? With PG&E EV-A, there is only Off-Peak and Peak on the weekend. And weekday Off-Peak is all at night (99% true).

I described the optimal algorithm in Post 328 of this thread.

Cheers, Wayne
 
I don't think the Powerwalls currently look at anything but the current day, so "surplus" is defined as more energy than needed to meet the current day's peak period. I see what you're saying about the wasted round-trip, though. I was only thinking with a one-day horizon too.
Performance could be very good while only looking one day ahead, at least in my case. The algorithm for shoulder periods (part peak) should be "only charge if necessary to cover the next peak usage period; then only discharge if necessary to make room for the next off-peak generation period."

Basically the default option for shoulder should be standby. Balanced is too biased towards charging, and Cost Savings is too biased toward discharging.

Cheers, Wayne
 
As long as there is sufficient energy to power through the Peak period, does it matter which part of the SOC window is used? I actually like that the batteries charge fully then export the surplus as the Peak period approaches. When Winter comes, that will be necessary with my small solar system. My daily solar production is 5:1 higher in Summer than Winter. I think if I was on NEM 2.0 I would like the system to run more like Self Powered during the Summer Part-Peak period because the NBCs would help balance out the round trip efficiency losses.