Hi everyone
Im not a coder, just edit code enough to get myself into trouble
I have this sensor defined in configuration.yaml
template:
- sensor:
- name: "Preço Electricidade"
unit_of_measurement: "EUR/kWh"
state: >
{% set cv, ci, ev, ei, pv, pi, hv = bool(states("schedule.eda_cheias_verao")),
bool(states("schedule.eda_cheias_inverno")),
bool(states("schedule.eda_vazio_verao")),
bool(states("schedule.eda_vazio_inverno")),
bool(states("schedule.eda_ponta_verao")),
bool(states("schedule.eda_ponta_inverno")),
(5 < now().month < 11) %}
{% if (cv and hv) or (ci and not hv) %}
{{ (0.1736 * 1.16) | round(4) }}
{% elif (ev and hv) or (ei and not hv) %}
{{ (0.1072 * 1.16) | round(4) }}
{% elif (pv and hv) or (pi and not hv) %}
{{ (0.2416 * 1.16) | round(4) }}
{% endif %}
what I want is to replace the number 0.1736 / 0.1072 / 0.2416 with the values from text input helpers (example: input_text.eda_preco_cheias)
I break the sensor every time i try this, anyone can help me with the right way to code it ?
I had tried (states(“input_text.eda_preco_cheias”)) … but broke it
Any help welcome