Heat Index / Apparent Temperature / Feels Like Temperature

Re-resurrecting an old thread for reasons I feel are good as well…

I did a bit of research about heat index and it seemed to only apply to the great outdoors. Then I stumbled across the following article: http://www-das.uwyo.edu/~geerts/cwx/notes/chap05/apparentt.html

It was clear to me that heat index and wind chill really don’t apply in the case of indoor temperature. I really wanted to take advantage of the formula provided, but needed Saturation Vapor Pressure and Actual Vapor pressure in order to calculate that value. That’s when I found the following: https://physics.stackexchange.com/questions/4343/how-can-i-calculate-vapor-pressure-deficit-from-temperature-and-relative-humidit which provided the final piece of the puzzle.

Armed with all of the above, I came up with the following value template:

    value_template: >
      {% set upstairs_temp_c = ((states('sensor.upstairs_temperature') | float) - 32) * 5/9 %}
      {% set es = 0.6108 * e ** (17.27 * upstairs_temp_c / (upstairs_temp_c + 237.3)) %} {# Saturation vapor pressure in kPa #}
      {% set ea = ((states('sensor.upstairs_humidity') | float) / 100 * es) %} {# Actual vapor pressure in kPa #}
      {% set tp = -1.3 + 0.92 * upstairs_temp_c + 2.2 * ea %} {# Apparent temperature in C #}
      {% set tpf = (tp * 9/5) + 32 %}
      {{ tpf | round(1) }}
6 Likes

thanks for sharing this. but I’m not sure is this the right one. I have compared the apparent temperature given by dark sky vs the result calculated at https://www.calculator.net/heat-index-calculator.html using the temperature and humidity value from dark sky are quite consistent.

Anyway, I have revisited the formula page at https://www.wpc.ncep.noaa.gov/html/heatindex_equation.shtml and updated the template based on my understanding. Here is the latest version…

- platform: template
  sensors:
    outdoor_heat_index:
      friendly_name: 'Outdoor Feels Like'
      value_template: >-
          {% set T = ((states.sensor.outdoor_temperature.state|float)*1.8)+32 %}
          {% set RH = states.sensor.outdoor_humidity.state|float %}

          {% set STEADMAN_HI = 0.5 * (T + 61.0 + ((T-68.0)*1.2) + (RH*0.094)) %}

          {% if STEADMAN_HI >= 80 %}

            {% set ROTHFUSZ_HI = -42.379 + 2.04901523*T + 10.14333127*RH - 0.22475541*T*RH - 0.00683783*T*T - 0.05481717*RH*RH + 0.00122874*T*T*RH + 0.00085282*T*RH*RH - 0.00000199*T*T*RH*RH %}
            
            {% set HI = ROTHFUSZ_HI %}
          
            {% if RH < 13 and 80 < T < 112 %}
              {% set ADJUSTMENT = ((13-RH)/4)*((17-(T-95)|abs)/17)**0.5 %}
              {% set HI = HI - ADJUSTMENT %}
            {% elif RH > 85 and 80 < T < 87 %}
              {% set ADJUSTMENT = ((RH-85)/10) * ((87-T)/5) %}
              {% set HI = HI + ADJUSTMENT %}
            {% endif %}
            
          {% else %}
            {% set HI = STEADMAN_HI %}
          {% endif %}

          {% set HI_C = (HI-32)/1.8 %}
          
          {{- HI_C|round(1) -}}
      unit_of_measurement: '°C'
3 Likes

Hi.

Sorry for resurrecting this topic, but I get errors on this config:

  - platform: template
    sensors:
      outdoor_heat_index:
        friendly_name: 'Outdoor Feels Like'
        value_template: >-
          {% set T = ((states.sensor.0x00158d000304031a_temperature.state|float)*1.8)+32 %}
          {% set RH = states.sensor.0x00158d000304031a_humidity.state|float %}
          {% set STEADMAN_HI = 0.5 * (T + 61.0 + ((T-68.0)*1.2) + (RH*0.094)) %}
          {% if STEADMAN_HI >= 80 %}
            {% set ROTHFUSZ_HI = -42.379 + 2.04901523*T + 10.14333127*RH - 0.22475541*T*RH - 0.00683783*T*T - 0.05481717*RH*RH + 0.00122874*T*T*RH + 0.00085282*T*RH*RH - 0.00000199*T*T*RH*RH %}
            {% set HI = ROTHFUSZ_HI %}
            {% if RH < 13 and 80 < T < 112 %}
              {% set ADJUSTMENT = ((13-RH)/4)*((17-(T-95)|abs)/17)**0.5 %}
              {% set HI = HI - ADJUSTMENT %}
            {% elif RH > 85 and 80 < T < 87 %}
              {% set ADJUSTMENT = ((RH-85)/10) * ((87-T)/5) %}
              {% set HI = HI + ADJUSTMENT %}
            {% endif %}
          {% else %}
          {% set HI = STEADMAN_HI %}
          {% endif %}
          {% set HI_C = (HI-32)/1.8 %}
          {{- HI_C|round(1) -}}
        unit_of_measurement: '°C'

Log:

# hassio ha check
Error: Testing configuration at /config
Failed config
  sensor.template:
    - Invalid config for [sensor.template]: invalid template (TemplateSyntaxError: expected token ')', got 'x00158d000304031a_temperature') for dictionary value @ data['sensors']['outdoor_heat_index']['value_template']. Got '{% set T = ((states.sensor.0x00158d000304031a_temperature.state|float)*1.8)+32 %} {% set RH = states.sensor.0x00158d000304031a_humidity.state|float %} {% set STEADMAN_HI = 0.5 * (T + 61.0 + ((T-68.0)*1.2) + (RH*0.094)) %} {% if STEADMAN_HI >= 80 %}\n  {% set ROTHFUSZ_HI = -42.379 + 2.04901523*T + 10.14333127*RH - 0.22475541*T*RH - 0.00683783*T*T - 0.05481717*RH*RH + 0.00122874*T*T*RH + 0.00085282*T*RH*RH - 0.00000199*T*T*RH*RH %}\n  {% set HI = ROTHFUSZ_HI %}\n  {% if RH < 13 and 80 < T < 11.... (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.template/
    - platform: template
      sensors: [source /config/configuration.yaml:297]
        outdoor_heat_index: [source /config/configuration.yaml:298]
          friendly_name: Outdoor Feels Like
          unit_of_measurement: °C
          value_template: {% set T = ((states.sensor.0x00158d000304031a_temperature.state|float)*1.8)+32 %} {% set RH = states.sensor.0x00158d000304031a_humidity.state|float %} {% set STEADMAN_HI = 0.5 * (T + 61.0 + ((T-68.0)*1.2) + (RH*0.094)) %} {% if STEADMAN_HI >= 80 %}
  {% set ROTHFUSZ_HI = -42.379 + 2.04901523*T + 10.14333127*RH - 0.22475541*T*RH - 0.00683783*T*T - 0.05481717*RH*RH + 0.00122874*T*T*RH + 0.00085282*T*RH*RH - 0.00000199*T*T*RH*RH %}
  {% set HI = ROTHFUSZ_HI %}
  {% if RH < 13 and 80 < T < 112 %}
    {% set ADJUSTMENT = ((13-RH)/4)*((17-(T-95)|abs)/17)**0.5 %}
    {% set HI = HI - ADJUSTMENT %}
  {% elif RH > 85 and 80 < T < 87 %}
    {% set ADJUSTMENT = ((RH-85)/10) * ((87-T)/5) %}
    {% set HI = HI + ADJUSTMENT %}
  {% endif %}
{% else %} {% set HI = STEADMAN_HI %} {% endif %} {% set HI_C = (HI-32)/1.8 %} {{- HI_C|round(1) -}}
Successful config (partial)
  sensor.template:

Solved:

  - platform: template
    sensors:
      heat_index_suite:
        friendly_name: 'Feels Like - Suite'
        value_template: >-
          {% set T = ((states('sensor.0x00158d000304031a_temperature')|float)*1.8+32) %}
          {% set RH = states('sensor.0x00158d000304031a_humidity')|float %}
          {% set STEADMAN_HI = 0.5 * (T + 61.0 + ((T-68.0)*1.2) + (RH*0.094)) %}
          {% if STEADMAN_HI >= 80 %}
            {% set ROTHFUSZ_HI = -42.379 + 2.04901523*T + 10.14333127*RH - 0.22475541*T*RH - 0.00683783*T*T - 0.05481717*RH*RH + 0.00122874*T*T*RH + 0.00085282*T*RH*RH - 0.00000199*T*T*RH*RH %}
            {% set HI = ROTHFUSZ_HI %}
            {% if RH < 13 and 80 < T < 112 %}
              {% set ADJUSTMENT = ((13-RH)/4)*((17-(T-95)|abs)/17)**0.5 %}
              {% set HI = HI - ADJUSTMENT %}
            {% elif RH > 85 and 80 < T < 87 %}
              {% set ADJUSTMENT = ((RH-85)/10) * ((87-T)/5) %}
              {% set HI = HI + ADJUSTMENT %}
            {% endif %}
          {% else %}
          {% set HI = STEADMAN_HI %}
          {% endif %}
          {% set HI_C = (HI-32)/1.8 %}
          {{- HI_C|round(1) -}}
        unit_of_measurement: '°C'
2 Likes

I was just rereading this thread after I came across it again. I just realized we had very different goals in mind.

The heat index calculation you’re using is, in fact, the correct calculation for outdoor “feels like” temperatures. My goal was to calculate a “feels like” temperature for the indoors, which is a very different calculation–note the NOAA formula is only accurate down to 80 degrees F, which would definitely be outside my comfort zone for an indoor temperature.

My usage is primarly for the purpose of tweaking indoor thermostat settings based on a “feels like” temperature rather than an absolute temperature.

Hopefully, that clarifies the use-case and reasoning behind the different formula.

2 Likes

Thanks – this is nearly what I was looking for. I have also realised that even indoor airflow (through fans and ventilators) affect the comfort level.

Is there a method we can first measure indoor air velocity and then use it to tweak the thermostats.

Do you know what I’d have to change to get this to work in Fahrenheit?

I might be missing something, but that template solves for Fahrenheit. It converts to F to C back to F.

Thank you for this template. I needed a template sensor for VPD.

Anyone know if there’s a way to make this calculation reusable?

I’m a bit confused with the above calculations, as the UK Meterology Office describes outdoor ‘Feels Like’ temperature as a measurement of temp/humidity/windspeed at a height of 5ft. Unless I’m missing something I don’t see windspeed integrated in those calcs. If I find the calculation for this missing piece of info, I’ll post it here.

1 Like

Here in the US, windspeed isn’t considered in the feels-like temperature. Here’s the formula: https://www.weather.gov/media/epz/wxcalc/heatIndex.pdf.

Are you still using this formula for indoor? How has it worked for you?
I’m looking into implementing something like that for my home and I think what you wanted is exactly what I want to do.
Could you tell me if you have noticed a difference by using the feeling temperature compared to the real temp?

There’s generally not a vast difference between the measured temperature and the feels-like temperature. For example, right now there’s only a one-degree difference between the feels-like temperature upstairs and the actual temperature (69.8 vs. 68.8) and that’s with 66% humidity.

I was going to try to look at a historical graph and discovered that history doesn’t record derived values, unfortunately. Otherwise, I might have been able to see how much of a delta I saw between the two.

If you’re interested in picking up a 1-2 degree difference, it might be useful; otherwise, it’s more of a novelty, I think. To answer your question more directly, the only place I leveraged the feels-like temperature is in determining whether to switch over between A/C and Heat. Otherwise, my house uses the thermostat temperature as you would normally.

Just popped in to say this is so beautiful I could cry. You should see my brute force attempt to do the same. With zillions of ifs and ().
Sad.

1 Like
2 Likes

Several solutions were discussed here and on other threads so I tried a few. Here are my results in case anyone is interested.

  1. Outdoor Feels Like (Feels Like Suite) @ masterkenobi
  2. SensorX Real Feel @ Petrica
  3. Limych Feels Like @ Limych


They all follow nearly the exact same pattern but have significant offsets. Not to criticize anyone’s work, but IMO “SenxorX Real Feel” felt the closest to my expectation of temperature experience.

2 Likes

Sorry to spoil the party, but it seems any computation should consider the impact of humidity on insulating value of clothing…
http://agron-www.agron.iastate.edu/courses/Agron541/classes/541/lesson06a/6a.3.html

Hi,
Perhaps heat index and apparent temperature are relatively different concepts with different scope of application ?..

First about Heat Index:
Heat Index shows how much hotter the air seems to be than the ambient dry-bulb temperature due to the influence of humidity.
I found that the formula of the multiple regression analysis conducted by Lans P. Rothfusz is limited by temperature >~27C. Accordingly, for lower temperatures, the result may have large discrepancies relative to the original tables by Steadman. Although a simplified expression ( HI = 0.5 * {T + 61.0 + [(T-68.0)1.2] + (RH0.094)}) is given to circumvent this limitation.

On the other hand, the Apparent temperature has a wider range of acceptable values of dry-bulb temperature values (>20C).

Therefore, it may make sense to combine formulas. However, it should be borne in mind that the heat index / apparent temperature graphs intersect at different temperatures.

1 Like