Smart EV Charging: Save 40% on Electricity Costs

Discover how to automatically optimize your electric vehicle charging schedule using Home Assistant. Learn to integrate dynamic pricing, solar production, and battery management for maximum savings.

Electric vehicle ownership comes with many benefits, but one challenge that catches many new EV owners off-guard is the impact on their electricity bill. A typical EV can add $50-150 to your monthly energy costs if charged inefficiently. However, with smart automation through Home Assistant, you can dramatically reduce these costs while actually improving your charging experience.

💰 Real Savings Example

One of our community members reduced their EV charging costs from €180/month to €108/month (40% savings) by implementing the automations covered in this guide. Their setup automatically charges during off-peak hours and prioritizes free solar energy when available.

The Problem with Dumb Charging

Most EV owners simply plug in when they get home, typically between 5-7 PM. This is precisely when electricity is most expensive in many markets due to peak demand pricing. Additionally, this charging pattern:

Smart Charging Fundamentals

Intelligent EV charging optimization focuses on three key principles:

1. Time-Based Optimization

Schedule charging during off-peak hours when electricity rates are lowest. In many European markets, this can mean rates as low as €0.05/kWh at night versus €0.35/kWh during peak hours.

2. Solar-First Charging

Prioritize charging when your solar panels are producing excess energy. This essentially provides "free" charging from your own renewable generation.

3. Grid-Aware Charging

Dynamically adjust charging rates based on grid conditions, pricing signals, and your household's total energy demand.

Prerequisites and Hardware

Before implementing smart charging, you'll need:

Compatible Charger

The foundation of smart charging is a controllable charger. Popular Home Assistant-compatible options include:

Energy Monitoring

Essential for optimal charging decisions:

💡 Pro Tip

If you're planning to install solar panels, consider doing so before implementing smart EV charging. The combination provides the highest savings potential and fastest return on investment.

Basic Time-of-Use Charging

Let's start with a simple automation that charges your EV during off-peak hours. This alone can save 20-30% on charging costs.

Setting Up Rate Periods

First, define your utility's rate periods:

# configuration.yaml input_select: electricity_rate_period: name: "Current Rate Period" options: - "Peak" - "Shoulder" - "Off-Peak" initial: "Peak" sensor: - platform: template sensors: current_electricity_rate: friendly_name: "Current Rate" unit_of_measurement: "€/kWh" value_template: > {% set period = states('input_select.electricity_rate_period') %} {% if period == 'Peak' %} 0.31 {% elif period == 'Shoulder' %} 0.18 {% else %} 0.09 {% endif %}

Rate Period Automation

# automations.yaml - alias: "Set Off-Peak Rate" trigger: - platform: time at: "22:00:00" action: - service: input_select.select_option target: entity_id: input_select.electricity_rate_period data: option: "Off-Peak" - alias: "Set Peak Rate" trigger: - platform: time at: "07:00:00" action: - service: input_select.select_option target: entity_id: input_select.electricity_rate_period data: option: "Peak" - alias: "Set Shoulder Rate" trigger: - platform: time at: "14:00:00" action: - service: input_select.select_option target: entity_id: input_select.electricity_rate_period data: option: "Shoulder"

Smart Charging Automation

- alias: "Smart EV Charging Control" trigger: - platform: state entity_id: input_select.electricity_rate_period - platform: state entity_id: device_tracker.my_ev to: "home" - platform: numeric_state entity_id: sensor.ev_battery_level below: 80 condition: - condition: state entity_id: device_tracker.my_ev state: "home" - condition: numeric_state entity_id: sensor.ev_battery_level below: 80 action: - choose: - conditions: - condition: state entity_id: input_select.electricity_rate_period state: "Off-Peak" sequence: - service: switch.turn_on entity_id: switch.ev_charger - service: notify.mobile_app data: title: "EV Charging Started" message: "Charging at off-peak rate (€{{ states('sensor.current_electricity_rate') }}/kWh)" - conditions: - condition: state entity_id: input_select.electricity_rate_period state: "Peak" sequence: - service: switch.turn_off entity_id: switch.ev_charger - service: notify.mobile_app data: title: "EV Charging Paused" message: "Waiting for off-peak rates to resume charging" default: - service: switch.turn_on entity_id: switch.ev_charger

Solar-Integrated Charging

If you have solar panels, you can achieve even greater savings by prioritizing solar charging. This approach can provide essentially free charging during sunny days.

Solar Surplus Calculation

sensor: - platform: template sensors: solar_surplus: friendly_name: "Solar Surplus" unit_of_measurement: "W" value_template: > {% set solar_production = states('sensor.solar_power')|float %} {% set house_consumption = states('sensor.house_power')|float %} {% set surplus = solar_production - house_consumption %} {{ surplus if surplus > 0 else 0 }} ev_charging_from_solar: friendly_name: "EV Charging from Solar" unit_of_measurement: "%" value_template: > {% set ev_power = states('sensor.ev_charger_power')|float %} {% set solar_surplus = states('sensor.solar_surplus')|float %} {% if ev_power > 0 %} {{ ((solar_surplus / ev_power) * 100)|round(0)|int if ev_power <= solar_surplus else 0 }} {% else %} 0 {% endif %}

Dynamic Solar Charging

