diy solar

diy solar

Hacking the new Growatt WiFi-F modules

What channel is your WiFi running on? These ESP chips don't support channels above 11 by default. Try 1 or 6.
Are you also using WPA2 encryption?
New APs worked. It’s connected.
MQTT sees the info being shared from it but I can’t seem to add it as a device in HA. So I have not entities to access. Any Ideas?

(MQTT currently only has my alarm as a device)
 
Last edited:
New APs worked. It’s connected.
MQTT sees the info being shared from it but I can’t seem to add it as a device in HA. So I have not entities to access. Any Ideas?

(MQTT currently only has my alarm as a device)
I manually added all the mqtt topic as sensors within Home Assistant
 
Here's the list of working registers:

Name
Address Offset (from 0x1000)
Type
Multiplier
Unit
System Status​
0​
uint16_t​
1​
0: Standby;
1; (No Use);
2: Discharge;
3: Fault;
4: Flash;
5: PV charge;
6: AC charge;
7: Combine charge;
8: Combine charge and bypass;
9: PV charge and bypass;
10: AC charge and bypass;
11: Bypass;
12: PV charge and discharge;​
PV Voltage​
1​
uint16_t​
0.1​
Volts​
PV Power​
3​
uint32_t​
0.1​
Watts​
Buck Converter Current​
7​
uint16_t​
0.1​
Amps​
Output Watts​
9​
uint32_t​
0.1​
Watts​
Output VA​
11​
uint32_t​
0.1​
VA​
AC Charger Watts​
13​
uint32_t​
0.1​
Watts​
AC Charger VA​
15​
uint32_t​
0.1​
VA​
Battery Voltage​
17​
uint16_t​
0.01​
Volts​
Battery SOC​
18​
uint16_t​
1​
Percent​
Bus Voltage​
19​
uint16_t​
0.1​
Amps​
AC Input Voltage​
20​
uint16_t​
0.1​
Volts​
AV Input Frequency​
21​
uint16_t​
0.01​
Hertz​
AC Output Voltage​
22​
uint16_t​
0.1​
Volts​
AC Output Frequency​
23​
uint16_t​
0.01​
Hertz​
Inverter Temperature​
25​
uint16_t​
0.1​
Degrees C​
DC to DC Converter Temperature​
26​
uint16_t​
0.1​
Degrees C​
Load Percentage​
27​
uint16_t​
0.1​
Percent​
Buck Converter Temperature​
32​
uint16_t​
0.1​
Degrees C​
Output Current​
34​
uint16_t​
0.1​
Amps​
Inverter Current​
35​
uint16_t​
0.1​
Amps​
AC Input Watts​
36​
uint32_t​
0.1​
Watts​
AC Input VA​
38​
uint32_t​
0.1​
VA​
PV Energy Today​
48​
uint32_t​
0.1​
kWh​
PV Energy Total​
50​
uint32_t​
0.1​
kWh​
AC Charger Today​
56​
uint32_t​
0.1​
kWh​
AC Charger Total​
58​
uint32_t​
0.1​
kWh​
Battery Discharge Today​
60​
uint32_t​
0.1​
kWh​
Battery Discharge Total​
62​
uint32_t​
0.1​
kWh​
AC Charger Battery Current​
68​
uint16_t​
0.1​
Amps​
AC Discharge Watts​
69​
uint32_t​
0.1​
Watts​
AC Discharge VA​
71​
uint32_t​
0.1​
VA​
Battery Discharge Watts​
73​
uint32_t​
0.1​
Watts​
Battery Discharge VA​
75​
uint32_t​
0.1​
VA​
Battery Watts​
77​
int32_t​
0.1​
Watts​
Fan1​
82​
uint16_t​
1​
Percent​
Fan2​
83​
uint16_t​
1​
Percent​


