New feature: grottserver #98
Replies: 136 comments 257 replies
-
Great news! Especially for my privacy and (remote) control of the inverter by Growatt!!! Would be nice if this option is also available for users as me which use the dockerversion. As the envireronment must be configured with names beginning with g.. So looking forward to a docker version of python or even better, included in docker is possible. Two seperate versions is no problem either! |
Beta Was this translation helpful? Give feedback.
-
You can use the grott environmentals ggrowattip and ggrowattport to specify the destination in the docker container. |
Beta Was this translation helpful? Give feedback.
-
Wow - Amazing! just better that i was expecting! is it possible to send both to grott server and also to growatt untill the api to send commands is not available? Asking because i created code to send the commands, but they send it to GW servers and server relay them to the inverter. |
Beta Was this translation helpful? Give feedback.
-
Sorry having it next to each other is not possible (without difficult programming). You will have to wait till I find out how to enable grott (grottserver) to accept and send commands next to maintaining the connection with the inverter. I am working on it. My python skills are improving every day ;) My idea for now is to have an api and maybe browser based interface available in the future. |
Beta Was this translation helpful? Give feedback.
-
Gave it a try and it seems to be working fine. |
Beta Was this translation helpful? Give feedback.
-
@a-dekker thanks for testing and the hint for improvement. I will add that. This is the first beta version of grottserver. Hopefully it will fulfill a need (Monitoring without sending data to China). I am working on a second version which also make it possible to send commands (via an API). But as you already noticed I first have to improve my python socket programming and multi threading skills. In doing so one learns :) The plan is to integrate it with Grott. So no separate server is needed anymore. |
Beta Was this translation helpful? Give feedback.
-
I did some tests with grottserver.py (see discussion #98) as destination in stead of a connection to the growatt server. My conclusion : The growatt server is the limitation when specifying a report frequency <= 1 minute. Lower then that may cause connection errors. With the beta grotserver.py running at the same machine as grott 1 minute is no problem. I even manged to run with 0.5 (half a minute) and 0.1 (every 6 seconds) without any problems. Be aware this will increase the PVOutput request limit problem (only 60 request per hour are allowed) A reason more to look for a solution for that ;) |
Beta Was this translation helpful? Give feedback.
-
i have tested the grottserver.py and it works fine. 4200mtl-s respons and the 3600tl-x respons only when the 4200-mtls is down. |
Beta Was this translation helpful? Give feedback.
-
First impression is very good @johanmeijer! Simple enough to quickly respond to the datalogger and skip the need of server.growatt.com. Haven't tested overnight or if the datalogger is reset. Will let this server run overnight and see how it performs. |
Beta Was this translation helpful? Give feedback.
-
Very timely with the growatt server website offline for maintenance at the moment. Well done! |
Beta Was this translation helpful? Give feedback.
-
The MVP-2 with the ability of sending API's is almost there. The basic server (with data and API processing) is in test. I am in the middle of understanding/decoding the commands so I can create useful API's. I am not sure if I have to and can integrate the command processing also in proxy mode (with the growatt server as destination). A stand-alone server is for now the most simple solution. But to be honest at the end (grott 3.x) I want everything in de basic code. |
Beta Was this translation helpful? Give feedback.
-
Hello @johanmeijer do you need any help with decoding the commands? Looking forward to the next release! :) |
Beta Was this translation helpful? Give feedback.
-
@mjdyson that would be helpful. I like to know which commands are being used (or wanted) and how looks the Grott log data (from growatt original data till growatt plain data) for that command. In principle there are 4 commands types:
A register represented a specific value/setting. E,g, For datalogger 04 is the interval, 31 is datetime. For SPF (and SPH?) inverter register 00 is being used for change AC Output source. I would be nice if we had a list of where a register (both datalogger / inverter) is being used for. In the version I am creating now I will make it possible to read/set registers via an API. It would be nice if we can use meaningful keywords in stead of register so e.g. interval instead of reg = 04. I know this is fine tuning but at the end it makes it looking more professional ;). |
Beta Was this translation helpful? Give feedback.
-
@mjdyson @tabascoz I have already found these documents and use them for decoding the data. They are really perfect for that (use the input reg part for that). I think the output reg description should match with the inverter command structure. Although I have not been able to map that directly. For the Datalogger commands (like setting interval, date-time, ip address/port for growattserver, etc)I have not found any description of this yet. So that is something we have to found out by trail and error ( I prefer to call this empirically examining). I agree with developing both methods (register and keywords). The first thing I will do (working on that) is setting registers (inverter and datalogger). Later we can map keywords on registers and create more logical API calls (this can be parameter based like the layout structure and easy adjustable). The current working format of the API is:
Do you agree that, according to API standards, a HTTP GET is a read and POST is an update / change? This means that you can not give commands with a GET (e.g. in a browser address field). I am not sure if all the tooling you are going to use (like HA) can work with this. Is there someone using a shine lanbox? I am really interested in the first communication flow after startup. At the end (if a I have some spare time left) there will be a browser/html interface to see more information on status and give commands. |
Beta Was this translation helpful? Give feedback.
-
Ok. Thanks. T0550xx does not exist. is 01! I know enough for now! This means dat the "address" of the datalogger is always 01! |
Beta Was this translation helpful? Give feedback.
-
Again thank you for your support. The hint with register read/write, might be right. I am also struggeling with the loop in node red read loop. I tried the event_changed and events: state nodes with "If State" is {"value": 0} as a string. But is always fires the false output whether the state is the mentioned value or not. |
Beta Was this translation helpful? Give feedback.
-
Sorry, I'm not sure what you mean. Use the debug nodes to see what the fields and values are of the messages in your NR flows. When I do a GET, the output has the value in the payload, not in the state. |
Beta Was this translation helpful? Give feedback.
-
it reads register4&, not48 ;-)Gesendet von Outlook für Android
|
Beta Was this translation helpful? Give feedback.
-
@johanmeijer: I did some network sniffing and I suddenly realized that my datalogger never get and PUT request from the grott server. How does grott server even know the IP Adress of my datalogger? Am I missing something or do I make a stupid mistake? The data must somehow flow to the inverter/datalogger to be changed. |
Beta Was this translation helpful? Give feedback.
-
Everything else works perfect over a year now.I am also completly puzzled by that. My last resort is the datalogger, which however works fine with register changes, when grottserver is off.BTW. I can confirm now, that after a grottserver restart all register read outs work without problems for a while (a hour or so). The longer it runs, the more unstable become the register reads. Might it be that this is a buffer or cache problem?Gesendet von Outlook für Android
|
Beta Was this translation helpful? Give feedback.
-
With the http://ipaddress:5782/datalogger (or http://ipaddress:5782/inverter)you can see the inverter/dataloggers Grottserver is aware off. With following commands you can see if any "cached" register data: get :5782/datalogger?command=regall&datalogger=
get :5782/inverter?command=regall&inverter=
|
Beta Was this translation helpful? Give feedback.
-
I've never got the regall versions to give me what I expect (a list of all the registers and their values). All I get are the values of registers that I've individually read (roughly, I haven't done a detailed examination). I rarely get any inverter registers if I use regall. Have I misunderstood how it works? I've therefore put together my own version of grottserver that, if I use the url http://ipaddress:5782:registers, will read all registers in the wiki and display them in a very simple web page (here's an example) but it's very slow as it reads each register individually and has to retry when the data logger doesn't respond. |
Beta Was this translation helpful? Give feedback.
-
Regall shows only the register value that are "cached" because of an earlier get register request or because of spontaneously sends (why I do not know) of register information by the datalogger (applies only to datalogger registers I think, never seen one from the inverter). If I have nothing to do anymore maybe I will decode the initial datarecord with register information ("03") from the inverter that is being sent during startup. For now this is only a fleeting thought. |
Beta Was this translation helpful? Give feedback.
-
@johanmeijer I've finally gotten around to taking full advantage of grott and grott server. Seems to be working pretty well, and now I can get 6s updates - woohoo! I was able to check the layouts quite extensively by monitoring what was going through grott, and was confident enough to set the the output and charge sources of my inverter (SPF 5000TL HVM-P) via grott server - so I officially don't need the Growatt web app any more! I don't know about other people but I'm tired of missing data from the inverter and not being able to change the output/charge source whenever I so chose. I've started work on a windows notification area status icon that consumes the MQTT output from grott: To add to my confidence I also added a hard filter to only allow grott to set specific inverter registers with specific possible values. I've also wrapped up calling grott server in a shell script to make it easier to work with. Next up is Home Assistant. These tools are probably quite specific to my inverter model, but would be happy to share if anyone is interested. I believe there is a remarkable amount of consolidated knowledge here - great job! It's taken over a year, but I've finally come to the party :P |
Beta Was this translation helpful? Give feedback.
-
@geoffles Can you explain how you adjusted the update frequency to 6 seconds? I have a Growatt MTL5000 i believe |
Beta Was this translation helpful? Give feedback.
-
Sign into the Growatt Sever with the webinterface and set register 4 to 0.1 |
Beta Was this translation helpful? Give feedback.
-
It could be that Growatt limited the setup. My Interface on the Growatt doesnt set a lower number that 1 anymore! |
Beta Was this translation helpful? Give feedback.
-
Password would be growatt20240219 |
Beta Was this translation helpful? Give feedback.
-
I'm now on an export tariff that pays me whenever I export power. The import and export tariffs vary by time of day (eg between 16:00 and 19:00 I get paid the highest amount for my exports but I also get charged the highest amount if I import). I've tried to automate the charging, discharging of my battery dependent on the time of day. For example, if an hour before the most expensive time, at 15:00, I check the charge in my battery and, if it's low, I charge it up so it will see me through the most expensive period without any need for importing. My automation sets what I think are the required registers (from here) one by one using grottserver. So far it hasn't worked as I expected and there have been the following issues:
Has anyone seem similar behaviour? Is there a correct order for setting the registers (eg time slots before 1092, 1102 or vice versa or more complex)? |
Beta Was this translation helpful? Give feedback.
-
For anyone who's interested, I think I have finally worked out how registers should be set, at least for my SPH inverter:
Note I've created a version of grottserver that allows all three registers of a timeslot to be set in one transaction (see here |
Beta Was this translation helpful? Give feedback.
-
New: Grottserver.py
I added grottserver.py to the 2.7 branche.
Grottserver can be used as destination to send the inverter/datalogger data. It will remove the need to send data to the internet (growatt server).
grottserver use
Install needed python libraries
Start the grottserver:
grottserver will start to listen at the server ip address and port 5782.
Change grott.ini file to route the data to grottserver, add or change:
Restart Grott
Be aware: This is the first version of the server and I like to see your reactions. My experience is for now (after running it a couple of hours): it works!!
Improvements, new functionality will be added in the next versions. Examples (but let me know what you want):
Beta Was this translation helpful? Give feedback.
All reactions