Hi,
I have an EV and installed a charge pole. I only find a sensor of the charge pole that gives the total energy charged into the EV. I wanted to calculate the charge power by using a derivative helper:
template:
- trigger:
- platform: time_pattern
seconds: "/10"
sensor:
- name: "EVAC Laadvermogen Actief"
unique_id: evac_laadvermogen_actief
unit_of_measurement: "kW" # Vul "W" in als je derivative al in Watts is
device_class: power
state_class: measurement
state: >
{% set s = states.sensor.evac_geladen_energie_kwh %}
{% if s is defined and s is not none and s.last_updated is not none %}
{% set age = (now() - s.last_updated).total_seconds() %}
{% if age < 120 %}
{{ states('sensor.evac_laadvermogen_derivative') | float(0) | round(1) }}
{% else %}
0.0
{% endif %}
{% else %}
0.0
{% endif %}
The calculation is not correct since it always shows 0 W.
Can someone help me out?
Tx/Alain