Adding Victron MPPT to Home Assistant is now possible. Using this method that you are about to see, you can add any Victron device with VE.Direct port in Home Assistant.

What is the goal of today’s project?

In my article from last week I added a Victron MPPT and an EDECOA Inverter in my Camper, so that I can have AC electricity inside. This is the full article if you are interested – DIY Camper Van Solar System Upgrade with Victron SmartSolar MPPT Controller & EDECOA Inverter

Today, I will add that Victron MPPT in my Home Assistant, so I can see the Victron readings on my Home Assistant Dashboard.

Sensors from Victron MPPT added in Home Assistant
Sensors from Victron MPPT added in Home Assistant

To do that I will connect one cheap ESP board to the VE.Direct port of the Victron MPPT. I will flash that ESP board with ESPHome, so that Home Assistant will be able to communicate with the board and as a result I will have all of the important sensors inside my Home Assistant.

I will show you what I did in details and I will share all the tips and tricks and of course, difficulties that I faced, so you can avoid them beautifully.

I want to thank…

Before I begin I just want to say big thank you to my friend Grigor, who not only guided me during the whole process, starting from choosing the right components, through researching, and even sending me some parts like connectors and level shifters.

So, thank you Grigor, I needed that help and I truly appreciate it.

Now let’s start this. 

Some Requirements for the Victron MPPT to Home Assistant with ESPHome

I will use a D1 Mini board which is an ESP8266 board that can be bought from AliExpress for less than $3 US dollars. I will show you how I wired everything later in the article, because now I want to say few words about Home Assistant and ESPHome.

Home Assistant & ESPHome Dashboard

There is a nice chain here that I will try to explain:

ESPHome Dashboard is needed for this project, so that I can upload the ESPHome Software on the D1 mini or any other ESP board using a simple Micro USB cable. There are several ways to run the ESPHome Dashboard and they are all well explained in this article of mine – Complete ESPHome Installation Guide: 4 different ways to install ESPHome

However, one of the easiest way is to use use the one-click installable ESPHome Dashboard add-on available in Home Assistant Add-on store. For that, of course, you need a working Home Assistant installation type with Add-on store.

To understand which Home Assistant installation types have that damn Add-On store, and everything around this topic, I’m personally inviting you to my upcoming Webinar, where I’ll be talking exactly about that – What are the official methods to start Home Assistant and their pros & cons!

So, go and reserve your seat right now on my other website:

https://automatelike.pro/webinar

It is all free.

What will I use to integrate Victron MPPT in Home Assistant?

As summary, to make this project working:

  • A Victron Device with VE.Direct port is needed that could be a MPPT, inverter, shunt, and many more.
  • Also an ESP board like the D1 Mini,
  • USB cable and few wires are also needed.
  • It is not a bad idea to get one 4-pin JST 2.0 PH connector for the VE.Direct port, unless you find some other way to connect to the Victron device physically.

I will put some affiliate links below to all of the needed components if you want to check their current prices in AliExpress and Amazon.

If you buy something from the above links you will support my channel, because I will receive a small commission from your purchases with no additional cost for you.

Wiring the D1 mini to the Victron VE.Direct port

Next thing that I did is the actual wiring.

  • I connected the TX pin on the Victron Device to the D7 pin on the D1 mini board.
  • Next, I connected the GND from the Victron Device to the GND pin on the D1 mini board.
  • After that, I connected the D1 mini board to the device where Home Assistant and ESPHome are running, In my case it is a Raspberry Pi 4. I plan to leave that cable permanently, because the Victron VE.Direct port is not not having enough power to powering the D1 Mini board.
Step-by-Step Tutorial: Add Victron MPPT to Home Assistant with ESPHome 1
Wiring of the D1 mini to Victron MPPT, so that I can add the Victron Readings in Home Assistant

REMARK: It is also possible to use a logic level converter or voltage divider between the Victron device and the ESP board, as the MPPT voltage is 5V and the native voltage of the ESP board is 3.3v (but D1 Mini is 5v compatible). So if you want to be on the super, super safe side – buy one logic level converter or voltage divider which may help with the working voltage inconsistency. 

And now the fun part begins.

Installation of the ESPHome on the D1 mini with the Victron MPPT ESPHome integration

The steps that I executed are the following:

  • Inside Home Assistant opened my ESPHome Dashboard.
  • I clicked on the NEW DEVICE button.
  • I typed a device name. The name doesn’t matter in my case it was Victron-mppt.
  • Then I entered my WIFI name and password and I clicked Next.
  • I chose ESP8266 option, because D1 Mini is such a board and I clicked on SKIP button, because, I don’t want to install ESPHome yet.
  • I clicked on the EDIT button on my new ESPHome deviceand I’ll head on to the Jiri’s GitHub Page. This is the GitHub Project of the VictronMPPT-ESPHOME
  • I opened the smartsolar-mppt-esp8266-example file. And I copied everything inside.
  • Then I’ll go to my ESPHome dashboard again and I overwrited the content of my newly created ESPHome device with the copied code.
Creating A ESPHome device with the Code for Victron to Home Assistant integration
Creating A ESPHome device with the Code for Victron to Home Assistant integration

Now is the best moment to say that all of the credits here for the code are going to Jiri from Czech Republic, which is the author of this integration and of course his contributors.

You can find the link to his GitHub repo in the steps above and I will paste it again here for your convenience – https://github.com/KinDR007/VictronMPPT-ESPHOME

As next steps, I did the following:

  • I made just a few changes in the code
    • I uncommented the API row, because I want this integration to work using the native Home Assistant API.
    • And I commented the MQTT section. If you have a MQТТ broker you can leave it as it is, but I don’t want to use it. I will use the Home Assistant native API instead.
  • This is my final version if you want to use it as well – LINK
  • Everything else will stay as it is. I clicked SAVE and then INSTALL in the upper right corner.
  • I selected PLUG INTO THE COMPUTER RUNNING ESPHOME DASHBOARD option.
  • Before that I connected my D1 Mini to the Raspberry Pi 4 where Home Assistant and ESPHome Dashboard are running.
  • I selected the Server Port and the ESPHome installation begins.
Pasting the ESPHome Code that will work for the Victron MPPT device
Pasting the ESPHome Code that will work for the Victron MPPT device

After around 5 minutes the ESPHome installation is now complete. And after closing some of the opened windows, I saw that my victron-mppt device is now online.

Victron-mppt ESPHome device is now online
Victron-mppt ESPHome device is now online

I can check the LOGS wirelessly, because ESPHome device is already running. And as you can see I have some readings. For example, the battery voltage is 13.47V and so on and so forth.

This is a very good sign.

This is part of the LOGS of the Victron-mppt ESPHome device
This is part of the LOGS from the ESPHome device

Adding the Victron MPPT Sensors in Home Assistant

As a next step I will open my Home Assistant integrations section in hope that inside I will find my auto discovered new ESPHome device.

To do that I did the following:

  • While I was inside Home Assistant, I pressed the “c” button on my keyboard and I typed Integrations in the appeared command search bar.
  • I selected Navigate Integrations and there I found one new device called victron-mppt, which was auto discovered by Home Assistant.
  • I clicked CONFIGURE, then SUBMIT and I selected an area(but this is optional of course) and then FINISH.
Victron-mppt ESPHome device auto discovered by Home Assistant
Victron-mppt ESPHome device auto discovered by Home Assistant
  • As a result I got 1 Device with 23 entities under my ESPHome integration.

If I click on that new ESPHome device l see all of the sensors that Victron MPPT have. For example: Battery Voltage, Charging Mode, Load Current, Yield Today, Yield Total, Panel Power, Max Power Today, and more and everything seems to work.

Victron MPPT devices added in Home Assistant thanks to ESPHome and D1 mini board
Victron MPPT devices added in Home Assistant thanks to ESPHome and D1 mini board

Next steps

I can add this data to my Home Assistant Dashboard. I’ll add it like that and I’ll beautify it later.

Adding the Victron MPPT sensor to Home Assistant Dashboard is super easy
Adding the Victron MPPT sensor to Home Assistant Dashboard is super easy

As next step, I can make few automations that can notify me when something is wrong or when some thresholds are reached. Also, I can play a bit to make this data more beautiful using some different Home Assistant cards.

Adding a Gauge Cards is one super simple but useful and more beautiful way to add data in your Home Assistant
Adding a Gauge Cards is one super simple but useful and more beautiful way to add data in your Home Assistant

Comparison between VictronConnect App and Home Assistant readings

As comparison, I will show the readings from the VictronConnect mobile app on my phone and the readings in Home Assistant and the numbers are matching.

VictronConnect Mobile App vs Home Assistant
VictronConnect Mobile App vs Home Assistant

All of that means that I can now stop using the VictronConnect mobile app and start using my Victron to Home Assistant integration either from the Internet or from my Smart Control Panel.

My Smart Home Control Panel in my RV
My Smart Home Control Panel in my RV

Smart Home Glossary?

If some of the terms that I’m using are not so clear for you make sure that you download my Smart Home Glossary available from my other website – https://automatelike.pro/glossary.

It is totally free.

Thanks for reading, I’m Kiril and I’ll see you next week. Bye!


3 Comments

Neil · 11/01/2024 at 8:02 pm

I tried making this today using the 75/15 version. it connected to home assistant ok but doesn’t give any information via the sensors. I tried flashing two boards and made 2 separate connectors just to be sure. Same result each time. Any thoughts on the issue or suggestions?

    Neil · 12/01/2024 at 3:04 pm

    Disregard the previous statement. I looked closer at the wiring pic and despite being the same model the fuse area was modified and flipped. This includes the ve.direct connection so my pins were in the wrong place. I rewired and it’s working now. Thanks for the tutorial.

Joe · 21/04/2024 at 6:52 pm

Hello,
I had the same problem with the wiring.
But now everything works.
There is still a small error hidden here:
battery_current:
name: “${name} panel current”

It should probably mean:
battery_current:
name: “${name} battery current”

Many thanks for the very helpful instructions and descriptions…

Greetings Jürgen

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *