Page 1 of 1

Reduce Battery Charge Current when above 93% charge

Posted: Tue Sep 10, 2024 2:49 pm
by Dave Foster

Code: Select all

alias: Charge Reduction
description: ""
trigger:
  - platform: time_pattern
    minutes: /1
condition:
  - condition: or
    conditions:
      - condition: numeric_state
        entity_id: sensor.battery_soc
        below: 90
      - condition: numeric_state
        entity_id: sensor.battery_soc
        above: 93
action:
  - if:
      - condition: numeric_state
        entity_id: sensor.battery_soc
        above: 92
    then:
      - if:
          - condition: numeric_state
            entity_id: sensor.max_charge_current
            above: 10
        then:
          - service: number.set_value
            data:
              value: 4
            target:
              entity_id: number.max_charge_current
          - service: logbook.log
            data:
              message: Setting Max Charge to 4A
              name: Max Charge
    else:
      - if:
          - condition: numeric_state
            entity_id: sensor.battery_soc
            below: 90
        then:
          - if:
              - condition: numeric_state
                entity_id: sensor.max_charge_current
                below: 10
            then:
              - service: number.set_value
                data:
                  value: "35"
                target:
                  entity_id: number.max_charge_current
              - service: logbook.log
                data:
                  message: Setting Max Charge to 35A
                  name: Max Charge
mode: single

This is a simple automation that sets the charge current to 4A above 93% SoC and then increases it backs to 35A (the default max setting) when the battery drops below 90%.

Whilst this will slow down the final 6% of charging the battery it helps to maintain the battery balance by giving the batteries more time to top balance.

In home assistant go to Settings, Automations & Scenes and click the blue button in the bottom corner that says 'CREATE AUTOMATION' , select 'Create new automation', then click the three dots in the top right corner of the window and choose 'Edit in Yaml'

Copy the code above into the new automation overwriting what is there, then click 'Save'

This automation will be called 'Charge Reduction' and once saved will start to work the next time your battery SoC goes over 93%