Git Product home page Git Product logo

ginlong-solis-mqtt's Introduction

Ginlong Solis mqtt/pv-output

Publish Docker image

Getting Ginlong Solis invertor data and posting on MQTT / PV output.

Using a docker image as a service to read the invertor via the RS485 port.

The measurements are send to mqtt every 5 seconds, and to PV output every 5 minutes.

Requirements

  • RS485 to USB converter.

Connections

Connecting the converter straight to the invertor.

The pins are a little bigger that standard breadboard, you need something that would fit.

I used the wires of the female side of a PCI-E power connector and compressed it a little.

The connector pins on the Solis invertor are tagged with a number, just take a close look.

Solis invertor RS485 to USB
1 nc
2 nc
3 A+
4 B-

Docker compose

version: "2.1"
services:
  ginlong:
    image: bram2202/ginlong-solis-mqtt:latest
    container_name: ginlong-solis-mqtt
    environment:
      - USB_SERIAL=/dev/ttyUSB0
      - BROKER_IP=<IP of mqtt broker>
      - BROKER_PORT=1883
      - BROKER_USER=<mqtt user>
      - BROKER_PASSWORD=<mqtt password>
      - PV_OUTPUT_SYSTEM_ID=<PVOutput system ID>
      - PV_OUTPUT_API_KEY=<PVOutput api key>
    restart: unless-stopped
    devices:
      - /dev/ttyUSB0:/dev/ttyUSB0

As a service

Its posible to run the script in a service instead of a docker container. Download this repo and install the requirements.

Libraries

Use pip install

  • paho-mqtt
  • minimalmodbus
  • schedule

Create new

vim /lib/systemd/system/pv-script.service

And add: (change path of script folder)

[Unit]
Description=PV output script
After=multi-user.target
[email protected]
[Service]
Type=simple
ExecStart=/usr/bin/python3  <YOUR-FOLDER>/src/inverter.py
StandardInput=tty-force
Restart=always
[Install]
WantedBy=multi-user.target

Start script

Reload the daemon:

systemctl daemon-reload

Start the script

systemctl start pv-script.service

Check the status

systemctl status pv-script.service

Start service at boot

systemctl enable pv-script.service

Env vars

vars default Description
mqtt_broker - IP of mqtt broker
mqtt_port 1883 Port of mqtt broker
mqtt_user - user name for mqtt
mqtt_password - password for mqtt
pv_api_key - Your PVOutput api key
pv_system_id - Your PVOutput system ID

MQTT topics

Topic Description
pv/ac All AC related values
pv/dc All DC related values
pv/gen ALL generation values
pv/temp Temperature value

Values

Every topic contains a json with values

AC

Value Description unit
W Watts W
V Volts V
C Current A
F Frequency Hz

DC

Value Description unit
V Volt V
C Current A

GEN

Value Description unit
D Generated today kWh
T Generated all time kWh

temp

Value Description unit
T Inverter temperature C

ginlong-solis-mqtt's People

Contributors

bram2202 avatar chrisv78 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

chrisv78

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.