3 min read

How I Automated EV Charging Using EVCC, an EG4 Solar Inverter, and a Tesla Mobile Connector

TL;DR: Want to charge your Tesla with the Universal Mobile Connector using EVCC? Have a Lux Power or EG4 inverter and battery and want to integrate them with EVCC? Or are you interested in using EVCC to calculate real-time energy import/export pricing with PG&E? If any of these scenarios sound relevant, read on!

I recently shared my experience cobbling together a DIY EV solar charging solution—something I don’t recommend! Thankfully, I discovered a much more mature project called EVCC, which I wish I had known about earlier. It’s a fantastic option for those looking to optimize their EV charging and who are comfortable using the terminal. Once installed it's user-friendly enough to be shared with other household members who may need to use it to quickly fast charge an EV.

Since EVCC is open source, it didn’t matter that it lacked native support for my Lux Power/EG4 inverter. A buddy and I purchased a third-party dongle designed to extract data from the otherwise closed inverter, and we figured out how to integrate it with EVCC. This allowed us to manage charging for our similar setups, which each include an EG4 18kPV inverter, a Tesla Model 3, and a Tesla Universal Mobile Connector (UMC). The dongle streams data via MQTT, enabling EVCC to track critical metrics such as solar generation, grid usage, and battery status, while also supporting dynamic control of battery discharge during fast charging.

In addition to integrating the inverter, I set up TeslaBLEHttpProxy to let EVCC smartly control the (dumb) Tesla UMC. This works by enabling EVCC to communicate with the Tesla vehicle through the proxy locally over Bluetooth, allowing near real-time charging adjustments based on solar and grid conditions. With this setup, I can dynamically adjust charging parameters such as amperage, enable fast charging, limit charging to solar excess, and more.

To better manage energy costs, I configured EVCC to account for PG&E’s seasonal tariffs under my Electric Home Rate Plan (E-ELEC). Using a custom formula, the tariffs automatically adjust between summer and winter rates, with different time-of-use (TOU) pricing tiers. This ensures that I can charge at the lowest possible cost by prioritizing solar energy, battery reserves, or grid power depending on availability and cost.

Overall, this custom setup offers a fully integrated solution that balances solar self-consumption, grid tariffs, and vehicle charging. It’s ideal for anyone comfortable with configuring these components and looking to maximize their EV charging efficiency.

If you’re interested in setting up something similar, check out this repository. Clone it, copy evcc.env.sample to evcc.env, and edit the values to match your setup. If you don’t plan to use InfluxDB, be sure to uncomment DISABLE_INFLUX in evcc.env. Once your values are set, run gen.sh to generate evcc.yaml with your customized configuration. The repo provides pre-configured PG&E seasonal tariffs for California residential E-ELEC households and annual feed-in export energy pricing for 2025, both of which can be easily removed if they don’t match your setup. This allows for real-time energy cost calculations.

While your setup is likely to differ, this repository serves as a useful example of how to use EVCC to:

• Integrate a Lux Power/EG4 inverter using a third-party dongle.

• Enable smart control of a Tesla with a UMC charger via Bluetooth using TeslaBLEHttpProxy.

• Configure seasonal summer/winter tariffs for importing energy via PG&E.

• Configure annual feed-in export energy pricing via PG&E.

Requirements:

EVCC – Open-source EV charging controller.

Monitor My Solar Dongle – If you’re integrating an EG4 or Lux inverter.

TeslaBLEHttpProxy – If you’re planning on using a Tesla UMC with EVCC.

For more details and to get started, check out the repository:

GitHub - skrul/evcc-config
Contribute to skrul/evcc-config development by creating an account on GitHub.
Screenshot displaying options for charging modes, such as Solar and Fast, along with real-time energy consumption and cost tracking.