Skip to content

Grottserver

Johan Meijer edited this page Jan 18, 2024 · 3 revisions

Grottserver is emulating the Growatt server so you do not need a connection with the growatt servers (in china) anymore but still can use the features of grott sending data to MQTT(and everything using this like HA, Nodered etc), Inlfuxdb or pvoutput.

Grottserver provides also an API interface to read and write Inverter and Datalogger registers.

The server is listing to 2 ports: 5782 for API commands (and a simple browser interface) and 5781 for emulating the growatt server.

In schematics:

image

The Grott docker container image only contains the Grott proxy.

The Grottserver docker container image runs both Grott and Grottserver (but as shown in the picture with one communication flow).

grottserver use

Install needed python libraries

pip3 install libscrc 

Start the grottserver:

pyhon3 grottserver.py 

grottserver will start to listen at the server ip address and port 5781 for data, and at port 5782 for API commands.

Change grott.ini file to route the data to grottserver, add or change:

 [Growatt] 
 #ip address and port of Growatt server (specify only if IP has changed)
 ip = <your.server.ip.address>
 port = 5781                                                 <== differs from previous grottserver version!!!!!!

Restart Grott

sudo service grott restart

Docker support

There is a Grottserver docker image available (ledidobe/grottserver). This image contains the Grott proxy and Grottserver and can work as a standalone solution.

For more information see: https://hub.docker.com/repository/docker/ledidobe/grottserver/general

HTTP (API) interface

Show home page (under development)
 (from browser)
 http://<your ip>:5782 
get datalogger / inverter information
get <your ip>:5782/datalogger  
get <your ip>:5782/inverter
read datalogger register
get <your ip>:5782/datalogger?command=register&register=<regno>&datalogger=<your datalogger>
- register in decimal
- output json "value" in text 
read inverter register
get <your ip>:5782/inverter?command=register&register=<regno>&inverter=<your inverter>&format=<dec,hex,text>
- register in decimal
- output json "value" in decimal (standard) or hex (format = hex), text (format = text)   
write datalogger register
put <your ip>:5782/datalogger?command=register&register=<regno>&datalogger=<your datalogger>&value=<your value>
- register in decimal
- "value" in text 
write inverter register
put <your ip>:5782/inverter?command=register&register=<regno>&inverter=<your inverter>&value=<your value>&format=<dec,hex,text>
- register in decimal
- "value" in decimal (standard) or hex (format = hex), text (format = text)   

special commands

 get <your ip>:5782/datalogger?command=regall&datalogger=<your datalogger>
 - shows all datalogger register information being read by the api command or published by datalogger 
 - initial time information is sent to early (before grottserver sets time command) and not accurate

 get <your ip>:5782/inverter?command=regall&inverter=<your inverter>
 - shows all inverter register information being read by the api command 

considerations

  • datalogger registers not document by growatt.
  • datalogger register 4 => update interval in seconds (e.g 5 or 1 or 0.5)
  • datalogger register 31 => time (e.g 2022-05-17 21:01:50)
  • datalogger register 17 => growatt server (now grott) ip addres (e.g. 192.168.0.206)
  • datalogger register 18 => growatt server (now grott) ip port (e.g. 5279)
  • during startup of the inverter grottserver will sent a time command (with server time) to sync time
  • inverter registers are documented in the modbus protocol documents from growattat the holding reg paragraf from growatt (see discussion #98).
  • there are separate protocol documents for the xxxx-s, SPF and TL-X/TL3-X/MIX/SPA/SPH (1 document).
  • inverter register documentation is not always complete (at least for xxxx tl-s inverters.
  • inverter register read /write command response are relatively "slow"(seconds) and sometimes not valid (showing "0000" while that is not always the value). A second read is then necessary. Until now I do not have a answer for this problem. Seems to be a communication mismatch between inverter / datalogger.
  • Inverter register units to be used are document in the protocol document (e.g 0.1v, 0,1VA, percent, 0.01hz, ASCII). E.g. this means change grid voltage low to 185 , you have to specify 1850. This is different from the Growatt site but unavoidable without a lot of programming and data analyses (for all inverters).
  • All get commands can also be sent via the browser, for put you need a tool like postman or curl.