Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 105670

Sensor template not showing any value

$
0
0

Hi all,

I tried to create a template sensor (Heating setpoint) which is 10 C higher than the outside temperature, but at least 5 and maximum 10 C.

for this i added below to my configuration.yaml

- platform: template
  sensors:
    heating_setpoint:
      friendly_name: "heating setpoint"
      unit_of_measurement: "°C"
      unique_id: fasdfsadrrjfffsdajmggnr231
      value_template: >
        {% set heating_setpoint = states('sensor.st_00137716_temperature') | float(none) %}

        {% if heating_setpoint is none %}
          {{ 5 }}  # Default to 5 if sensor is unavailable
        {% else %}
          {% set temp = heating_setpoint + 10 %}
          {% set clamped_temp = [5, temp, 10] | sort | slice(1,1) | first %}
          {{ clamped_temp }}
        {% endif %}

altough the sensor is created after restarting home assistant, it does not show any value.
what mistake did i make?
thanks in advance for any advise…

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 105670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>