slipx06 / sunsynk-power-flow-card

⚡A customizable Home Assistant card to emulate the Sunsynk System flow that's displayed on the Inverter screen.
MIT License
169 stars 51 forks source link

Goodwe - Shutdown SOC/DOD & battery display enhancements #144

Closed FajnB closed 8 months ago

FajnB commented 8 months ago

Is there an existing issue for this?

Current Behavior

There will be multiple enhancements suggestions. Therefore they'll be marked with & and a number. If you don't want me to open multiple threads please use this marking in your responses so we know to what you comment

&1 shutdown_soc is not compatible with HASS integration of DOD (depth of discharge) for Goodwe. HASS slider is showing how much battery can be used and not how much battery must be left. HASS DOD 80% = Goodwe SOC 20%

&2 Not implemented

&3 Not implemented

&4 Not implemented

&5 Not implemented + is limited to 30% max

Expected behaviour

&1 Goodwe interpretation DOD is working natively with this setting

&2 Ability to see how much overall + usable energy is stored in the battery.

&3 Ability to se current shutdown_soc limit.

&4 Ability to set and see DOD (SOC) for backup/off-grid

&5 Battery icon could be set to be based on shutdown_soc + empty_capacity: is not limited to 30% max

Possible Solutions

&1 Add native support for this Goodwe integration entity. Recalculate DOD from Goodwe integration to SOC. i.e. 80% DOD >> 20% SOC

&2 Add option to show how much energy is stored in battery + how much usable energy is stored. This could be based purely from reported battery capacity (battery - energy:) and current battery SOC. For usable energy it can be calculated from reported battery capacity minus the capacity reserved by shutdown_soc and current battery SOC. Also I would use ~ next to this stat as at least Goodwe reports SOC as integer.

&3 Add option to display current shutdown_soc limit.

&4 Add option off_grid_shutdown_soc and also add option to display that new limit.

&5 Add option to mirror the shutdown_soc limit + add option to remove the limit of 30% max for the icon option empty_capacity:.

Mode

Both

Context / Reason

&1 It would be nice to have it automatically change for Goodwe users

&2 This could be a good indicator for example if I can start a washer or washing machine or wait till daylight. Especially during winter months when the solar production is low.

&3 Some of us use automations to set the DOD for selling electricity at night based on the solar production forecast.

&4 Goodwe hybrid inverters have two battery limits. 1st is for when the grid power is available so called on-grid DOD (This is the one shown in the Goodwe integration). 2nd is for when the grid is not available, so called off-grid DOD (Currently missing from Goodwe integration but still valuable information) To explain it more. At summer batteries are set to 20/10 shutdown_soc. This means that when there is grid available, the battery will stop being discharged at 20%, but if there is a black out and there is no grid available, the inverter will disable the on-grid limit and allow discharge to the second set limit, in this example 10%. At winter these limit should be (at least for Pylontech batteries) set to 50/20.

&5 It will be nice to see the representation of usable battery rather than hard-coded one.

slipx06 commented 8 months ago

Thanks for the suggestions. I will respond as I work through them.

&1 Trying to accommodate every inverter model through internal card checks introduces complexities and additional code that does not apply for many of the other users. For your case I would suggest you create a template sensor that calculates shutdown_soc based on DOD

&2 Its possible but there is not much space. Please share some mock ups where you think this can be displayed. Remember to enable all card features

&3 Possible but may be redundant as the system timer settings display shutdown_soc when grid is disconnected and when the grid is connected the minimum battery capacity for that time slot. See the 30% in the image below and "runtime to x%"

image

&4 Can be added but where would it be displayed?

&5 I can remove the limits. What do you mean by mirror the shutdown_soc limit. Make empty_capacity: == shustdown_soc if not defined in the config?

FajnB commented 8 months ago

&1

&2

&3+4

&5

Hope it is not overwhelming 😉

slipx06 commented 8 months ago

Hi &1 We can add it to the documentation, specifically a note here https://slipx06.github.io/sunsynk-power-flow-card/examples/goodwe.html . You can create a pull request or send me the text to add. Its not possible to implement the logic as suggested in the config i.e. shutdown_soc: 100 - number.on_grid_dod for the sensor

&3+4 I need to think about this and how it affects the system timer settings. Is the system timer not available for Goodwe inverters i.e. programmable minimum soc, bat charge etc based on time of day

&5 The battery icon is based on the following thresholds

soc >= bat_full , 
soc >= 50 && soc < bat_full
soc > bat_empty soc <= 49
soc <= bat_empty

In most cases shutdown soc is less than 30%. Why do you need to increase this threshold? I cant see how this restricts usable capacity. It only changes the icon.

FajnB commented 8 months ago

&1

&3+4

&5

mamo-nick commented 8 months ago

@FajnB Let's talk about it here https://www.homeassistant-cz.cz/viewtopic.php?t=1086 (in czech) . I need to understand your request properly.

FajnB commented 8 months ago

@mamo-nick I made a post on there as you wanted. I hope it is now a little clearer to you what my intentions are. 😃

Mybe my engrish no so guud. 🤣

bodawui commented 8 months ago

