Codegnosis / givtcp-battery-card

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

Battery Capacity calculated wrong for 9.5 battery #35

Closed gcoan closed 4 months ago

gcoan commented 4 months ago

I have a 5.2 and a 9.5 battery on separate inverters.

Noticed today that the 9.5 battery (recenty replaced) is showing as 6.4 capacity, but all the HA metrics I look at give the correct capacity, as does the BBC basic app and the GivEnergy app.

I did have custom_dod set to 80 for this battery but use_custom_dod set to false, but even changing it to custom_dod 100, and turning use_custom_dod on or off, still shows the wrong capacity

IMG_0923

config:

      - type: horizontal-stack
        cards:
          - 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: 100
            calculate_reserve_from_dod: false
            display_custom_dod_stats: false
            display_energy_today: false
            entity: sensor.g_xxx_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
            display_energy_today: false
            entity: sensor.h_xxx_invertor_serial_number

Checklist:

Release with the issue: 0.2.4

Last working release (if known): Tried it with 0.2.2 and 0.2.0 and both the same issue

Browser and Operating System: HA companion app, ipad Same with iPad Safari

Description of problem: Should show 9.5 capacity. Suspect somehow it is not reading correctly the capacity

gcoan commented 4 months ago

Found the cause of the issue, for reasons I don't understand GivTCP was reporting the 9.5kW battery capacity as 6.4kWh.

This was only reported in MQTT, not in a HA entity, so wasn't immediately obvious image

I could see soc_max changing from 9.52kW to 6.4kW in the predbat log at the run at 12:10. In the inverter notifications this corresponded to a 'low voltage' error so maybe that caused the glitch.

Restarting GivTCP and it now shows correctly as 9.5kW in MQTT and the battery card