MQTT-S7-Connector connects a Siemens S7 PLC over MQTT with Home Assistant
This project is intended to use it along with Home Assistant, but is also possible to use it as a simple bridge between a S7 PLC and a MQTT broker.
- Optimized PLC DB reads using NodeS7
- Publishing PLC values to MQTT
- Writing MQTT values back to PLC-DBs
- Generate and publish Home Assistant discovery messages for devices/entities.
This is just a plain Node.js App and should run with the latest LTS version of Node.js so you can invoke
npm ci
node index.js
to run the app.
The MQTT-S7-Connector is available as native Home Assistant Addon: https://github.com/dixi83/hassio-addons/tree/main/mqtt-s7-connector
There are docker-builds of the MQTT-S7-Connector published to ghcr.
docker run -d -v $PWD/config.yaml:/app/config.yaml ghcr.io/dixi83/mqtt-s7-connector --loglevel 2
Note: You only have to mount the configuration file, not the entire folder.
Or use docker-compose.yaml
:
mqtt-s7-connector:
image: ghcr.io/dixi83/mqtt-s7-connector
container_name: mqtt-s7-connector
command: [ "--loglevel", "2" ]
volumes:
- ./config.yaml:/app/config.yaml
restart: unless-stopped
Option | Shorthand | Description |
---|---|---|
--config |
-c |
Overwrite the default config.yaml file location. |
--addonversion |
-v |
Set the version for the "origin" section of the discovery topic. |
--loglevel |
-l |
Sets the log level (0: Trace, 1: Debug, 2: Info, 3: Notice, 4: Warning (default), 5: Error, 6: Fatal). |
Most of the configurations are done using a config file. See Configuration file documentation for detailed instructions.
Implemented entity-types:
- Tim Römisch who created MQTT-S7-Connection initially, this is just a fork!
- plcpeople / nodeS7