Vehicule branche : depart ponctuel (VW et ZERO repartent l'apres-midi sans jours fixes), ZERO 15 kWh / 3,5 kW

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011uJ47NxgfpGnuuMr3f2n7Z
This commit is contained in:
Tallagrand Thierry
2026-09-28 14:25:46 +02:00
parent f9cf9daa8c
commit 5c43249899
6 changed files with 42 additions and 5 deletions

View File

@@ -41,6 +41,17 @@
{%- endif -%}
{%- set branche = states.binary_sensor.victron_evcs_vehicle_connected -%}
{%- set niveau = states.input_number.victron_evcs_vehicle_level_pct -%}
{#- Depart ponctuel (VW, ZERO : pas de jours fixes) : pour aujourd'hui, a venir,
saisi depuis ce branchement. Le plus proche des deux departs l'emporte. -#}
{%- set ponctuel = states.input_datetime.victron_evcs_departure_ponctuel -%}
{%- if branche is not none and ponctuel is not none and branche.state == 'on'
and ponctuel.state not in ['unknown', 'unavailable', ''] -%}
{%- set p = as_datetime(ponctuel.attributes.timestamp) | as_local -%}
{%- if p.date() == now().date() and p > now()
and as_timestamp(ponctuel.last_changed) >= as_timestamp(branche.last_changed) - 3600 -%}
{%- set vh.dep = p if vh.dep == '' or p < vh.dep else vh.dep -%}
{%- endif -%}
{%- endif -%}
{%- if branche is not none and niveau is not none and branche.state == 'on' -%}
{#- Date de SAISIE ecrite par l'automatisation, pas last_changed : une saisie
identique ne change pas l'etat du helper mais compte comme une saisie. -#}