@FajnB I believe that we are talking about: number.depth_of_discharge_on_grid entity. snad ti to pomůže :-)

FajnB commented 8 months ago

@bodawui That would be it then. That's the third time I've seen this entity so I am pretty much certain now.

&1

- platform: template
  sensors:
    goodwe_shutdown_soc:
      friendly_name: "GoodWe Shutdown SOC"
      unit_of_measurement: "%"
      icon_template: mdi:battery-arrow-down  
      value_template: "{{100 - states('number.depth_of_discharge_on_grid') | int }}"

Pay attention to a fact that your slider entity might be named in the language that your home assistant installation is set to in the system settings. e.i. number.similar_name_but_in_your_language

&3/4

  1. I am still waiting for response from my czech colleges
  2. 1st is unfortunately irrelevant as I learned that even if the invertor it self updates the DoD, the integration (at least the official one, idk for the beta one) won't update that stat on the fly, but rather only at startup of that integration. 😞

&5

Theoretically that should be all. 😁

slipx06 commented 8 months ago

&1 Thanks I will add this to the documentation

&3/4 To confirm you would like to add another optional attribute into the card config to show offgrid shutdown soc see example below. You also want to display both shutdown soc and off grid shutdown soc on the card all the time? As we confirmed this is displayed when the battery is discharging or the grid is disconnected. I can keep this logic and display offgrid shutdown soc or shutdown soc based on the grid connected status? Do all Goodwe users see the value in displaying both these values next to the battery soc? I can add as per your design 1

battery:
  energy: 5320
  shutdown_soc: sensor.goodwe_shutdown_soc
  shutdown_soc_offgrid: 10
  show_daily: true

&5 This is just a cosmetic thing as it only affects when the empty, low, medium and full battery images are shown. The images are just meant to be an approximation so it does not make sense to try make this an exact representation of SOC. As a compromise I will increase the bat_empty limit to 40%. I'll also make it possible to set this value using a sensor

FajnB commented 8 months ago

You also want to display both shutdown soc and off grid shutdown soc on the card all the time?

  • An option to show it all the time. i.e. New option called show_shutdown_soc: (normal => shutdown_soc ; offgrid => shutdown_soc_offgrid ; both => show them both) And the explanation could be something like: "Show the selected shutdown SOC/SOCs all the time"
  • This option won't affect the remaining time text below the SOC

I can keep this logic and display offgrid shutdown soc or shutdown soc based on the grid connected status?

  • This is a great idea! That would mean, that if the shutdown_soc_offgrid is populated it would show that limit instead of the regular one while the inverter is off grid.

Do all Goodwe users see the value in displaying both these values next to the battery soc?

  • I asked 2 of my friends (same GW inverters) and they very interested and also said, that it might be the only reasonable place to put it. Also on the czech forum they said that we must think of people whose cards are packed with information
  • One concern was the mentioned space for people with crowded cards and thus there was clear consensus on the design number 1. Plus as I mentioned it would beneficial to add that vertical line so that it clearly separates the SOC and the shutdown SOC/SOCs. Otherwise the SOC area might become one big clump of numbers.

And I ran out of english for today. I am very tired as I was studding for 3 uni exams last night. Hope I answered all of your questions and concerns. 😉 If something comes across your mind, don't hesitate to ask me.

slipx06 commented 8 months ago

Ok I've implemented the changes. You can now specify the offgrid shutdown soc under the battery attributes. They accept a numeric value or sensor

battery:
  energy: 15960
  shutdown_soc: 30
  shutdown_soc_offgrid: 15

The card layout with shutdown soc displayed above the off grid shutdown soc image

Runtime to automatically changes to offgrid soc when the grid is disconnected image

If you dont specify the off grid shutdown soc the view changes as follows image

I've tried to avoid introducing additional card options that wont apply to other users. So the layout will adjust based on the supplied sensors. There is no option to only display the offgrid shutdown soc. This is not planned.

And these options are only applied if the inverter model is set to Goodwe*

FajnB commented 8 months ago

There is no option to only display the offgrid shutdown soc. This is not planned.

  • That's completely understandable

And these options are only applied if the inverter model is set to Goodwe*

  • This applies to the shutdown_soc_offgrid attribute only and it's functionality, right?

I think, you might just add the binary option to show the shutdown_soc just in case that some people won't want to see it all the time.

And I must say, it looks even better than I thought it would. You again did a great job.

slipx06 commented 8 months ago

This applies to the shutdown_soc_offgrid attribute only and it's functionality, right?

Yes that's correct

I think, you might just add the binary option to show the shutdown_soc just in case that some people won't want to see it all the time.

Yes there will be an option to hide_soc: true/false. That will apply to all inverter types and useful for those who want to retain system timer/prog settings but display 3 non_essential loads etc

slipx06 commented 8 months ago

This is now available in 3.22.0. Please test 😄

FajnB commented 8 months ago

It is working as intended. The note in the documentation is also way better phrased than what I brought to the table. :D (The grey solar part scared me and then I read the release notes 😂)

Thank you for yet another great update.

FajnB commented 8 months ago

Just found out that the error info still says "Empty capacity must be <= 30" if you input anything above 40 obrazek

slipx06 commented 8 months ago

Let me fix that.