Aug 2024 Edit:
Unless your solar is consistently producing over 1200 W excess, I wouldn't use this.
Tesla limits minimum charge rate to 5 amps in the app. Tesla charge on solar feature requires at least consistent 1.2 kW excess before starting.
There must be a reason it's been set at 5 amps. I've had instances where the car would error out and say unstable input voltage or other errors when charging below 5 amps. So it's not recommended.
----------------------------------------------------------------------
Original post:
I've been asked to share how I am charging my Tesla using excess solar. I am using a software solution with a dumb charge point instead of smart charge points like Zappi.
Key is that the Tesla API allows setting any charge current (amps) from 0 up to whatever is allowed by your charge point. So in this sense, it's better than Zappi because through Tesla API, I can adjust down to 0 amps. Zappi only allows down to 6 amps due to charge standards: the charge point must provide 6 amps minimum, but cars can pull any amount of power up to charge point provided amount. 0 and 1 amp is useless because the car consumes about 250w sitting there. But it's useful to have it idle when a momentary thick cloud flys across. My small solar install means I typically charge at around 4 amps, only up to 6 amps in perfect conditions.
You'll need Home Assistant, talking to Tesla API. Plus some way for HA to get smart meter reading, I'm using Glow IHD, which sends MQTT update to HA every 10s.
Please do carefully look at the automations to make sure it does what you need to do.
First, set up an input_number (input_number.tesla_y_charge_amps) for charging amps and a script to apply the charging amps.
I have 3 automations, one to start charging, one to stop charging and one to auto-adjust amps based on excess solar. Start and stop are very simple to do, just need to do "switch.turn_on" for the "switch.car_charger" entity to start charging. You can pre-set charging limit and charging amps before start charging, it is also worth waiting 10-20 seconds between each API call to avoid flooding the server.
Here is the auto-adjust automation, it does the following:
1. trigger: on new smart meter MQTT message
2. condition: car is at home, not night time (avoid messing with overnight cheap tariff)
3. action: wait for another meter data point (10s for me), to avoid spikes
4. then do the charge current increment/decrement, send it to Tesla and wait a time out.
It will not bug Tesla server more than twice a minute if solar production is constantly charging.
End result is that you can make your car track solar production, resolution is about 240w because we are changing charging amps and voltage is at around 240v.
This was very sunny Sunday 28th May, charging was started just after 9am on this day: (yellow is solar production used, purple below 0 is exported, blue on top of yellow is import. I think 11-12 import was due to the oven, with the car idling at 0 amps)
Over last 2 weeks of sunny days, with my small 2.9 kW-p W-E install, I charged 40% of "free" energy, well over 100 miles. Starting from 60% up to 84% with a 10% drive in the middle, then another 6% on Sunday.
Hope this is helpful to you, let's drive on sunshine, right now
Unless your solar is consistently producing over 1200 W excess, I wouldn't use this.
Tesla limits minimum charge rate to 5 amps in the app. Tesla charge on solar feature requires at least consistent 1.2 kW excess before starting.
There must be a reason it's been set at 5 amps. I've had instances where the car would error out and say unstable input voltage or other errors when charging below 5 amps. So it's not recommended.
----------------------------------------------------------------------
Original post:
I've been asked to share how I am charging my Tesla using excess solar. I am using a software solution with a dumb charge point instead of smart charge points like Zappi.
Key is that the Tesla API allows setting any charge current (amps) from 0 up to whatever is allowed by your charge point. So in this sense, it's better than Zappi because through Tesla API, I can adjust down to 0 amps. Zappi only allows down to 6 amps due to charge standards: the charge point must provide 6 amps minimum, but cars can pull any amount of power up to charge point provided amount. 0 and 1 amp is useless because the car consumes about 250w sitting there. But it's useful to have it idle when a momentary thick cloud flys across. My small solar install means I typically charge at around 4 amps, only up to 6 amps in perfect conditions.
You'll need Home Assistant, talking to Tesla API. Plus some way for HA to get smart meter reading, I'm using Glow IHD, which sends MQTT update to HA every 10s.
Please do carefully look at the automations to make sure it does what you need to do.
First, set up an input_number (input_number.tesla_y_charge_amps) for charging amps and a script to apply the charging amps.
YAML:
alias: Tesla Set Charge Amp
mode: restart
sequence:
- service: tesla_custom.api
data:
command: CHARGING_AMPS
parameters:
path_vars:
vehicle_id: "{{ state_attr('binary_sensor.y_online', 'id') }}"
charging_amps: "{{ states('input_number.tesla_y_charge_amps') | int(default=30) }}"
wake_if_asleep: true
Here is the auto-adjust automation, it does the following:
1. trigger: on new smart meter MQTT message
2. condition: car is at home, not night time (avoid messing with overnight cheap tariff)
3. action: wait for another meter data point (10s for me), to avoid spikes
4. then do the charge current increment/decrement, send it to Tesla and wait a time out.
It will not bug Tesla server more than twice a minute if solar production is constantly charging.
YAML:
alias: Tesla - Solar charging adjust
trigger:
- platform: mqtt
topic: glow/+/SENSOR/electricitymeter
condition:
- condition: or
conditions:
- condition: numeric_state
entity_id: sensor.smart_meter_electricity_power_export
above: 160
- condition: numeric_state
entity_id: sensor.smart_meter_electricity_power_import
above: 150
- condition: state
entity_id: device_tracker.tesla_location
state: home
- condition: state
entity_id: switch.y_charger
state: "on"
- condition: sun
before: sunset
after: sunrise
action:
- wait_for_trigger:
- platform: mqtt
topic: glow/+/SENSOR/electricitymeter
timeout:
hours: 0
minutes: 0
seconds: 11
milliseconds: 0
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.smart_meter_electricity_power_export
above: 930
sequence:
- service: input_number.increment
data: {}
target:
entity_id: input_number.tesla_y_charge_amps
- service: input_number.increment
data: {}
target:
entity_id: input_number.tesla_y_charge_amps
- service: input_number.increment
data: {}
target:
entity_id: input_number.tesla_y_charge_amps
- service: input_number.increment
data: {}
target:
entity_id: input_number.tesla_y_charge_amps
- conditions:
- condition: numeric_state
entity_id: sensor.smart_meter_electricity_power_export
above: 690
sequence:
- service: input_number.increment
data: {}
target:
entity_id: input_number.tesla_y_charge_amps
- service: input_number.increment
data: {}
target:
entity_id: input_number.tesla_y_charge_amps
- service: input_number.increment
data: {}
target:
entity_id: input_number.tesla_y_charge_amps
- conditions:
- condition: numeric_state
entity_id: sensor.smart_meter_electricity_power_export
above: 460
sequence:
- service: input_number.increment
data: {}
target:
entity_id: input_number.tesla_y_charge_amps
- service: input_number.increment
data: {}
target:
entity_id: input_number.tesla_y_charge_amps
- conditions:
- condition: numeric_state
entity_id: sensor.smart_meter_electricity_power_export
above: 140
sequence:
- service: input_number.increment
data: {}
target:
entity_id: input_number.tesla_y_charge_amps
- conditions:
- condition: numeric_state
entity_id: sensor.smart_meter_electricity_power_import
above: 930
sequence:
- service: input_number.decrement
data: {}
target:
entity_id: input_number.tesla_y_charge_amps
- service: input_number.decrement
data: {}
target:
entity_id: input_number.tesla_y_charge_amps
- service: input_number.decrement
data: {}
target:
entity_id: input_number.tesla_y_charge_amps
- service: input_number.decrement
data: {}
target:
entity_id: input_number.tesla_y_charge_amps
- conditions:
- condition: numeric_state
entity_id: sensor.smart_meter_electricity_power_import
above: 690
sequence:
- service: input_number.decrement
data: {}
target:
entity_id: input_number.tesla_y_charge_amps
- service: input_number.decrement
data: {}
target:
entity_id: input_number.tesla_y_charge_amps
- service: input_number.decrement
data: {}
target:
entity_id: input_number.tesla_y_charge_amps
- conditions:
- condition: numeric_state
entity_id: sensor.smart_meter_electricity_power_import
above: 460
sequence:
- service: input_number.decrement
data: {}
target:
entity_id: input_number.tesla_y_charge_amps
- service: input_number.decrement
data: {}
target:
entity_id: input_number.tesla_y_charge_amps
- conditions:
- condition: numeric_state
entity_id: sensor.smart_meter_electricity_power_import
above: 140
sequence:
- service: input_number.decrement
data: {}
target:
entity_id: input_number.tesla_y_charge_amps
default:
- stop: ""
- service: script.turn_on
data: {}
target:
entity_id: script.tesla_set_charge_amp
- delay:
hours: 0
minutes: 0
seconds: 18
milliseconds: 0
mode: single
max_exceeded: silent
This was very sunny Sunday 28th May, charging was started just after 9am on this day: (yellow is solar production used, purple below 0 is exported, blue on top of yellow is import. I think 11-12 import was due to the oven, with the car idling at 0 amps)
Over last 2 weeks of sunny days, with my small 2.9 kW-p W-E install, I charged 40% of "free" energy, well over 100 miles. Starting from 60% up to 84% with a 10% drive in the middle, then another 6% on Sunday.
Hope this is helpful to you, let's drive on sunshine, right now