Automating 3 AC chargers based on available power (Solar power minus consumed power)

I am charging my solar battery with 3 different AC chargers which are switched with by one shelly plug for each charger .

I would like to create one automation to look at the available solar power and whether there is already one charger switched on and then decide whether to switch on an additional charger, switch a smaller charger off and a larger on etc.

The different charge levels are:

  • PSU_1 only: 125W
  • PSU_2 only: 225W
  • PSU_3 only: 470W
  • PSU_1 + PSU_2: 125W + 225W = 350W
  • PSU_1 + PSU_3: 125W + 470W = 595W
  • PSU_2 + PSU_3: 225W + 470W = 695W
  • PSU_1 + PSU_2 + PSU_3: 125W + 225W + 470W = 820W

I created an automation with 7 options, but somehow only option 1 seems to become active. I also wonder if a pattern of every 5 seconds is smart vs. reacting to the state change of the sensor wo monitors the available solar power. I tried the numeric state of the sensor sensor.bkw_shelly_power, which is my solar system, but apparently the changes do not always trigger the actions.

Can someone look at this and advise how this can be improved in order to work?

My goal is to only charge when enough solar power is available.

alias: Solar - DEV - Ladeautomatik (7 Options)
description: ''
trigger:
  - platform: time_pattern
    seconds: '5'
condition:
  - condition: state
    entity_id: input_boolean.solar_ladeautomatik
    state: 'on'
action:
  - repeat:
      until:
        - condition: sun
          before: sunset
      sequence:
        - choose:
            - conditions:
                - condition: numeric_state
                  entity_id: sensor.bkw_shelly_power
                  above: 250
                  below: 375
                - condition: numeric_state
                  entity_id: sensor.hm1500_zuruck_zum_netz_watt
                  above: 130
                  below: 230
              sequence:
                - type: turn_on
                  device_id: 9922fec52f355949181aa87f2d40b008
                  entity_id: switch.steckdose_victron_4a_ladegeraet
                  domain: switch
                - type: turn_off
                  device_id: 9fb87321921c3f7e1643536e5737ef34
                  entity_id: switch.steckdose_victron_8a_ladegerat
                  domain: switch
                - type: turn_off
                  device_id: 83cc56bf1781bca5490be7b2e1fdb9cc
                  entity_id: switch.steckdose_victron_16a_ladegeraet
                  domain: switch
            - conditions:
                - condition: numeric_state
                  entity_id: sensor.bkw_shelly_power
                  above: 375
                  below: 500
                - condition: numeric_state
                  entity_id: sensor.hm1500_zuruck_zum_netz_watt
                  above: 230
                  below: 355
              sequence:
                - type: turn_off
                  device_id: 9922fec52f355949181aa87f2d40b008
                  entity_id: switch.steckdose_victron_4a_ladegeraet
                  domain: switch
                - type: turn_on
                  device_id: 9fb87321921c3f7e1643536e5737ef34
                  entity_id: switch.steckdose_victron_8a_ladegerat
                  domain: switch
                - type: turn_off
                  device_id: 83cc56bf1781bca5490be7b2e1fdb9cc
                  entity_id: switch.steckdose_victron_16a_ladegeraet
                  domain: switch
            - conditions:
                - condition: numeric_state
                  entity_id: sensor.bkw_shelly_power
                  above: 500
                  below: 620
                - condition: numeric_state
                  entity_id: sensor.hm1500_zuruck_zum_netz_watt
                  above: 355
                  below: 475
              sequence:
                - type: turn_on
                  device_id: 9922fec52f355949181aa87f2d40b008
                  entity_id: switch.steckdose_victron_4a_ladegeraet
                  domain: switch
                - type: turn_on
                  device_id: 9fb87321921c3f7e1643536e5737ef34
                  entity_id: switch.steckdose_victron_8a_ladegerat
                  domain: switch
                - type: turn_off
                  device_id: 83cc56bf1781bca5490be7b2e1fdb9cc
                  entity_id: switch.steckdose_victron_16a_ladegeraet
                  domain: switch
            - conditions:
                - condition: numeric_state
                  entity_id: sensor.bkw_shelly_power
                  above: 620
                  below: 745
                - condition: numeric_state
                  entity_id: sensor.hm1500_zuruck_zum_netz_watt
                  above: 475
                  below: 600
              sequence:
                - type: turn_off
                  device_id: 9922fec52f355949181aa87f2d40b008
                  entity_id: switch.steckdose_victron_4a_ladegeraet
                  domain: switch
                - type: turn_off
                  device_id: 9fb87321921c3f7e1643536e5737ef34
                  entity_id: switch.steckdose_victron_8a_ladegerat
                  domain: switch
                - type: turn_on
                  device_id: 83cc56bf1781bca5490be7b2e1fdb9cc
                  entity_id: switch.steckdose_victron_16a_ladegeraet
                  domain: switch
            - conditions:
                - condition: numeric_state
                  entity_id: sensor.bkw_shelly_power
                  above: 745
                  below: 845
                - condition: numeric_state
                  entity_id: sensor.hm1500_zuruck_zum_netz_watt
                  above: 600
                  below: 700
              sequence:
                - type: turn_on
                  device_id: 9922fec52f355949181aa87f2d40b008
                  entity_id: switch.steckdose_victron_4a_ladegeraet
                  domain: switch
                - type: turn_off
                  device_id: 9fb87321921c3f7e1643536e5737ef34
                  entity_id: switch.steckdose_victron_8a_ladegerat
                  domain: switch
                - type: turn_on
                  device_id: 83cc56bf1781bca5490be7b2e1fdb9cc
                  entity_id: switch.steckdose_victron_16a_ladegeraet
                  domain: switch
            - conditions:
                - condition: numeric_state
                  entity_id: sensor.bkw_shelly_power
                  above: 845
                  below: 970
                - condition: numeric_state
                  entity_id: sensor.bkw_shelly_power
                  above: 700
                  below: 825
              sequence:
                - type: turn_off
                  device_id: 9922fec52f355949181aa87f2d40b008
                  entity_id: switch.steckdose_victron_4a_ladegeraet
                  domain: switch
                - type: turn_on
                  device_id: 9fb87321921c3f7e1643536e5737ef34
                  entity_id: switch.steckdose_victron_8a_ladegerat
                  domain: switch
                - type: turn_on
                  device_id: 83cc56bf1781bca5490be7b2e1fdb9cc
                  entity_id: switch.steckdose_victron_16a_ladegeraet
                  domain: switch
            - conditions:
                - condition: numeric_state
                  entity_id: sensor.bkw_shelly_power
                  above: 970
                - condition: numeric_state
                  entity_id: sensor.hm1500_zuruck_zum_netz_watt
                  above: 825
              sequence:
                - type: turn_on
                  device_id: 9922fec52f355949181aa87f2d40b008
                  entity_id: switch.steckdose_victron_4a_ladegeraet
                  domain: switch
                - type: turn_on
                  device_id: 9fb87321921c3f7e1643536e5737ef34
                  entity_id: switch.steckdose_victron_8a_ladegerat
                  domain: switch
                - type: turn_on
                  device_id: 83cc56bf1781bca5490be7b2e1fdb9cc
                  entity_id: switch.steckdose_victron_16a_ladegeraet
                  domain: switch
mode: single