Here you go, I defined eco mode as minimum 3kw solar, max 1kw grid. Green max 0.250kw grid. I have separate consumption (import) and production sensors (export). This automation triggers on either a HA restart, the wallbox state moving from anything to charging and the triggering of eco and green modes (in a scenario where it is charging at max and I want to activate either green or eco this enforces an immediate test against max grid import)
alias: Pause / Resume Wallbox - Charger connected
description: ''
trigger:
- platform: state
entity_id:
- sensor.wallbox_portal_status_description
to: Charging
for:
hours: 0
minutes: 0
seconds: 0
- platform: state
entity_id:
- input_boolean.wallbox_charger_green
to: 'on'
- platform: state
entity_id:
- input_boolean.wallbox_charger_eco
to: 'on'
- platform: homeassistant
event: start
condition:
- condition: or
conditions:
- condition: and
conditions:
- condition: state
entity_id: input_boolean.wallbox_charger_green
state: 'on'
- condition: numeric_state
entity_id: sensor.power_consumption
above: '0.250'
- condition: and
conditions:
- condition: state
entity_id: input_boolean.wallbox_charger_eco
state: 'on'
- condition: numeric_state
entity_id: sensor.power_consumption
above: '1.000'
- condition: state
entity_id: sensor.wallbox_portal_status_description
state: Charging
action:
- service: switch.turn_off
data: {}
target:
entity_id: switch.wallbox_portal_pause_resume
mode: single