My new challenge is that the inverter's MODBUS interface seems to stop responding after a couple days operation with my ESP firmware. A complete power cycle of the system brings it back online. I'd be interested to know if anyone else experiences this.
System running, however it appears not all data is accurate & up-to-date or is unknown
Going to look into InfluxDB and/or Grofana.
Seems like i might end up with solar assistant in the end :(

Also pretty sure there is more available MODBUS infor as the Shine firmware gave real-time PV Production info, utility consumption, battery consumtpion.
Where did you find the MODBUS register info for the inverter?

Extra info: Using HA with MQTT to view the data.
 
System running, however it appears not all data is accurate & up-to-date or is unknown
There must be something wrong with your setup - all the data that's available via MODBUS is sent to MQTT with minimal changes.

real-time PV Production info, utility consumption, battery consumtpion.
All of this is covered in the following registers:
PV_Voltage
PV_Power
AC_Input_Watts
Battery_Discharge_Watts

If you can't see this information or it's incorrect, there must be something wrong with the way it's being received or interpreted by HA, because it's definitely sent to MQTT. You can see an example of what you should expect in the MQTT Dash screenshot on my GitHub page.

Where did you find the MODBUS register info for the inverter?
From the Growatt MODBUS protocol documentation. I attached it here: https://diysolarforum.com/threads/hacking-the-new-growatt-wifi-f-modules.43231/post-551228
 
Last edited:
There must be something wrong with your setup - all the data that's available via MODBUS is sent to MQTT with minimal changes.


All of this is covered in the following registers:
PV_Voltage
PV_Power
AC_Input_Watts
Battery_Discharge_Watts

If you can't see this information or it's incorrect, there must be something wrong with the way it's being received or interpreted by HA, because it's definitely sent to MQTT. You can see an example of what you should expect in the MQTT Dash screenshot on my GitHub page.


From the Growatt MODBUS protocol documentation. I attached it here: https://diysolarforum.com/threads/hacking-the-new-growatt-wifi-f-modules.43231/post-551228
I rechecked all my yaml code to add each topic as a sensor in HA. All seems okay. I can't get any AC Input info (all shows 0, even though it is receiving ac input). Any ideas?
 

Attachments

  • Screenshot 2023-05-18 at 20.21.41.png
    Screenshot 2023-05-18 at 20.21.41.png
    858 KB · Views: 21
  • Inverter MQTT YAML CODE.pdf
    25.9 KB · Views: 14
I rechecked all my yaml code to add each topic as a sensor in HA. All seems okay. I can't get any AC Input info (all shows 0, even though it is receiving ac input). Any ideas?
I can't see anything wrong with the YAML code.
Next step would be to connect directly to the WiFi-F stick to see what it's doing.

You can connect to the IP address of the WiFi-F stick using telnet on port 23. You should see heaps of information scrolling past, including all the measurements. Run that for 30 seconds and post the results, we might be able to see where the problem is coming from.
 
Wouldn't accept the code for port 23, just the ip worked (eg: 'telnet 192.168.10.52')
Here is the info it got.
 

Attachments

  • Screenshot 2023-05-19 at 18.14.14.png
    Screenshot 2023-05-19 at 18.14.14.png
    109.7 KB · Views: 13
  • Screenshot 2023-05-19 at 18.14.38.png
    Screenshot 2023-05-19 at 18.14.38.png
    19.6 KB · Views: 10
Wouldn't accept the code for port 23, just the ip worked (eg: 'telnet 192.168.10.52')
Here is the info it got.
That's good - you can see that the WiFi-F stick is successfully retrieving and processing the statistics from your inverter, however it's having trouble connecting to (and maintaining a connection with) your MQTT server. This is probably due to an issue on the MQTT server of some kind.

Can you ping the IP address of the WiFi-F stick reliably from your MQTT server?
 
That's good - you can see that the WiFi-F stick is successfully retrieving and processing the statistics from your inverter, however it's having trouble connecting to (and maintaining a connection with) your MQTT server. This is probably due to an issue on the MQTT server of some kind.

Can you ping the IP address of the WiFi-F stick reliably from your MQTT server?
Im not sure how to go about doing that?
Currently HA is the only thing running a MQTT server.
 
Im not sure how to go about doing that?
Currently HA is the only thing running a MQTT server.
I imagine you're running HA on a Raspberry Pi, or something like that?
Log into the computer that's running HA through SSH, then use the ping command to ping the IP of your WiFi-F stick for a few minutes and see if you have any high latency or packet loss.
 
I imagine you're running HA on a Raspberry Pi, or something like that?
Log into the computer that's running HA through SSH, then use the ping command to ping the IP of your WiFi-F stick for a few minutes and see if you have any high latency or packet loss.
Okay, thank you. I'm in the process of migrating Home Assistant so have no MQTT server/ broker running at the moment. Will update you when im up and running again.
 
I imagine you're running HA on a Raspberry Pi, or something like that?
Log into the computer that's running HA through SSH, then use the ping command to ping the IP of your WiFi-F stick for a few minutes and see if you have any high latency or packet loss.
I cant get Influx DB within HA to collect/ receive any data. I did change the code in 'SECRETS.h' (Secret_influxdb - to the HA ip address of HA and created a username, password and db name which i created in HA influxdb) and uncommented the include lines for influx db. Need my code?
what am I doing wrong :(
 
I cant get Influx DB within HA to collect/ receive any data. I did change the code in 'SECRETS.h' (Secret_influxdb - to the HA ip address of HA and created a username, password and db name which i created in HA influxdb) and uncommented the include lines for influx db. Need my code?
what am I doing wrong :(
I'm not sure I understand. Home Assistant doesn't come with InfluxDB.
Did you try to use the Home Assistant InfluxDB integration somehow?
 
Yes, I used the InfluxDB Add on.
I think you're misunderstanding some of the fundamentals of how HA works, and what InfluxDB is. The HA add-on I linked to above is just an InfluxDB client, it's not the server itself. You'd need to install and configure InfluxDB separately to receive data from your inverter. HA doesn't provide this capability and won't have much to do with this process.
 
Hey - I'm baaack.... :) while I like the solar assistant setup I have, I'd prefer to use my Raspi for other things... plus I'm migrating everything to ESPHome now from Tasmota (won't get into that discussion here...) I was coming back to see if anyone had worked on firmware for the wifi module that used API calls to HA.. and found that ESPHome appears to already have something created for Growatt?


I haven't dug out the adapter yet to see how it works or even verify that the ESPHome code works for my model inverter.. thought I would ask for any experience/opinions first?

I've been using external Grafana and HA Lovelace monitoring pages and it works really well, except MQTT sometimes stops updating. ( Growatt->solarassistant->mqtt->Homeassistant->prometheus->grafana)

Simply exposing a Prometheus exporter endpoint from the wifi dongle would work - if I only used Prometheus to review metrics - but I do have automation that uses the data also so I prefer it to go through HA.
 
Yes, I dumped the stock firmware before I started experimenting with my own, I've attached it for whoever might want a copy.

I can also post all the MODBUS registers if it'd be helpful, through trial and error I found that the documentation for these systems has a couple mistakes and many registers that don't return anything useful.
I bricked my Shine Wifi-S module while trying to update it.

Do anyone know whether the firmware bumped inhere for the Wifi-F also applies for the Wifi-S ? Or does anyone know where to get an original firmware for the Wifi-S?

Thx
 
I bricked my Shine Wifi-S module while trying to update it.

Do anyone know whether the firmware bumped inhere for the Wifi-F also applies for the Wifi-S ? Or does anyone know where to get an original firmware for the Wifi-S?

Thx
The firmware in this thread is only tested and known to work on the WiFi-F. You might be best trying to contact Growatt directly to see if they can help.
 
The firmware in this thread is only tested and known to work on the WiFi-F. You might be best trying to contact Growatt directly to see if they can help.
Ok. I bought a new Wifi-S and made a dump of the firmware.

Just attaching it here in case others should look for the Shine Wifi-S firmware version 3.0.0.2
 

Attachments

  • ShineWifi-S_3.0.0.2_flash.zip
    293.7 KB · Views: 20
Back
Top