Merge pull request #45 from arendst/development

Update from Tasmota
This commit is contained in:
Adrian Scillato 2018-04-12 01:43:49 -03:00 committed by GitHub
commit 149c382a3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 105 additions and 94 deletions

View File

@ -42,8 +42,8 @@
#define D_HOUR_MINUTE_SEPARATOR ":" #define D_HOUR_MINUTE_SEPARATOR ":"
#define D_MINUTE_SECOND_SEPARATOR ":" #define D_MINUTE_SECOND_SEPARATOR ":"
#define D_DAY3LIST "PonÚteStřČtvPátSobNed" #define D_DAY3LIST "Po Út St Čt Pá So Ne "
#define D_MONTH3LIST "LedÚnoBřeDubKvěČerČevSrpZářŘíjLisPro" #define D_MONTH3LIST "LedÚnoBřeDubKvěČvnČvcSrpZářŘíjLisPro"
// Non JSON decimal separator // Non JSON decimal separator
#define D_DECIMAL_SEPARATOR "," #define D_DECIMAL_SEPARATOR ","
@ -56,19 +56,19 @@
#define D_AUTO "AUTO" #define D_AUTO "AUTO"
#define D_BLINK "Blikání" #define D_BLINK "Blikání"
#define D_BLINKOFF "BlikáníVyp" #define D_BLINKOFF "BlikáníVyp"
#define D_BOOT_COUNT "Počítadlo spuštění" #define D_BOOT_COUNT "Počitadlo spuštění"
#define D_BRIGHTLIGHT "Světlý" #define D_BRIGHTLIGHT "Světlý"
#define D_BUTTON "Tlačítko" #define D_BUTTON "Tlačítko"
#define D_BY "by" // Written by me #define D_BY "by" // Written by me
#define D_BYTES "Bytu" #define D_BYTES "Bytů"
#define D_CELSIUS "Celsia" #define D_CELSIUS "°C"
#define D_CO2 "Kysličníku uhličitého" #define D_CO2 "CO2"
#define D_CODE "kód" // Button code #define D_CODE "kód" // Button code
#define D_COLDLIGHT "Studený" #define D_COLDLIGHT "Studené světlo"
#define D_COMMAND "Příkaz" #define D_COMMAND "Příkaz"
#define D_CONNECTED "...připojeno" #define D_CONNECTED "...připojeno"
#define D_COUNT "Počítej" #define D_COUNT "Počítej"
#define D_COUNTER "Počítadlo" #define D_COUNTER "Počitadlo"
#define D_CURRENT "Proud" // As in Voltage and Current #define D_CURRENT "Proud" // As in Voltage and Current
#define D_DATA "Data" #define D_DATA "Data"
#define D_DARKLIGHT "Tmavý" #define D_DARKLIGHT "Tmavý"
@ -89,14 +89,14 @@
#define D_FALSE "Nepravda" #define D_FALSE "Nepravda"
#define D_FILE "Soubor" #define D_FILE "Soubor"
#define D_FREE_MEMORY "Volná paměť" #define D_FREE_MEMORY "Volná paměť"
#define D_GAS "Gas" #define D_GAS "Plyn"
#define D_GATEWAY "Výchozí brána" #define D_GATEWAY "Výchozí brána"
#define D_GROUP "Skupina" #define D_GROUP "Skupina"
#define D_HOST "Server" #define D_HOST "Server"
#define D_HOSTNAME "Název serveru" #define D_HOSTNAME "Název serveru"
#define D_HUMIDITY "Vlhkost" #define D_HUMIDITY "Vlhkost"
#define D_ILLUMINANCE "Osvětlení" #define D_ILLUMINANCE "Osvětlení"
#define D_IMMEDIATE "Mžikové" // Button immediate #define D_IMMEDIATE "Okamžité" // Button immediate
#define D_INDEX "Index" #define D_INDEX "Index"
#define D_INFO "Informace" #define D_INFO "Informace"
#define D_INITIALIZED "Inicializovaný" #define D_INITIALIZED "Inicializovaný"
@ -107,11 +107,11 @@
#define D_MQTT "MQTT" #define D_MQTT "MQTT"
#define D_MULTI_PRESS "několikeré-stisknutí" #define D_MULTI_PRESS "několikeré-stisknutí"
#define D_NOISE "Hluk" #define D_NOISE "Hluk"
#define D_NONE "Není" #define D_NONE "Žádný"
#define D_OFF "Vypnutý" #define D_OFF "Vyp."
#define D_OFFLINE "Neaktivní" #define D_OFFLINE "Neaktivní"
#define D_OK "OK" #define D_OK "OK"
#define D_ON "Sepnutý" #define D_ON "Zap."
#define D_ONLINE "Aktivní" #define D_ONLINE "Aktivní"
#define D_PASSWORD "Heslo" #define D_PASSWORD "Heslo"
#define D_PORT "Port" #define D_PORT "Port"
@ -119,15 +119,15 @@
#define D_POWERUSAGE "Příkon" #define D_POWERUSAGE "Příkon"
#define D_PRESSURE "Tlak" #define D_PRESSURE "Tlak"
#define D_PRESSUREATSEALEVEL "Tlak na úrovni hladiny moře" #define D_PRESSUREATSEALEVEL "Tlak na úrovni hladiny moře"
#define D_PROGRAM_FLASH_SIZE "Velikost flash programu" #define D_PROGRAM_FLASH_SIZE "Velikost paměti flash"
#define D_PROGRAM_SIZE "Velikost programu" #define D_PROGRAM_SIZE "Velikost programu"
#define D_PROJECT "Projekt" #define D_PROJECT "Projekt"
#define D_RECEIVED "Obdržený" #define D_RECEIVED "Přijatý"
#define D_RESTART "Restart" #define D_RESTART "Restart"
#define D_RESTARTING "Restartování" #define D_RESTARTING "Restartování"
#define D_RESTART_REASON "Příčina restartu" #define D_RESTART_REASON "Příčina restartu"
#define D_RESTORE "Načtený" #define D_RESTORE "Obnovit"
#define D_RETAINED "Uloženo" #define D_RETAINED "Zachováno"
#define D_SAVE "Ulož" #define D_SAVE "Ulož"
#define D_SENSOR "Sensor" #define D_SENSOR "Sensor"
#define D_SSID "SSID" #define D_SSID "SSID"
@ -137,8 +137,8 @@
#define D_SUBNET_MASK "Maska podsítě" #define D_SUBNET_MASK "Maska podsítě"
#define D_SUBSCRIBE_TO "Přihlaš se do" #define D_SUBSCRIBE_TO "Přihlaš se do"
#define D_SUCCESSFUL "úspěšné." #define D_SUCCESSFUL "úspěšné."
#define D_SUNRISE "Sunrise" #define D_SUNRISE "Svítání"
#define D_SUNSET "Sunset" #define D_SUNSET "Soumrak"
#define D_TEMPERATURE "Teplota" #define D_TEMPERATURE "Teplota"
#define D_TO "do" #define D_TO "do"
#define D_TOGGLE "Přepni" #define D_TOGGLE "Přepni"
@ -154,18 +154,18 @@
#define D_UV_LEVEL "úroveň UV" #define D_UV_LEVEL "úroveň UV"
#define D_VERSION "Verze" #define D_VERSION "Verze"
#define D_VOLTAGE "Napětí" #define D_VOLTAGE "Napětí"
#define D_WARMLIGHT "Ohřev" #define D_WARMLIGHT "Teplé světlo"
#define D_WEB_SERVER "Web Server" #define D_WEB_SERVER "Web Server"
// sonoff.ino // sonoff.ino
#define D_WARNING_MINIMAL_VERSION "WARNING Tato verze nepodporuje trvalé nastavení" #define D_WARNING_MINIMAL_VERSION "UPOZORNĚNÍ Tato verze nepodporuje trvalé nastavení"
#define D_LEVEL_10 "úroveň 1-0" #define D_LEVEL_10 "úroveň 1-0"
#define D_LEVEL_01 "úroveň 0-1" #define D_LEVEL_01 "úroveň 0-1"
#define D_SERIAL_LOGGING_DISABLED "Logování na sériovém portu ukončeno" #define D_SERIAL_LOGGING_DISABLED "Logování na sériovém portu ukončeno"
#define D_SYSLOG_LOGGING_REENABLED "Obnoven zápis do Syslog" #define D_SYSLOG_LOGGING_REENABLED "Obnoven zápis do Syslog"
#define D_SET_BAUDRATE_TO "Nastavení rychlosti přenosu na" #define D_SET_BAUDRATE_TO "Nastavení rychlosti přenosu na"
#define D_RECEIVED_TOPIC "Obdržený topic" #define D_RECEIVED_TOPIC "Přijatý topic"
#define D_DATA_SIZE "Velikost dat" #define D_DATA_SIZE "Velikost dat"
#define D_ANALOG_INPUT "Analogový vstup" #define D_ANALOG_INPUT "Analogový vstup"
@ -228,13 +228,13 @@
#define D_RESTORE_CONFIGURATION "Obnovení nastavení" #define D_RESTORE_CONFIGURATION "Obnovení nastavení"
#define D_MAIN_MENU "Hlavní menu" #define D_MAIN_MENU "Hlavní menu"
#define D_MODULE_PARAMETERS "Parametry modulu" #define D_MODULE_PARAMETERS "Nastavení modulu"
#define D_MODULE_TYPE "Typ modulu" #define D_MODULE_TYPE "Typ modulu"
#define D_GPIO "GPIO" #define D_GPIO "GPIO"
#define D_SERIAL_IN "Serial In" #define D_SERIAL_IN "Serial In"
#define D_SERIAL_OUT "Serial Out" #define D_SERIAL_OUT "Serial Out"
#define D_WIFI_PARAMETERS "Parametry WiFi" #define D_WIFI_PARAMETERS "Nastavení WiFi"
#define D_SCAN_FOR_WIFI_NETWORKS "Scan sítí WiFi" #define D_SCAN_FOR_WIFI_NETWORKS "Scan sítí WiFi"
#define D_SCAN_DONE "Scan dokončen" #define D_SCAN_DONE "Scan dokončen"
#define D_NO_NETWORKS_FOUND "Síť nebyla nalezena" #define D_NO_NETWORKS_FOUND "Síť nebyla nalezena"
@ -250,11 +250,11 @@
#define D_AP2_SSID "AP2 SSID" #define D_AP2_SSID "AP2 SSID"
#define D_AP2_PASSWORD "Heslo AP2" #define D_AP2_PASSWORD "Heslo AP2"
#define D_MQTT_PARAMETERS "Parametry MQTT" #define D_MQTT_PARAMETERS "Nastavení MQTT"
#define D_CLIENT "Klient" #define D_CLIENT "Klient"
#define D_FULL_TOPIC "Celý topic" #define D_FULL_TOPIC "Celý topic"
#define D_LOGGING_PARAMETERS "Volby logování" #define D_LOGGING_PARAMETERS "Volba logování"
#define D_SERIAL_LOG_LEVEL "Seriová úroveň logu" #define D_SERIAL_LOG_LEVEL "Seriová úroveň logu"
#define D_WEB_LOG_LEVEL "Webová úroveň logu" #define D_WEB_LOG_LEVEL "Webová úroveň logu"
#define D_SYS_LOG_LEVEL "Systemová úroveň logu" #define D_SYS_LOG_LEVEL "Systemová úroveň logu"
@ -263,7 +263,7 @@
#define D_SYSLOG_PORT "Syslog port" #define D_SYSLOG_PORT "Syslog port"
#define D_TELEMETRY_PERIOD "Interval telemetrie" #define D_TELEMETRY_PERIOD "Interval telemetrie"
#define D_OTHER_PARAMETERS "Jiné parametry" #define D_OTHER_PARAMETERS "Další nastavení"
#define D_WEB_ADMIN_PASSWORD "Heslo Web administrátora" #define D_WEB_ADMIN_PASSWORD "Heslo Web administrátora"
#define D_MQTT_ENABLE "MQTT aktivní" #define D_MQTT_ENABLE "MQTT aktivní"
#define D_FRIENDLY_NAME "Friendly Name" #define D_FRIENDLY_NAME "Friendly Name"
@ -346,7 +346,7 @@
#define D_3_RESPONSE_PACKETS_SENT "3 pakety odpovědi odeslány" #define D_3_RESPONSE_PACKETS_SENT "3 pakety odpovědi odeslány"
// xdrv_05_domoticz.ino // xdrv_05_domoticz.ino
#define D_DOMOTICZ_PARAMETERS "Parametry Domoticz" #define D_DOMOTICZ_PARAMETERS "Nastavení Domoticz"
#define D_DOMOTICZ_IDX "Idx" #define D_DOMOTICZ_IDX "Idx"
#define D_DOMOTICZ_KEY_IDX "Key idx" #define D_DOMOTICZ_KEY_IDX "Key idx"
#define D_DOMOTICZ_SWITCH_IDX "Spinac idx" #define D_DOMOTICZ_SWITCH_IDX "Spinac idx"
@ -363,14 +363,14 @@
#define D_DOMOTICZ_UPDATE_TIMER "Aktualizace stopek" #define D_DOMOTICZ_UPDATE_TIMER "Aktualizace stopek"
// xdrv_09_timers.ino // xdrv_09_timers.ino
#define D_CONFIGURE_TIMER "Configure Timer" #define D_CONFIGURE_TIMER "Nastavení Časovače"
#define D_TIMER_PARAMETERS "Timer parameters" #define D_TIMER_PARAMETERS "Časovač"
#define D_TIMER_ARM "Arm" #define D_TIMER_ARM "Zajistit"
#define D_TIMER_TIME "Time" #define D_TIMER_TIME "Čas"
#define D_TIMER_DAYS "Days" #define D_TIMER_DAYS "Dny"
#define D_TIMER_REPEAT "Repeat" #define D_TIMER_REPEAT "Opakovat"
#define D_TIMER_OUTPUT "Output" #define D_TIMER_OUTPUT "Výstup"
#define D_TIMER_POWER "Power" #define D_TIMER_POWER "Napájení"
// xdrv_10_KNX.ino // xdrv_10_KNX.ino
#define D_CONFIGURE_KNX "Configure KNX" #define D_CONFIGURE_KNX "Configure KNX"
@ -393,9 +393,9 @@
#define D_KNX_WARNING "The group address ( 0 / 0 / 0 ) is reserved and can not be used." #define D_KNX_WARNING "The group address ( 0 / 0 / 0 ) is reserved and can not be used."
// xdrv_03_energy.ino // xdrv_03_energy.ino
#define D_ENERGY_TODAY "Energie Dnes" #define D_ENERGY_TODAY "Spotřeba Dnes"
#define D_ENERGY_YESTERDAY "Energie Včera" #define D_ENERGY_YESTERDAY "Spotřeba Včera"
#define D_ENERGY_TOTAL "Energie Součet" #define D_ENERGY_TOTAL "Celková spotřeba"
// xsns_05_ds18b20.ino // xsns_05_ds18b20.ino
#define D_SENSOR_BUSY "Sensor DS18x20 obsazen" #define D_SENSOR_BUSY "Sensor DS18x20 obsazen"
@ -404,19 +404,19 @@
// xsns_06_dht.ino // xsns_06_dht.ino
#define D_TIMEOUT_WAITING_FOR "Čekání na" #define D_TIMEOUT_WAITING_FOR "Čekání na"
#define D_START_SIGNAL_LOW "signál, startovní nízký" #define D_START_SIGNAL_LOW "nízký startovní signál"
#define D_START_SIGNAL_HIGH "signál, startovní vysoký" #define D_START_SIGNAL_HIGH "vysoký startovní signál"
#define D_PULSE "puls" #define D_PULSE "impuls"
#define D_CHECKSUM_FAILURE "Chybný kontrolní součet" #define D_CHECKSUM_FAILURE "Chybný kontrolní součet"
// xsns_07_sht1x.ino // xsns_07_sht1x.ino
#define D_SENSOR_DID_NOT_ACK_COMMAND "Sensor neobdržel pžíkaz ACK" #define D_SENSOR_DID_NOT_ACK_COMMAND "Sensor neobdržel příkaz ACK"
#define D_SHT1X_FOUND "SHT1X nalezen" #define D_SHT1X_FOUND "SHT1X nalezen"
// xsns_18_pms5003.ino // xsns_18_pms5003.ino
#define D_STANDARD_CONCENTRATION "CF-1 PM" // Standard Particle CF-1 Particle Matter #define D_STANDARD_CONCENTRATION "CF-1 PM" // Standard Particle CF-1 Particle Matter
#define D_ENVIRONMENTAL_CONCENTRATION "PM" // Environmetal Particle Matter #define D_ENVIRONMENTAL_CONCENTRATION "PM" // Environmetal Particle Matter
#define D_PARTICALS_BEYOND "Particals" #define D_PARTICALS_BEYOND "částic"
// sonoff_template.h // sonoff_template.h
#define D_SENSOR_NONE "Není" #define D_SENSOR_NONE "Není"
@ -429,11 +429,11 @@
#define D_SENSOR_WS2812 "WS2812" #define D_SENSOR_WS2812 "WS2812"
#define D_SENSOR_IRSEND "IRsend" #define D_SENSOR_IRSEND "IRsend"
#define D_SENSOR_SWITCH "Spínač" // Suffix "1" #define D_SENSOR_SWITCH "Spínač" // Suffix "1"
#define D_SENSOR_BUTTON "Tlačít" // Suffix "1" #define D_SENSOR_BUTTON "Tlačítko" // Suffix "1"
#define D_SENSOR_RELAY "Relé" // Suffix "1i" #define D_SENSOR_RELAY "Relé" // Suffix "1i"
#define D_SENSOR_LED "Led" // Suffix "1i" #define D_SENSOR_LED "Led" // Suffix "1i"
#define D_SENSOR_PWM "PWM" // Suffix "1", #define D_SENSOR_PWM "PWM" // Suffix "1",
#define D_SENSOR_COUNTER "Počíta" // Suffix "1" #define D_SENSOR_COUNTER "Počitadlo" // Suffix "1"
#define D_SENSOR_IRRECV "IRrecv" #define D_SENSOR_IRRECV "IRrecv"
#define D_SENSOR_MHZ_RX "MHZ Rx" #define D_SENSOR_MHZ_RX "MHZ Rx"
#define D_SENSOR_MHZ_TX "MHZ Tx" #define D_SENSOR_MHZ_TX "MHZ Tx"
@ -451,7 +451,7 @@
// Units // Units
#define D_UNIT_AMPERE "A" #define D_UNIT_AMPERE "A"
#define D_UNIT_HOUR "Hod" #define D_UNIT_HOUR "hod"
#define D_UNIT_KILOOHM "kOhm" #define D_UNIT_KILOOHM "kOhm"
#define D_UNIT_KILOWATTHOUR "kWh" #define D_UNIT_KILOWATTHOUR "kWh"
#define D_UNIT_LUX "lx" #define D_UNIT_LUX "lx"
@ -460,7 +460,7 @@
#define D_UNIT_MICROSECOND "us" #define D_UNIT_MICROSECOND "us"
#define D_UNIT_MILLIAMPERE "mA" #define D_UNIT_MILLIAMPERE "mA"
#define D_UNIT_MILLISECOND "ms" #define D_UNIT_MILLISECOND "ms"
#define D_UNIT_MINUTE "Min" #define D_UNIT_MINUTE "min"
#define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_BILLION "ppb"
#define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_DECILITER "ppd"
#define D_UNIT_PARTS_PER_MILLION "ppm" #define D_UNIT_PARTS_PER_MILLION "ppm"

