Skip to content

modbus2mqtt/hassio-modbus2mqtt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

hassio-modbus2mqtt

Image

Add-ons

This repository contains the following add-ons

Supports aarch64 Architecture Supports amd64 Architecture Supports armhf Architecture Supports armv7 Architecture Supports i386 Architecture

Installation

  1. If you don't have an MQTT broker yet; in Home Assistant go to Settings → Add-ons → Add-on store and install the Mosquitto broker addon.
  2. Go back to the Add-on store, click ⋮ → Repositories, fill in
    https://github.com/modbus2mqtt/hassio-modbus2mqtt and click Add → Close or click the Add repository button below, click Add → Close (You might need to enter the internal IP address of your Home Assistant instance first).
    Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.
  3. The repository includes two add-ons:
    • modbus2MQTT is the stable release that tracks the released versions of modbus2MQTT. (recommended for most users)
    • modbus2MQTT Edge tracks the dev branch of modbus2MQTT such that you can install the edge version if there are features or fixes in the modbus2MQTT dev branch that are not yet released.
  4. Click on the addon and press Install and wait till the addon is installed.
  5. Click on Configuration
    • If you are not using the Mosquitto broker addon, Configure the MQTT brocker connection data in the modbus2mqtt Configuration menu
    • If you don't know the port and you have just one USB device connected to your machine try /dev/ttyUSB0. Else use the Home Assistant CLI and execute ha hardware info to find out.
    • Click Save
    • Tip: it is possible to refer to variables in the Home Assistant secrets.yaml file (not the modbus2MQTT one!) by using e.g. password: '!secret mqtt_pass'
  6. Start the addon by going to Info and click Start
  7. Wait till modbus2MQTT starts and press OPEN WEB UI to verify modbus2MQTT started correctly.
    • If it shows 502: Bad Gateway wait a bit more and refresh the page.
    • If this takes too long (e.g. 2 minutes +) check the Log tab to see what went wrong.

For more information see the documentation.

Restoring data from a standalone installation

  1. Ensure that both environments are running the same version
  2. Backup your standalone environment data folder (possibly leaving out the logs/ folder)
  3. Configure your serial port using the HA addon configuration UI
  4. Restore your data folder contents into /usr/share/hassio/homeassistant/modbus2mqtt
  5. Edit the /usr/share/hassio/homeassistant/modbus2mqtt/configuration.yaml file:
    • Ensure that the serial port section matches the one configured with the UI
    • Remove any irrelevant sections from the config (e.g. mqtt, advanced/log_syslog, frontend)
  6. Start the add-on

Changelog

The format is based on Keep a Changelog.

All notable changes to this project will be documented in the CHANGELOG.md file.

Version for releases is based on modbus2MQTT format: X.Y.Z.

Any changes on the addon that do not require a new version of modbus2MQTT will use the format: X.Y.Z-A where X.Y.Z is fixed on the modbus2MQTT release version and A is related to the addon.

Edge version will not maintain a CHANGELOG and doesn't have a version.

Issues

If you find any issues with the add-on, please check the issue tracker for similar issues before creating one. If your issue is regarding specific devices or, more generally, an issue that arises after modbus2MQTT has successfully started, it should likely be reported in the modbus2MQTT issue tracker.

Feel free to create a PR for fixes and enhancements.

Testing changes locally

If you're submitting a PR and wish to test it locally:

  • Gain root access to your Home Assistant installation

  • In the Add-on Settings, Ensure "Watchdog" is turned off so the container isn't automatically restarted when it's stopped via the CLI

  • Enter the modbus2mqtt container interactively.

docker exec -it $(docker ps | grep modbus2mqtt | cut -d" " -f 1) /bin/sh
  • Edit the file you'd like to test & save.
vi server/src/mqttdiscover.ts
  • Back on the Home Assistant installation, restart the modbus2mqtt container
docker restart $(docker ps | grep modbus2mqtt | cut -d" " -f 1)
  • Refresh the web UI and perform your testing.

Credits

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •