New Addon for easy integration of Modbus Devices into Home Assistant (modbus2mqtt)

Hi,

today, I released a new Addon named Modbus<=> MQTT.
It supports

  • MQTT Discovery
  • The basic Modus functions
  • Automatic detection of preconfigured modbus devices(from a community)
  • Create own configuration for your device.

For more information see documentation
or watch this video

This is a prerelease.
If you face any issue, please let me know here

7 Likes

This is magnificent!
The one true way to start the exit of modbus <3

Love it.
I prefer this uncoupling from HA (read recently about issues with modbus after 2025.1 release)

zigbee2mqtt, govee2mqtt, shelly through mqtt and now modbus2mqtt.

@vovo500 This idea is awesome! I looked at the github page and did not find clear information about how I would add support for a device and contribute the support to the community.

I see:

Advanced functionalities(video will follow)

  • Contribute specification

For an addon like this to take of, good community support for devices is essential, so making it as simple as possible to add support for a device should be made as straightforward as possible.

Many thanks for your efforts.

@vovo500 Hi, I’ve got few modbus devices that I would love to add to your device list. But there is no clear way to do so.
Maybe there should be clear way for users to create a config → then go through the approval process ?

Hi Tom,

yes, I know, this is an open issue.
There is already an procedure implemented.
You need a Github token. Then you can upload your device specification.
I’d like to show it in a video, but currently, I am working on some fixes and extensions for the addon.
This will take a few weeks. May be then I can start working on the video.

The process is simple. Just create a Github user and a token.
Then open modbus2mqtt UI go to specifications view and press upload button.
A validation will take place in the background. A few minutes later, the specification is online. It’s stored in a github repository and is available for everyone nearly immediately.

The docs and video for this addon looks very promising! It’s a pity that it didn’t exist yet when I was looking for a Modbus to MQTT adapter last year. I therefore implemented an alternative Modbus integration via MQTT with slightly different focus: it is targeted at experienced users willing to edit files without a UI, and the Modbus to MQTT adapter is running in a separate container, independent of Home Assistant.

I’ve seen that there are a few more projects doing the same job, but most of them are restricted to certain Modbus devices. I believe there’s a demand in a generic adapter between Modbus and MQTT in the field of Smart Home.

Thanks for your efforts!

Wondering if this ever went anywhere? I have 0 knowledge of modbus but am attempting to setup an esp32 to get temp/humidity data from an AK-CC55. Can anyone point me where to start?
The documentation for the controller is available here:

You need a hardware adapter for Modbus RTU that is physically connected to some kind of host (using a pair of wires).

The host might be an ESP32, but I have no experience with that.

The host might be an Arduino. budulinek/arduino-modbus-rtu-tcp-gateway explains what you need and how to wire it up using an Arduino. It adapts Modbus RTU (wires) to Modbus TCP so that you can request data via your LAN.

The host might be a NAS or PC, then you could use a USB dongle as adapter.

Once you have the device connected to the host, you can integrate it into HA, either via the native HA Modbus integration or an alternative integration like mobugen described above. The integration is basically a mapping between the values listed in the device documentation and HA entities.

Thanks, I ended up going with Rail-Mount Serial Server, RS485 to WIFI/Ethernet Module, Modbus MQTT Gateway | RS485 TO WIFI/ETH
and was able to get it to work with home assistant pretty easily using the modbus integration.