View File

@ -42,7 +42,7 @@
#define D_HOUR_MINUTE_SEPARATOR ":" #define D_HOUR_MINUTE_SEPARATOR ":"
#define D_MINUTE_SECOND_SEPARATOR ":" #define D_MINUTE_SECOND_SEPARATOR ":"
#define D_DAY3LIST "SonMonDieMitDonFriSam" #define D_DAY3LIST "So Mo Di Mi Do Fr Sa "
#define D_MONTH3LIST "JanFebMärAprMaiJunJulAugSepOktNovDez" #define D_MONTH3LIST "JanFebMärAprMaiJunJulAugSepOktNovDez"
// Non JSON decimal separator // Non JSON decimal separator

View File

@ -558,7 +558,7 @@ void MqttDataHandler(char* topic, byte* data, unsigned int data_len)
XsnsCall(FUNC_COMMAND); XsnsCall(FUNC_COMMAND);
// if (!XsnsCall(FUNC_COMMAND)) type = NULL; // if (!XsnsCall(FUNC_COMMAND)) type = NULL;
} }
else if ((CMND_SETOPTION == command_code) && ((index <= 23) || ((index > 31) && (index <= P_MAX_PARAM8 + 31)))) { else if ((CMND_SETOPTION == command_code) && ((index <= 21) || ((index > 31) && (index <= P_MAX_PARAM8 + 31)))) {
if (index <= 31) { if (index <= 31) {
ptype = 0; // SetOption0 .. 31 ptype = 0; // SetOption0 .. 31
} else { } else {
@ -588,7 +588,8 @@ void MqttDataHandler(char* topic, byte* data, unsigned int data_len)
case 19: // hass_discovery case 19: // hass_discovery
case 20: // not_power_linked case 20: // not_power_linked
case 21: // no_power_on_check case 21: // no_power_on_check
case 23: // rules_enabled // case 22: // mqtt_serial - use commands SerialSend and SerialLog
// case 23: // rules_enabled - use command Rule
bitWrite(Settings.flag.data, index, payload); bitWrite(Settings.flag.data, index, payload);
} }
if (12 == index) { // stop_flash_rotate if (12 == index) { // stop_flash_rotate
@ -1264,7 +1265,7 @@ void PublishStatus(uint8_t payload)
if (!energy_flg && (9 == payload)) payload = 99; if (!energy_flg && (9 == payload)) payload = 99;
if ((0 == payload) || (99 == payload)) { if ((0 == payload) || (99 == payload)) {
uint8_t maxfn = (devices_present > MAX_FRIENDLYNAMES) ? MAX_FRIENDLYNAMES : devices_present; uint8_t maxfn = (devices_present > MAX_FRIENDLYNAMES) ? MAX_FRIENDLYNAMES : (!devices_present) ? 1 : devices_present;
stemp[0] = '\0'; stemp[0] = '\0';
for (byte i = 0; i < maxfn; i++) { for (byte i = 0; i < maxfn; i++) {
snprintf_P(stemp, sizeof(stemp), PSTR("%s%s\"%s\"" ), stemp, (i > 0 ? "," : ""), Settings.friendlyname[i]); snprintf_P(stemp, sizeof(stemp), PSTR("%s%s\"%s\"" ), stemp, (i > 0 ? "," : ""), Settings.friendlyname[i]);

View File

@ -1376,6 +1376,12 @@ void RtcSecond()
snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_APPLICATION "(" D_UTC_TIME ") %s, (" D_DST_TIME ") %s, (" D_STD_TIME ") %s"), snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_APPLICATION "(" D_UTC_TIME ") %s, (" D_DST_TIME ") %s, (" D_STD_TIME ") %s"),
GetTime(0).c_str(), GetTime(2).c_str(), GetTime(3).c_str()); GetTime(0).c_str(), GetTime(2).c_str(), GetTime(3).c_str());
AddLog(LOG_LEVEL_DEBUG); AddLog(LOG_LEVEL_DEBUG);
if (local_time < 1451602800) {
XdrvCall(FUNC_NTP_SET);
} else {
XdrvCall(FUNC_NTP_SET);
}
} else { } else {
ntp_sync_minute++; // Try again in next minute ntp_sync_minute++; // Try again in next minute
} }

View File

@ -183,12 +183,10 @@ const char HTTP_BTN_RSTRT[] PROGMEM =
"<br/><form action='rb' method='get' onsubmit='return confirm(\"" D_CONFIRM_RESTART "\");'><button>" D_RESTART "</button></form>"; "<br/><form action='rb' method='get' onsubmit='return confirm(\"" D_CONFIRM_RESTART "\");'><button>" D_RESTART "</button></form>";
const char HTTP_BTN_MENU_MODULE[] PROGMEM = const char HTTP_BTN_MENU_MODULE[] PROGMEM =
"<br/><form action='md' method='get'><button>" D_CONFIGURE_MODULE "</button></form>"; "<br/><form action='md' method='get'><button>" D_CONFIGURE_MODULE "</button></form>";
#ifdef USE_TIMERS #if defined(USE_TIMERS) && defined(USE_TIMERS_WEB)
#ifdef USE_TIMERS_WEB
const char HTTP_BTN_MENU_TIMER[] PROGMEM = const char HTTP_BTN_MENU_TIMER[] PROGMEM =
"<br/><form action='tm' method='get'><button>" D_CONFIGURE_TIMER "</button></form>"; "<br/><form action='tm' method='get'><button>" D_CONFIGURE_TIMER "</button></form>";
#endif // USE_TIMERS_WEB #endif // USE_TIMERS and USE_TIMERS_WEB
#endif // USE_TIMERS
const char HTTP_BTN_MENU_WIFI[] PROGMEM = const char HTTP_BTN_MENU_WIFI[] PROGMEM =
"<br/><form action='w0' method='get'><button>" D_CONFIGURE_WIFI "</button></form>"; "<br/><form action='w0' method='get'><button>" D_CONFIGURE_WIFI "</button></form>";
const char HTTP_BTN_MENU_MQTT[] PROGMEM = const char HTTP_BTN_MENU_MQTT[] PROGMEM =
@ -343,11 +341,9 @@ void StartWebserver(int type, IPAddress ipweb)
WebServer->on("/", HandleRoot); WebServer->on("/", HandleRoot);
WebServer->on("/cn", HandleConfiguration); WebServer->on("/cn", HandleConfiguration);
WebServer->on("/md", HandleModuleConfiguration); WebServer->on("/md", HandleModuleConfiguration);
#ifdef USE_TIMERS #if defined(USE_TIMERS) && defined(USE_TIMERS_WEB)
#ifdef USE_TIMERS_WEB
WebServer->on("/tm", HandleTimerConfiguration); WebServer->on("/tm", HandleTimerConfiguration);
#endif // USE_TIMERS_WEB #endif // USE_TIMERS and USE_TIMERS_WEB
#endif // USE_TIMERS
WebServer->on("/w1", HandleWifiConfigurationWithScan); WebServer->on("/w1", HandleWifiConfigurationWithScan);
WebServer->on("/w0", HandleWifiConfiguration); WebServer->on("/w0", HandleWifiConfiguration);
if (Settings.flag.mqtt_enabled) { if (Settings.flag.mqtt_enabled) {
@ -641,11 +637,9 @@ void HandleConfiguration()
page.replace(F("{v}"), FPSTR(S_CONFIGURATION)); page.replace(F("{v}"), FPSTR(S_CONFIGURATION));
page += FPSTR(HTTP_HEAD_STYLE); page += FPSTR(HTTP_HEAD_STYLE);
page += FPSTR(HTTP_BTN_MENU_MODULE); page += FPSTR(HTTP_BTN_MENU_MODULE);
#ifdef USE_TIMERS #if defined(USE_TIMERS) && defined(USE_TIMERS_WEB)
#ifdef USE_TIMERS_WEB
if (devices_present) page += FPSTR(HTTP_BTN_MENU_TIMER); if (devices_present) page += FPSTR(HTTP_BTN_MENU_TIMER);
#endif // USE_TIMERS_WEB #endif // USE_TIMERS and USE_TIMERS_WEB
#endif // USE_TIMERS
page += FPSTR(HTTP_BTN_MENU_WIFI); page += FPSTR(HTTP_BTN_MENU_WIFI);
if (Settings.flag.mqtt_enabled) page += FPSTR(HTTP_BTN_MENU_MQTT); if (Settings.flag.mqtt_enabled) page += FPSTR(HTTP_BTN_MENU_MQTT);
page += FPSTR(HTTP_BTN_MENU4); page += FPSTR(HTTP_BTN_MENU4);
@ -1112,13 +1106,11 @@ void HandleSaveSettings()
Settings.seriallog_level, Settings.weblog_level, Settings.syslog_level, Settings.syslog_host, Settings.syslog_port, Settings.tele_period); Settings.seriallog_level, Settings.weblog_level, Settings.syslog_level, Settings.syslog_host, Settings.syslog_port, Settings.tele_period);
AddLog(LOG_LEVEL_INFO); AddLog(LOG_LEVEL_INFO);
break; break;
#ifdef USE_TIMERS #if defined(USE_TIMERS) && defined(USE_TIMERS_WEB)
#ifdef USE_TIMERS_WEB
case 7: case 7:
TimerSaveSettings(); TimerSaveSettings();
break; break;
#endif // USE_TIMERS_WEB #endif // USE_TIMERS and USE_TIMERS_WEB
#endif // USE_TIMERS
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
case 4: case 4:
DomoticzSaveSettings(); DomoticzSaveSettings();

View File

@ -316,6 +316,8 @@ void MqttDisconnected(int state)
snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_MQTT D_CONNECT_FAILED_TO " %s:%d, rc %d. " D_RETRY_IN " %d " D_UNIT_SECOND), snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_MQTT D_CONNECT_FAILED_TO " %s:%d, rc %d. " D_RETRY_IN " %d " D_UNIT_SECOND),
Settings.mqtt_host, Settings.mqtt_port, state, mqtt_retry_counter); Settings.mqtt_host, Settings.mqtt_port, state, mqtt_retry_counter);
AddLog(LOG_LEVEL_INFO); AddLog(LOG_LEVEL_INFO);
XdrvCall(FUNC_MQTT_DISCONNECTED);
} }
void MqttConnected() void MqttConnected()
@ -371,6 +373,8 @@ void MqttConnected()
XdrvCall(FUNC_MQTT_INIT); XdrvCall(FUNC_MQTT_INIT);
} }
mqtt_initial_connection_state = 0; mqtt_initial_connection_state = 0;
XdrvCall(FUNC_MQTT_CONNECTED);
} }
#ifdef USE_MQTT_TLS #ifdef USE_MQTT_TLS

