Merge pull request #22 from arendst/development

Change SGP30 CO2 into eCO2
This commit is contained in:
Adrian 2018-04-01 16:56:48 -03:00 committed by GitHub
commit 42cb3fd602
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 21 additions and 6 deletions

View File

@ -48,6 +48,7 @@
#define D_JSON_DATA "Data" #define D_JSON_DATA "Data"
#define D_JSON_DNSSERVER "DNSServer" #define D_JSON_DNSSERVER "DNSServer"
#define D_JSON_DONE "Done" #define D_JSON_DONE "Done"
#define D_JSON_ECO2 "eCO2"
#define D_JSON_EMPTY "Empty" #define D_JSON_EMPTY "Empty"
#define D_JSON_ENDDST "EndDST" // End Daylight Savings Time #define D_JSON_ENDDST "EndDST" // End Daylight Savings Time
#define D_JSON_ERASE "Erase" #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} = <tr><th>, {m} = </th><td>, {e} = </td></tr> const char HTTP_SNS_SEAPRESSURE[] PROGMEM = "%s{s}%s " D_PRESSUREATSEALEVEL "{m}%s " D_UNIT_PRESSURE "{e}"; // {s} = <tr><th>, {m} = </th><td>, {e} = </td></tr>
const char HTTP_SNS_ANALOG[] PROGMEM = "%s{s}%s " D_ANALOG_INPUT "%d{m}%d{e}"; // {s} = <tr><th>, {m} = </th><td>, {e} = </td></tr> const char HTTP_SNS_ANALOG[] PROGMEM = "%s{s}%s " D_ANALOG_INPUT "%d{m}%d{e}"; // {s} = <tr><th>, {m} = </th><td>, {e} = </td></tr>
#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} = <tr><th>, {m} = </th><td>, {e} = </td></tr> const char HTTP_SNS_CO2[] PROGMEM = "%s{s}%s " D_CO2 "{m}%d " D_UNIT_PARTS_PER_MILLION "{e}"; // {s} = <tr><th>, {m} = </th><td>, {e} = </td></tr>
#endif // USE_WEBSERVER #endif // USE_WEBSERVER

View File

@ -77,6 +77,7 @@
#define D_DNS_SERVER "Server DNS" #define D_DNS_SERVER "Server DNS"
#define D_DONE "Provedeno" #define D_DONE "Provedeno"
#define D_DST_TIME "DST" #define D_DST_TIME "DST"
#define D_ECO2 "eCO2"
#define D_EMULATION "Emulace" #define D_EMULATION "Emulace"
#define D_ENABLED "Otevřený" #define D_ENABLED "Otevřený"
#define D_ERASE "Smaž" #define D_ERASE "Smaž"

View File

@ -77,6 +77,7 @@
#define D_DNS_SERVER "DNS Server" #define D_DNS_SERVER "DNS Server"
#define D_DONE "erledigt" #define D_DONE "erledigt"
#define D_DST_TIME "DST" #define D_DST_TIME "DST"
#define D_ECO2 "eCO2"
#define D_EMULATION "Emulation" #define D_EMULATION "Emulation"
#define D_ENABLED "aktiviert" #define D_ENABLED "aktiviert"
#define D_ERASE "löschen" #define D_ERASE "löschen"

View File

@ -77,6 +77,7 @@
#define D_DNS_SERVER "DNS Server" #define D_DNS_SERVER "DNS Server"
#define D_DONE "Done" #define D_DONE "Done"
#define D_DST_TIME "DST" #define D_DST_TIME "DST"
#define D_ECO2 "eCO2"
#define D_EMULATION "Emulation" #define D_EMULATION "Emulation"
#define D_ENABLED "Enabled" #define D_ENABLED "Enabled"
#define D_ERASE "Erase" #define D_ERASE "Erase"

View File

@ -77,6 +77,7 @@
#define D_DNS_SERVER "DNS Server" #define D_DNS_SERVER "DNS Server"
#define D_DONE "Listo" #define D_DONE "Listo"
#define D_DST_TIME "DST" #define D_DST_TIME "DST"
#define D_ECO2 "eCO2"
#define D_EMULATION "Emulación" #define D_EMULATION "Emulación"
#define D_ENABLED "Habilitado" #define D_ENABLED "Habilitado"
#define D_ERASE "Borrar" #define D_ERASE "Borrar"

View File

@ -77,6 +77,7 @@
#define D_DNS_SERVER "Serveur DNS" #define D_DNS_SERVER "Serveur DNS"
#define D_DONE "Fait" #define D_DONE "Fait"
#define D_DST_TIME "DST" #define D_DST_TIME "DST"
#define D_ECO2 "eCO2"
#define D_EMULATION "Emulation" #define D_EMULATION "Emulation"
#define D_ENABLED "Activé" #define D_ENABLED "Activé"
#define D_ERASE "Effacer" #define D_ERASE "Effacer"

View File

