Code Monkey home page Code Monkey logo

ginlong-mqtt's Introduction

Overview

This is a daemon that will listen on a port for connections from a Ginlong Solar Inverter. Currently tested with a Solis 4G Mini Single Phase Inverter (Solis-mini-700-4G) running on firmware MW_08_0501_1.58 (Solarman-Ethernet protocol v5).

Thanks

graham0 for the inital script: https://github.com/graham0/ginlong-wifi dpoulson for the work on ginlong protocol: https://github.com/dpoulson/ginlong-mqtt

Details

The Solis solar inverters come with the option for wired or wireless monitoring 'sticks'. These are designed to talk to their own portal at http://www.ginlongmonitoring.com/ where the stats will gather. This software allows you to run your own gatherer on a server and push these stats into an MQTT queue for use in other systems such as the OpenHAB home automation software.

You will need a system running python with the following modules:

  • paho.mqtt.publish
  • socket
  • binascii
  • time
  • sys
  • string

You will also need a running MQTT server.

Setup

  1. Log into the monitoring device, and configure the second IP option to point to the server that this daemon is running on. (Daemon defaults to port 10000) There's a hidden menu available at http://ip-of-data-logger/config_hide.html
  2. Make sure that the MQTT settings are correct in the daemon.
  3. Start the daemon
  4. Add the following to your OpenHAB items (Replace XXXXXXXXXX with the serial number of your inverter)
// Environmentals
Number Solis_Temp "Temperature [%.2f °C]" (Solis) { mqtt="<[mymosquitto:ginlong/XXXXXXXXXX/Temp:state:default" }

// DC
Number Solis_DC1Volt "DC Volts [%.2f V]" (Solis) { mqtt="<[mymosquitto:ginlong/XXXXXXXXXX/Vpv1:state:default" }
Number Solis_DC1Amp "DC Current [%.2f A]" (Solis) { mqtt="<[mymosquitto:ginlong/XXXXXXXXXX/Ipv1:state:default" }

// AC
Number Solis_AC1Volt "AC Volts [%.2f V]" (Solis) { mqtt="<[mymosquitto:ginlong/XXXXXXXXXX/Vac1:state:default" }
Number Solis_AC1Amp "AC Current [%.2f A]" (Solis) { mqtt="<[mymosquitto:ginlong/XXXXXXXXXX/Iac1:state:default" }

// Stats
Number Solis_kWhToday "kWh today [%.2f kWh]" (Solis) { mqtt="<[mymosquitto:ginlong/XXXXXXXXXX/kwhtoday:state:default" }
Number Solis_kWhTotal "kWh total [%.2f kWh]" (Solis) { mqtt="<[mymosquitto:ginlong/XXXXXXXXXX/kwhtotal:state:default" }
  1. These items should now be accessible in your rules. If you have influxdb and grafana set up, you should also be able to start producing graphs

Alternative setup

  1. Set a static DNS entry in your router and point data1.solarmanpv.com and data2.solarmanpv.com to the server hosting this script.
  2. Make sure to use port 10000 since this is the default port used by ginlong portal

ginlong-mqtt's People

Contributors

codeworkx avatar dpoulson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ginlong-mqtt's Issues

MW_08_0501_1.58 - >>> 214 byte long payload message PROTOCOL

Here the decoding of the 214 byte long payload message found on my Solis Mini 1000 Single Phase Inverter ....

====================================
Solis/Ginlong Wlan Logger Protocol

Solis Mini 1000 Single Phase Inverter
Firmware version (logger): MW_08_0501_1.58

214 byte data packet

Position Type Modifier Data

0-1 hex headCode hex(a5)
14-21 Ascii Data logger serial number
64-93 Ascii Inverter serial number

96-99 hex /10 Inverter temperatur
100-103 hex /10 Vpv
106-109 hex /10 Ipv
114-117 hex /10 Iac
128-131 hex /10 Vac
140-143 hex /100 Fac (Frequency)

144-149 hex Power
146-149 base

150-157 hex Power today
154-157 base

158-165 hex Power total
162-165 base

194-195 hex /1 Power this month
198-199 hex /1 Power last month

212-213 hex endCode hex(15)

MW_08_0501_1.58 - 476 length messages

Thanks for pointing me here @codeworkx! Gave this a spin. Small messages with the serial, firmware version etc seem to be decoded OK, but the "long" 476 length messages with most of the data I need seem to not be decoded.

Firmware version is MW_08_0501_1.58.

Some logs:

