mletenay / home-assistant-goodwe-inverter

Experimental version of Home Assistant integration for Goodwe solar inverters
https://discord.gg/TaXyWXT
MIT License
145 stars 38 forks source link

Charging/discharging plan reset after changing the mode via HA #151

Closed tauceti2 closed 1 year ago

tauceti2 commented 1 year ago

Hi,

First of all thanks for a great integration of GoodWe! I have started to use modes, however when I set charging/discharging plan via mobile app and then change the mode via HA (e.g. from eco to general), all the plan entries are disabled. When I activate them again they remain active till another mode change via HA. I have GoodWe 8K-ET.

Thanks for any help in advance.

Michal

TomEkk33 commented 1 year ago

Hi,

I'd like to connect to this issue and confirm that observe the same behavior on ET inverter. Going from General Mode (or other mode) to ECO disables ECO schedules. The hours,values remain as previously set, but they are inactive. Goodwe allows to setup 4 different plans in ECO. So in ECO mode should be an option in HM to direct which "Battery power groupX" should be activated in ECO (where X=1,2,3,4).

The only solution for now is activation ECO plans manually in "PV Master" app each time when switching ECO out/in.

Please help how to fix this. Thanks.

BR, Tom.

janchlebek commented 1 year ago

Not a solution from my end - but how about simply ditching PV Master and doing everything via HA (create corresponding schedules in HA)?

elRadix commented 1 year ago

I have created an automation, not perfect but works it check also if there enough solar energy and limit the charging power to avoid higher costs

alias: Charge Battery from Grid Winter mode
description: Charge battery during winter and night mode
trigger:
  - platform: time
    at: "00:10:00"
    id: night
  - platform: state
    entity_id:
      - sensor.battery_state_of_charge
    id: battery
    to: "70"
condition: []
action:
  - if:
      - condition: trigger
        id: night
      - condition: numeric_state
        entity_id: sensor.battery_state_of_charge
        below: 40
      - condition: numeric_state
        entity_id: sensor.solcast_forecast_today
        below: 7
        alias: Check if Forecast solar is below 7 kWh
    then:
      - service: number.set_value
        data:
          value: "17"
        target:
          entity_id: number.eco_mode_power
      - service: select.select_option
        data:
          option: Eco charge mode
        target:
          entity_id: select.inverter_operation_mode
      - service: notify.xxx
        data:
          title: >-
            BYD Battery 🔋 mode set to {{
            states.select.inverter_operation_mode.state}}
          message: >-
            Start charging from grid, battery is at {{
            states.sensor.battery_state_of_charge.state}}%
        alias: Send notification to start battery charging + status
    alias: "Charge battery from grid during night modus "
  - if:
      - condition: trigger
        id: battery
    then:
      - service: number.set_value
        data:
          value: "0"
        target:
          entity_id: number.eco_mode_power
      - service: select.select_option
        data:
          option: General mode
        target:
          entity_id: select.inverter_operation_mode
      - delay:
          hours: 0
          minutes: 2
          seconds: 30
          milliseconds: 0
      - service: select.select_option
        data:
          option: General mode
        target:
          entity_id: select.inverter_operation_mode
      - service: number.set_value
        data:
          value: "0"
        target:
          entity_id: number.eco_mode_power
      - service: notify.xxx
        data:
          title: >-
            BYD Battery 🔋 mode set to  {{
            states.select.inverter_operation_mode.state}}
          message: >-
            Stop charging, battery is at
            {{states.sensor.battery_state_of_charge.state}}%

            Total charged from the grid {{states.sensor.daily_energy.state}} kWh
        alias: Send notification with battery status
    alias: Stop charging
    else: []
mode: single
TomEkk33 commented 1 year ago

Not a solution from my end - but how about simply ditching PV Master and doing everything via HA (create corresponding schedules in HA)?

Well, HA doesn't have access (or at least I cannot find them) to some parameters which are visible inside Goodwe ET inverters. They are available with PV Master only. Beside of this I'd like to stay with Goodwe original settings to have all in sync in case of HA issues.

I'll try to use elRadix solution. Thanks.

janchlebek commented 1 year ago

Well, HA doesn't have access (or at least I cannot find them) to some parameters which are visible inside Goodwe ET inverters. They are available with PV Master only. Beside of this I'd like to stay with Goodwe original settings to have all in sync in case of HA issues.

I'll try to use elRadix solution. Thanks.

Just out of curiosity - which parameters you mean? The HA integration exposes almost everything.

Moreover even if you use HA as me or elRadix suggest you can still use PV Master to read data - by ditching PV Master I meant to not use it to control charging, you can still use it to access whatever information you want but leave charging control on some HA automation. I have a very similar one in place as elRadix and it works great. If HA fails, you can again set your schedules in PVM.

TomEkk33 commented 1 year ago

Just out of curiosity - which parameters you mean? The HA integration exposes almost everything.

"Battery power groupX" in ECO (where X=1,2,3,4) is listed in PV Master. I don't know which parameter in HA is responsible for these. Do you know which entity to look (select.inverter_operation_mode and then which option?) Thanks.

elRadix commented 1 year ago

maybe delete them and let HA create a new one ...

TomEkk33 commented 1 year ago

maybe delete them and let HA create a new one ...

Sorry, I don't understand. What should be deleted in HA: whole Goodwee device and add it again in HA?

elRadix commented 1 year ago

sorry I meant in the pv master app, the different eco modes

TomEkk33 commented 1 year ago

sorry I meant in the pv master app, the different eco modes

ECO mode without these "different eco modes" does not make any use to me.

Those modes are disabled by default when HA sets General Mode and then again back to the ECO mode. The question is how to enable them again using HA "Eco mode"? Thanks.

janchlebek commented 1 year ago

"Battery power groupX" in ECO (where X=1,2,3,4) is listed in PV Master. I don't know which parameter in HA is responsible for these. Do you know which entity to look (select.inverter_operation_mode and then which option?) Thanks.

But isn't this "battery group" just the schedule? Or you have more battery modules connected that you control separately somehow? I am not at home now so have no access with PV Master...

mletenay commented 1 year ago

I have re-implemented the EcoMode behavior in v0.9.9.9, can you verify it works now properly ?

TomEkk33 commented 1 year ago

I made some basic checking of ECO charge, discharge modes with ET inverter. Seem to work OK using "Battery power Group1".

I noticed that "Battery power Groups 2,3,4" are overwritten with some default values. It would be useful if you could do the deactivation of these groups only - leaving their other values unchanged (time, day of week, type).

ECO charge/discharge sets 00:00-23:59 every day for the "Battery power Group1". It has the highest priority in Goodwe scheduler- means it supersedes the "Battery power Groups 2,3,4" - they can be even left unchanged. This is true to the ET series.

TomEkk33 commented 1 year ago

The Peak Shaving Mode (https://github.com/mletenay/home-assistant-goodwe-inverter/issues/145) is quite similar to "ECO charge mode". The PSM requires also few parameters - currently they are not set when switching to PSM.

mletenay commented 1 year ago

I have changed the Eco Mode Charge/Discharge switching in the library v0.2.28 (will get to integration release v.0.9.9.10). It should no longer clear the schedules 2-4 and will just turn them off.

filipkrystl commented 1 year ago

It would be great if you could reenable disabled schedules after going back to normal "Eco mode" from either "Eco Mode Charge/Discharge" or from "General". Or set in configuration those schedules that should be enabled when going to "Eco mode"

My scenario is that I have some schedules to charge/discharge battery in PV master for Eco mode and now mode change in HA will currently disable them and there is no way from HA to enable them again. I have to go to PV master a enable them manually. Thanks