Skip to content

Connect Siemens S7 to Mqtt with Homeassistant discovery support

License

Notifications You must be signed in to change notification settings

dixi83/mqtt-s7-connector

 
 

Repository files navigation

mqtt-s7-connector

This is a Node.js tool to connect 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 s7 and mqtt.

Purpose

This tool can receive data over mqtt and can write it to a designated address on a plc and vice versa, enabling smart home data to be displayed in the home assistant.

How to install

docker run -d -v /path/on/host/config.json:/usr/src/app/config.json timroemisch/mqtt-s7-connector

Note: You only have to mount the configuration file, not the entire folder.
Config volume mountpoint: /usr/src/app/config.json

Or run it directly from your console. Note that Node.js and NPM need to be installed. Run the following commands inside the mqtt-s7-connector folder to start mqtt-s7-connector

npm install --only=production
npm start

Commandline options

--yaml
Adding this option will enable mqtt-s7-connector to use YAML config files.

--config <path>
Specify the path of the config file

Auto Discovery

This tool will send for each device an auto-discovery message over mqtt in the correct format defined by Home Assistant.

The default mqtt topic is homeassistant, it can be changed in the config file. (See the example)

ToDo

  • climate component additional attributes
  • code cleanup
  • documentation + JSDoc comments
  • more testing

Pull requests welcome! 😄

Credits

License

Licensed under ISC
Copyright (c) 2021 Tim Römisch

About

Connect Siemens S7 to Mqtt with Homeassistant discovery support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 98.8%
  • Dockerfile 1.2%