I got this working really easily with my shinewifi-S and Growatt 3000-S inverter. However, my Growatt inverter shuts itself off when there is no power from the solar panels. Which leaves my total energy produced today set to unavailable, which means I cannot add a simple ‘this was todays energy production’ to my main dashboard. After lots of threads with complicated setups to fix this, I decided this needs a simple SQL sensor:
select *
from states
where entity_id = 'sensor.growatt_today_s_generation'
and state != 'unavailable'
and state != 'unknown'
order by state_id desc
limit 1;
Then select the state column for the sensor value, and set units of measurement to kWh. This always shows the last value of today’s generation, updated every 30 seconds. This every 30 seconds makes it less efficient than event based, but also much more simple to setup. A second SQL sensor showing total power can also be added.
This works - but has someone found a better way to mark these two sensors as never being unavailable, instead of this trick?
What is the config that you use? What is your history looks like? It seems it gets a big number somewhere. It is fixable in analytics but of course not how it is meant to be.
I really cant say what is causing this. -But my theory is that the inverter maybe switches between on-/offline a couple of times during the odd days which leads to an accumulating value? (My total production so far is only 97.4 kWh and my reading from the inverter seems correct and accumulating with no spikes).
17/12-22 EDIT: today it happended again. It seems to show exactly 4x the total production of my inverter when this occurs.
Manage to flash both my sticks S + X via VSCode with the PlatformIO plugin… The S was connected with a USB-TTL CP2102 converter, RX-TX needed NOT to be crossed and baudrate needed to be lowered to 115200.
Could not get them flashed with my MBPro M1, the device was found but timeout while flashing perhaps due to the USB-C to USB conversion? So I used a x86 Intel NUC with Ubuntu (again with VSCode) which worked fine. Both devices now show their graphs nicely when connecting to their IP.
I do have a question about the integration in HA, whenever I add the below to my configuration.yaml the configuration check hangs and it does not want to restart (I did not force it since it will probably not come up).
So am I missing some integration? some modbus support somewhere?
I’m having trouble setting the powerfactor. I’ve got all sensors working and can even read holding address 3 with the powerfactor but the code below does not work.
<code language== “YAML” >
number:
platform: modbus_controller
modbus_controller_id: growatt3000
id: pv_powerfactor3000
name: “PV inverter Power factor Growatt 3000”
address: 0x3
value_type: U_WORD
lambda: "return x; "
write_lambda: |-
ESP_LOGD(“main”,“Modbus Number incoming value = %f”,x);
uint16_t powerfactor = x ;
payload.push_back(powerfactor);
return x;
I get this response:
[13:23:54][D][number:054]: ‘PV inverter Power factor Growatt 3000’ - Setting number value
[13:23:54][D][number:113]: New number value: 99.000000
[13:23:54][D][main:070]: Modbus Number incoming value = 99.000000
[13:23:54][D][number:012]: ‘PV inverter Power factor Growatt 3000’: Sending state 99.000000
[13:23:55][D][modbus_controller:029]: Modbus command to device=1 register=0x00 countdown=0 no response received - removed from send queue
[13:23:56][D][text_sensor:067]: ‘Growatt3300 Status’: Sending state ‘Unknown’
[13:24:10][D][modbus.number:023]: Number new state : 100.00
And the number value goes back to 100 percent. What do I do wrong?
Hi,
First of all, thanks for all the hard work.
Question: I have a SPH-5000 inverter, connected to an SDM230-Modbus meter (connected by RJ45), in order to get house consumption data besides the production data. All the data us being sent by my Shine Wifi-S stick to growatt servers (with grott in the middle).
Using this method, will I be able to define sensors in ESPHome for all the data? I mean, not only for the production but also for the consumption data?
For anyone with SPH 10k-TL3 BH-UP here’s what worked for me for keeping the original USB stick and connections to the Growatt cloud and local updates every 10s. There are obviously far more values in the registers, I set up just what I was interested in…
Hi Plawa,
I have an exact configuration as you do: 10k Growatt inverter, ESP32 board and MAX 485/TTL module. Tried your esphome code but there are no readings received from the inverter. I’am not sure about the pins - eventhough 1 and 5 are mentioned in the documentation, If I measure the voltage on these pins (connected to RS485-3 port on the inverter) there is only 15 mV but should be like 200 mV. Strange. Could you please check the RS485 settings one the invertor? It is under Basic parameters/RS485 Adr/COM Address, you can get to the settings menu by long press of the OK button next to inverter display? I have 001 there, not sure if this is the right value.
I checked my inverter config, it’s set to 001, plus when I measure the voltage across the pins I’m using I get ~1.7V… from what I have read it can either be pin 1&5 or 4&5, see if that works for you.
Hi Plawa, I tried pins 1&5 and 4&5, also tried two diffeent boards - ESP8266 and ESP32 with two different RS485/UART modules but with no success. Seems like there is no data coming from the RS485-3 connector. Maybe it must be enabled somewhere in the invertor settings but I have no clue of where to do it. Will investigate it a bit further. Thanks a lot. Pavel
Hi Plawa! I will like to see what model of RS 485 you have used. Can you post a picture with your setup?
Regarding HA Card, what card did you use? Is looking very nice. Thanks!
There is an on-screen menu for configuring the RS485. Hold down the OK button for a couple of seconds until it says “Basic Parameters”, and then you can navigate to RS485 settings. (SPH10000-TL3)
Hi Christoffer, yes, I am anware of this settings. We checked with Plawa in an offline communication that his settings is “unused” (other are ShineMaster, VPP and Meter2). For me having set “unused” does not help either. Will investigate furhter over the weekend but seems I am stuck with no ovious reason.
Hello there, im going to buy a SPH3600, i can see that you have export to grid information, is that provided by the GroWatt inverser or dou you use something else?