Integrating Hoymiles Inverter with HomeAssistant: A Step-by-Step Guide

After spending several weeks configuring my Hoymiles inverter with the AhoyDTU and integrating it into HomeAssistant, I wanted to share my experience and some tips that might help others facing similar challenges. :star2:

Setup Overview

First, I focused on setting up the AhoyDTU correctly. The key steps included:

  • Configuring the inverter name and MQTT broker details in AhoyDTU.
  • Setting up the MQTT broker in HomeAssistant with the correct IP address, port, and topic.

I created a dedicated user in HomeAssistant for MQTT access, which was crucial for ensuring secure communication. For those looking for guidance, there are plenty of tutorials and videos available online that cover these basics. :man::computer:

Configuration Details

In the configuration.yaml, I added the following line to include my MQTT settings:
yaml
mqtt: !include mqtt.yaml

Then, I created the mqtt.yaml file to define the sensors. This involved mapping the topics from AhoyDTU to the corresponding sensors in HomeAssistant. For example:
yaml
sensor:

  • name: “AHOY(comm_start)”
    state_topic: ahoy/comm_start

I made sure to replace the default topic and inverter name with my own, which is essential for the integration to work smoothly. :hammer_and_wrench:

Challenges and Solutions

One issue I encountered was the incorrect display of uptime. Initially, it only showed hours, minutes, and seconds, but I wanted to include days as well. After some research, I found a solution by modifying the value template to handle the timestamp correctly. :clock3:

Another challenge was understanding the sensor values, especially the power production. The inverter reports a minimum of 5W, even during downtime, which I initially found confusing. To address this, I created a custom sensor in template.yaml to filter out these low values:
yaml
sensor:

  • name: “Total Power Solar”
    device_class: power
    unit_of_measurement: “W”
    state: >
    {{ states(‘sensor.ahoy_p_ac’)|float(0) if states(‘sensor.ahoy_p_ac’)|int > 5 else 0 }}

This helped me get more accurate readings and integrate the data into my energy monitoring setup. :bar_chart:

Lessons Learned

  • Documentation is Key: Referencing official guides and community forums saved me a lot of time.
  • Customization: Don’t hesitate to tweak sensors and templates to fit your specific needs.
  • Testing: Regularly check the sensor values and adjust your configurations as needed.

If you’re planning to integrate a Hoymiles inverter with HomeAssistant, I highly recommend starting with the basics and gradually exploring advanced configurations. It’s a rewarding process once everything is set up! :rocket:

Any questions or tips to share? Let’s discuss! :speech_balloon: