# Humidex index formula help

**URL:** <https://discourse.nodered.org/t/humidex-index-formula-help/63037>\
**Category:** General\
**Created:** [25 May 2022 08:59 UTC](https://discourse.nodered.org/t/humidex-index-formula-help/63037 "2022-05-25T08:59:54Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giamma](https://avatars.discourse-cdn.com/v4/letter/g/e47774/32.png) [@Giamma](https://discourse.nodered.org/u/Giamma)\
**Post date:** [25 May 2022 08:59 UTC](https://discourse.nodered.org/t/humidex-index-formula-help/63037/1 "2022-05-25T08:59:54Z")

</div>

Hi,  
can you help me to reproduce this formula in node red function?

 ![humidex](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/7/e776e0114067b7b0a84ed2d06e55e26023b018ea.png)

Ta = temperature value  
UR = humidity value

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [25 May 2022 09:32 UTC](https://discourse.nodered.org/t/humidex-index-formula-help/63037/2 "2022-05-25T09:32:32Z")

</div>

This suggests a slightly simpler approach which should be easier to translate to JavaScript - if only because it is clearer.

[What is the Humidex formula used to find subjective temperature as a function of both measured temperature and relative humidity? (physlink.com)](https://www.physlink.com/education/askexperts/ae287.cfm)

You also need the dewpoint:

Tdc = 243.04\*(LN(RH/100)+((17.625_T)/(243.04+T)))/(17.625-LN(RH/100)-((17.625_T)/(243.04+T)))

> **[Temperature, Dewpoint, and Relative Humidity Calculator](http://bmcnoldy.rsmas.miami.edu/Humidity.html)**
>
> Brian McNoldy's T/Td/RH Calculator.

(243.04\*(Math.log(RH/100)+((17.625_Tc)/(243.04+Tc)))/(17.625-Math.log(RH/100)-((17.625_Tc)/(243.04+Tc)))).toFixed(1);

Though you will need to convert that to Kelvins

* * *

However, you might find it a lot easier to use Heat Index rather than the Canadian Humidex. HI is based on relative humidity rather than Dew Point and so is generally much easier to work with since there are lots of sensors that will output humidity or it is available in weather forecasts.

[Heat index - Simple English Wikipedia, the free encyclopedia](https://simple.wikipedia.org/wiki/Heat_index)

---

<div class="post-metadata">

**Author:** ![Giamma](https://avatars.discourse-cdn.com/v4/letter/g/e47774/32.png) [@Giamma](https://discourse.nodered.org/u/Giamma)\
**Post date:** [25 May 2022 09:43 UTC](https://discourse.nodered.org/t/humidex-index-formula-help/63037/3 "2022-05-25T09:43:30Z")

</div>

Ok ....  
but in this site ...

> **[Gli indici Humidex (H) e di Temperatura Equivalente](http://www.centrometeo.com/articoli-reportage-approfondimenti/climatologia/5008-indici-humidex-temperatura-equivalente)**
>
> Gli indici Humidex e di Temperatura Equivalente presentati in questo articolo rappresentano solo alcuni dei numerosi indici di disagio climatico studiati in questi ultimi decenni...

I found a simplified formula and my problem is how to make this calculation  
 ![calcolo](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/a/5af29b2069bf3f4e084b91c8e32ed890995accbe.png)

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [25 May 2022 09:44 UTC](https://discourse.nodered.org/t/humidex-index-formula-help/63037/4 "2022-05-25T09:44:43Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/9/f9101c66f4a363d9d13b31e64c3ee30e798269a3.png)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [25 May 2022 09:45 UTC](https://discourse.nodered.org/t/humidex-index-formula-help/63037/5 "2022-05-25T09:45:12Z")

</div>

Well that translates to "10 to the power of (0.03 \* temperature)"

Also note:

> The index is applicable between temperatures of 20°C and 55°C

---

<div class="post-metadata">

**Author:** ![Giamma](https://avatars.discourse-cdn.com/v4/letter/g/e47774/32.png) [@Giamma](https://discourse.nodered.org/u/Giamma)\
**Post date:** [25 May 2022 09:50 UTC](https://discourse.nodered.org/t/humidex-index-formula-help/63037/6 "2022-05-25T09:50:59Z")

</div>

Thank you ....

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [25 May 2022 10:06 UTC](https://discourse.nodered.org/t/humidex-index-formula-help/63037/7 "2022-05-25T10:06:23Z")

</div>

```auto
const TC = msg.payload.temperature // in celcius
const RH = msg.payload.humidity // Relative humidity as %

// Humidex: http://www.centrometeo.com/articoli-reportage-approfondimenti/climatologia/5008-indici-humidex-temperatura-equivalente
const H = Number( (TC + (0.5555 * (0.06 * RH * Math.pow(10, 0.03 * TC) - 10))).toFixed(1) )
msg.payload.humidex = H

if ( H < 27 ) {
    msg.payload.humidexCategory = 'Well Being'
} else if ( H < 30 ) {
    msg.payload.humidexCategory = 'Caution'
} else if ( H < 40 ) {
    msg.payload.humidexCategory = 'Extreme Caution'
} else if (H < 55) {
    msg.payload.humidexCategory = 'Danger'
} else {
    msg.payload.humidexCategory = 'High Danger'
}

return msg

```

---

<div class="post-metadata">

**Author:** ![Giamma](https://avatars.discourse-cdn.com/v4/letter/g/e47774/32.png) [@Giamma](https://discourse.nodered.org/u/Giamma)\
**Post date:** [25 May 2022 10:24 UTC](https://discourse.nodered.org/t/humidex-index-formula-help/63037/8 "2022-05-25T10:24:14Z")

</div>

Thank you, thank you very much .......

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [25 May 2022 10:25 UTC](https://discourse.nodered.org/t/humidex-index-formula-help/63037/9 "2022-05-25T10:25:59Z")

</div>

No problem. I did it while listening in to a boring team meeting 😸

It was interesting. The calculation that is, not the meeting! I'll be adding to my environment data for sure.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [8 June 2022 10:26 UTC](https://discourse.nodered.org/t/humidex-index-formula-help/63037/10 "2022-06-08T10:26:19Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
