home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.67k stars 30.42k forks source link

Fronius: Storage Battery icon not showing status of charging #51954

Closed thecem closed 3 years ago

thecem commented 3 years ago

The problem

The Battery on Fronius integration don't show the charging state. If there is device_class set to battery for the SOC the battery icon shows the SOC in relation, but if it is charging it does not show the charging state.

Is there a possibility to change the integration, that the charging state is an attribute of the SOC? Or a possibility to set the parameter that HA could show the battery icon accordingly, like it is in other integrations, when the battery is charged.

What is version of Home Assistant Core has the issue?

core-2021.6.5

What was the last working version of Home Assistant Core?

core-2021.6.5

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Fronius

Link to integration documentation on our website

https://www.home-assistant.io/integrations/fronius/

Example YAML snippet

sensor:
  - platform: fronius
    resource: FRONIUS_URL
    monitored_conditions:
    - sensor_type: inverter
      device: 1
    - sensor_type: meter
      device: 3
    - sensor_type: storage
      device: 0
    - sensor_type: power_flow

Anything in the logs that might be useful for us?

NO

Additional information

Inverter: GEN24 10.0 Plus Battery/ Storage: BYD HVS 10.2

probot-home-assistant[bot] commented 3 years ago

fronius documentation fronius source (message by IssueLinks)

probot-home-assistant[bot] commented 3 years ago

Hey there @nielstron, mind taking a look at this issue as its been labeled with an integration (fronius) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

nielstron commented 3 years ago

Hi @thecem, thanks for the suggestion. Can you point out the exact sensors that should take into account the charging state of the battery in their icons? My own device does not feature a battery, so I have no resources to test it myself.

thecem commented 3 years ago

Thanks for your answer! The one for charging state could be sensor.power_battery_fronius_power_flow_0_url values are -10000 up to 10000, actual the battery is charged with value: -366.3 charging state of battery is: sensor.state_of_charge_fronius_power_flow_0_url

So it would be nice if a negativ value of the power_battery sensor could be used for the charging state of the battery icon of the state_of_charge sensor. Additional the device_class of state_of_charge sensor should be by default battery.

if you need more details, logs, tests let me know.

nielstron commented 3 years ago

I think I will not get to implement this myself, but this thread may be interesting for anyone with some coding experience and a fronius device with batteries :)

thecem commented 3 years ago

At least when flow for HEMS will come in 2021.8.. but if you would like to have this in place, there is an option with Sunspec integration https://github.com/CJNE/ha-sunspec to have the right battery sign.