gadgetchnnel / lovelace-card-templater

Custom Lovelace card which allows Jinja2 templates to be applied to other cards
120 stars 6 forks source link

Modifying a custom card do not work #74

Open liouma opened 6 months ago

liouma commented 6 months ago

I'm trying to modify the field "orp_setpoint" in custom:pool-monitor-card I replaced orp_setpoint with orp_setpoint_template and then I tried different syntaxes, without sucess.

type: custom:card-templater
card:
  type: custom:pool-monitor-card
  language: fr
  show_last_updated: true
  ph: sensor.analyseur_d_eau_ph
  ph_setpoint: 7.4
  orp: sensor.analyseur_d_eau_oxidation_reduction_potential
  orp_setpoint_template: >-
    MY TEMPLATE
  salinity: sensor.analyseur_d_eau_salinity
  salinity_setpoint: 6000
  salinity_step: 1000
  tds: sensor.analyseur_d_eau_total_dissolved_solids
  tds_setpoint: 4000
  tds_unit: ppm
  tds_step: 1000

In the place of "MY TEMPLATE", I tried to apply following syntaxes,but none was sucessful. Did I miss something??: Isn't it supposed to work with custom cards?

{{ 792 if states('sensor.analyseur_d_eau_ph')|round(1)==7 else 
785 if states('sensor.analyseur_d_eau_ph')|round(1)==7.1 else 
779 if states('sensor.analyseur_d_eau_ph')|round(1)==7.2 else 
773 if states('sensor.analyseur_d_eau_ph')|round(1)==7.3 else 
766 if states('sensor.analyseur_d_eau_ph')|round(1)==7.4 else 
760 if states('sensor.analyseur_d_eau_ph')|round(1)==7.5 else 
754 if states('sensor.analyseur_d_eau_ph')|round(1)==7.6 else 
748 if states('sensor.analyseur_d_eau_ph')|round(1)==7.7 else 766}}
{% set ph = states('sensor.analyseur_d_eau_ph')|round(1) %}
{% if states('sensor.analyseur_d_eau_ph')|round(1)==7 %}792
{% elif states('sensor.analyseur_d_eau_ph')|round(1)==7.1 %}785
{% elif states('sensor.analyseur_d_eau_ph')|round(1)==7.2 %}779
{% elif states('sensor.analyseur_d_eau_ph')|round(1)==7.3 %}773
{% elif states('sensor.analyseur_d_eau_ph')|round(1)==7.4 %}766
{% elif states('sensor.analyseur_d_eau_ph')|round(1)==7.5 %}760
{% elif states('sensor.analyseur_d_eau_ph')|round(1)==7.6 %}754
{% elif states('sensor.analyseur_d_eau_ph')|round(1)==7.7 %}748
{% else %}766
{% endif %}
{% set ph = states('sensor.analyseur_d_eau_ph')|round(1) %}
{% if ph==7 %}792
{% elif ph==7.1 %}
{% elif ph==7.2 %}779
{% elif ph==7.3 %}773
{% elif ph==7.4 %}766
{% elif ph==7.5 %}760
{% elif ph==7.6 %}754
{% elif ph==7.7 %}748
{% else %}766
{% endif %}
liouma commented 5 months ago

All recent post in community say the same thing. I guess this card is not working anymore