🚗 Tesla Dynamic Charging (Ford, Mercedes… any EV) Automation

Dynamic EV Charging Automation for Home Assistant

This project automates the charging current of an electric vehicle based on household power consumption.
It works with any EV (Tesla, Mercedes, Ford, BYD, etc.) or any EV charger as long as it is integrated and can be controlled within Home Assistant.

This blueprint dynamically adjusts the charging rate, ensuring that the vehicle uses the maximum available power without exceeding the contracted limit.
It also supports different power limits for day and night to optimize charging based on electricity tariffs.

If you found this project helpful, please consider buying me a coffee!

Buy Me a Coffee at ko-fi

Versions

Version 1.1 - Adjustments are made in 1A increments every 8 seconds to avoid charger errors.

:inbox_tray: Installation

This blueprint can be installed in two ways:

:link: Direct Import via Home Assistant

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

:open_file_folder: Manual Installation

  1. Open the blueprint file in this repository:
    https://github.com/EDV11/electric-vehicle-ev-dynamic-charging-home-assistant-/blob/55aff6f887136b29e311d646cfaea37b93042f07/Dynamic-EV-Charging-Automation.yaml
  2. Copy the URL from your browser’s address bar.
  3. In Home Assistant, go to Settings → Automations & Scenes → Blueprints.
  4. Click “Import Blueprint” in the bottom right corner.
  5. Paste the URL and click “Preview Blueprint”.
  6. Click “Import Blueprint” to finalize.

:electric_plug: :red_car: :battery: Tested Hardware

This is some of the hardware I’ve used and tested with this automation:

Just to be clear, if you can control your car from Home Assistant and have access to its sensors, you can use this automation without a connected charger.


:wrench: Requirements

Before using this blueprint, you need the following:

  • Total Power Consumption Sensor
    (e.g., Shelly EM Gen3 is recommended if you don’t have one; you can get it from that link).
  • Your EV or Charger integrated into Home Assistant, exposing the necessary sensors.
    (For example, Feyree portable charger.)
  • Basic information about your electricity contract, including:
    • Grid voltage (e.g., 230V for EU, 120V for the US).
    • Maximum grid power limits (contracted power).
    • Day and night tariff periods (if applicable).

:gear: Configuration

The following parameters need to be configured:

  • Charging interval (1, 3, or 5 minutes).
  • A device tracker (preferably the car) to ensure that the automation runs only when the EV is at home.
  • A charging status sensor to ensure changes are only made when the EV is actively charging.
  • Total power consumption sensor (measured in watts).
  • Maximum Grid Power (Day) – Set to 0 if you only want to charge at night.
  • Maximum Grid Power (Night).
  • Charging current control entity – The EV or charger must support dynamic amperage control.
  • Grid voltage.
  • Maximum charging amperage – The system will never exceed this limit, even if extra power is available.
  • Minimum charging amperage – The system will stop charging if power availability drops below this threshold.
  • Day-time period settings (Define when “day” mode applies, typically when electricity is more expensive or power is limited).

:rocket: How It Works

The automation runs every 1, 3, or 5 minutes, depending on the selected interval.
It only adjusts the charging rate if the EV is charging and at home.

Dynamic Load Adjustment

The automation continuously monitors household power usage and dynamically adjusts the charging current to avoid exceeding the contracted power limit.
If a high-power appliance (e.g., oven, stove, heating) is turned on, the charging rate will automatically decrease to prevent overloading.
Once power consumption drops, the EV will resume charging at the maximum allowed rate.

Day & Night Power Limits

Many electricity contracts offer cheaper power at night, along with higher power limits.
This blueprint allows setting different power limits for day and night, ensuring that charging is optimized based on your tariff structure.


:question: Reporting Issues & Community Discussion

If you encounter issues or have suggestions for improvements, please post them below

New update after @Deporpeps reported errors with the charger.

I’ve modified the current increase/decrease logic. Now, adjustments are made in 1A increments to avoid charger errors. Changes occur every 8 seconds until the selected power limit is stabilized.

Hi @Eduardo any chance you could help me out?
I’m trying to use your Blueprint with a Wallbox Copper SB.

The charging status is set by default to “Charge”.
While in your blueprint it is checking on “charge”.

The uppercase C is resulting in a false result while my car is charing. I’d like to keep the blueprint as user-friendly as possible and not transform it in an editable automation.

Any chance this can be configured somewhere that I could have missed?
Thanks

Open the installed blueprint and change, on line 173, adding the uppercase C

        state: Charging

It’s the easiest way to move forward with your issue.

1 Like

Thanks a lot @Eduardo worked like a charm. I’m new with Blueprints so I didn’t know these could be edited through the File manager.
It’s working fine now!
Thanks a lot for your help and super useful blueprint.

hello Eduardo, i´ve read the blueprint, and my question is: is it complicated to use a blueprint like yours to absorbe all the power from solar pannels,

Sorry but until I install some panels I will not be able to hive any details on solar power, as it’s something I haven’t tested myself

1 Like