Hello all,
I’m trying to compensate the Wallbox power consumption using a current control from Wallbox integration.
Originally I work on regulation based on Home Power Consumption to reduce using progressice if/then conditions nested (25-20-15 progressive reduction if above 6 Kw) then I was thinking to calculate it.
Since is the first time I try to set numbers based on formulas and I find several topics I try the following code:
alias: CARICA EV - Limita la corrente di carica in base consumo casa - Calcolo
description: ""
trigger:
- platform: numeric_state
entity_id:
- sensor.casa_potenza_di_carico
above: 6
condition:
- condition: state
entity_id: sensor.wallbox_pulsar_max_sn_604257_descrizione_dello_stato
state: Charging
action:
- service: number.set_value
metadata: {}
data:
value:
{{ ((6 - states(‘sensor.casa_potenza_di_carico’) | float / 230) | float + states(‘number.wallbox_pulsar_max_sn_604257_corrente_di_carica_massima’) | float }}
target:
entity_id: number.wallbox_pulsar_max_sn_604257_corrente_di_carica_massima
mode: single
This do not work since when I save it, the formula disappears.
- sensor.casa_potenza_di_carico is the home power load measured from Tesla integration
- wallbox_pulsar_max_sn_604257_corrente_di_carica_massima is the current max allowed for Wallbox and this can be set usign this parameter
Any idea where I make mistakes?