Automation with more than one combination / Setting the KEBA Charging Power to PV-Excess

Hi Guys,

im trying to set up an automation that uses the PV Excess to charge my car. It should’nt too complicated - i just want to use the PV excess (e.g. of last 5 minutes) to adjust the Wallbox charging rate.

I’ve made a simple POC but i’m not sure how i could archive my goal!

to clarify - i have the following Setup:

  • PV Inverter from SolarEdge
  • Keba P30 Wallbox (X Series)
  • Audi PHEV also connected to HA

and all these components are working in HA.

I have the following Sensors which gives me the right values (the PV-Excess)

→ (sensor.solar_panel_production_w - (sensor.solar_house_consumption_w-sensor.keba_p30_charging_power)) = PV-Excess

and i want to set the charging power of this object:
→ number.keba_p30_charging_current

between 6 and 16Ampere - e.g. to 6A if PV Excess is at <=3000 or to 8 if its over >=3001 and 4000 … and to 16 if it is over 7000

Now is here my simple POC to see if its generally working:

alias: TEST
description: ''
trigger:
  - platform: numeric_state
    entity_id: sensor.solaredge_m1_ac_power
    for:
      hours: 0
      minutes: 5
      seconds: 0
    above: '2750'
    below: '3250'
condition:
  - condition: numeric_state
    entity_id: sensor.solaredge_battery1_state_of_charge
    above: '90'
action:
  - device_id: 03cf8f6cd4763f1e92109b4d57a531e9
    domain: number
    entity_id: number.keba_p30_charging_current
    type: set_value
    value: 6
mode: single

How could i reach the goal while not creating for every pair of Excess and Charging power to one simple Automation? I just need a simple “Case” or Else if ?!

I’m relative new to the HA scene and this is my very first Challenge.

bye
s_ash

Use the Choose action. Chose which charging rate depending on the numeric state condition of your excess.

https://www.home-assistant.io/docs/scripts#choose-a-group-of-actions

1 Like

Thank you - for everyone who needs a similar thing, here is my automation which is not 100% correct to the Watt Values, but it works like it should.

Now i’m tuning the values and settings

alias: TEST
description: ''
trigger:
  - platform: time_pattern
    minutes: /1
condition:
  - condition: state
    entity_id: binary_sensor.keba_p30_charging
    state: 'on'
action:
  - choose:
      - conditions:
          - condition: numeric_state
            entity_id: sensor.solar_pv_excess
            below: '4675'
            above: '3200'
        sequence:
          - device_id: 03cf8f6cd4763f1e92109b4d57a531e9
            domain: number
            entity_id: number.keba_p30_charging_current
            type: set_value
            value: 8
      - conditions:
          - condition: numeric_state
            entity_id: sensor.solar_pv_excess
            below: '5650'
            above: '4675'
        sequence:
          - device_id: 03cf8f6cd4763f1e92109b4d57a531e9
            domain: number
            entity_id: number.keba_p30_charging_current
            type: set_value
            value: 10
      - conditions:
          - condition: numeric_state
            entity_id: sensor.solar_pv_excess
            below: '6500'
            above: '5650'
        sequence:
          - device_id: 03cf8f6cd4763f1e92109b4d57a531e9
            domain: number
            entity_id: number.keba_p30_charging_current
            type: set_value
            value: 12
      - conditions:
          - condition: numeric_state
            entity_id: sensor.solar_pv_excess
            below: '7000'
            above: '6500'
        sequence:
          - device_id: 03cf8f6cd4763f1e92109b4d57a531e9
            domain: number
            entity_id: number.keba_p30_charging_current
            type: set_value
            value: 14
      - conditions:
          - condition: numeric_state
            entity_id: sensor.solar_pv_excess
            above: '7000'
        sequence:
          - device_id: 03cf8f6cd4763f1e92109b4d57a531e9
            domain: number
            entity_id: number.keba_p30_charging_current
            type: set_value
            value: 16
    default:
      - device_id: 03cf8f6cd4763f1e92109b4d57a531e9
        domain: number
        entity_id: number.keba_p30_charging_current
        type: set_value
        value: 6
mode: single
1 Like

This looks very promising, but I have one question:

Once the amps are set, your PV Excess will drop since the power will be going to the car. Wouldn’t that cause the automation to then reduce the charging current?
And what happens if your PV excess increases after the initial charging current has been set? Would it then stay at the selected value or adapt?