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.
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.
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 |
|---|---|
| Full manual control of amperage & scheduling. | |
| Charges only using excess PV energy with gradual step-up/down logic and anti-cloud delay. | |
| Automatically starts charging at a defined time if PV forecast is insufficient for the next day. | |
| Dynamically prioritizes charging between your EV and home battery based on daily SOC targets. |
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
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 │
└──────────────────────────────┘
Tested with Tesla vehicles (via standard API to monitor SOC Battery).
Works with Tuya-compatible wallboxes and any charger supporting step current profiles: 6, 8, 10, 12, 16, 20, 24, 32 A.
The integration does not directly depend on car brand APIs — you can use it with any EV.
Quick Installation (HACS, 30 seconds)
- Go to HACS → Integrations → ⋮ → Custom repositories
- Add
- Category: Integration
- Search EV Smart Charger and install it
- Restart Home Assistant
- Go to Settings → Devices & Services → Add Integration → EV Smart Charger
- Follow the setup wizard
All entities are auto-generated after setup; no YAML required.
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 |
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
Troubleshooting & Use Cases
- Night charge logic details: NIGHT_CHARGE_SCENARIOS.md
- Common setup issues & logs: TROUBLESHOOTING.md
Feedback & Contributions
This is an open project built during real-world EV & solar use.
Your logs, feedback, and PRs make it better.
Repository → github.com/antbald/ha-ev-smart-charger
Bug reports → Issues tab
PRs → PEP-8 + typed preferred
Community Feedback
EV Smart Charger was born out of real-world testing and countless nights of fine-tuning under unpredictable skies
.
If you’ve tested it, your feedback is gold — I’d love to know:
Does the logic behave as expected in your setup?
How well does it handle your specific inverter / charger / EV combination?
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