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

Time Based Control - What Do You Think of The Functionality Offered?

This site may earn commission on affiliate links.
I want this too, and will consider adding it to my program, but the only way I can see to do that now is to turn off the powerwall - which stops logging (I guess I can live with that) - but also risks drawing from the grid if load exceeds PV during peak hours. This is beyond the ability for simple hacking to work around - we'd need to change the way the PW handles PV > site load (now it charges, we want it to not charge), but we want it (or at least I do) to discharge when site load > PV to avoid paying peak rates from grid

Agreed - next year, we have a super peak feed in tariff from 3pm to 9pm - I don't want the PW to charge during this time, but to export to the grid (but still match house load)

As the author author of the service mentioned here - (this just links to post #7 above Time Based Control - What Do You Think of The Functionality Offered?) - this is hard. I've only got one other person actively testing, and although we have similar tariffs and economic drivers, what we happen to want is quite different. I've discovered that the algorithm that I thought was perfect is very far from what my tester would like.

So, while I'm unhappy I'm burning hours writing my own TOU control because Tesla hasn't released theirs, I do see the scale of their problem - deal with a very wide range of permitted scenarios from UK to US with different rules in different states, ITCs and SGIPs, differing feed in rules (NEM vs Gross) and different feed in rates at different times of days - and then combine that with a widely different set of wishes from end users with different priorities - avoid peak, vs maximise feed in vs. minimise all grid vs always have a buffer for grid outages.

I'm optimisting my service will be redundant soon - which is why it is hard to invest lots of time into making it easy for everyone to run and suitable for everyone. It runs on Windows as a service because that's what I know how to develop quickly and reliably.

Can you share your code / upload it to GitHub. I'm happy to test it and track / fix bugs in GitHub. I'll also upload your project to github if you want (I'll be sure to credit you as the author). If its .Net core then it will run on Linux happy to test it out on Windows and Linux and report back. I've got a dual PW2 setup with Solar self-generation mode. I'm not on a time of use tariff at the moment but happy to test the software. We had our solar and PW2s installed last month so I'm looking at options for

1) Soaking up excess solar (PW2 and Water/Space heating)
2) Topping up PW2 with cheap grid power in the Winter. (Currently, in the UK I get 50kWh per day when its sunny so I'll stay with the flat tariff)

So far my todo list is
  1. Poll the PW2 gateway to get the state of charge as a percentage (Done)
  2. Change the manual switch for the water heater (600l tank thermally lagged) to support MQTT/HTTP command (I'll use an ESP8266 and a 3.3v switchable SSR with 40amp 240v output via GPIO)
  3. Find a way to flip the PW2 into grid charge mode/back to the self-powered mode I can put the logic into Node-Red (Hoping the Windows code you have might help with this)
  4. Track the self-generation meter remotely. This should be simple as the self-generation meter sends out IR codes so I can grab these and process them on a ESP8266 and send the results to Node-Red
 
It's not really github-ready. Here is a zip of the project. Just edit rotues/powerwall.js to add your gateway IP address and serial number (with "S" prepended). iRun "npm install" to get the node modules, and then you can just run the development server using "bin/www".

I use nginx as a front-end to do https so I don't have an unencrypted link in through my firewall. Obviously the URLs could be obfuscated too for more security.
 

Attachments

  • powerwall-service.zip
    5.2 KB · Views: 56
Just edit routes/powerwall.js to add your gateway IP address and serial number (with "S" prepended). iRun "npm install" to get the node modules, and then you can just run the development server using "bin/www".
Awesome, thanks for sharing! I particularly appreciate having a copy of your powerwall.js file since it shows how to call the gateway's API.

This may be timely because we still don't have TBC, we were watching a movie last night, and at 10pm I forgot to manually switch our Powerwalls from Self Consumption mode to Backup mode. As a result, our nighttime EV charging came from the Powerwalls, at least until they dropped to my current reserve amount of 15%. For one night, this is only a $2 or $3 mistake, but that could add up on a monthly or annual basis.
 
One addendum: time-based control (TBC) is not currently supported through the local API. When on TBC, the operation mode is set to "autonomous," but trying to set it to that through the API results in an error. This means I'm currently manually switching back to TBC after an OhmHour.

For what it's worth, when set to 100% reserve in self-consumption the Powerwall appears to behave the same as in backup-only mode.