johanmeijer / grott

Growatt inverter monitor
https://github.com/johanmeijer/grott/wiki
389 stars 108 forks source link

API call Grott-server #334

Open T1gg1 opened 1 year ago

T1gg1 commented 1 year ago

Heyho! If I put it: XXX.XXX.XXX.XXX:5782/datalogger?datalogger=XXXXXXXXXX&command=register&register=03&value=50

Then the grott-server-console shows "- Grotthttpserver - http response send: 400 text/body b'invalid datalogger id ' "

Can anybody help? BR

johanmeijer commented 1 year ago

Works fine for me (with postman). What do want to change with register 3? Seems to be 0 for my both inverters.

T1gg1 commented 1 year ago

https://forum.iobroker.net/assets/uploads/files/1550402978050-growatt-pv-inverter-modbus-rs485-rtu-protocol-v3.05-%E5%AE%A2%E6%88%B7%E7%89%88.pdf

in this link, that is the max output percentage Do you have another list?

T1gg1 commented 1 year ago

@johanmeijer how do you use that? I thougth I have to use the server with that over the browser. Where I can find the right register?

johanmeijer commented 1 year ago

You have two sets of register, the datalogger and the inverter.

The datalogger registers say something about the connection with the internet and how the data is sent to the outside world. The dataloggers registers are not very good documented. You find some here in the grottserver discussion thread (#98),

The inverter register, that can change inverter behavior, are documented in the growatt documentation as the holding registers. And to be honest they are not all documented well either for all inverters. You find also more in the grottserver discussion thread.

I am not sure if the document you pointing to is the right document for your inverter. This more the document for the "older" type of inverters (o.a. TL-S) The newer type there is a othor document (eg: https://www.scribd.com/document/489508943/Growatt-Inverter-Modbus-RTU-Protocol-II-V1-20-English). For the SPH type inverters there is also a n other document.

T1gg1 commented 1 year ago

@johanmeijer Okay I test it but still I got the following error:

Grotthttpserver - http response send: 400 text/body b'invalid datalogger id ' --
johanmeijer commented 1 year ago

Which tool do you use to sent the httprequest?

T1gg1 commented 1 year ago

my browser

johanmeijer commented 1 year ago

First of all you can not set registers via the browser (browser get a get command and you need to use a put httprequest.

Having said that the command as you show should not give an invalid logger id.

If you use the command:

XXX.XXX.XXX.XXX:5782/datalogger

What do you see? Do you use the first device id for data datalogger command (for me it starts with JPC)? Example:

 {"JPCxxxxxxx": {"ip": "192.168.0.206", "port": 52684, "protocol": "06", "QNBxxxxxxx": {"inverterno": "01", "power": 0}}
T1gg1 commented 1 year ago

{}

that is my response ;)

johanmeijer commented 1 year ago

Are you sure you using grottserver (have you routed the grott.py output to grottserver)?

T1gg1 commented 1 year ago

yes. In the server log there I can see the data from the datalogger. I can see all on my mqtt server as well.

T1gg1 commented 1 year ago

@johanmeijer Do you know what Modbus Register 03 is? :D 4 is the update intervall I wrote 100 to 03 and I don´t know if its right or if something is broken now. I don´t find any updated version

T1gg1 commented 1 year ago

Or can I reset only the register 3?

johanmeijer commented 1 year ago

No panic! If you write to the datalogger registers it will not affect the inverter itself (so no modbus register is being set). You need the inverter API for that.

I do not know what register 3 of the datalogger is. In my two inverters (2 seperat shinewifi-s dataloggers) these register are set to 0. I think you should set it back to 0 also.

T1gg1 commented 1 year ago

I had panic and did a factoryreset on both😅 Register 3 is still 100 so I think that is unused, too Thank you

T1gg1 commented 1 year ago

@johanmeijer I found out that register 123 of my inverter is the exportlimitation. Can I set it via the Api or do I need the right register from the datalogger?

johanmeijer commented 1 year ago

You can set it directly in the inverter. Via the grott api inverter request.

Be aware the inverter interface is a little bit instable (not a Grott thing, also true for doing it via growatt website). Sometimes you have to try it multiple times.

T1gg1 commented 1 year ago

I set the exportlimitation via CT to 40% (api, app and inverter itself) but the inverter produces the full power. Do you know why? Or should I limit the active power? Then it is register 03 as I mentioned😅🙈

johanmeijer commented 1 year ago

I have really no idea. Hopefully somebody else can answer this one.