-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: send commands to Growatt inverter #73
Comments
Okee.... Nice challenge! At this moment Grott is not able to send commands to the inverter. I do not say I do not want that (I like by example to be able to change sample rate and inverter time) but I still have to find out how the command structure looks like. Grott can recognize and block commands coming from the Growatt server. If we know what the command should be (if it is possible to switch the output mode by command) we can try to implement it. Do you know if it is possible to sent this command from the growatt.server.com website (via the inverter setting menu)? If that is possible we can try to "catch" the command and see how it looks like. |
Yes, it is possible - i was thinking about inplementing some debug logging on the python code to extract the package. Everytime i change a parameter from growatt server i see the packages flowing though grott. Will try to log and send it back to you. Thanks ! count with my full support to test it! :) |
on grottproxy.py i included the line 126 as below:
This is the result when i issue a command from ShrinePhone:
Looks like it receive two commands for this particular parameter. |
That is nice. We are to see the command.I am a little bit worried about the format. It is now a mix of binary and string data. Can you do it again with the original grottproxy.py and minrecl = 1 added in the generic session of the grott.ini file. This should enable printing of all records (in binary format only). If this does not work I will try to debug your printed data. One think we also have to think about is how we can trigger Grott to send the commands. We need some kind of interface (API/Dashboard/MQTT read) to "talk" with Grott. I you or somebody else has ideas on this please let me know. |
Here it is: 1, Change AC Output source to Batt priority:
I also send another command with a numeric parameter "Battery to Mains operating point" where i set it to 44 volts:
My suggestion on sending commands to grott - at least for testing and alpha stage would be nice to have a (quick and dirty) python command issuing the interaction with the value or command we need to issue - it could be the beginning of an API code. Final result by monitoring MQTT would be awesome as it would allow a more clean and nice solution for automation. I tried to find documentation of commands to send but unfortunately, i couldn't find nothing. But it seems that it wont be that difficult to reverse engineer or replay the streams. will put some time on it to document all the strings and most useful commands for automation. If you agree, please let me know the best format to have the data. Thanks! |
Thanks for the records. I am going to try debug it and build it in Grott. It will take some time while I, as stated, have a find a way how to sent commands to grott and I can only test it in the weekends. My growatt inverter only works when it is generating energy and that is not the best part of the year for it now in the Netherlands. Next to it I have to do some gitthub administration/validation (committing or declining pull requests) before I can move on with a next release. Of course I can test with your commands (I have a simple inverter only for Solar panels attached) but can try it with commands (like set time, sample frequentie, set ip address/ports etc) that my inverter understands. Be aware if you specify blockcmd = true in the .ini file any command coming from the growatt server (except set time) should be blocked. |
Thanks Johan, Take your time and I'm fully available to support in anything necessary - also if you need access to my box to debug and test anything you need. I'm running Gentoo so it should be pretty easy to do anything there. |
Hello, not sure if this is helpful (since it's reverse engineered from the public api), but I've seen a fork of PyPi_Growatt that has added settings functionality. https://github.com/muppet3000/PyPi_GrowattServer/tree/feature/add-settings-functionality |
Thanks for the hint. I am going to look at it! |
Hi - thanks for sharing. I took a look and (if i got it right) the fork took a different approach to send to Growatt server the updates we need. I'm an Iphone user but my device is jailbroken so I need to setup a SSL sniffer to capture traffic of the parameters I'd like to control and call this library for it. But the approach GROTT could implement would be more reliable as we're operating on inverter side and (i believe) less susceptible ( and dependent) on Growatt server woes. |
That's excellent. Thanks for investigating. I've managed to get some info via mitmproxy if that's useful? Mostly stimulating a settings change on the website and seeing what is sent with the POST. I'm happy to lend a hand if it would be useful info :) |
Hi @mjdyson - I managed to make it work! a BIG thank you !! Still on early stages, i used burpsuite as a proxy server in linux and SSL Kill Switch jailbreak tweak to temporary bypass IOS SSL pinning and with proxy settings i was able to capture SSL traffic from ShinePhone app. For me, I was interested to change AC_Source and Charger_source, so now I'm able to run automations for ex. in case weather forecast shows only rainy days i can configure Growatt to act more like an UPS and prioritize charged batteries in case i lose grid and have little sun available. To make it work, i have to edit init.py and change default op parameter (line 605) to "storageSPF5000Set2020". I tweaked examples/setings_example.py as below:
Johan, I still belive it would be more elegant and reliable to send commands through GROTT. Anytime you need me to test, I'm fully available! |
Hi, Has there been any progress on this? I have just installed this inverter and want to do a similar process of controlling charge and output from home assistant. |
See discussion #104. With grottserver (beta in 2.7.4). It should be possible. |
I went over this page and discussion #104 and I cant see if its possible to send commands to the inverter and how. Any word on this? |
Your right is is discussion: #98. Sorry! |
Has anyone off you got this working? I want to pause or stop my inverter when my dynamic energy prices are negative. Thanks, |
This is available with Grottserver (see #98). |
Hi there,
First of all, thank you very much for dedicating your time to this project - i appreciate it much.
I'd like to ask to consider a new functionality to send commands to the devices in proxy mode.
Ex. I run an SFP3500ES and I'd like to set some automated logic with Homeassistant behind standard growatt logic and set device output mode according to particular needs ex. change from SOL to SBU or GRID in case a storm is coming and i need to charge the batteries while i am away from home.
I tried to find a way to do it by using modbus but I'm still on early stages and i thought it might be something easy to implement in Grott.
The text was updated successfully, but these errors were encountered: