This one regarding the complete keba charger setup was not very straightforwad, i summarized the whole setup at my side to simplify it for the others:
configuration.yaml:
#helper for PV Excess automation - Keba does not have enable/disable switch
switch:
- platform: template
switches:
keba:
friendly_name: "Keba"
turn_on:
service: button.press
target:
entity_id: button.keba_p30_de_enable
turn_off:
service: button.press
target:
entity_id: button.keba_p30_de_disable
#helper for pV Excess automation - when input number chages Keba.set_current will be launched
input_number:
kebacurrent:
name: Keba Current
initial: 5
min: 5
max: 16
step: 1
I have used Keba buttons and the button.press service for the purpose of enable/disable the wall box:
Keba automation for PV Excess:
alias: Keba nabijacka podla PV 1F
description: ovladanie Keba nabijacky podla prebytkov PV 1F
use_blueprint:
path: homeassistant/pv_excess_control.yaml
input:
automation_id: Keba nabijacka podla PV 1F
pv_power: sensor.solarman_activepower_output_total
export_power: sensor.solarman_activepower_pcc_total
solar_production_forecast: sensor.solcast_pv_forecast_predpoved_dnes
load_power: sensor.solarman_activepower_load_sys
appliance_switch: switch.keba
dynamic_current_appliance: true
defined_current: 5
appliance_priority: 21
appliance_switch_interval: 15
appliance_current_set_entity: input_number.kebacurrent
min_current: 5
appliance_phases: 1
actual_power: sensor.starship_y_charger_power
switch.keba and input_number.kebacurrent is used for enabling/disabling and setting the wall box power as defined before
To change keba current, I have used the following automation triggered when input_number.kebacurrent has changed:
alias: KEBA set current
description: KEBA set current through helper
trigger:
- platform: state
entity_id:
- input_number.kebacurrent
condition: []
action:
- service: keba.set_current
data:
current: "{{ states('input_number.kebacurrent')|float(0) }}"
device_id: 52aa9005d865986e0e97235e82559910
mode: single
device id: 52aa9005d865986e0e97235e82559910 is my keba P30 DE wall box, as keba.set_current requires device id as the mandatory parameter.
To fine tune the actual current for the charging, I initialize it (depending on charging mode: PV Excess or full power) when charging has started. This is the automation for the purpose:
alias: Aktualizuj current pre Keba pri zacati nabijania
description: Aktualizuj current pre Keba pri zacati nabijania podla Tesla power mode
trigger:
- type: powered
platform: device
device_id: 52aa9005d865986e0e97235e82559910
entity_id: 2fafa1feae086c272767e415d62b5e1c
domain: binary_sensor
condition: []
action:
- service: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.keba
- if:
- condition: state
entity_id: input_boolean.tesla_full_power
state: "on"
then:
- service: input_number.set_value
metadata: {}
data:
value: 16
target:
entity_id: input_number.kebacurrent
else:
- service: input_number.set_value
metadata: {}
data:
value: 5
target:
entity_id: input_number.kebacurrent
mode: single
device_id: 52aa9005d865986e0e97235e82559910 - is Keba_DE device and entity id: 2fafa1feae086c272767e415d62b5e1c is “charging is powered” as follows the automation trigger:
Hope it will help someone.