Force charge and force discharge your Powerwall

There's one thing Powerwall owners have wanted for a long time that Tesla has never offered: a way to just tell the battery to charge or discharge. Tesla's app and the Fleet API let you change settings like the operation mode, the backup reserve and your tariff, but there is no command to charge or discharge. If you wanted the battery to charge from the grid when power was cheap, or export when it was expensive, you had to change modes or upload a fake tariff and hope the Powerwall made the decision you wanted.
That changes now. For the first time, customers can force charge and force discharge their Powerwall, at a power they choose, for as long as they choose, using Home Assistant locally. It came together in a few days, on top of a year of groundwork from people across the community, so here's how it happened.
It started with Tesla-API and pypowerwall
Sending any command to a Powerwall on your local network starts with the gateway trusting you. Matthew1471's Tesla-API project worked out the RSA key pairing behind that trust, and back in November 2025 its protobuf documentation identified, but never implemented, the gateway's dispatch battery power command, the one this whole post is about.
Jason Cox's pypowerwall built on that research, crediting Matthew1471 for the key pairing discovery, and in February 2026 added the signed "v1r" local connection used to send commands. A lot of local Powerwall projects stand on that work, PowerSync and Teslemetry's aiopowerwall among them.
It was hiding in tesla-protocol
Back in July 2026 I published tesla-protocol, an open set of Tesla protobuf definitions discovered by the community and observed in our own reasearch. The repository primarily covers Tesla vehicles, but also including the messages the Powerwall gateway speaks locally. Without realising it at the time, it has the full definition of the timed battery command, TEGAPIDispatchBatteryPowerRequest: a power in watts and a duration in seconds, or a request to resume normal operation.
It was buried in a large set of other commands that I didn't have time to focus on, so what's even more exciting about this discovery is that there is likely much more capability just waiting to be unlocked for local Powerwall control.
PowerSync brought it to customers
bolagnaise builds PowerSync, a Home Assistant integration for syncing electricity prices and optimising home batteries. Scotty (cool.scotty), a member of the PowerSync (and Teslemetry) Discord, was the first to try the command on a real gateway and found that it worked: charge or discharge at a set power for a set time, after which the Powerwall goes back to normal by itself. bolagnaise then built it into PowerSync.
On October 23, PowerSync v2.12.1468 shipped local Force Charge, Force Discharge and Smart Optimisation using those direct gateway power commands, making PowerSync the first Home Assistant integration to offer it. It was tested on a Powerwall 3, and PowerSync customers have been testing and iterating on this over the days since its release.
Fast following
The same day PowerSync shipped, I added the command to aiopowerwall, our async take on pypowerwall that powers Teslemetry's local Powerwall support, built from our existing published definitions (#28). Then I tested it on my own Powerwall 3 (#29). Within a few seconds of the command the battery went from charging on solar to the power I asked for, discharging worked the same way, and when the time ran out the Powerwall returned to normal operation on its own. A resume command hands control back early, and sending a new command replaces the old one. It works.
Coming to Home Assistant
The Teslemetry integration in Home Assistant already supports local Powerwall control. Two new actions build on it, and the pull request (#188303) has been merged into Home Assistant core:
- Teslemetry: Dispatch battery power charges or discharges the Powerwall at a set power, in watts, for a set time, in seconds. A positive value discharges, a negative value charges, and when the time is up the Powerwall returns to its normal operation by itself.
- Teslemetry: Resume battery operation ends a dispatch early and hands control straight back to the Powerwall.
# Charge at 5 kW for 30 minutes
action: teslemetry.dispatch_battery_power
data:
device_id: 0d462c0c4c0b064b1a91cdbd1ffcbd31
power: -5000
duration: 1800
Both actions go straight to the gateway over your local network, so your energy site needs to be paired for local control first. Your Powerwall still applies its own backup reserve and grid limits, and the action needs gateway firmware that supports battery dispatch. So far it has only been tested on Powerwall 3.
This will arrive in the Home Assistant 2026.11 release. If you don't want to wait, the actions are already in the Teslemetry HACS beta, so you can try them today.
Install the HACS betaAs far as I know, Home Assistant is the only consumer platform in the world that can force charge and force discharge a Tesla Powerwall. Charge from the grid when prices go negative, or export during a demand response event, all from an automation you control. I can't wait to see what you build with it.
Thank you
This is what happens when people share what they learn. Thank you to:
- Matthew1471, whose Tesla-API work gave us the RSA key pairing research and first documented the dispatch battery power command.
- Jason Cox and everyone working on pypowerwall, for the local groundwork.
- Scotty, a customer we're lucky to share with PowerSync, for being the first to try the command and test it.
- bolagnaise, for getting it into customers' hands in PowerSync.
- @gjohansson-ST, for reviewing and merging it into Home Assistant.
- The entire Home Assistant core team, for all the hard work that goes into maintaining that project.
- Finally, my Teslemetry customers. Without your support of Teslemetry, none of this research and development would be possible.
As always, let me know how it goes on Discord.