Configuration - flashg1/evSolarCharger GitHub Wiki

Different inverter brands and charger API working with evSolarCharger

To help the community, please let people know your inverter brand and charger API you got working with evSolarCharger.

How to set up home location in HA?

Home location must be defined in HA in order for HA to detect Tesla is at home. Settings > System > General > Edit location

Create charger effective voltage sensor for 3-phase system

Assuming your system has following entities, eg.

  • sensor.line_voltage
  • sensor.number_of_active_lines
Settings > Devices & services > Helpers > Create helper > Template > Template a sensor >
Name: Charger effective voltage
State template: {{ states('sensor.line_voltage') | float * states('sensor.number_of_active_lines') | int }}
Unit of measurement: V
Device class: Voltage
State class: Measurement

See note from @andrut1291 for 3-phase detection using Tesla Fleet API hidden entity "binary_sensor.charger_has_multiple_phases".

Daily car charge limit settings

  • If set daily car charge limit is toggled off, charge limit will be set according to the Tesla app.
  • If set daily car charge limit is toggled on and charge car based on weather is disabled, charge limit will be set according to the limit configured for the day.
  • If set daily car charge limit is toggled on and charge car based on weather is enabled, charge limit will be adjusted to the highest limit set within the rainy forecast period taking into account the car charge limit on bad weather setting.
  • Automatically adjust to a higher charge limit today if today has no charge completion time and next 3 days have higher charge limit. The day before the highest charge limit day will be set to 5% below the highest charge limit, otherwise it will be set to (N*10)% below the highest charge limit where N is the number of days before the highest charge limit day. The objective is to reduce charge limit difference between days to make it easier to achieve charge limit goals.
  • If charge car based on weather is enabled, daily car charge limit and weather provider settings must be configured.

How to determine battery maximum charge speed?

To determine battery maximum charge speed in charge level percentage rise per hour, calculate how long it takes for the charge level to increase by one percent when charging battery using maximum current. Do it a few times to get an average.

Suggest to get the required data using trace file from an actual charging session. See below for sample output and calculation. Use nowTime and e_batteryLevel values to determine duration required to increase battery level by one percent. Before starting the session, toggle on charge from grid and set minimum charge current to your maximum charge current value.

egrep debug_newStates [trace file]

            "debug_newStates": "nowTime = 2025-05-04 13:02:59.515611+10:00\ne_stopCharger = off\ne_useSecondaryPowerSource = off\ne_sunElevation = 37.78\ne_evHomeState = home\ne_chargerConnectState = on\ne_chargerSwitch = on\ne_chargerChargeState = on\ne_evBatteryLevel = 55\ne_evChargeLimit = 60",
.
.
            "debug_newStates": "nowTime = 2025-05-04 13:13:12.930801+10:00\ne_stopCharger = off\ne_useSecondaryPowerSource = off\ne_sunElevation = 36.82\ne_evHomeState = home\ne_chargerConnectState = on\ne_chargerSwitch = on\ne_chargerChargeState = on\ne_evBatteryLevel = 56\ne_evChargeLimit = 60"
.
.
            "debug_newStates": "nowTime = 2025-05-04 13:22:33.603566+10:00\ne_stopCharger = off\ne_useSecondaryPowerSource = off\ne_sunElevation = 36.1\ne_evHomeState = home\ne_chargerConnectState = on\ne_chargerSwitch = on\ne_chargerChargeState = on\ne_evBatteryLevel = 57\ne_evChargeLimit = 60"

Example maximum charge speed calculation for 15A maximum charge current:

{% set time1 = '2025-05-04 13:02:59.515611+10:00' %}
{% set time2 = '2025-05-04 13:13:12.930801+10:00' %}
{% set time3 = '2025-05-04 13:22:33.603566+10:00' %}
{% set speed1 = 60 * 60 / (time2 | as_timestamp - time1 | as_timestamp) %}
{% set speed2 = 60 * 60 / (time3 | as_timestamp - time2 | as_timestamp) %}
{% set avSpeed = (speed1 + speed2) / 2 %}
Battery maximum charge speed to 56% = {{ speed1 }} percent/hour
Battery maximum charge speed to 57% = {{ speed2 }} percent/hour
Average battery maximum charge speed = {{ avSpeed }} percent/hour
onePercentChargeDuration: {{ 60 * 60 / avSpeed }} seconds

Result:
Battery maximum charge speed to 56% = 5.868781958446128 percent/hour
Battery maximum charge speed to 57% = 6.420857627877997 percent/hour
Average battery maximum charge speed = 6.144819793162062 percent/hour
onePercentChargeDuration: 585.8593288620228 seconds

Note: Trace file only records the last 20 iterations. See here on how to get the trace file.

Tesla Fleet API charging status not up-to-date

I am not using Tesla Fleet API, so I am not sure what configuration is required for Tesla Fleet API to work with evSolarCharger. I suspect charging status might not be up-to-date during the charging process. If so, I suggest to create a helper button and assign to "EV button force update Home Assistant" when configuring the Blueprint. See vehicle sleep for polling and cost. Happy for any user feedback for improvement.

This might not be required. See discussion.

Create the button, eg.

  - entity: input_button.[YourEvName]_tesla_fleet_api_update_ha

Create automation for the button, eg.

alias: [YourEvName] Tesla Fleet API update HA
description: Tesla Fleet API update HA on button press.
triggers:
  - trigger: state
    entity_id:
      - input_button.[YourEvName]_tesla_fleet_api_update_ha
conditions: []
actions:
  - action: homeassistant.update_entity
    data:
      entity_id:
        - sensor.[YourEvName]_charging
mode: single

Charge mutiple EVs at the same time based on power allocation weighting for each car

Note: This is theoretical only since I don't have 2 EVs to test this, but happy for any feedback. To ensure power is allocated according to weighting, the "Main power net" update cycle should be the same as the script looping cycle, ie. 1 minute.

  • Create power allocation weighting for each car. For example, to create for car1,
Settings > Devices & services > Helpers > Create helper > Number >
Name: Car1 power allocation weight
Minimum value: 1
Maximum value: 10
  • Create power allocation sensor for each car. For example, to create power allocation sensor for car1 assuming we have car1 and car2,
Settings > Devices & services > Helpers > Create helper > Template > Template a sensor >
Name: Car1 power allocation
State template: {{ states('sensor.main_power_net')|int * states('input_number.car1_power_allocation_weight')|int / (state_attr('automation.car1_solar_charger_automation', 'current') * states('input_number.car1_power_allocation_weight')|int + state_attr('automation.car2_solar_charger_automation', 'current') * states('input_number.car2_power_allocation_weight')|int) }}
Unit of measurement: W
Device class: Power
State class: Measurement
  • Use the power allocation sensors defined above as input to "Main power net" in each car's Blueprint.