mkaiser / Sungrow-SHx-Inverter-Modbus-Home-Assistant

Sungrow SH Integration for Home Assistant for SH3K6, SH4K6, SH5K-20, SH5K-V13, SH3K6-30, SH4K6-30, SH5K-30, SH3.RS, SH3.6RS, SH4.0RS, SH5.0RS, SH6.0RS, SH5.0RT, SH6.0RT, SH8.0RT, SH10RT, SH5.0RT-20, SH6.0RT-20, SH8.0RT-20, SH10RT-20, SH5.0RT-V112, SH6.0RT-V112, SH8.0RT-V112, SH10RT-V112, SH5.0RT-V122, SH6.0RT-V122, SH8.0RT-V122, SH10RT-V122, SH4.6R
344 stars 92 forks source link

Forced Charge Not Working #162

Closed Crootie closed 5 months ago

Crootie commented 1 year ago

Describe the bug When i change the EMS to forced mode for charging it is not activating. Everything says forced but it won't forced charge.

Your Sungrow inverter:

Home Assistant :

modbus_sungrow.yaml:

Expected behavior Forced Charge should enable buut it isn't.

mkaiser commented 1 year ago

hi,

There was an issue with the EMS mode setting, which was fixed last night. Please ensure, that you are on the 2023-09-12 version.

If you are on the current version: Did you set both parameters? 1) EMSmode --> "Forced mode" 2) Battery forced charge discharge cmd --> "Forced charge"

Crootie commented 1 year ago

config ss ems ss Overview ss

Yep. I updated the Code before I updated HA to 2023.09.02

mkaiser commented 1 year ago

just to be sure: did you wait >10 seconds after setting the mode? It takes some time until the sensors are updated again:

image

is something in the log files?

Crootie commented 1 year ago

have managed to get inverter state to change but it still isn't charging the battery. Have waited about 1 minute before taking screen shots. Not sure where to go to find the logs for this but there is nothing under core or supervisor which point to anything remotely related to the pv.

ems control power ss

Crootie commented 1 year ago

Don't know if this is going to make a difference and after testing it hasn't. says enabled but should be disabled.

ems control

mkaiser commented 1 year ago

Does something happen, if you toggle the "Export power limit mode"?

Also, I recommend completely powering off your system and turn it back on. I had it a couple of times, that the battery was offline. Cold-Restarting helped.

Crootie commented 1 year ago

Does something happen, if you toggle the "Export power limit mode"?

toggled this and it is now disabled. pulled the power on the rpi4 and left it for 5 mins then rebooted. still won't go into forced charge mode even though it says it is. can you guide me to the logs for it?

forced power

mkaiser commented 1 year ago

Does something happen, if you toggle the "Export power limit mode"?

Also, I recommend completely powering off your system and turn it back on. I had it a couple of times, that the battery was offline. Cold-Restarting helped.

oh, that was ambiguous ....

I meant: Please completely power off your inverter / battery :)

(I never cold-restarted my RPI4 the last 3 years, except one power outage...)

mkaiser commented 1 year ago

toggled this and it is now disabled. pulled the power on the rpi4 and left it for 5 mins then rebooted. still won't go into forced charge mode even though it says it is. can you guide me to the logs for it?

Settings --> System --> Logs

image

Then look for something with modbus :)

Crootie commented 1 year ago

Found an error...

Logger: homeassistant.components.modbus.modbus Source: components/modbus/modbus.py:401 Integration: Modbus (documentation, issues) First occurred: 7:15:42 PM (1 occurrences) Last logged: 7:15:42 PM

Pymodbus: SungrowSHx: Exception Response(134, 6, SlaveFailure)

mkaiser commented 1 year ago

Can you enable the debug log for modbus and give me a new log?

Instructions here: https://www.home-assistant.io/integrations/modbus/

search for "logger"

Crootie commented 1 year ago

home-assistant_2023-09-14T09-14-31.021Z.log

okies.. try that.

mkaiser commented 1 year ago

Cannot find any error related to modbus in your logs. Seems all working normal

Crootie commented 1 year ago

Same but it still won't force charge.

