⚡ EV Smart Charger – Intelligent solar & battery-aware EV charging for Home Assistant (HACS)

:zap: EV Smart Charger — Intelligent Solar & Battery-Aware EV Charging for Home Assistant (HACS)

Smart. Predictive. Fully autonomous EV charging logic for Home Assistant.

Designed to use your home battery and solar power intelligently — avoiding grid import and maximizing solar surplus.

:earth_africa: Why I built it

I wanted to avoid grid imports , use solar surplus automatically , and make my EV charge cooperate with my home battery and daily priorities.

Existing solutions were either static or too simple — so I built EV Smart Charger, a full automation logic packaged as a native HACS integration.


:rocket: What it does

EV Smart Charger dynamically manages EV charging current based on your energy flow, PV forecast, and home battery state.

It introduces four main charging profiles, each with adjustable parameters and safety thresholds:

Profile Purpose
:compass: Manual Full manual control of amperage & scheduling.
:sunny: Solar Surplus Charges only using excess PV energy with gradual step-up/down logic and anti-cloud delay.
:crescent_moon: Night Smart Charge Automatically starts charging at a defined time if PV forecast is insufficient for the next day.
:dart: Priority Daily Balancer Dynamically prioritizes charging between your EV and home battery based on daily SOC targets.

:wrench: Key Features

  • Intelligent charge modulation (6–32 A range)
  • Custom step profiles: 6, 8, 10, 12, 16, 20, 24, 32 A
  • Anti-oscillation delay and fallback logic
  • Smart battery interaction (don’t drain below target SOC)
  • PV forecast-based night charging
  • Transparent diagnostics with detailed “reason” feedback
  • Ready-to-use Lovelace dashboard template

:jigsaw: Architecture Overview

┌──────────────────────────────┐
│ Sensors Layer │
│ PV power | Home load | Grid │
│ import/export | Battery SOC │
│ EV SOC | Charger state │
└──────────────┬───────────────┘


┌──────────────────────────────┐
│ EV Smart Charger Core │
│ - Profile logic engine │
│ - Thresholds & delay guards │
│ - Priority Daily Balancer │
│ - Night Smart Charge logic │
└──────────────┬───────────────┘


┌──────────────────────────────┐
│ Charger Control Layer │
│ switch.ev_charger_on_off │
│ number.ev_charger_amps │
│ sensor.ev_charger_state │
└──────────────────────────────┘

:white_check_mark: Tested with Tesla vehicles (via standard API to monitor SOC Battery).

:white_check_mark: Works with Tuya-compatible wallboxes and any charger supporting step current profiles: 6, 8, 10, 12, 16, 20, 24, 32 A.

:no_entry_sign: The integration does not directly depend on car brand APIs — you can use it with any EV.


:gear: Quick Installation (HACS, 30 seconds)

  1. Go to HACS → Integrations → ⋮ → Custom repositories
  2. Add
  1. Category: Integration
  2. Search EV Smart Charger and install it
  3. Restart Home Assistant
  4. Go to Settings → Devices & Services → Add Integration → EV Smart Charger
  5. Follow the setup wizard

:bulb: All entities are auto-generated after setup; no YAML required.


:brick: Required Entities Mapping

Function Expected Entity Notes
Charger On/Off switch.<charger_on_off> Controls EV charger relay
Charger State sensor.<charger_state> Expected values: charger_charging, charger_end, charger_wait, charger_free
Charging Amperage number.<charger_current> 6–32 A range; steps: 6 / 8 / 10 / 12 / 16 / 20 / 24 / 32
EV SOC sensor.<ev_soc> (%) Used by Priority Daily Balancer
Home Battery SOC sensor.<battery_soc> (%) Required for battery logic
PV Power sensor.<pv_power> (W) Required for surplus calculation
Home Load sensor.<home_load> (W) Optional, improves precision
Grid Import sensor.<grid_import> (W) Optional, fallback for surplus detection
PV Forecast sensor.<pv_forecast_kwh>(kWh) Required for Night Smart Charge

:brain: How it decides priorities

  • If EV target for today not reached → EV gets priority
  • If EV target reached and battery SOC below target → battery gets priority
  • Otherwise → keep monitoring PV power and grid import

Diagnostic entity:

sensor.evsc_priority_daily_state
  attributes:
    reason: "EV target reached, balancing to home battery"
    ev_target: 70
    home_target: 60
    next_update: 22:00

:toolbox: Troubleshooting & Use Cases


:speech_balloon: Feedback & Contributions

This is an open project built during real-world EV & solar use.

Your logs, feedback, and PRs make it better.

:package: Repository → github.com/antbald/ha-ev-smart-charger

:lady_beetle: Bug reports → Issues tab

:handshake: PRs → PEP-8 + typed preferred


:bulb: Community Feedback

EV Smart Charger was born out of real-world testing and countless nights of fine-tuning under unpredictable skies :sun_behind_large_cloud:.

If you’ve tested it, your feedback is gold — I’d love to know:

  • :speech_balloon: Does the logic behave as expected in your setup?
  • :zap: How well does it handle your specific inverter / charger / EV combination?
  • :jigsaw: What features or improvements would you like to see next?

You can share your thoughts right here in the thread or start a discussion on GitHub Discussions.

Every insight helps refine the algorithm and make the system smarter for everyone.

Let’s evolve this project together :muscle:

5 Likes

Nice smart way to charge the EV.
Did you also tried the home-made wallbox using DomBusEVSE module?
It works with HA and have several nice features for your component:
managed mode => perfect to work with your component because you can set any current between 6 and 32A, 1A step

Also, you can set a minimum voltage to keep, for example 250V, so it charges the vehicle using the minimum current to keep the selected voltage: this is very useful for those who have a photovoltaic system that starts power derating in case of excess power from the sun (V>=253V) and have the vehicle battery almost full.