Update: I am using this „much easier“ integration now: https://github.com/suaveolent/ha-hoymiles-wifi[GitHub, External]
I’ve been tinkering with my home automation setup recently, specifically integrating HMS-XXXXW-2T series micro-inverters with my system. The hms-mqtt-publisher[GitHub, External] is a neat tool that does just that by fetching telemetry info from these inverters and publishing it to an MQTT broker. The catch? It typically requires compiling from source with Cargo, Rust’s package manager.
The Challenge with Cargo
Compiling with Cargo is straightforward in many environments, but within my specific setup — an LXC container on Proxmox hosting Docker containers — it presented unnecessary complexity. My goal was a simpler, more direct deployment method that fit seamlessly into my existing workflow.
The Simple Solution: Docker Compose
The solution I landed on involves a Docker Compose file that bypasses the need for Cargo compilation. This approach not only simplifies deployment but also provides flexibility in configuration management. The Docker Compose setup is designed for ease of use, allowing quick adjustments and deployments.
You can find my solution here: https://github.com/marchorst/hms-mqtt-publisher-docker-compose
Configuration Choices
When deploying the hms-mqtt-publisher[GitHub, External] using Docker, there are a couple of options for configuration. The original setup suggests using environment variables for essential settings such as the inverter host and MQTT broker details. These variables include INVERTER_HOST, MQTT_BROKER_HOST, and optional settings for username, password, and port. (Or using Cargo)
However, I opted to mount config.toml directly into the Docker container. This method offers comprehensive control over all configurable options, ensuring full customization beyond what environment variables alone might allow. This decision was driven by a desire for detailed configuration management within the Dockerized environment.
Wrap Up: Three Ways to Deploy HMS MQTT Publisher
To sum up, there are three main ways to set up the HMS MQTT Publisher:
- Compiling from source using Cargo.
- Mounting a config.toml file for comprehensive configuration.
- Configuring through environment variables for a simpler setup.
Each method has its merits, catering to different preferences and technical environments. For my purposes, mounting the config.toml was the preferred choice, offering a balance between ease of use and configuration depth.
If you’re interested in exploring this tool and its deployment options further, I encourage you to check out the original repository at https://github.com/DennisOSRM/hms-mqtt-publisher/ and my Docker Compose https://github.com/marchorst/hms-mqtt-publisher-docker-compose. Whether you’re new to Docker or looking for a hassle-free way to integrate your micro-inverters with your home automation system, this Docker Compose setup might just be the solution you’re looking for.
Links
https://github.com/marchorst/hms-mqtt-publisher-docker-compose
https://github.com/DennisOSRM/hms-mqtt-publisher/