View File

@ -105,7 +105,7 @@ void CounterShow(boolean json)
if (json) { if (json) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"" D_JSON_COUNTER "%d\":%s"), mqtt_data, i +1, counter); snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"" D_JSON_COUNTER "%d\":%s"), mqtt_data, i +1, counter);
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
if (1 == dsxflg) { if ((0 == tele_period) && (1 == dsxflg)) {
DomoticzSensor(DZ_COUNT, RtcSettings.pulse_counter[i]); DomoticzSensor(DZ_COUNT, RtcSettings.pulse_counter[i]);
dsxflg++; dsxflg++;
} }

View File

@ -123,10 +123,12 @@ void SonoffScShow(boolean json)
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"SonoffSC\":{\"" D_JSON_TEMPERATURE "\":%s,\"" D_JSON_HUMIDITY "\":%s,\"" D_JSON_LIGHT "\":%d,\"" D_JSON_NOISE "\":%d,\"" D_JSON_AIRQUALITY "\":%d}"), snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"SonoffSC\":{\"" D_JSON_TEMPERATURE "\":%s,\"" D_JSON_HUMIDITY "\":%s,\"" D_JSON_LIGHT "\":%d,\"" D_JSON_NOISE "\":%d,\"" D_JSON_AIRQUALITY "\":%d}"),
mqtt_data, temperature, humidity, sc_value[2], sc_value[3], sc_value[4]); mqtt_data, temperature, humidity, sc_value[2], sc_value[3], sc_value[4]);
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
if (0 == tele_period) {
DomoticzTempHumSensor(temperature, humidity); DomoticzTempHumSensor(temperature, humidity);
DomoticzSensor(DZ_ILLUMINANCE, sc_value[2]); DomoticzSensor(DZ_ILLUMINANCE, sc_value[2]);
DomoticzSensor(DZ_COUNT, sc_value[3]); DomoticzSensor(DZ_COUNT, sc_value[3]);
DomoticzSensor(DZ_AIRQUALITY, 500 + ((100 - sc_value[4]) * 20)); DomoticzSensor(DZ_AIRQUALITY, 500 + ((100 - sc_value[4]) * 20));
}
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
#ifdef USE_KNX #ifdef USE_KNX

View File

@ -197,7 +197,7 @@ void Ds18b20Show(boolean json)
if(json) { if(json) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"DS18B20\":{\"" D_JSON_TEMPERATURE "\":%s}"), mqtt_data, temperature); snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"DS18B20\":{\"" D_JSON_TEMPERATURE "\":%s}"), mqtt_data, temperature);
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
DomoticzSensor(DZ_TEMP, temperature); if (0 == tele_period) DomoticzSensor(DZ_TEMP, temperature);
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
#ifdef USE_WEBSERVER #ifdef USE_WEBSERVER
} else { } else {

View File

@ -380,7 +380,7 @@ void Ds18x20Show(boolean json)
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"%s\":{\"" D_JSON_ID "\":\"%s\",\"" D_JSON_TEMPERATURE "\":%s}"), mqtt_data, stemp, address, temperature); snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"%s\":{\"" D_JSON_ID "\":\"%s\",\"" D_JSON_TEMPERATURE "\":%s}"), mqtt_data, stemp, address, temperature);
} }
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
if (domoticz_flag) { if ((0 == tele_period) && domoticz_flag) {
DomoticzSensor(DZ_TEMP, temperature); DomoticzSensor(DZ_TEMP, temperature);
domoticz_flag = false; domoticz_flag = false;
} }

