Code Monkey home page Code Monkey logo

sma2mqtt's Introduction

sma2mqtt Overview

The sma2mqtt tool is designed to discover SMA devices, such as inverters and Sunny HomeManagers, on a local network. It identifies the data these devices can publish and subsequently delivers this information to an MQTT server.

Within the local network, sma2mqtt joins the SMA multicast to listen to announcements from Sunny HomeManager. Please note, this functionality is strictly limited to the local network due to the inherent restrictions of multicast.

The repository includes a build.sh shell script that constructs a Docker container encapsulating the sma2mqtt tool. It's likely necessary to adjust this script to suit the specifics of individual Docker setups.

Upon execution, sma2mqtt produces output on MQTT similar to the one shown on the left, which in turn can be used to drive a node-red dashboard shown on the right.

MQTT Explorer ScreenshotNode-Red Dashboard Screenshot

Docker Container Use

A Docker image, specifically engineered for 64-bit ARM architecture, is available. This image is compatible with a range of devices, including the Raspberry Pi, Apple Silicon Macs, and other 64-bit ARM computers. It can be employed directly using the following command:

docker run --name "sma2mqtt" --net service16  jollyjinx/sma2mqtt:latest sma2mqtt --inverter-password MySimplePassword

The --net option is included in this command to specify a separate network for SMA devices. If there is no dedicated network in use, port 9522 should be open for the container.

Usage

USAGE: sma2mqtt <options>

OPTIONS:
  --log-level <log-level> Set the log level. (default: debug)
  --json-output           send json output to stdout
  --mqtt-servername <mqtt-servername>
                          MQTT Server hostname (default: mqtt)
  --mqtt-port <mqtt-port> MQTT Server port (default: 1883)
  --mqtt-username <mqtt-username>
                          MQTT Server username (default: mqtt)
  --mqtt-password <mqtt-password>
                          MQTT Server password
  -e, --emit-interval <emit-interval>
                          Minimum Emit Interval to send updates to mqtt Server. (default: 1.0)
  -b, --basetopic <basetopic>
                          MQTT Server topic. (default: example/sma/)
  --bind-address <bind-address>
                          Multicast Binding Listening Interface Address. (default: 0.0.0.0)
  --bind-port <bind-port> Multicast Binding Listening Port number. (default: 9522)
  --mcast-address <mcast-address>
                          Multicast Group Address. (default: 239.12.255.254)
  --mcast-port <mcast-port>
                          Multicast Group Port number. (default: 9522)
  --inverter-password <inverter-password>
                          Inverter Password. (default: 0000)
  --interesting-paths-and-values <interesting-paths-and-values>
                          Array of path:interval values we are interested in (default: dc-side/dc-measurements/power:2, ac-side/grid-measurements/power:2, ac-side/measured-values/daily-yield:30, battery/state-of-charge:20, battery/battery/temperature:30,
                          battery/battery-charge/battery-charge:20)
  -h, --help              Show help information.

The option --interesting-paths-and-values is currently defaulted to the things I like to see, but you probably have different needs. To find out what your inverter supports you can use the catch all argument *:600 which will show all paths your inverter supports.

sma2mqtt does support signaling. When you send:

  • SIG_USR1: it switches the log level between trace/debug/info.
  • SIG_USR2: it prints the description of the SMALighthouse object including all currently used SMADevices and their state.

So you can use killall -USR2 sma2mqtt in a shell to let sma2mqtt print out the SMALighthouse status.

sma2mqtt's People

Contributors

jollyjinx avatar pst-estos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

pstestos

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.