Heat Index Function

The National Weather Service (NOAA) publishes a Table and Calculation for measuring the “heat index”. The Heat Index is a combination of temperature and humidity ([url=http://www.srh.noaa.gov/ama/?n=heatindex]http://www.srh.noaa.gov/ama/?n=heatindex[/url] that are used together to calculate the “apparent temperature”. The link provides the apparent temperature as a “table” and also provides the equation used to calculate apparent temperature.

Obtaining the temperature and humidity information from some of my Z-wave sensors, I would like to be able to turn on some devices (fans) when the apparent temperature is greater than a specified apparent temperature. I would like to be able to use three parameters; temperature, humidity, maximum apparent temperature, to determine when to turn these devices on and off.

Unfortunately, I don’t see a way to do this in PLEG, and am not fluent in Luua. Any ideas on how to make this work?

Thank you for your time.