Keba Wallbox Home Assistant Charging Control – BYD Battery Load Management based on Wallbox Status

This flow optimizes the charging behavior of a BYD home battery system based on the current charging status of two EV chargers (Wallbox Garage and Wallbox Carport).

Main Goal: If one or both EVs are charging, the BYD home battery is forced into load-only mode (charging only, no discharging). If both Wallboxes are idle (no EV charging), the battery returns to its normal charging and discharging behavior.

How it works: Input Triggers: The flow listens for state changes of both EV chargers (sensor.goe_car_value for Garage and sensor.goe_car_value for Carport). It triggers whenever the state of either Wallbox changes to or from "Laden" (German for "Charging").

Charging Detection Logic: When a charger starts charging (Laden), the flow checks that the other charger is not already charging, ensuring that the battery switches to load-only mode as soon as any one charger starts.

Stop Condition (Both Wallboxes Idle): When both chargers report not charging, the flow triggers the Home Assistant script byd_charging_and_uncharging to return the BYD battery to its default behavior (charge and discharge allowed).

Home Assistant Entities Used: sensor.goe_car_value (Garage Wallbox status)

sensor.goe_2_car_value (Carport Wallbox status)

Scripts executed in Home Assistant:

script.byd_only_load → Forces battery into load-only mode

script.byd_charging_and_uncharging → Resets battery to charge/discharge mode

[{"id":"d9f0ce822b96e4e3","type":"server-state-changed","z":"de3fdf315c475e0c","name":"Carport EV Charging","server":"your_home_assistant_server","version":6,"outputs":2,"entities":{"entity":["sensor.carport_wallbox_status"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"Charging","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":true,"ignorePrevStateUnknown":true,"ignorePrevStateUnavailable":true,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"payload","propertyType":"msg","valueType":"entityState"},{"property":"data","propertyType":"msg","valueType":"eventData"},{"property":"topic","propertyType":"msg","valueType":"triggerId"}],"x":140,"y":140,"wires":[["d3ad25fb3bb96e20"],["42d9de308b5e1725"]]},{"id":"d2cf9b7515dd1eaa","type":"comment","z":"de3fdf315c475e0c","name":"EV Charging → BYD Load Mode Control","info":"","x":260,"y":80,"wires":[]},{"id":"e77e69ca0b264a02","type":"api-call-service","z":"de3fdf315c475e0c","name":"","server":"your_home_assistant_server","version":7,"action":"script.force_battery_load_only","domain":"script","service":"force_battery_load_only","x":920,"y":140,"wires":[]},{"id":"116e40654c75d850","type":"debug","z":"de3fdf315c475e0c","name":"EV Charging Active","active":true,"tosidebar":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":880,"y":80,"wires":[]},{"id":"ca6d2744466ea6c3","type":"api-call-service","z":"de3fdf315c475e0c","name":"","server":"your_home_assistant_server","version":7,"action":"script.reset_battery_mode","domain":"script","service":"reset_battery_mode","x":970,"y":200,"wires":[]},{"id":"ac01e061858baba2","type":"server-state-changed","z":"de3fdf315c475e0c","name":"Garage EV Charging","server":"your_home_assistant_server","version":6,"outputs":2,"entities":{"entity":["sensor.garage_wallbox_status"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"Charging","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":true,"ignorePrevStateUnknown":true,"ignorePrevStateUnavailable":true,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"payload","propertyType":"msg","valueType":"entityState"},{"property":"data","propertyType":"msg","valueType":"eventData"},{"property":"topic","propertyType":"msg","valueType":"triggerId"}],"x":140,"y":200,"wires":[["d3ad25fb3bb96e20"],["42d9de308b5e1725"]]},{"id":"d3ad25fb3bb96e20","type":"api-current-state","z":"de3fdf315c475e0c","name":"Garage Not Charging?","server":"your_home_assistant_server","version":3,"outputs":2,"halt_if":"Charging","halt_if_type":"str","halt_if_compare":"is_not","entity_id":"sensor.garage_wallbox_status","state_type":"str","x":410,"y":140,"wires":[[],["24633607839df6b1"]]},{"id":"24633607839df6b1","type":"api-current-state","z":"de3fdf315c475e0c","name":"Carport Not Charging?","server":"your_home_assistant_server","version":3,"outputs":2,"halt_if":"Charging","halt_if_type":"str","halt_if_compare":"is_not","entity_id":"sensor.carport_wallbox_status","state_type":"str","x":670,"y":140,"wires":[[],["e77e69ca0b264a02","116e40654c75d850"]]},{"id":"42d9de308b5e1725","type":"api-current-state","z":"de3fdf315c475e0c","name":"Garage Not Charging?","server":"your_home_assistant_server","version":3,"outputs":2,"halt_if":"Charging","halt_if_type":"str","halt_if_compare":"is_not","entity_id":"sensor.garage_wallbox_status","state_type":"str","x":410,"y":200,"wires":[["c9d776cc9c084331"],[]]},{"id":"c9d776cc9c084331","type":"api-current-state","z":"de3fdf315c475e0c","name":"Carport Not Charging?","server":"your_home_assistant_server","version":3,"outputs":2,"halt_if":"Charging","halt_if_type":"str","halt_if_compare":"is_not","entity_id":"sensor.carport_wallbox_status","state_type":"str","x":670,"y":200,"wires":[["ca6d2744466ea6c3"],[]]},{"id":"your_home_assistant_server","type":"server","name":"Your Home Assistant Server"}]

Flow Info

Created 3 days ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • comment (x1)
  • debug (x1)
Other

Tags

  • Home Assistant
  • Energy Management
  • BYD Battery
  • EV Charging
  • Load Shifting
  • Smart Home
  • Solar Optimization
  • Battery Control
  • Wallbox
  • Home Energy Automation
  • Keba
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option