Tesla Powerwall Controls

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

3 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

Considering getting Powerwall 3 installed. Can I ask how does each of the controls work?

I want to do the following automations:

  1. How do I force PW to stop doing anything and go idle via HA? (eg. let house consume from the grid, use-case: when my Tesla is being asked by energy provider Octopus to charge on their Intelligent Go tariff)
  2. How do I force PW to charge via HA?
  3. How do I set overnight charge limit to leave space to capture solar excess via HA?
  4. Not HA, can the powerwall allow export of solar excess but match load when import is detected. (eg. to avoid paying import pricing but get paid for exporting solar excess) Is there a mode for this?

Set backup reserve % to match current state of charge % and the battery will no longer be discharged for home load.

  • How do I force PW to charge via HA?

Set backup reserve % > SOC % and will charge at 1.7 kW per battery
Set operating mode to ‘backup’ will charge at 3.7 kW per battery
Set operating mode to Time Base Control/ Autonomous with a OFFPEAK utility tariff, will charge at 5 kW per battery.

  • How do I set overnight charge limit to leave space to capture solar excess via HA?

Leave backup reserve % low to allow headroom, or utilise a more comprehensive optimisation scheduler like EMHASS: An Energy Management for Home Assistant

  • Not HA, can the powerwall allow export of solar excess but match load when import is detected. (eg. to avoid paying import pricing but get paid for exporting solar excess) Is there a mode for this?

Switch AllowedExports mode to PV only.

1 Like

Thank you so much for detailed answers. So Tesla powerwall can do all those things, just though a convoluted way rather than a direct “charge” or “upper charge limit” setting. I was getting really confused by their demo app.

Finally how can I force PW to discharge? What rate (kW) does it do discharge?

Discharge is the biggest workaround.

Powerwall will export in TBC mode, provided your utility rate plan has a high export price during PEAK, exports are generally 5 kW per battery.

1 Like

Thank you very much.

For anyone else searching, I’ve also got answers from Tesla custom integration discussions:

This is great, thanks. Ive been able to use this to get my EV charger and Powerwall link together with the Intelligent Octopus tariff that I’m on for electric in the UK.

Can i just check that we still need to use the ‘dev’ version of this?

1 Like