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

Tesla development needed for solar+car+powerwall control

This site may earn commission on affiliate links.
Done some research on this trying to see how I can maxmise use of solar while ensuring I still have enough charge in the Powerwall and car by a set time of day. It seems you can't at the moment unless you use an OpenEVSE charger instead and use code to control the charge rate. Some have modded the Tesla charger to allow it to be controlled but that's messy and has safety approval issues.

Tesla should be able to do better with their app as they have access to all of the necessary elements. The app can already read solar production, grid import / export, home consumption, Powerwall SOC and charge rate, car SOC and charge rate.

The car charge rate can't currently be controlled via the API - it can only be turned on or off. But it can control the Powerwall charge rate.

So all Tesla needs to do is update the firmware of the car to allow the charge rate to be controlled via the API like they do with the Powerwall (restricted just to them if need be) and then update the app so that you can set your battery / car charge settings. It can then adjust the charge rate of the car according to SOC of Powerwall and car in conjunction with your preferences to use your solar production as much as possible without drawing more from the grid than necessary to achieve your desired charge by a certain time of day.

Let's hope this is part of the roadmap ...
 
There is a lot they could do with this. A couple of basic functions that would be nice for multiple Tesla owners and power wall users:

1) Two cars should be able to talk to each other to stagger the charging. Have one car start after the other is finished (without having to install 2 HPWCs).
2) Be able to skip charging during power outages if I have at least a certain amount of range left,. If it needs to charge, reduce the rate to a Powerwall friendly rate.
 
I totally agree.

As noted in a separate post, I would hope there is a future software setting/option incorporated with a Tesla car that would stop or limit charging in the event of a grid power failure. No need for complicated hardware setup since it is possible via software. This can be done regardless of the charging device (Tesla mobile connector, Tesla wall connector, or third party unit).

This all can be set via the Tesla app which already can control the Powerwall and car. If there is enough energy in the Powerwall battery, there can be an option to continue to charge a Tesla car down to the set reserve energy amount at a reduced rate.

Something as "simple" as:

IF grid=1 THEN Charge Tesla=100% ELSE
IF grid=0 AND (Powerwall battery > reserve) THEN Charge Tesla=50% ELSE
IF grid=0 AND (Powerwall battery < reserve) THEN Charge Tesla=0%
 
  • Like
Reactions: Bigtanuki
I think this is all possible with a bit of coding and by using tricking the Tesla Wall Charger like in the interesting TWCManager example GitHub - cdragon/TWCManager: Control power delivered by a Tesla Wall Charger using two wires screwed into its RS-485 terminals.

For my setup, I want to ensure I use all of my solar but I also want to ensure I minimise the expensive day-rate electricity usage from the grid. So I want the car to charge at night and to ensure the Powerwall is full to cover the evening.

That means really I need a good idea of how much excess solar I'll be getting the next day so I can charge the Powerwall with cheap night-rate electricity leaving enough for the excess solar to top up the rest. So then you get into reading weather forecast feeds to get an approximate solar output for tomorrow.

So in terms of data feeds, we'd have:

  • SOC of car from Tesla API
  • Max SOC of car from Tesla API
  • SOC of Powerwall from Tesla API
  • Max SOC of Powerwall from Tesla API
  • Desired car SOC for set times from app settings (e.g. maybe a schedule, so weekdays 50% ok for evening use but then min 70, max 85 for the mornring commute).
  • Predicted excess solar for tomorrow from weather forecast and calcs
  • Cheap night rate period from settings
  • Car charge priority override e.g. by app setting or detecting a set desired charge in the car (e.g. <70% means solar only, 80-90 means grid at night rate and 90+ means grid any time).
The from that we can set the following:

  • Max amps for Tesla Wall Charger (using adaptation of TWCManager) to control car charging
  • Max storage for overnight Powerwall charge (using Tesla API)
  • Delay Powerwall solar charging if we need to charge the car during the day to reached desired min car SOC
  • Charge Powerwall in preference to car when car has achieved the min desired SOC required that day.