Charge HC manuelle : comparaison booleenne corrigee (ne marchait pas depuis le 18/09)

This commit is contained in:
Tallagrand Thierry
2026-10-13 06:22:43 +02:00
parent 3146093b05
commit a2dafc518c
2 changed files with 7 additions and 2 deletions

View File

@@ -100,11 +100,15 @@ automation:
{% endif %}
{% if hm >= m1 and hm < m2 %}{% set d.v = true %}{% endif %}
{{ d.v }}
# 13/10/2026 : `dans_hc` arrive en BOOLEEN (types natifs de HA), pas en
# chaine ; comparee a 'True' elle etait toujours fausse -> le plancher
# restait a 0 et le bouton se desarmait : la charge manuelle n'a jamais
# fonctionne depuis le 18/09. On compare donc `dans_hc | string`.
arme: "{{ is_state('input_boolean.evcs_battery_manual_hc', 'on') }}"
plancher_actuel: "{{ states('input_number.evcs_battery_manual_hc_floor') | float(0) }}"
voulu: >
{{ (states('input_number.evcs_battery_manual_hc_target') | float(0))
if (arme and dans_hc == 'True') else 0 }}
if (arme and (dans_hc | string) == 'True') else 0 }}
- condition: template
value_template: "{{ (voulu | float(0) - plancher_actuel | float(0)) | abs > 0.01 }}"
- service: input_number.set_value
@@ -118,7 +122,7 @@ automation:
- if:
- condition: template
value_template: >
{{ arme and dans_hc != 'True' and (plancher_actuel | float(0)) > 0 }}
{{ arme and (dans_hc | string) != 'True' and (plancher_actuel | float(0)) > 0 }}
then:
- service: input_boolean.turn_off
target: