[PROJECT] Driver for Connecting to Your Tesla Powerwall

I'm in PG&E land. I think they realized they were not a tax law enforcement agent and allow systems under a certain size to charge from the grid.

1 Like

That is interesting - I download the daily totals that our meter reports to our provider and compare them to what I get from the Powerwall. They are within a few kWh of what the utility reports. My panels are Tesla, so maybe the large difference is because of that?

The problem is related to the powerwall (Battery to Home and Solar to Battery) reported values in the data downloaded from the Tesla app versus what is displayed in the Tesla app on my phone; the other data has only very small differences.

I have to do more work to identify the source of the problem as the app reporting of total solar differs from that reported by the array software.

I seem to recall the Grid Charging thing was a result of my acceptance of the Federal Tax Credit on the Powerwall/Solar panels, and the restriction for Grid charging was connected to that. For some reason 10 years sticks in my head, at which point I can switch them away from "Stormwatch" only mode to a regular charge from grid/solar mode. I could misremember though.

"In the US this setting is intended to comply with the Investment Tax Credit (ITC) guidance from the Internal Revenue Service of charging your Powerwall 100% from solar."

From the description of Powerwall Modes (Grid-Charging) @ https://www.tesla.com/support/energy/powerwall/mobile-app/powerwall-modes

OK, I've spent enough time on this today, but originally to qualify for the Solar Tax Credit with Batteries (in the US), there was a provision that for the batteries to qualify, they must be charged 100% from Solar. Since the passage of the IRA (inflation reduction act) -- the tax credit for batteries no longer imposes that limitation, and batteries purchased under the IRA era Tax Credit only have a limitation on minimum capacity, but no requirement for the method of charging.

I don't know how that applies to those of us that bought Powerwalls under the 2018 -2022 non IRA Solar Tax credit -- but frankly, I doubt the IRS is looking at our Powerwall/Inverter settings to check up on us. It probably wouldn't take much further research, or a phone call to the IRS to determine what the limitations are. Some of the reading I did today, indicated the original limitation was for 5 years. But I haven't read the IRS code to see if it is addressed.

S.

1 Like

Here in Aus we can select between the various operational modes however we like. The exception is Storm watch, that is automatic and triggered by Tesla when the right conditions are met, like today. :sunglasses:

Here in Victoria, we have a Peak/Off-peak tariff structure for Solar system owners. 3pm - 9pm is peak rates (~30c p/kWh) and outside of that is off-peak (~16c p/kWh).

During the winter / low sun months, (April - September), I run our Powerwall 2 in Time-based control mode (it charges up on cheap off-peak power), and the rest of the year I run it in Self-powered mode. This strategy saves us between $1,500 to $2,000 a year off our power bill (used to average $3k p/a) without making any major changes to our usage patterns.

2 Likes

15 posts were split to a new topic: Needed help with a Tesla power wall

Been sick. Exact time of sample is unlikely to be the same for Tesla app and Rule Machine rule [or other app], plus calculation differnces with, for example # of decimal points, means exact replication of results from the two is not likely. I belive my system has an issue of important difference between the manufacturer {LG+Enphase, LG+APsystems} and Tesla app sikar production. I will have get my installer to address.

I just learned about repeating rules and am seeking debugging help--see below. My main comcern is the operarion of the repeating rule and will it accumulate the value I want. Do I need the Cancel and Run actions -- can't I just start the repeating rule by doing a Run Actions in Hubitat on that rule? Is there a better/eaiser way to get what I want?

NOTE: ConvertToPW%Factor is based on 2x powerwall.


The purpose is to set a reserve equal to the amount of non-Solar energy the Home consumed (on the previous day) during a selected 24-hour period. Takes a day sync .

Repeating rule to capture data.

Set Reserve for Partial Peak and Peak.

This code can be used (with appropriate changes) at any time desired as the reference start time.*

Switch to Self-Powered when reserve is remainder.
image

Updated Version(s):

  • TeslaDriver.groovy = 1.2.11
  • TeslaChild.groovy = 1.0.4

Change(s):

  • Correction to the ProcessEvent function to make sure events trigger the changed state properly.
  • Remove the driver-specific attributes "Driver Name", "Driver Status", and "Driver Version" when Save Preferences is run. They have been replaced with ones that do not have spaces in the name.
1 Like

I'm seeing this error constantly now:

[error] Powerwall - Error connecting to Tesla for Registration. 404

Looks like that page went away in a recent firmware update. I'm not sure if there's a new replacement URL, but commenting out the urlget

asynchttpGet( "ParseRegistration", Params )

resolves it for now. Don't remember if there was anything interesting back from that.

As a longer term project, would it be possible to separate the urlgets into slow, once per day updates and faster power related ones?

2 Likes

Thanks for the notice! I am away from my computer for the week so cannot do any coding... But I will look into it when I get back.

If you do not mind I may end up asking you to try some stuff, as I do not have a PowerWall myself...

Howdy, I was also having major issues with errors and loss of connectivity to my Powerwall. And then I found this driver / app:

It’s rock solid and might have useful code to help improve your driver?

One thing I loved about your driver is the huge amount of info I had access to, this driver is much more limited, but on the flip side it allows me to control what mine does.

Eg i grab the solar forecast from SolCast and if it’s going to be a poor day for solar, Hubitat instructs my power wall to charge from cheap off peak power.

I’m happy to test changes for you on my 2nd hub if it helps.

As I understand it, the darwinsden one is cloud based via Tesla servers.
The driver here is direct local connection.

It uses both methods:

1 Like

It can be configured to operate locally.

1 Like

Yep, I use both methods, LAN for direct state monitoring (1 minute updates) and Internet for controlling the PowerWall Mode and reserve levels.

Updated Version(s):

  • TeslaDriver.groovy = 1.2.12
  • TeslaChild.groovy = 1.0.5

Change(s):

  • Removal of customer registration information check.
  • Moved site_info and powerwalls checks (checks to see what the general information of the site as well as how many powerwalls there are) to being performed once a day as these will likely rarely change. The new DailyCheck will not be scheduled until you Save Preferences in the parent device.
  • Correction to remove "Driver Status" attribute in parent and child drivers as this was replaced with DriverStatus (like DriverName and DriverVersion). This will also only take affect when Save Preferences is performed on a device (including children). It does not affect the performance of the driver in any way and is only informational to let you know if a newer driver is available.

Note(s):

  • At this time (June 2024), this driver is still only designed to READ information from Powerwall(s) API. I have not implemented any ability to control the Powerwall in any way as I was concerned about allowing changes to something so potentially critical (and expensive) that I myself have no way of testing. I do know of many of the commands and have samples of what to send... but have so far decided to be cautious about it. If there is indeed a need/desire to allow control from the driver I can look into it more.
4 Likes

Is the timed login/reauthorization working reliably for everyone?

I have an intermittent issue where the powerwall will drop off the network, and after it comes back, the device reports constant 401 errors.
Powerwall - Error connecting to Tesla for System Status. 401
Can one of these trigger a re-login?

If I press login manually, it goes through right away and it's back in business.

No, that’s why I recommended @snell take a look at the authentication in the darwinsden app/driver. It’s local authentication has never failed once for me, and my Powerwall never goes missing from my network.

I think it's just error case handling. The login itself always succeeds,
it just when it gets logged out it doesn't reconnect immediately.

I found it that when it failed, it never reconnected for me.