View File

@ -188,7 +188,7 @@ void Ds18x20Show(boolean json)
mqtt_data, stemp, i +1, ds18x20_types, Ds18x20Addresses(i).c_str(), temperature); mqtt_data, stemp, i +1, ds18x20_types, Ds18x20Addresses(i).c_str(), temperature);
strcpy(stemp, ","); strcpy(stemp, ",");
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
if (1 == dsxflg) { if ((0 == tele_period) && (1 == dsxflg)) {
DomoticzSensor(DZ_TEMP, temperature); DomoticzSensor(DZ_TEMP, temperature);
} }
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ

View File

@ -226,7 +226,7 @@ void DhtShow(boolean json)
if (json) { if (json) {
snprintf_P(mqtt_data, sizeof(mqtt_data), JSON_SNS_TEMPHUM, mqtt_data, Dht[i].stype, temperature, humidity); snprintf_P(mqtt_data, sizeof(mqtt_data), JSON_SNS_TEMPHUM, mqtt_data, Dht[i].stype, temperature, humidity);
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
if (!dsxflg) { if ((0 == tele_period) && !dsxflg) {
DomoticzTempHumSensor(temperature, humidity); DomoticzTempHumSensor(temperature, humidity);
dsxflg++; dsxflg++;
} }

View File

@ -199,7 +199,7 @@ void ShtShow(boolean json)
if (json) { if (json) {
snprintf_P(mqtt_data, sizeof(mqtt_data), JSON_SNS_TEMPHUM, mqtt_data, "SHT1X", temperature, humidity); snprintf_P(mqtt_data, sizeof(mqtt_data), JSON_SNS_TEMPHUM, mqtt_data, "SHT1X", temperature, humidity);
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
DomoticzTempHumSensor(temperature, humidity); if (0 == tele_period) DomoticzTempHumSensor(temperature, humidity);
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
#ifdef USE_KNX #ifdef USE_KNX

View File

@ -262,7 +262,7 @@ void HtuShow(boolean json)
if (json) { if (json) {
snprintf_P(mqtt_data, sizeof(mqtt_data), JSON_SNS_TEMPHUM, mqtt_data, htu_types, temperature, humidity); snprintf_P(mqtt_data, sizeof(mqtt_data), JSON_SNS_TEMPHUM, mqtt_data, htu_types, temperature, humidity);
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
DomoticzTempHumSensor(temperature, humidity); if (0 == tele_period) DomoticzTempHumSensor(temperature, humidity);
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
#ifdef USE_KNX #ifdef USE_KNX

View File

@ -465,7 +465,7 @@ void BmpShow(boolean json)
mqtt_data, bmp_name, temperature, (bmp_model >= 2) ? json_humidity : "", pressure, (Settings.altitude != 0) ? json_sealevel : ""); mqtt_data, bmp_name, temperature, (bmp_model >= 2) ? json_humidity : "", pressure, (Settings.altitude != 0) ? json_sealevel : "");
#endif // USE_BME680 #endif // USE_BME680
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
DomoticzTempHumPressureSensor(temperature, humidity, pressure); if (0 == tele_period) DomoticzTempHumPressureSensor(temperature, humidity, pressure);
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
#ifdef USE_KNX #ifdef USE_KNX

View File

@ -77,7 +77,7 @@ void Bh1750Show(boolean json)
if (json) { if (json) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"BH1750\":{\"" D_JSON_ILLUMINANCE "\":%d}"), mqtt_data, illuminance); snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"BH1750\":{\"" D_JSON_ILLUMINANCE "\":%d}"), mqtt_data, illuminance);
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
DomoticzSensor(DZ_ILLUMINANCE, illuminance); if (0 == tele_period) DomoticzSensor(DZ_ILLUMINANCE, illuminance);
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
#ifdef USE_WEBSERVER #ifdef USE_WEBSERVER
} else { } else {

View File

@ -82,7 +82,7 @@ void Veml6070Show(boolean json)
if (json) { if (json) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"VEML6070\":{\"" D_JSON_UV_LEVEL "\":%d}"), mqtt_data, uvlevel); snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"VEML6070\":{\"" D_JSON_UV_LEVEL "\":%d}"), mqtt_data, uvlevel);
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
DomoticzSensor(DZ_ILLUMINANCE, uvlevel); if (0 == tele_period) DomoticzSensor(DZ_ILLUMINANCE, uvlevel);
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
#ifdef USE_WEBSERVER #ifdef USE_WEBSERVER
} else { } else {

View File

@ -216,8 +216,10 @@ void Ina219Show(boolean json)
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"INA219\":{\"" D_JSON_VOLTAGE "\":%s,\"" D_JSON_CURRENT "\":%s,\"" D_JSON_POWERUSAGE "\":%s}"), snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"INA219\":{\"" D_JSON_VOLTAGE "\":%s,\"" D_JSON_CURRENT "\":%s,\"" D_JSON_POWERUSAGE "\":%s}"),
mqtt_data, voltage, current, power); mqtt_data, voltage, current, power);
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
if (0 == tele_period) {
DomoticzSensor(DZ_VOLTAGE, voltage); DomoticzSensor(DZ_VOLTAGE, voltage);
DomoticzSensor(DZ_CURRENT, current); DomoticzSensor(DZ_CURRENT, current);
}
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
#ifdef USE_WEBSERVER #ifdef USE_WEBSERVER
} else { } else {

View File

@ -107,7 +107,7 @@ void Sht3xShow(boolean json)
if (json) { if (json) {
snprintf_P(mqtt_data, sizeof(mqtt_data), JSON_SNS_TEMPHUM, mqtt_data, types, temperature, humidity); snprintf_P(mqtt_data, sizeof(mqtt_data), JSON_SNS_TEMPHUM, mqtt_data, types, temperature, humidity);
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
if (0 == i) { // We want the same first sensor to report to Domoticz in case a read is missed if ((0 == tele_period) && (0 == i)) { // We want the same first sensor to report to Domoticz in case a read is missed
DomoticzTempHumSensor(temperature, humidity); DomoticzTempHumSensor(temperature, humidity);
} }
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ

View File

@ -265,7 +265,7 @@ void MhzShow(boolean json)
if (json) { if (json) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"%s\":{\"" D_JSON_CO2 "\":%d,\"" D_JSON_TEMPERATURE "\":%s}"), mqtt_data, mhz_types, mhz_last_ppm, temperature); snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"%s\":{\"" D_JSON_CO2 "\":%d,\"" D_JSON_TEMPERATURE "\":%s}"), mqtt_data, mhz_types, mhz_last_ppm, temperature);
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
DomoticzSensor(DZ_AIRQUALITY, mhz_last_ppm); if (0 == tele_period) DomoticzSensor(DZ_AIRQUALITY, mhz_last_ppm);
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
#ifdef USE_WEBSERVER #ifdef USE_WEBSERVER
} else { } else {

View File

@ -71,7 +71,7 @@ void Tsl2561Show(boolean json)
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"TSL2561\":{\"" D_JSON_ILLUMINANCE "\":%u.%03u}"), snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"TSL2561\":{\"" D_JSON_ILLUMINANCE "\":%u.%03u}"),
mqtt_data, milliLux/1000, milliLux%1000); mqtt_data, milliLux/1000, milliLux%1000);
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
DomoticzSensor(DZ_ILLUMINANCE, (milliLux+500)/1000); if (0 == tele_period) DomoticzSensor(DZ_ILLUMINANCE, (milliLux+500)/1000);
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
#ifdef USE_WEBSERVER #ifdef USE_WEBSERVER
} else { } else {

View File

@ -213,7 +213,7 @@ void SenseairShow(boolean json)
} }
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s}"), mqtt_data); snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s}"), mqtt_data);
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
DomoticzSensor(DZ_AIRQUALITY, senseair_co2); if (0 == tele_period) DomoticzSensor(DZ_AIRQUALITY, senseair_co2);
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
#ifdef USE_WEBSERVER #ifdef USE_WEBSERVER
} else { } else {

View File

@ -131,9 +131,11 @@ void PmsShow(boolean json)
pms_data.pm10_env, pms_data.pm25_env, pms_data.pm100_env, pms_data.pm10_env, pms_data.pm25_env, pms_data.pm100_env,
pms_data.particles_03um, pms_data.particles_05um, pms_data.particles_10um, pms_data.particles_25um, pms_data.particles_50um, pms_data.particles_100um); pms_data.particles_03um, pms_data.particles_05um, pms_data.particles_10um, pms_data.particles_25um, pms_data.particles_50um, pms_data.particles_100um);
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
if (0 == tele_period) {
DomoticzSensor(DZ_COUNT, pms_data.pm10_env); // PM1 DomoticzSensor(DZ_COUNT, pms_data.pm10_env); // PM1
DomoticzSensor(DZ_VOLTAGE, pms_data.pm25_env); // PM2.5 DomoticzSensor(DZ_VOLTAGE, pms_data.pm25_env); // PM2.5
DomoticzSensor(DZ_CURRENT, pms_data.pm100_env); // PM10 DomoticzSensor(DZ_CURRENT, pms_data.pm100_env); // PM10
}
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
#ifdef USE_WEBSERVER #ifdef USE_WEBSERVER
} else { } else {

View File

@ -108,8 +108,10 @@ void NovaSdsShow(boolean json)
if (json) { if (json) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"SDS0X1\":{\"PM2.5\":%s,\"PM10\":%s}"), mqtt_data, pm2_5, pm10); snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"SDS0X1\":{\"PM2.5\":%s,\"PM10\":%s}"), mqtt_data, pm2_5, pm10);
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
if (0 == tele_period) {
DomoticzSensor(DZ_VOLTAGE, pm2_5); // PM2.5 DomoticzSensor(DZ_VOLTAGE, pm2_5); // PM2.5
DomoticzSensor(DZ_CURRENT, pm10); // PM10 DomoticzSensor(DZ_CURRENT, pm10); // PM10
}
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
#ifdef USE_WEBSERVER #ifdef USE_WEBSERVER
} else { } else {

View File

@ -74,7 +74,7 @@ void Sgp30Show(boolean json)
if (json) { if (json) {
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"SGP30\":{\"" D_JSON_ECO2 "\":%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); if (0 == tele_period) DomoticzSensor(DZ_AIRQUALITY, sgp.eCO2);
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
} else { } else {
#ifdef USE_WEBSERVER #ifdef USE_WEBSERVER