Create an automation, which you can then run manually to test. Under that Actions part set the following.
action type set to āCall serviceā
service set to āTesla Gateway: set_operationā
service data set to something like this;
service: tesla_gateway.set_operation
data: null
real_mode: self_consumption
backup_reserve_percent: 15
You can set the real_mode to either āself_consumptionā (Self-Powered), āautonomousā (Time-Based Control) or ābackupā (Backup).
Backup mode no longer exists in the Tesla app which means that if you set it to backup mode, then go in to the app, it will reset it back to Self-Powered mode. The only way to check that it goes to Backup Mode is to look at power consumption via a different app. I have MyEnergi devices so can check charging of the battery via the MyEnergi app. This issue will catch you out if you check your Tesla app halfway through the night!
Also if you set the real_mode to backup then it doesnāt matter what backup_reserve_percent is set to as it will always put it to 100.
Why would you use all these variations? Self-Powered only charges the powerwall at 1.7kW. Autonomous charges the battery at 5kW. Backup charges the battery at 3.3kW. If you are on a tariff like Octopus Go then you only have 4 hours of off-peak electric. 1.7kW x 4 hours = 6.8kW total recharge, a half full (or empty!) battery.
Backup mode charges at a sensible charge of 3.3kW but over 4 hours will only charge 13.2kW, so can sometime charge just short of 100% dependant on how much you have depleted the battery the previous day. However if you set the real_mode to backup then it doesnāt matter what backup_reserver_percent is set to in the configuration, it will always set to 100.
For both self_consumption and autonomous the backup_reserve_percent can be set to the desired amount.
Autonomous mode charges up at 5kW (dependant on the Tesla forecast). I use autonomous mode if I am trying to charge to a percentage between 50 and 100, as up to 50% and 100% I can use either other mode to charge accurately to these levels. Autonomous is the fastest so will charge more than self_consumption but if i set the reservce to 75%, the Powerwall āforecastingā may decide that I need 90%, so although I have the reserve set to 75% in this example the battery will charge to 90%. Also fastest might not be best for the batteries long term health!
If you want to take this further then you can intergrate this with a solar forcast, and then automate your battery charge level over night dependant on the solar forecast. I stress the solar forecasts are only forecasts and can occationally be wildly in accurate. I find in the occasion that they do under or over estimate power generation, that I can change my usage. The benefit of integrating solar forecasting is that I am not changing the charge level every day in Home Assistant.
Hope this helps. Tesla have made this much harder than necessary, but at least it is still possible thanks to the dev that started this! I wish they just added this functionality to the app in the first place!