@ -77,6 +77,7 @@
#define D_DNS_SERVER "DNS Szerver" #define D_DNS_SERVER "DNS Szerver"
#define D_DONE "Kész" #define D_DONE "Kész"
#define D_DST_TIME "DST" #define D_DST_TIME "DST"
#define D_ECO2 "eCO2"
#define D_EMULATION "Emuláció" #define D_EMULATION "Emuláció"
#define D_ENABLED "Engedélyezve" #define D_ENABLED "Engedélyezve"
#define D_ERASE "Törlés" #define D_ERASE "Törlés"

View File

@ -77,6 +77,7 @@
#define D_DNS_SERVER "DNS Server" #define D_DNS_SERVER "DNS Server"
#define D_DONE "Fatto" #define D_DONE "Fatto"
#define D_DST_TIME "DST" #define D_DST_TIME "DST"
#define D_ECO2 "eCO2"
#define D_EMULATION "Emulazione" #define D_EMULATION "Emulazione"
#define D_ENABLED "Abilitato" #define D_ENABLED "Abilitato"
#define D_ERASE "Cancellare" #define D_ERASE "Cancellare"

View File

@ -77,6 +77,7 @@
#define D_DNS_SERVER "DNS Server" #define D_DNS_SERVER "DNS Server"
#define D_DONE "Klaar" #define D_DONE "Klaar"
#define D_DST_TIME "ZT" #define D_DST_TIME "ZT"
#define D_ECO2 "eCO2"
#define D_EMULATION "Emulatie" #define D_EMULATION "Emulatie"
#define D_ENABLED "Geactiveerd" #define D_ENABLED "Geactiveerd"
#define D_ERASE "Wissen" #define D_ERASE "Wissen"

View File

@ -77,6 +77,7 @@
#define D_DNS_SERVER "Server DNS" #define D_DNS_SERVER "Server DNS"
#define D_DONE "Wykonane" #define D_DONE "Wykonane"
#define D_DST_TIME "DST" #define D_DST_TIME "DST"
#define D_ECO2 "eCO2"
#define D_EMULATION "Emulacja" #define D_EMULATION "Emulacja"
#define D_ENABLED "Otwarty" #define D_ENABLED "Otwarty"
#define D_ERASE "Nadpisz" #define D_ERASE "Nadpisz"

View File

@ -77,6 +77,7 @@
#define D_DNS_SERVER "Servidor DNS" #define D_DNS_SERVER "Servidor DNS"
#define D_DONE "Concluído" #define D_DONE "Concluído"
#define D_DST_TIME "DST" #define D_DST_TIME "DST"
#define D_ECO2 "eCO2"
#define D_EMULATION "Emulação" #define D_EMULATION "Emulação"
#define D_ENABLED "Habilitado" #define D_ENABLED "Habilitado"
#define D_ERASE "Apagar" #define D_ERASE "Apagar"

View File

@ -77,6 +77,7 @@
#define D_DNS_SERVER "DNS Сервер" #define D_DNS_SERVER "DNS Сервер"
#define D_DONE "Выполнено" #define D_DONE "Выполнено"
#define D_DST_TIME "DST" #define D_DST_TIME "DST"
#define D_ECO2 "eCO2"
#define D_EMULATION "Эмуляция" #define D_EMULATION "Эмуляция"
#define D_ENABLED "Активно" #define D_ENABLED "Активно"
#define D_ERASE "Стирать" #define D_ERASE "Стирать"

View File

@ -77,6 +77,7 @@
#define D_DNS_SERVER "DNS服务器" #define D_DNS_SERVER "DNS服务器"
#define D_DONE "完成" #define D_DONE "完成"
#define D_DST_TIME "DST" #define D_DST_TIME "DST"
#define D_ECO2 "eCO2"
#define D_EMULATION "设备模拟" #define D_EMULATION "设备模拟"
#define D_ENABLED "启用" #define D_ENABLED "启用"
#define D_ERASE "擦除" #define D_ERASE "擦除"

View File

@ -77,6 +77,7 @@
#define D_DNS_SERVER "DNS伺服器" #define D_DNS_SERVER "DNS伺服器"
#define D_DONE "完成" #define D_DONE "完成"
#define D_DST_TIME "DST" #define D_DST_TIME "DST"
#define D_ECO2 "eCO2"
#define D_EMULATION "設備模擬" #define D_EMULATION "設備模擬"
#define D_ENABLED "啟用" #define D_ENABLED "啟用"
#define D_ERASE "刪除" #define D_ERASE "刪除"

View File

@ -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} = <tr><th>, {m} = </th><td>, {e} = </td></tr>
"{s}SGP30 " D_TVOC "{m}%d " D_UNIT_PARTS_PER_BILLION "{e}";
void Sgp30Show(boolean json) void Sgp30Show(boolean json)
{ {
if (sgp30_ready) { if (sgp30_ready) {
if (json) { 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 #ifdef USE_DOMOTICZ
DomoticzSensor(DZ_AIRQUALITY, sgp.eCO2); DomoticzSensor(DZ_AIRQUALITY, sgp.eCO2);
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
} else { } else {
#ifdef USE_WEBSERVER #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_SGP30, mqtt_data, sgp.eCO2, sgp.TVOC);
snprintf_P(mqtt_data, sizeof(mqtt_data), HTTP_SNS_TVOC, mqtt_data, sgp.TVOC);
#endif #endif
} }
} }