Add support for Tesla Powerwall

I am now setting the backup reserve % using the rewrite integration.

You need to call the number.set_value service.

See my automation below with the legacy tesla_gateway.set_reserve service (enabled: false) and the number.set_value service. This automation sets backup reserve to the current value of my sensor.soc_batt_forecast, which is set by the EMHASS add-on: An energy management optimization add-on for Home Assistant OS and supervised, but you should be able to hard code your values.

You can also check by manually calling number.set_value service from Developer Tools.

The advantage of using this new service call is you receive confirmation to what the value has been changed to.

alias: Battery SOC Forecast
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.soc_batt_forecast
condition: []
action:
  - service: tesla_gateway.set_reserve
    data:
      backup_reserve_percent: "{{states('sensor.soc_batt_forecast')|int(0)-5}}"
    enabled: false
  - service: number.set_value
    data:
      value: "{{states('sensor.soc_batt_forecast')|int(0)-5}}"
    target:
      entity_id: number.home_energy_gateway_backup_reserve
mode: single