listening on 0.0.0.0:10000
waiting for a connection
connection from ('192.168.1.27', 14502)
Length of hex data is 198
Hex data: b'a556001041000146cd6fef0268622f021000000000000000053c780260034d575f30385f303530315f312e35380000000000000000000000000000000000000000000000000098d8638dfd8a3139322e3136382e312e32370000000000000101054c15'
Got data logger core data message
Data logger serial 4017081670
Data logger firmware: MW_08_0501_1.58
Data logger MAC: 98d8638dfd8a
Response: b'a50a001011020146cd6fef0201b0013960780000006415'
Finally
waiting for a connection
connection from ('192.168.1.27', 13220)
Length of hex data is 476
Hex data: b'a5e1001042020246cd6fef0105056a622f0212000000489f095e01003be6020031313046353031393331383030353320bd00970f2e000d0000001400000000007709000000008b13f90100006801000064640000000000000107000000000000000000000000000000000000060200004e0000005f0000005c00ad0000000d0000003b030000c9030000e803150002001a000e000b0034007a091c0170feffff0500ee010000000096091400140063002a1300006400fa0000000000720325007a0100000300160066010000020015008e25000054000c0000000000872f000078000c01f5001200210001008815'
hexdata has invalid length
Finally
waiting for a connection
connection from ('192.168.1.27', 13374)
Length of hex data is 476
Hex data: b'a5e1001042020346cd6fef01050574622f021c000000489f095e01003be6020031313046353031393331383030353320bd00970f2e000d0000001400000000007709000000008b13f90100006801000064640000000000000107000000000000000000000000000000000000060200004e0000005f0000005c00ad0000000d0000003b030000c9030000e803150002001a000e000b0034007a091c0170feffff0500ee010000000096091400140063002a1300006400fa0000000000720325007a0100000300160066010000020015008e25000054000c0000000000872f000078000c01f5001200210001009d15'
hexdata has invalid length
Finally
waiting for a connection
connection from ('192.168.1.27', 15840)
Length of hex data is 476
Hex data: b'a5e1001042020446cd6fef0105057f622f0227000000489f095e01003be6020031313046353031393331383030353320bd00970f2e000d0000001400000000007709000000008b13f90100006801000064640000000000000107000000000000000000000000000000000000060200004e0000005f0000005c00ad0000000d0000003b030000c9030000e803150002001a000e000b0034007a091c0170feffff0500ee010000000096091400140063002a1300006400fa0000000000720325007a0100000300160066010000020015008e25000054000c0000000000872f000078000c01f500120021000100b415'
hexdata has invalid length
Finally
waiting for a connection
connection from ('192.168.1.27', 18679)
Length of hex data is 0
Hex data: b''
hexdata has invalid length
Finally
waiting for a connection
connection from ('192.168.1.27', 12894)
Length of hex data is 476
Hex data: b'a5e1001042020546cd6fef0105058f622f0237000000489f095e01003be6020031313046353031393331383030353320bd00970f2e000d0000001400000000007709000000008b13f90100006801000064640000000000000107000000000000000000000000000000000000060200004e0000005f0000005c00ad0000000d0000003b030000c9030000e803150002001a000e000b0034007a091c0170feffff0500ee010000000096091400140063002a1300006400fa0000000000720325007a0100000300160066010000020015008e25000054000c0000000000872f000078000c01f500120021000100d515'
hexdata has invalid length
Finally
waiting for a connection
connection from ('192.168.1.27', 17537)
Length of hex data is 476
Hex data: b'a5e1001042020646cd6fef0105059a622f0243000000489f095e01003be6020031313046353031393331383030353320bd00970f2e000d0000001400000000007709000000008b13f90100006801000064640000000000000107000000000000000000000000000000000000060200004e0000005f0000005c00ad0000000d0000003b030000c9030000e803150002001a000e000b0034007a091c0170feffff0500ee010000000096091400140063002a1300006400fa0000000000720325007a0100000300160066010000020015008e25000054000c0000000000872f000078000c01f500120021000100ed15'
hexdata has invalid length
Finally
waiting for a connection
connection from ('192.168.1.27', 13214)
Length of hex data is 476
Hex data: b'a5e1001042020746cd6fef010505a5622f024e000000489f095e01003be6020031313046353031393331383030353320bd00970f2e000d0000001400000000007709000000008b13f90100006801000064640000000000000107000000000000000000000000000000000000060200004e0000005f0000005c00ad0000000d0000003b030000c9030000e803150002001a000e000b0034007a091c0170feffff0500ee010000000096091400140063002a1300006400fa0000000000720325007a0100000300160066010000020015008e25000054000c0000000000872f000078000c01f5001200210001000415'
hexdata has invalid length
Finally
waiting for a connection
connection from ('192.168.1.27', 16949)
Length of hex data is 0
Hex data: b''
hexdata has invalid length
Finally
waiting for a connection
connection from ('192.168.1.27', 16641)
Length of hex data is 28
Hex data: b'a501001047020846cd6fef00d315'
Got data logger serial message
Data logger serial: 4017081670
Response: b'a50a001017e66b46cd6fef000103023960780000000a15'
Finally
waiting for a connection
connection from ('192.168.1.27', 19914)
Socket timeout occured!
Response: b'a50a00100000004e4fa7ef10003f02396078000000af15'
Finally
waiting for a connection
connection from ('192.168.1.27', 17704)


Length of hex data is 28
Hex data: b'a501001047020946cd6fef00d415'
Got data logger serial message
Data logger serial: 4017081670
Response: b'a50a001017e66b46cd6fef00017a023960780000008115'
Finally
waiting for a connection
connection from ('192.168.1.27', 18757)
Length of hex data is 0
Hex data: b''
hexdata has invalid length
Finally
waiting for a connection
connection from ('192.168.1.27', 12409)
Socket timeout occured!
Response: b'a50a00100000004e4fa7ef1000b6023960780000002615'
Finally
waiting for a connection
connection from ('192.168.1.27', 14151)
Length of hex data is 0
Hex data: b''
hexdata has invalid length
Finally
waiting for a connection
connection from ('192.168.1.27', 12796)

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.