I try to create a state for a templete sensor for yes and no by comparing a value of two different values and this seems not to work.
What I did was:
- platform: template
sensors:
heizen_bad:
friendly_name: 'Bad aufheizen'
value_template: >-
{%- if is_state(states.sensor.eurotronic_eur_cometz_wall_radiator_thermostat_valve_control_temperature_8_1.state < states.input_slider.temperatur_bad.state ) -%}
Ja
{%- else -%}
Nein
{%- endif -%}
The state of sensor.eurotronic_eur_cometz_wall_radiator_thermostat_valve_control_temperature_8_1 is 23
and the state of input_slider.temperatur_bad is 25, so it should be “Ja”, but it looks like an wrong syntax.
Dec 28 21:37:24 home-assistant hass[11883]: 16-12-28 21:37:24 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=None, entity_id=sensor.heizen_bad, new_state=<state sensor.heizen_bad=unknown; friendly_name=Bad aufheizen @ 2016-12-28T22:37:24.838288+01:00>>