diff --git a/sonoff/i18n.h b/sonoff/i18n.h index b026d0af5..95b17fea6 100644 --- a/sonoff/i18n.h +++ b/sonoff/i18n.h @@ -48,6 +48,7 @@ #define D_JSON_DATA "Data" #define D_JSON_DNSSERVER "DNSServer" #define D_JSON_DONE "Done" +#define D_JSON_ECO2 "eCO2" #define D_JSON_EMPTY "Empty" #define D_JSON_ENDDST "EndDST" // End Daylight Savings Time #define D_JSON_ERASE "Erase" @@ -481,7 +482,7 @@ const char HTTP_SNS_PRESSURE[] PROGMEM = "%s{s}%s " D_PRESSURE "{m}%s " D_UNIT_P const char HTTP_SNS_SEAPRESSURE[] PROGMEM = "%s{s}%s " D_PRESSUREATSEALEVEL "{m}%s " D_UNIT_PRESSURE "{e}"; // {s} = , {m} = , {e} = const char HTTP_SNS_ANALOG[] PROGMEM = "%s{s}%s " D_ANALOG_INPUT "%d{m}%d{e}"; // {s} = , {m} = , {e} = -#if defined(USE_MHZ19) || defined(USE_SENSEAIR) || defined(USE_SGP30) +#if defined(USE_MHZ19) || defined(USE_SENSEAIR) const char HTTP_SNS_CO2[] PROGMEM = "%s{s}%s " D_CO2 "{m}%d " D_UNIT_PARTS_PER_MILLION "{e}"; // {s} = , {m} = , {e} = #endif // USE_WEBSERVER diff --git a/sonoff/language/cs-CZ.h b/sonoff/language/cs-CZ.h index 9f2740ecb..21336443c 100644 --- a/sonoff/language/cs-CZ.h +++ b/sonoff/language/cs-CZ.h @@ -77,6 +77,7 @@ #define D_DNS_SERVER "Server DNS" #define D_DONE "Provedeno" #define D_DST_TIME "DST" +#define D_ECO2 "eCO2" #define D_EMULATION "Emulace" #define D_ENABLED "Otevřený" #define D_ERASE "Smaž" diff --git a/sonoff/language/de-DE.h b/sonoff/language/de-DE.h index 45040412e..caa74fd41 100644 --- a/sonoff/language/de-DE.h +++ b/sonoff/language/de-DE.h @@ -77,6 +77,7 @@ #define D_DNS_SERVER "DNS Server" #define D_DONE "erledigt" #define D_DST_TIME "DST" +#define D_ECO2 "eCO2" #define D_EMULATION "Emulation" #define D_ENABLED "aktiviert" #define D_ERASE "löschen" diff --git a/sonoff/language/en-GB.h b/sonoff/language/en-GB.h index 7addad82d..6704cc2b7 100644 --- a/sonoff/language/en-GB.h +++ b/sonoff/language/en-GB.h @@ -77,6 +77,7 @@ #define D_DNS_SERVER "DNS Server" #define D_DONE "Done" #define D_DST_TIME "DST" +#define D_ECO2 "eCO2" #define D_EMULATION "Emulation" #define D_ENABLED "Enabled" #define D_ERASE "Erase" diff --git a/sonoff/language/es-AR.h b/sonoff/language/es-AR.h index 1553fe9b5..0f3a24de2 100644 --- a/sonoff/language/es-AR.h +++ b/sonoff/language/es-AR.h @@ -77,6 +77,7 @@ #define D_DNS_SERVER "DNS Server" #define D_DONE "Listo" #define D_DST_TIME "DST" +#define D_ECO2 "eCO2" #define D_EMULATION "Emulación" #define D_ENABLED "Habilitado" #define D_ERASE "Borrar" diff --git a/sonoff/language/fr-FR.h b/sonoff/language/fr-FR.h index d5a62db80..5d09cfcb6 100644 --- a/sonoff/language/fr-FR.h +++ b/sonoff/language/fr-FR.h @@ -77,6 +77,7 @@ #define D_DNS_SERVER "Serveur DNS" #define D_DONE "Fait" #define D_DST_TIME "DST" +#define D_ECO2 "eCO2" #define D_EMULATION "Emulation" #define D_ENABLED "Activé" #define D_ERASE "Effacer" diff --git a/sonoff/language/hu-HU.h b/sonoff/language/hu-HU.h index f4dc7a0c9..e043b1b96 100644 --- a/sonoff/language/hu-HU.h +++ b/sonoff/language/hu-HU.h @@ -77,6 +77,7 @@ #define D_DNS_SERVER "DNS Szerver" #define D_DONE "Kész" #define D_DST_TIME "DST" +#define D_ECO2 "eCO2" #define D_EMULATION "Emuláció" #define D_ENABLED "Engedélyezve" #define D_ERASE "Törlés" diff --git a/sonoff/language/it-IT.h b/sonoff/language/it-IT.h index 8a3a80702..59851e677 100644 --- a/sonoff/language/it-IT.h +++ b/sonoff/language/it-IT.h @@ -77,6 +77,7 @@ #define D_DNS_SERVER "DNS Server" #define D_DONE "Fatto" #define D_DST_TIME "DST" +#define D_ECO2 "eCO2" #define D_EMULATION "Emulazione" #define D_ENABLED "Abilitato" #define D_ERASE "Cancellare" diff --git a/sonoff/language/nl-NL.h b/sonoff/language/nl-NL.h index 507213f07..b21bea2aa 100644 --- a/sonoff/language/nl-NL.h +++ b/sonoff/language/nl-NL.h @@ -77,6 +77,7 @@ #define D_DNS_SERVER "DNS Server" #define D_DONE "Klaar" #define D_DST_TIME "ZT" +#define D_ECO2 "eCO2" #define D_EMULATION "Emulatie" #define D_ENABLED "Geactiveerd" #define D_ERASE "Wissen" diff --git a/sonoff/language/pl-PL.h b/sonoff/language/pl-PL.h index 856e682bf..9d0352315 100644 --- a/sonoff/language/pl-PL.h +++ b/sonoff/language/pl-PL.h @@ -77,6 +77,7 @@ #define D_DNS_SERVER "Server DNS" #define D_DONE "Wykonane" #define D_DST_TIME "DST" +#define D_ECO2 "eCO2" #define D_EMULATION "Emulacja" #define D_ENABLED "Otwarty" #define D_ERASE "Nadpisz" diff --git a/sonoff/language/pt-PT.h b/sonoff/language/pt-PT.h index 482e40474..5c52cd528 100644 --- a/sonoff/language/pt-PT.h +++ b/sonoff/language/pt-PT.h @@ -77,6 +77,7 @@ #define D_DNS_SERVER "Servidor DNS" #define D_DONE "Concluído" #define D_DST_TIME "DST" +#define D_ECO2 "eCO2" #define D_EMULATION "Emulação" #define D_ENABLED "Habilitado" #define D_ERASE "Apagar" diff --git a/sonoff/language/ru-RU.h b/sonoff/language/ru-RU.h index ee84a50b0..d11bfcda2 100644 --- a/sonoff/language/ru-RU.h +++ b/sonoff/language/ru-RU.h @@ -77,6 +77,7 @@ #define D_DNS_SERVER "DNS Сервер" #define D_DONE "Выполнено" #define D_DST_TIME "DST" +#define D_ECO2 "eCO2" #define D_EMULATION "Эмуляция" #define D_ENABLED "Активно" #define D_ERASE "Стирать" diff --git a/sonoff/language/zh-CN.h b/sonoff/language/zh-CN.h index a105a9c3a..f9d0d5cc2 100644 --- a/sonoff/language/zh-CN.h +++ b/sonoff/language/zh-CN.h @@ -77,6 +77,7 @@ #define D_DNS_SERVER "DNS服务器" #define D_DONE "完成" #define D_DST_TIME "DST" +#define D_ECO2 "eCO2" #define D_EMULATION "设备模拟" #define D_ENABLED "启用" #define D_ERASE "擦除" diff --git a/sonoff/language/zh-TW.h b/sonoff/language/zh-TW.h index 118e0d719..a95b772ca 100644 --- a/sonoff/language/zh-TW.h +++ b/sonoff/language/zh-TW.h @@ -77,6 +77,7 @@ #define D_DNS_SERVER "DNS伺服器" #define D_DONE "完成" #define D_DST_TIME "DST" +#define D_ECO2 "eCO2" #define D_EMULATION "設備模擬" #define D_ENABLED "啟用" #define D_ERASE "刪除" diff --git a/sonoff/xsns_21_sgp30.ino b/sonoff/xsns_21_sgp30.ino index 205c34437..eed03ce7f 100644 --- a/sonoff/xsns_21_sgp30.ino +++ b/sonoff/xsns_21_sgp30.ino @@ -64,20 +64,21 @@ void Sgp30Update() // Perform every second to ensure proper operation of the ba } } -const char HTTP_SNS_TVOC[] PROGMEM = "%s{s}SGP30 " D_TVOC "{m}%d " D_UNIT_PARTS_PER_BILLION "{e}"; +const char HTTP_SNS_SGP30[] PROGMEM = "%s" + "{s}SGP30 " D_ECO2 "{m}%d " D_UNIT_PARTS_PER_MILLION "{e}" // {s} = , {m} = , {e} = + "{s}SGP30 " D_TVOC "{m}%d " D_UNIT_PARTS_PER_BILLION "{e}"; void Sgp30Show(boolean json) { if (sgp30_ready) { if (json) { - snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"SGP30\":{\"" D_JSON_CO2 "\":%d,\"" D_JSON_TVOC "\":%d}"), mqtt_data, sgp.eCO2, sgp.TVOC); + snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"SGP30\":{\"" D_JSON_ECO2 "\":%d,\"" D_JSON_TVOC "\":%d}"), mqtt_data, sgp.eCO2, sgp.TVOC); #ifdef USE_DOMOTICZ - DomoticzSensor(DZ_AIRQUALITY, sgp.eCO2); + DomoticzSensor(DZ_AIRQUALITY, sgp.eCO2); #endif // USE_DOMOTICZ } else { #ifdef USE_WEBSERVER - snprintf_P(mqtt_data, sizeof(mqtt_data), HTTP_SNS_CO2, mqtt_data, "SGP30", sgp.eCO2); - snprintf_P(mqtt_data, sizeof(mqtt_data), HTTP_SNS_TVOC, mqtt_data, sgp.TVOC); + snprintf_P(mqtt_data, sizeof(mqtt_data), HTTP_SNS_SGP30, mqtt_data, sgp.eCO2, sgp.TVOC); #endif } }