Skip to content

Cookie preferences

We use cookies for our own analytics, to see how our campaigns perform and, if you allow it, to load content from other services such as the Google site search. We never sell your data. Necessary cookies keep the site working and cannot be switched off. See our Cookie Policy for details and our Privacy Policy for how we handle personal data.

Security, load balancing and remembering your cookie choice.

Show us which pages people read, how they find the site and where they get stuck, so we can improve it (Google Analytics, Microsoft Clarity).

Show us which of our ad campaigns bring visitors to the site and remember the campaign or partner link you arrived from (Google Ads, LinkedIn, Meta, partner program). We do not use these cookies to build advertising profiles.

Load the site search from Google when you use it. Google sets its own cookies and shows ads in the search results.

© 2026 The ThingsBoard Authors

ThingsBoard Cloud

Choose your data region

Your data stays in the region you choose, for residency and compliance. No credit card required.

Rather run it yourself? Install on your own servers

Heat Index

  • Calculated Field
  • 0 installs
  • v1.0.0
  • Nov 16, 2026
  • MIT license
  • v4.4+

Turns temperature (°C) and relative humidity (%) into the NWS heat index, the temperature the air actually feels like, plus its NWS risk level (Caution, Extreme caution, Danger, Extreme danger). When the formula doesn’t apply it reports “Below range” instead of guessing, and it writes nothing if a reading is missing.

Type
  • Script
Category
  • Environmental
Use Cases
  • Environment Monitoring
  • Industrial Automation
  • Smart Building
  • Smart Farming
  • Health Care

Who it’s for

People who watch a warehouse, greenhouse, factory floor or care home, where the rule for when work slows or stops is written against felt temperature, not the thermometer. They already collect temperature and humidity, and they want to know “is it Caution or Danger right now?” without converting the readings by hand.

What it does

It reads the latest temperature (°C) and relativeHumidity (%) telemetry of the device and computes the heat index, the temperature the air actually feels like, as defined by the US National Weather Service (NWS).

It uses the NWS heat index formula (Rothfusz, 1990) with the NWS low and high humidity adjustments. The temperature is converted to °F for the formula, and the result is converted back to °C:

heat-index-1.0.0-diagram

It writes two time series on the same entity: heatIndex, the heat index in °C with one decimal, and heatIndexLevel, the NWS risk level (Caution, Extreme caution, Danger, Extreme danger or Below range).

The formula only applies when the heat index is 26.7 °C (80 °F) or higher. NWS checks this with a simple estimate first. If that estimate, or the final result, is below 80 °F, the field writes only heatIndexLevel = Below range and no heatIndex number, instead of guessing one. Because no number is written in that case, the latest heatIndex still shows the last result in range, so read heatIndexLevel first and hide or grey out heatIndex when it is Below range.

If either reading has not arrived yet, or humidity is outside 0 - 100 %, nothing is written, so a dashboard never shows a confident wrong number.

The formula matches the NWS heat index chart to within about ±0.7 °C (±1.3 °F). It was fitted to air temperatures up to about 43 °C (110 °F). Above that, treat both the number and the level as rough estimates. It does not cover wet-bulb globe temperature, solar load, wind or per-person factors.

For example, 32.2 °C at 70 % gives 41.0 °C (Danger), 35.6 °C at 10 % gives 32.5 °C (Extreme caution), and 22 °C at 50 % gives only Below range.

How to customize

  • To use different telemetry keys - change the Time series key on the temperature and relativeHumidity arguments to match what your sensors publish.
  • To feed temperature in °F - change var t = temperature * 9.0 / 5.0 + 32.0; to var t = temperature;.
  • To output the heat index in °F - return Math.round(hi * 10.0) / 10.0 as heatIndex instead of hiC.
  • To rename the outputs - change the heatIndex and heatIndexLevel keys in the script’s return statements.
  • To match the levels in your own safety policy - edit the thresholds in the if (hi >= ...) chain (values are in °F) and the label strings next to them.
  • To colour a dashboard by level - use heatIndexLevel in the widget’s value-to-colour mapping. No lookup is needed.
  • To raise an alarm on a level - create an alarm rule on heatIndexLevel equal to Danger or Extreme danger.

Share Your Calculated Field with the Community

Built a useful data transformation? Export it as a JSON from ThingsBoard and publish it to the IoT Hub. Share it with thousands of ThingsBoard developers worldwide.