mirror of https://github.com/arendst/Tasmota.git
Add Show calculated heat index if temperature and humidity is available with ``#define USE_HEAT_INDEX`` (#4771)
This commit is contained in:
parent
920967506b
commit
fb003e006e
|
@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file.
|
|||
- HASPmota more attributes (#20744)
|
||||
- QMC5883l check for overflow and scale reading (#20643)
|
||||
- TasMesh support for LWT messages (#20392)
|
||||
- Show calculated heat index if temperature and humidity is available with ``#define USE_HEAT_INDEX`` (#4771)
|
||||
|
||||
### Breaking Changed
|
||||
|
||||
|
|
|
@ -118,6 +118,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
|
|||
|
||||
## Changelog v13.4.0.1
|
||||
### Added
|
||||
- Show calculated heat index if temperature and humidity is available with ``#define USE_HEAT_INDEX`` [#4771](https://github.com/arendst/Tasmota/issues/4771)
|
||||
- TasMesh support for LWT messages [#20392](https://github.com/arendst/Tasmota/issues/20392)
|
||||
- QMC5883l check for overflow and scale reading [#20643](https://github.com/arendst/Tasmota/issues/20643)
|
||||
- HASPmota `p<x>b<y>.delete` to delete an object [#20735](https://github.com/arendst/Tasmota/issues/20735)
|
||||
|
|
|
@ -95,6 +95,7 @@
|
|||
#define D_JSON_HALLEFFECT "HallEffect"
|
||||
#define D_JSON_HALTING "Halting"
|
||||
#define D_JSON_HEAPSIZE "Heap"
|
||||
#define D_JSON_HEATINDEX "HeatIndex"
|
||||
#define D_JSON_HIGH "High"
|
||||
#define D_JSON_HOST_NOT_FOUND "Host not found"
|
||||
#define D_JSON_FILE_NOT_FOUND "File not found"
|
||||
|
@ -948,6 +949,7 @@ const char HTTP_SNS_F_ABS_HUM[] PROGMEM = "{s}%s " D_ABSOLUTE_HUMIDITY "{
|
|||
|
||||
const char HTTP_SNS_HUM[] PROGMEM = "{s}%s " D_HUMIDITY "{m}%s " D_UNIT_PERCENT "{e}";
|
||||
const char HTTP_SNS_DEW[] PROGMEM = "{s}%s " D_DEWPOINT "{m}%s " D_UNIT_DEGREE "%c{e}";
|
||||
const char HTTP_SNS_HEATINDEX[] PROGMEM = "{s}%s " D_HEATINDEX "{m}%s " D_UNIT_DEGREE "%c{e}";
|
||||
const char HTTP_SNS_PRESSURE[] PROGMEM = "{s}%s " D_PRESSURE "{m}%s " "%s{e}";
|
||||
const char HTTP_SNS_SEAPRESSURE[] PROGMEM = "{s}%s " D_PRESSUREATSEALEVEL "{m}%s " "%s{e}";
|
||||
const char HTTP_SNS_ANALOG[] PROGMEM = "{s}%s " D_ANALOG_INPUT "%d{m}%d" "{e}";
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Groep"
|
||||
#define D_HOST "Gasheer"
|
||||
#define D_HALL_EFFECT "Hall Effect"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Gasheername"
|
||||
#define D_HUMIDITY "Humiditeit"
|
||||
#define D_ILLUMINANCE "Verligting"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Група"
|
||||
#define D_HOST "Хост"
|
||||
#define D_HALL_EFFECT "Ефект на Хол"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Име на хоста"
|
||||
#define D_HUMIDITY "Влажност"
|
||||
#define D_ILLUMINANCE "Осветеност"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Grup"
|
||||
#define D_HOST "Hoste"
|
||||
#define D_HALL_EFFECT "Efecte Hall"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Nom de màquina"
|
||||
#define D_HUMIDITY "Humitat"
|
||||
#define D_ILLUMINANCE "Iluminància"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Skupina"
|
||||
#define D_HOST "Server"
|
||||
#define D_HALL_EFFECT "Hall Effect"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Název serveru"
|
||||
#define D_HUMIDITY "Vlhkost"
|
||||
#define D_ILLUMINANCE "Osvětlení"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Gruppe"
|
||||
#define D_HOST "Host"
|
||||
#define D_HALL_EFFECT "Hall Effekt"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Hostname"
|
||||
#define D_HUMIDITY "Feuchtigkeit"
|
||||
#define D_ILLUMINANCE "Beleuchtungsstärke"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Ομάδα"
|
||||
#define D_HOST "Host"
|
||||
#define D_HALL_EFFECT "Hall Effect"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Hostname"
|
||||
#define D_HUMIDITY "Υγρασία"
|
||||
#define D_ILLUMINANCE "Φωτεινότητα"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Group"
|
||||
#define D_HOST "Host"
|
||||
#define D_HALL_EFFECT "Hall Effect"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Hostname"
|
||||
#define D_HUMIDITY "Humidity"
|
||||
#define D_ILLUMINANCE "Illuminance"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Grupo"
|
||||
#define D_HOST "Host"
|
||||
#define D_HALL_EFFECT "Efecto Hall"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Hostname"
|
||||
#define D_HUMIDITY "Humedad"
|
||||
#define D_ILLUMINANCE "Luminancia"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Groupe"
|
||||
#define D_HOST "Hôte"
|
||||
#define D_HALL_EFFECT "Effet Hall"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Nom d'Hôte"
|
||||
#define D_HUMIDITY "Humidité"
|
||||
#define D_ILLUMINANCE "Éclairement"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Groep"
|
||||
#define D_HOST "Host"
|
||||
#define D_HALL_EFFECT "Hall Effect"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Hostnamme"
|
||||
#define D_HUMIDITY "Feuchte"
|
||||
#define D_ILLUMINANCE "Beljochting"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "קבוצה"
|
||||
#define D_HOST "מארח"
|
||||
#define D_HALL_EFFECT "Hall Effect"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "שם מארח"
|
||||
#define D_HUMIDITY "לחות"
|
||||
#define D_ILLUMINANCE "רמת חשיפה"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Csoport"
|
||||
#define D_HOST "Hoszt"
|
||||
#define D_HALL_EFFECT "Hall Effect"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Hosztnév"
|
||||
#define D_HUMIDITY "Páratartalom"
|
||||
#define D_ILLUMINANCE "Megvilágítás"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Gruppo"
|
||||
#define D_HOST "Host"
|
||||
#define D_HALL_EFFECT "Effetto hall"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Nome host"
|
||||
#define D_HUMIDITY "Umidità"
|
||||
#define D_ILLUMINANCE "Illuminazione"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "그룹"
|
||||
#define D_HOST "호스트"
|
||||
#define D_HALL_EFFECT "Hall Effect"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "호스트이름"
|
||||
#define D_HUMIDITY "습도"
|
||||
#define D_ILLUMINANCE "조도"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Groep"
|
||||
#define D_HOST "Host"
|
||||
#define D_HALL_EFFECT "Hall Effect"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Hostnaam"
|
||||
#define D_HUMIDITY "Luchtvochtigheid"
|
||||
#define D_ILLUMINANCE "Verlichtingssterkte"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Grupa"
|
||||
#define D_HOST "Serwer"
|
||||
#define D_HALL_EFFECT "Hall Effect"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Nazwa serwera"
|
||||
#define D_HUMIDITY "Wilgotność"
|
||||
#define D_ILLUMINANCE "Podświetlanie"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Grupo"
|
||||
#define D_HOST "Host"
|
||||
#define D_HALL_EFFECT "Efeito Hall"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Nome do Host"
|
||||
#define D_HUMIDITY "Umidade"
|
||||
#define D_ILLUMINANCE "Luminância"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Grupo"
|
||||
#define D_HOST "Anfitrião"
|
||||
#define D_HALL_EFFECT "Hall Effect"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Nome Anfitrião"
|
||||
#define D_HUMIDITY "Humidade"
|
||||
#define D_ILLUMINANCE "Luminâcia"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Grup"
|
||||
#define D_HOST "Gazdă"
|
||||
#define D_HALL_EFFECT "Hall Effect"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Hostname"
|
||||
#define D_HUMIDITY "Umiditate"
|
||||
#define D_ILLUMINANCE "Iluminare"
|
||||
|
|
|
@ -120,6 +120,7 @@
|
|||
#define D_GROUP "Группа"
|
||||
#define D_HOST "Хост"
|
||||
#define D_HALL_EFFECT "Hall Effect"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Имя хоста"
|
||||
#define D_HUMIDITY "Влажность"
|
||||
#define D_ILLUMINANCE "Освещенность"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Skupina"
|
||||
#define D_HOST "Server"
|
||||
#define D_HALL_EFFECT "Hall Effect"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Názov servera"
|
||||
#define D_HUMIDITY "Vlhkosť"
|
||||
#define D_ILLUMINANCE "Osvetlenie"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Grupp"
|
||||
#define D_HOST "Värd"
|
||||
#define D_HALL_EFFECT "Hall Effect"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Värdnamn"
|
||||
#define D_HUMIDITY "Fuktighet"
|
||||
#define D_ILLUMINANCE "Belysnings"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Grup"
|
||||
#define D_HOST "Host"
|
||||
#define D_HALL_EFFECT "Hall Effect"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Host Adresi"
|
||||
#define D_HUMIDITY "Nem"
|
||||
#define D_ILLUMINANCE "Aydınlık"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Група"
|
||||
#define D_HOST "Хост"
|
||||
#define D_HALL_EFFECT "Hall Effect"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Назва хосту"
|
||||
#define D_HUMIDITY "Вологість"
|
||||
#define D_ILLUMINANCE "Освітленність"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "Nhóm"
|
||||
#define D_HOST "Máy chủ"
|
||||
#define D_HALL_EFFECT "Hall Effect"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "Tên máy chủ"
|
||||
#define D_HUMIDITY "Độ ẩm"
|
||||
#define D_ILLUMINANCE "Độ sáng"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "组:"
|
||||
#define D_HOST "主机"
|
||||
#define D_HALL_EFFECT "Hall Effect"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "主机名"
|
||||
#define D_HUMIDITY "湿度"
|
||||
#define D_ILLUMINANCE "照度"
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define D_GROUP "群組:"
|
||||
#define D_HOST "主機"
|
||||
#define D_HALL_EFFECT "Hall Effect"
|
||||
#define D_HEATINDEX "Heat index"
|
||||
#define D_HOSTNAME "主機名稱"
|
||||
#define D_HUMIDITY "濕度"
|
||||
#define D_ILLUMINANCE "照度"
|
||||
|
|
|
@ -385,6 +385,8 @@
|
|||
//#define MY_LANGUAGE zh_CN // Chinese (Simplified) in China
|
||||
//#define MY_LANGUAGE zh_TW // Chinese (Traditional) in Taiwan
|
||||
|
||||
//#define USE_HEAT_INDEX // Show calculated Heat index from temperature and humidity (+1k4 code)
|
||||
|
||||
// -- Wifi Config tools ---------------------------
|
||||
#define WIFI_SOFT_AP_CHANNEL 1 // Soft Access Point Channel number between 1 and 13 as used by Wi-Fi Manager web GUI
|
||||
#define USE_IMPROV // Add support for IMPROV serial protocol as used by esp-web-tools (+2k code)
|
||||
|
|
|
@ -858,6 +858,33 @@ float CalcTempHumToDew(float t, float h) {
|
|||
return result;
|
||||
}
|
||||
|
||||
#ifdef USE_HEAT_INDEX
|
||||
float CalcTemHumToHeatIndex(float t, float h) {
|
||||
if (!Settings->flag.temperature_conversion) { // SetOption8 - Switch between Celsius or Fahrenheit
|
||||
t = t * 1.8f + 32; // Fahrenheit
|
||||
}
|
||||
float hi = 0.5 * (t + 61.0 + ((t - 68.0) * 1.2) + (h * 0.094));
|
||||
if (hi > 79) {
|
||||
float pt = t * t; // pow(t, 2)
|
||||
float ph = h * h; // pow(h, 2)
|
||||
hi = -42.379 + 2.04901523 * t + 10.14333127 * h +
|
||||
-0.22475541 * t * h +
|
||||
-0.00683783 * pt +
|
||||
-0.05481717 * ph +
|
||||
0.00122874 * pt * h +
|
||||
0.00085282 * t * ph +
|
||||
-0.00000199 * pt * ph;
|
||||
if ((h < 13) && (t >= 80.0) && (t <= 112.0)) {
|
||||
hi -= ((13.0 - h) * 0.25) * sqrtf((17.0 - abs(t - 95.0)) * 0.05882);
|
||||
}
|
||||
else if ((h > 85.0) && (t >= 80.0) && (t <= 87.0)) {
|
||||
hi += ((h - 85.0) * 0.1) * ((87.0 - t) * 0.2);
|
||||
}
|
||||
}
|
||||
return (Settings->flag.temperature_conversion) ? hi : (hi - 32) / 1.8f;
|
||||
}
|
||||
#endif // USE_HEAT_INDEX
|
||||
|
||||
float CalcTempHumToAbsHum(float t, float h) {
|
||||
if (isnan(t) || isnan(h)) { return NAN; }
|
||||
// taken from https://carnotcycle.wordpress.com/2012/08/04/how-to-convert-relative-humidity-to-absolute-humidity/
|
||||
|
@ -1338,13 +1365,19 @@ int ResponseAppendTime(void)
|
|||
return ResponseAppendTimeFormat(Settings->flag2.time_format);
|
||||
}
|
||||
|
||||
int ResponseAppendTHD(float f_temperature, float f_humidity)
|
||||
{
|
||||
int ResponseAppendTHD(float f_temperature, float f_humidity) {
|
||||
float dewpoint = CalcTempHumToDew(f_temperature, f_humidity);
|
||||
return ResponseAppend_P(PSTR("\"" D_JSON_TEMPERATURE "\":%*_f,\"" D_JSON_HUMIDITY "\":%*_f,\"" D_JSON_DEWPOINT "\":%*_f"),
|
||||
Settings->flag2.temperature_resolution, &f_temperature,
|
||||
Settings->flag2.humidity_resolution, &f_humidity,
|
||||
Settings->flag2.temperature_resolution, &dewpoint);
|
||||
int len = ResponseAppend_P(PSTR("\"" D_JSON_TEMPERATURE "\":%*_f,\"" D_JSON_HUMIDITY "\":%*_f,\"" D_JSON_DEWPOINT "\":%*_f"),
|
||||
Settings->flag2.temperature_resolution, &f_temperature,
|
||||
Settings->flag2.humidity_resolution, &f_humidity,
|
||||
Settings->flag2.temperature_resolution, &dewpoint);
|
||||
#ifdef USE_HEAT_INDEX
|
||||
float heatindex = CalcTemHumToHeatIndex(TasmotaGlobal.temperature_celsius, TasmotaGlobal.humidity);
|
||||
int len2 = ResponseAppend_P(PSTR(",\"" D_JSON_HEATINDEX "\":%*_f"),
|
||||
Settings->flag2.temperature_resolution, &heatindex);
|
||||
return len + len2;
|
||||
#endif // USE_HEAT_INDEX
|
||||
return len;
|
||||
}
|
||||
|
||||
int ResponseJsonEnd(void)
|
||||
|
|
|
@ -1025,8 +1025,13 @@ bool MqttShowSensor(bool call_show_sensor) {
|
|||
}
|
||||
if (2 == add_comma) {
|
||||
float dewpoint = CalcTempHumToDew(TasmotaGlobal.temperature_celsius, TasmotaGlobal.humidity);
|
||||
ResponseAppend_P(PSTR("%s\"" D_JSON_DEWPOINT "\":%*_f"),
|
||||
(add_comma)?",":"", Settings->flag2.temperature_resolution, &dewpoint);
|
||||
ResponseAppend_P(PSTR(",\"" D_JSON_DEWPOINT "\":%*_f"),
|
||||
Settings->flag2.temperature_resolution, &dewpoint);
|
||||
#ifdef USE_HEAT_INDEX
|
||||
float heatindex = CalcTemHumToHeatIndex(TasmotaGlobal.temperature_celsius, TasmotaGlobal.humidity);
|
||||
ResponseAppend_P(PSTR(",\"" D_JSON_HEATINDEX "\":%*_f"),
|
||||
Settings->flag2.temperature_resolution, &heatindex);
|
||||
#endif // USE_HEAT_INDEX
|
||||
}
|
||||
if (TasmotaGlobal.pressure_hpa != 0) {
|
||||
float p = ConvertPressure(TasmotaGlobal.pressure_hpa);
|
||||
|
|
|
@ -1027,6 +1027,10 @@ void WSContentSend_THD(const char *types, float f_temperature, float f_humidity)
|
|||
WSContentSend_PD(HTTP_SNS_HUM, types, parameter);
|
||||
dtostrfd(CalcTempHumToDew(f_temperature, f_humidity), Settings->flag2.temperature_resolution, parameter);
|
||||
WSContentSend_PD(HTTP_SNS_DEW, types, parameter, TempUnit());
|
||||
#ifdef USE_HEAT_INDEX
|
||||
dtostrfd(CalcTemHumToHeatIndex(f_temperature, f_humidity), Settings->flag2.temperature_resolution, parameter);
|
||||
WSContentSend_PD(HTTP_SNS_HEATINDEX, types, parameter, TempUnit());
|
||||
#endif // USE_HEAT_INDEX
|
||||
}
|
||||
|
||||
void WSContentEnd(void) {
|
||||
|
|
Loading…
Reference in New Issue