mkaiser commented 1 year ago

Let's go some steps back....

What happens if you are using the sungrow App for this?

Crootie commented 1 year ago

forced charge isolar

Let's go some steps back....

What happens if you are using the sungrow App for this?

Well this looks interesting.... not force charging through the app either. I think i might reboot the inverter tomorrow and see if that fixes it. App says it's good but overview is not showing as charging.

Crootie commented 1 year ago

ok restarted the system multiple times. going to contact the supplier of the unit since it isn't working through the sungrow app either. fly out to work tomorrow for 2 weeks so will have limited updates. HA addon still isn't working either even though it is direct connect.

STL2020 commented 1 year ago

Same Problem here. Switch to Force mode but nothings happens :-( Sungrow Firware latest...

mkaiser commented 1 year ago

Same Problem here. Switch to Force mode but nothings happens :-( Sungrow Firware latest...

see some post earlier:

Let's go some steps back....

What happens if you are using the sungrow App for this?

STL2020 commented 1 year ago

Yes thank you , it is a Sungrow Inverter Update Problem Maybe after the last Update !

hAMMERlized commented 11 months ago

Here it is either not working. Same as stated about. Forced mode seems to be on but it is not loading the battery from grid.

STL2020 commented 11 months ago

Yes I don't know why. But the same problem no update and no response from Sungrow ! I can't use the force mode maybe since the last Update !

hAMMERlized commented 11 months ago

@mkaiser

After updating the whole PV system (hybrid inverter, communication module, battery) and a complete restart, the force charge is now working as expected. Thanks for that great integration!

Hoellenwesen commented 10 months ago

Hi,

i have also the issue that the force charge is not working. I have the latest versions installed but nothing happens when i chnage to force charge.

image

I waited about 5 to 10 minutes after each state switch and then about 15 minutes for the battery to begin charging.

hAMMERlized commented 10 months ago

Hi,

i have also the issue that the force charge is not working. I have the latest versions installed but nothing happens when i chnage to force charge.

image

I waited about 5 to 10 minutes after each state switch and then about 15 minutes for the battery to begin charging.

Seems you don't have the latest updates installed. See my comment above.

Battlier commented 10 months ago

Hi I also have the same issue, forced charging not working. Latest firmware and updated HA and code. Inverter and battery restarted. Inverter reports forced mode and forced charge but nothing happens. Works with the iSolarCloud app.

hAMMERlized commented 10 months ago

Did you set a value at "set forced charge discharge Power"?

It also takes a few minutes until the inverter is switching the state to forced mode. 2-3 minutes in my case.

Battlier commented 10 months ago

Yes, I did set a value and waited a while. This is something that has changed the over the last few weeks, it worked flawless until then. My supplier updates my inverter now and then so i do not know if there was an update that they did a couple of weeks ago that triggered this. However I asked them yesterday to do an update to the last version but i still get the same behavior :(

The fault finding continues…I really would like this to work again. Setting forced charging times in the app every day is not a good solution.

Should I maybe do an isolated test with fresh/clean HA installation with the latest code and see if that works? Or is it so that you can anticipate that if the inverter reports that it is in forced mode and forced charge that it gets and acknowledge the commands in a proper way? Is there anyway to check via the iSolarCloud app that it is in forced mode?

Battlier commented 10 months ago

After one more reboot it works again.

shelldor commented 9 months ago

I am also unable to set force mode, found this in the log.

`Logger: homeassistant.components.automation.sungrow_inverter_update_battery_forced_charge_discharge_power_input_slider_update
Source: components/automation/__init__.py:676
Integration: Automation (documentation, issues)
First occurred: 2:51:32 AM (2 occurrences)
Last logged: 8:08:20 AM

Error while executing automation automation.sungrow_inverter_update_battery_forced_charge_discharge_power_input_slider_update: expected float for dictionary value @ data['value']`

Why is capacity 0? image

Louisbertelsmann commented 9 months ago

Try updating to the newest version of modbus_sungrow.yaml

bliblabl8 commented 9 months ago

I am also unable to set force mode, found this in the log.

`Logger: homeassistant.components.automation.sungrow_inverter_update_battery_forced_charge_discharge_power_input_slider_update
Source: components/automation/__init__.py:676
Integration: Automation (documentation, issues)
First occurred: 2:51:32 AM (2 occurrences)
Last logged: 8:08:20 AM

Error while executing automation automation.sungrow_inverter_update_battery_forced_charge_discharge_power_input_slider_update: expected float for dictionary value @ data['value']`

I had the same issue. I added "|float" in line 2742 in latest version of sungrow_modbus.yaml and now force charging works again.

hAMMERlized commented 9 months ago

@bliblabl8

I am also unable to set force mode, found this in the log.

`Logger: homeassistant.components.automation.sungrow_inverter_update_battery_forced_charge_discharge_power_input_slider_update
Source: components/automation/__init__.py:676
Integration: Automation (documentation, issues)
First occurred: 2:51:32 AM (2 occurrences)
Last logged: 8:08:20 AM

Error while executing automation automation.sungrow_inverter_update_battery_forced_charge_discharge_power_input_slider_update: expected float for dictionary value @ data['value']`

I had the same issue. I added "|float" in line 2742 in latest version of sungrow_modbus.yaml and now force charging works again.

In line 2742 only stands "data". Did you mean 2743? If yes, how does your code look in that line?

2742        data:
2743          value: "{{ states('sensor.battery_forced_charge_discharge_power') }}"

But anyway. For me the force charge does work even with the “|float" command. It just takes 3-5 minutes until it starts.

bliblabl8 commented 9 months ago

In my case it's line 2742 beginning with "value:..." as shown below:

    data:
      value: "{{ states('sensor.battery_forced_charge_discharge_power')|float }}"
mode: single
mkaiser commented 9 months ago

hmm It does not make much sense to me... Can someone enlighten me?

battery_forced_charge_discharge_power is a sensor (modbus uint16) with precision 0. So a simple integer.

You described that adding the |float conversion made force charging to work again:

  - id: "automation_sungrow_inverter_update_battery_forced_charge_discharge_power_input_slider_update"
    alias: "sungrow inverter update battery forced charge discharge power input slider update"
    description: "Updates battery forced charge discharge power input slider"
    trigger:
      - platform: state
        entity_id:
          - sensor.battery_forced_charge_discharge_power
    condition: []
    action:
      - service: input_number.set_value
        target:
          entity_id: input_number.set_sg_forced_charge_discharge_power
        data:
          value: "{{ states('sensor.battery_forced_charge_discharge_power') >>>>>>>>>>>>>> |float <<<<<<<<<<<<< }}"
    mode: single

(used >>> and <<< because I cant use bold formatting in a code quote)

The input sensor input_number.set_sg_forced_charge_discharge_power is also an integer. Why should a | float conversion help here?

What is your exact inverter model?

bliblabl8 commented 9 months ago

I've just read the error message "expect float" , so I tried that. Nothing else.

Converter is SH8.0RT-VT112

bliblabl8 commented 9 months ago

In the meanwhile, I changed my opinion. Forced charging does take a couple of minutes (! Up to 10 minutes) to start when converter isn't active (e g. When battery is empty and solar production is zero).

So I think, changing the automation "input_number.set_sg_forced_charge_discharge_power" to float only corrects to automation. It does not affect the forced charging. Forced charging works independent from the float bugfix, one just have to wait some more minutes!

hAMMERlized commented 9 months ago

lol that's what I'm telling you since the last posts. It takes a few minutes until it charges the battery...

Crootie commented 4 months ago

Just did the latest update for home assistant: image Tried to force charge and lost it again. Was working great and left it open in case others had issues with the same thing. image image

lassej01 commented 4 months ago

Change this one, and then you go :-) image

Crootie commented 4 months ago

Just ran that to 5000 and it is working....... but... that's discharging not charging. Quick education please.

Crootie commented 4 months ago

actually don't bother.. it is a dual setting depending on charge or discharge... thankyou.

lassej01 commented 4 months ago

image Maybe it should be an "&" in the middle for clearifaction.

Crootie commented 4 months ago

even just a charge/discharge would work it. but thankyou for your assistance