Tesla Powerwall Controls

The official integration of the Tesla Powerwall (https://www.home-assistant.io/integrations/powerwall/) is great and I use it to get live stats, however this has no control of powerwall functions - I would like to be able to set the powerwall to Backup mode when my electricity is cheap, then back to self consumption when it is not. Using the local API for this is apparently unreliable, but someone has documented the public App service API here on github and specifically the energy.py file has lots of comments showing use of the API with the powerwall. I’ve never written a HA integration and my python isn’t very good else i would try and integrate this directly.

Ideally this could be integrated into the official tesla extension, as an optional “add your tesla credentials for full powerwall controls” rather than just the IP of the gateway for monitoring. You can also pull stats from the public API, which would be great for people who’s powerwall is not on the local network.

Don’t forget to vote for your own request.

I would love to see this.
That way Powerwall users could also set modes based on upcoming weather forecasts.

1 Like

Love the idea. There is so much possibility that opens up if we are able to control the powerwall locally.

There are storage systems from other vendors too. Perhaps similar to a generic thermostat datamodel, they should define a generic battery, solar and EV.

1 Like

Direct http interface allows control to ‘Go On/ Off Grid’ and ‘Stop System’ which presumably could also be included.

4 Likes

A developer question - does anyone know why these countries aren’t possible with the current API use? Is it a permission/credential issue? Or a case of it simply not being implemented?

Even this as the only control would be extremely useful for the reasons mentioned upthread. I have a different set of criteria for utilizing my PWs than what the Tesla app supports and would love the ability to self-consume based on state of charge AND TOU instead of simply TOU rates/times.

Good news, there is a rewrite Home Assistant integration that will provide full control of your powerwall. It is currently in final states of testing and likely to be released wider in the next week.

This rewrite should resolve this request.

The Tesla Custom Integration is now available for testing and provides control and monitoring over Tesla vehicles as well as energy products including powerwall, including changing operating mode, backup reserve. This is a breaking change if you already have the integration installed.

You can install by including as a custom repository in

You need to install the dev version:

Happy to take comments here, but please raise any issues in GitHub.

Thanks @shred & @alandtse

2 Likes

Sounds like I am adopting HA at just the right time.
Controlling my powerwall and car charging is definitely something I want to do. Thanks!

I am fine using a custom repository if that is the right thing to do… but I get the impression that this is about to be released into the “main repository” (whatever that is called) to replace the sensor-only integrations that are there. Is that right? Is there a timeline for that?

If it is soon (a few weeks), I’d like to wait, but if there is going to be a bigger delay for that, I might just use the custom repository.

Thanks so much for doing this btw.

I am in the process of switching from smartthings to HA, and I gotta say… I really like it so far. Every time I sit down and say “I should port that custom ST device driver that I wrote over to HA” it turns out that there is already support for whatever it is, and it is more complete and easier to use than the one I wrote. Very exciting.

1 Like

Just found this new Tesla integration - sounds great.

I’ve been using the old monitoring only integration with my powerwall for a while. What’s the best way to move over to the new one?
What happens to automations that use the current sensor values?
Also don’t really understand the refresh token stuff (maybe it is obvious when you install the new integration?), what’s involved?
Keen not to mess things up, any advice appreciated.
Thanks

You can use both at the same time, so just leave your old one in place, and load up the new one and slowly move your automations across.

Very helpful, thank you.

Will give it a go.

The Custom Tesla integration installed fine - marvellous.
The old integration works locally but this one is cloud polling - is that right? (the reserve power level now agrees with the tesla app - no 4% difference that is there in the local data - hooray)

All the polling info in the docs refers to cars - I only have a Powerwall. Is polling relevant to powerwall only operation? The sensor data seems to be changing every 10-15 seconds. This isn’t critical to anything I just like to understand.

There are two cloud API custom components for install via HACS.

GitHub - carboncoop/tesla-gateway-ha-component: A Home Assistant component to control Tesla Powerwall. - which shouldn’t be used any more as it is unsupported

GitHub - alandtse/tesla: Tesla custom integration for Home Assistant. This requires a refresh token be generated by third-party apps to login. - which is under active management and has a lot of advanced powerwall controls.

There is also the local API integration, which is part of the home assistant core, which doesn’t have the advanced controls.

You can have all or some of these installed at the same time.

1 Like

Great job with this custom integration. It does exactly what I needed it to do!

Now I just need to find a way to control my Tesla Wall Connectors to manage charging my Non-Tesla Cars.

I have powerwalls and a Kona EV and and Zoe EV.

The Zoe charges via an EVSE that is OCPP capable (Schneider Electric EVLink), and the Kona via a dumb unit with no charge control. The Zoe can’t even set an upper limit to the battery charging, so it was important for me to be able to set this in another way.

Whist the ZOE car has no charging control from inside the car, the EVSE it came with from the factory is quite good and it works well through ChargeHQ.com to regulate charge current, although stopping charge can’t be automated by the battery SOC. That system works well with Tesla vehicles, although it can’t talk with non-Tesla cars. In addition to ChargeHQ.com, I call the HV Battery SOC through EVNotify, which Home assistant can collect via RestAPI, and then the EVSE have individual WiFi Circuit Breakers that Home assistant controls to kill the power at the set SOC percentages.

1 Like