- alias: "Solar-First EV Charging" trigger: - platform: state entity_id: sensor.solar_surplus - platform: state entity_id: device_tracker.my_ev to: "home" condition: - condition: state entity_id: device_tracker.my_ev state: "home" - condition: numeric_state entity_id: sensor.ev_battery_level below: 85 - condition: sun after: sunrise before: sunset action: - choose: # High solar surplus - charge at full rate - conditions: - condition: numeric_state entity_id: sensor.solar_surplus above: 5000 sequence: - service: number.set_value target: entity_id: number.ev_charger_current data: value: 32 - service: switch.turn_on entity_id: switch.ev_charger # Medium surplus - reduce charging rate - conditions: - condition: numeric_state entity_id: sensor.solar_surplus above: 2000 below: 5000 sequence: - service: number.set_value target: entity_id: number.ev_charger_current data: value: 16 - service: switch.turn_on entity_id: switch.ev_charger # Low surplus - minimum charging - conditions: - condition: numeric_state entity_id: sensor.solar_surplus above: 1400 below: 2000 sequence: - service: number.set_value target: entity_id: number.ev_charger_current data: value: 6 - service: switch.turn_on entity_id: switch.ev_charger # Insufficient surplus - stop charging (unless off-peak) default: - condition: not conditions: - condition: state entity_id: input_select.electricity_rate_period state: "Off-Peak" - service: switch.turn_off entity_id: switch.ev_charger

💡 Advanced Tip

Consider implementing a "learning" algorithm that tracks your driving patterns and adjusts charging schedules based on historical departure times and required charge levels. This prevents situations where you need to leave but the car isn't sufficiently charged.

Advanced Features

Dynamic Pricing Integration

For markets with real-time pricing, integrate live electricity rates:

# Add Nordpool integration for dynamic pricing sensor: - platform: nordpool region: "DE" currency: "EUR" - platform: template sensors: cheapest_hours_today: friendly_name: "Cheapest 4 Hours Today" value_template: > {% set prices = state_attr('sensor.nordpool_kwh_de_eur_3_10_021', 'raw_today') %} {% set sorted_prices = prices | sort(attribute='value') %} {{ sorted_prices[:4] | map(attribute='hour') | list }}

Emergency Override

Always include manual overrides for emergency situations:

input_boolean: ev_emergency_charge: name: "Emergency EV Charge" icon: mdi:car-emergency automation: - alias: "Emergency EV Charge Override" trigger: - platform: state entity_id: input_boolean.ev_emergency_charge to: "on" action: - service: switch.turn_on entity_id: switch.ev_charger - service: number.set_value target: entity_id: number.ev_charger_current data: value: 32 - delay: "02:00:00" # Auto-disable after 2 hours - service: input_boolean.turn_off entity_id: input_boolean.ev_emergency_charge

Battery Integration

If you have a home battery system, coordinate charging to maximize efficiency:

- alias: "Coordinated Battery and EV Charging" trigger: - platform: state entity_id: sensor.battery_soc - platform: state entity_id: input_select.electricity_rate_period condition: - condition: state entity_id: device_tracker.my_ev state: "home" action: - choose: # If battery is full and rates are cheap, charge EV - conditions: - condition: numeric_state entity_id: sensor.battery_soc above: 95 - condition: state entity_id: input_select.electricity_rate_period state: "Off-Peak" sequence: - service: switch.turn_on entity_id: switch.ev_charger # If battery is low, prioritize battery charging - conditions: - condition: numeric_state entity_id: sensor.battery_soc below: 20 sequence: - service: switch.turn_off entity_id: switch.ev_charger

Monitoring and Optimization

Create a dashboard to track your charging efficiency and savings:

# Dashboard configuration type: vertical-stack cards: - type: horizontal-stack cards: - type: entity entity: sensor.ev_battery_level name: "EV Battery" - type: entity entity: sensor.current_electricity_rate name: "Current Rate" - type: entity entity: sensor.ev_charging_from_solar name: "Solar Charging" - type: history-graph entities: - sensor.ev_charger_power - sensor.solar_surplus hours_to_show: 24 - type: statistics-graph entities: - sensor.daily_ev_charging_cost days_to_show: 30 stat_types: - mean - min - max

Measuring Your Savings

Track the effectiveness of your smart charging setup:

sensor: - platform: template sensors: monthly_ev_charging_savings: friendly_name: "Monthly EV Charging Savings" unit_of_measurement: "€" value_template: > {% set kwh_charged = states('sensor.monthly_ev_energy')|float %} {% set peak_rate = 0.31 %} {% set actual_cost = states('sensor.monthly_ev_cost')|float %} {% set peak_cost = kwh_charged * peak_rate %} {{ (peak_cost - actual_cost)|round(2) }} ev_charging_efficiency: friendly_name: "Charging Efficiency" unit_of_measurement: "%" value_template: > {% set solar_kwh = states('sensor.monthly_ev_solar_charging')|float %} {% set total_kwh = states('sensor.monthly_ev_energy')|float %} {{ ((solar_kwh / total_kwh) * 100)|round(1) if total_kwh > 0 else 0 }}

Troubleshooting Common Issues

Charger Not Responding

Inconsistent Solar Charging

Rate Period Misalignment

🎯 Optimization Results

After implementing these strategies, typical users see:

  • 30-40% reduction in EV charging costs
  • 60-80% of charging powered by solar (when available)
  • Reduced grid strain during peak hours
  • Extended battery life through optimized charging patterns

Future Enhancements

As your system matures, consider these advanced features:

Smart EV charging is one of the most impactful home automation projects you can implement. The combination of significant cost savings, environmental benefits, and improved convenience makes it an essential component of any smart home energy strategy.

⚠️ Safety Reminder

Always follow local electrical codes and regulations when installing EV charging equipment. Have a qualified electrician verify your installation, especially for high-amperage chargers. Never modify charging equipment beyond manufacturer specifications.