Codegnosis / givtcp-battery-card

A simple battery card for Home Assistant for GivTCP users
MIT License
8 stars 1 forks source link

Reporting Idle when battery is discharging #30

Closed gcoan closed 5 months ago

gcoan commented 6 months ago

Release with the issue: 0.2.2

Browser and Operating System: iPadOS Home Assistant Companion app

Description of problem: I have two batteries (on two inverters), identical battery card configurations.

Both batteries were discharging (in Eco mode) but one battery was reported as Idle even though it was clearly discharging image

It was only when the discharge rate went above 1kW did it start being reported as Discharging image

I would expect that there needs to be some threshold between reporting Idle and Discharge, recognising that there is the normal in and out that the battery does as the inverter tries to balance demand), but 1kW seems too high to me. Couldn't see any config to change the behaviour.

Maybe this should be a user config level for the threshold between Idle and Charging/Discharge ?

Additional information: Battery card config:

              - type: custom:givtcp-battery-card
                name: G182 Battery
                soc_threshold_very_high: 80
                soc_threshold_high: 60
                soc_threshold_medium: 40
                soc_threshold_low: 20
                soc_threshold_very_high_colour:
                  - 0
                  - 69
                  - 23
                soc_threshold_high_colour:
                  - 67
                  - 160
                  - 71
                soc_threshold_medium_colour:
                  - 255
                  - 166
                  - 0
                soc_threshold_low_colour:
                  - 219
                  - 68
                  - 55
                soc_threshold_very_low_colour:
                  - 94
                  - 0
                  - 0
                display_abs_power: true
                display_type: 2
                display_dp: 1
                icon_status_idle: mdi:sleep
                icon_status_charging: mdi:lightning-bolt
                icon_status_discharging: mdi:home-battery
                display_battery_rates: false
                use_custom_dod: false
                custom_dod: 80
                calculate_reserve_from_dod: true
                display_custom_dod_stats: false
                entity: sensor.g_yyyyy_invertor_serial_number
              - type: custom:givtcp-battery-card
                name: G395 Battery
                soc_threshold_very_high: 80
                soc_threshold_high: 60
                soc_threshold_medium: 40
                soc_threshold_low: 20
                soc_threshold_very_high_colour:
                  - 0
                  - 69
                  - 23
                soc_threshold_high_colour:
                  - 67
                  - 160
                  - 71
                soc_threshold_medium_colour:
                  - 255
                  - 166
                  - 0
                soc_threshold_low_colour:
                  - 219
                  - 68
                  - 55
                soc_threshold_very_low_colour:
                  - 94
                  - 0
                  - 0
                display_abs_power: true
                display_type: 2
                display_dp: 1
                icon_status_idle: mdi:sleep
                icon_status_charging: mdi:lightning-bolt
                icon_status_discharging: mdi:home-battery
                display_battery_rates: false
                use_custom_dod: true
                custom_dod: 80
                calculate_reserve_from_dod: true
                display_custom_dod_stats: false
                entity: sensor.h_xxxx_invertor_serial_number
Codegnosis commented 5 months ago

Hi - thanks for the report. Please try v0.2.3, and if the issue persists, I have added a temporary debug feature which can be enabled via the config. It will output the calculated and raw values to the browser's developer console, and may help pinpointing the issue.

Thanks :)

gcoan commented 5 months ago

thanks, I have put the new version in but at the moment its charging the battery at full rate so I can't see whether this has made a difference. Will keep an eye on it

gcoan commented 5 months ago

This looks better image

gcoan commented 5 months ago

thanks for fixing this