In today’s world, smart home technology is revolutionizing how we live, making our homes more efficient, comfortable, and sustainable. One of the most exciting applications of smart home technology is electric vehicle (EV) charging. By leveraging Home Assistant and a few powerful plugins, you can optimize your EV charging to take advantage of cheap electricity rates, saving money and energy.
Why Smart Charging?
Smart charging allows you to charge your EV when electricity is cheapest, typically during off-peak hours. This not only reduces your electricity bill but also helps balance the grid by shifting demand away from peak times. With the right setup, you can automate this process, ensuring your EV is always ready to go without any manual intervention.
Setting Up Home Assistant for Smart Charging
Home Assistant is an open-source home automation platform that puts local control and privacy first. It integrates with a wide range of devices and services, making it the perfect hub for your smart home. To get started with smart charging, you’ll need to install Home Assistant and a few key plugins:
- EV Smart Charging Plugin: This plugin, developed by Jonas B. Karlsson, allows you to schedule your EV charging based on electricity prices and your driving needs. You can find it here.
- Easee Home Assistant Integration: If you have an Easee charger, this plugin will enable you to control and monitor your charger directly from Home Assistant. Check it out here.
- Nordpool Integration: To get real-time electricity prices, you’ll need the Nordpool integration. This plugin fetches electricity prices from the Nordpool market, allowing you to automate your charging based on the most current rates. You can find it here.
Step-by-Step Guide to Smart Charging
- Install Home Assistant: If you haven’t already, install Home Assistant on a Raspberry Pi, a virtual machine, or any other compatible device. Follow the official installation guide for detailed instructions.
- Add the Plugins: Use the Home Assistant Community Store (HACS) to add the EV Smart Charging, Easee, and Nordpool plugins. If you don’t have HACS installed, you can follow the HACS installation guide.
- EV Smart Charging Plugin: After installing HACS, go to HACS > Integrations > Explore & Add Repositories, and search for “EV Smart Charging”. Click on the plugin and follow the installation instructions.
- Easee Home Assistant Integration: Similarly, search for “Easee” in HACS and install the plugin.
- Nordpool Integration: Search for “Nordpool” in HACS and install the plugin.
- Configure the Plugins: Once installed, configure each plugin according to your needs.
- EV Smart Charging Plugin:
- Go to Configuration > Integrations > Add Integration and search for “EV Smart Charging”.
- Enter your EV’s charging parameters, such as battery capacity, desired charge level, and charging power.
- The plugin will automatically schedule your charging sessions based on the electricity prices fetched by the Nordpool integration.
- Easee Plugin:
- Go to Configuration > Integrations > Add Integration and search for “Easee”.
- Enter your Easee account credentials to link your charger.
- Configure the charger settings, such as maximum charging current and preferred charging times.
- Nordpool Plugin:
- Go to Configuration > Integrations > Add Integration and search for “Nordpool”.
- Set your location to fetch the correct electricity prices.
- Configure the price sensors to monitor real-time electricity prices.
- EV Smart Charging Plugin:
Advanced Automation: Calendar-Based Charging
For more advanced automation, you can use calendar events to determine the optimal charging time. Here’s an example script that sets the charging time based on your calendar events:
alias: DS3 charge time end
sequence:
- alias: Fetch next calendar event
variables:
event_1_start: >-
{{
state_attr('calendar.your_calendar_1', 'start_time') }}
event_2_start: "{{ state_attr('calendar.your_calendar_2', 'start_time') }}"
event_2_title: "{{ state_attr('calendar.your_calendar_2', 'message') }}"
valid_event_2: |-
{{ event_2_title is not none and
( 'Night Shift' in event_2_title or
'Work night' in event_2_title or
'Work evening' in event_2_title ) }}
next_event: >-
{% set events = [] %} {% if event_1_start is not none %}
{% set events = events + [as_datetime(event_1_start)] %}
{% endif %} {% if valid_event_2 and event_2_start is not none %}
{% set events = events + [as_datetime(event_2_start)] %}
{% endif %} {% set sorted_events = events | sort %} {{ sorted_events[0]
if sorted_events | length > 0 else None }}
- condition: template
value_template: "{{ next_event is not none }}"
- alias: Calculate charge time and round down
variables:
charge_time: |-
{{
(as_datetime(next_event) - timedelta(hours=1))
.replace(minute=0, second=0, microsecond=0)
.strftime('%H:%M')
}}
- alias: Set charge time
action: select.select_option
target:
entity_id: select.ev_smart_charging_charge_completion_time
data:
option: "{{ charge_time }}"
description: Set EV Smart Charging time based on calendar
icon: mdi:car-clock
Explanation of the Script:
- Fetch the next calendar event: This step retrieves the start times of the next events from two calendars and checks if the events are relevant (e.g., work shifts).
- Calculate charge time and round down: This calculates the optimal charging time by subtracting one hour from the start time of the next event and rounding down to the nearest hour.
- Set charge time: This sets the calculated charge time in the EV Smart Charging plugin.
- Note: You need an automation to run the script. For example, you can run the script once a day, or after a calendar event ends.
Benefits of Smart Charging
- Cost Savings: By charging your EV during off-peak hours, you can significantly reduce your electricity bill.
- Convenience: Automating your charging schedule means you never have to worry about plugging in your car at the right time.
- Sustainability: Smart charging helps reduce the strain on the grid during peak times, contributing to a more sustainable energy system.
Conclusion
Smart home technology offers incredible opportunities to enhance our daily lives, and smart charging is a perfect example of this. By using Home Assistant and the right plugins, you can ensure your EV is always charged efficiently and cost-effectively. Start your smart charging journey today and enjoy the benefits of a truly connected home.