I am trying to do something that should be simple as pie but I consistently struggle with templating syntax.
I have been successful formating some sensor values using conditional statements in the value_template of the sensor, such as east_alcove_time_stamp, below.
I am trying to do the same thing with another sensor, but trying to save its current value to a input_number, not just the state change.
The following code in my configuration.yaml shows one working sensor (sensor.east_alcove_time_stamp), and the one I am having great difficulty with (sensor.furnace_temp_min), Should I not be able to set an input_number to the value of sensor?
east_alcove_time_stamp:
friendly_name: East Alcove Time Stamp
unit_of_measurement: ' '
value_template: >
{% if is_state('binary_sensor.east_alcove_motion', 'on') %}
{{ as_timestamp(now())| timestamp_custom('%H:%M') }}
{% else %}
{{ as_timestamp(states.binary_sensor.east_alcove_motion.last_changed) | timestamp_custom('%H:%M') }}
{% endif %}
furnace_temp_min:
friendly_name: Furnace Temp Min
device_class: temperature
unit_of_measurement: '°F '
value_template: >
{% if {{ states('sensor.furnace_temp') |int }} > {{states('input_number.test_min_temp') | int }} %}
"{{ states('sensor.furnace_temp') }}"
{% else %}
"{{ states('input_number.test_min_temp') | int }}"
{% endif %}
Many thanks for any guidance . . .