diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 410ecc1d1..121e9e428 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -62,6 +62,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c - Change define USE_TASMOTA_SLAVE into USE_TASMOTA_CLIENT - Change commands ``SlaveSend`` and ``SlaveReset`` into ``ClientSend`` and ``ClientReset`` - Fix escape of non-JSON received serial data (#8329) +- Fix exception or watchdog on rule re-entry (#8757) - Add command ``Rule0`` to change global rule parameters - Add command ``Time 4`` to display timestamp using milliseconds (#8537) - Add command ``SetOption94 0/1`` to select MAX31855 or MAX6675 thermocouple support (#8616) @@ -88,3 +89,4 @@ The following binary downloads have been compiled with ESP8266/Arduino library c - Add Library to be used for decoding Teleinfo (French Metering Smart Meter) - Add basic support for ESP32 ethernet adding commands ``Wifi 0/1`` and ``Ethernet 0/1`` both default ON - Add support for single wire LMT01 temperature Sensor by justifiably (#8713) +- Add compile time interlock parameters (#8759) diff --git a/tasmota/CHANGELOG.md b/tasmota/CHANGELOG.md index 3ba3a1d38..2a2a822f7 100644 --- a/tasmota/CHANGELOG.md +++ b/tasmota/CHANGELOG.md @@ -6,6 +6,8 @@ - Add support for Energy sensor (Denky) for French Smart Metering meter provided by global Energy Providers, need a adaptater. See dedicated full [blog](http://hallard.me/category/tinfo/) about French teleinformation stuff - Add library to be used for decoding Teleinfo (French Metering Smart Meter) - Add support for single wire LMT01 temperature Sensor by justifiably (#8713) +- Add compile time interlock parameters (#8759) +- Fix exception or watchdog on rule re-entry (#8757) - Change ESP32 USER GPIO template representation decreasing template message size - Change define USE_TASMOTA_SLAVE into USE_TASMOTA_CLIENT - Change commands ``SlaveSend`` and ``SlaveReset`` into ``ClientSend`` and ``ClientReset`` diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index 4f5623de1..e0de6bbf3 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -280,6 +280,12 @@ #define APP_DISABLE_POWERCYCLE false // [SetOption65] Disable fast power cycle detection for device reset #define DEEPSLEEP_BOOTCOUNT false // [SetOption76] Enable incrementing bootcount when deepsleep is enabled +#define APP_INTERLOCK_MODE false // [Interlock] Relay interlock mode +#define APP_INTERLOCK_GROUP_1 0xFF // [Interlock] Relay bitmask for interlock group 1 (0xFF if undef) +//#define APP_INTERLOCK_GROUP_2 0x00 // [Interlock] Relay bitmask for interlock group 2 (0x00 if undef) +//#define APP_INTERLOCK_GROUP_3 0x00 // [Interlock] Relay bitmask for interlock group 3 (0x00 if undef) +//#define APP_INTERLOCK_GROUP_4 0x00 // [Interlock] Relay bitmask for interlock group 4 (0x00 if undef) + // -- Lights -------------------------------------- #define WS2812_LEDS 30 // [Pixels] Number of WS2812 LEDs to start with (max is 512) #define LIGHT_MODE true // [SetOption15] Switch between commands PWM or COLOR/DIMMER/CT/CHANNEL diff --git a/tasmota/settings.ino b/tasmota/settings.ino index d7ede5f25..e7a43b70a 100644 --- a/tasmota/settings.ino +++ b/tasmota/settings.ino @@ -765,8 +765,11 @@ void SettingsDefaultSet2(void) } // Module -// flag.interlock |= 0; - Settings.interlock[0] = 0xFF; // Legacy support using all relays in one interlock group + flag.interlock |= APP_INTERLOCK_MODE; + Settings.interlock[0] = APP_INTERLOCK_GROUP_1; + Settings.interlock[1] = APP_INTERLOCK_GROUP_2; + Settings.interlock[2] = APP_INTERLOCK_GROUP_3; + Settings.interlock[3] = APP_INTERLOCK_GROUP_4; Settings.module = MODULE; Settings.fallback_module = FALLBACK_MODULE; ModuleDefault(WEMOS); @@ -1188,8 +1191,11 @@ void SettingsDelta(void) Settings.param[P_MDNS_DELAYED_START] = 0; } if (Settings.version < 0x0604010B) { - Settings.interlock[0] = 0xFF; // Legacy support using all relays in one interlock group - for (uint32_t i = 1; i < MAX_INTERLOCKS; i++) { Settings.interlock[i] = 0; } + Settings.flag.interlock = APP_INTERLOCK_MODE; + Settings.interlock[0] = APP_INTERLOCK_GROUP_1; + Settings.interlock[1] = APP_INTERLOCK_GROUP_2; + Settings.interlock[2] = APP_INTERLOCK_GROUP_3; + Settings.interlock[3] = APP_INTERLOCK_GROUP_4; } if (Settings.version < 0x0604010D) { Settings.param[P_BOOT_LOOP_OFFSET] = BOOT_LOOP_OFFSET; // SetOption36 diff --git a/tasmota/support_command.ino b/tasmota/support_command.ino index e23fda355..612f4dbce 100644 --- a/tasmota/support_command.ino +++ b/tasmota/support_command.ino @@ -1627,7 +1627,8 @@ void CmndInterlock(void) } ResponseAppend_P(PSTR("\"}")); } else { - Settings.flag.interlock = 0; // CMND_INTERLOCK - Enable/disable interlock + // never ever reset interlock mode inadvertently if we forced it upon compilation + Settings.flag.interlock = APP_INTERLOCK_MODE; // CMND_INTERLOCK - Enable/disable interlock ResponseCmndStateText(Settings.flag.interlock); } } diff --git a/tasmota/tasmota_globals.h b/tasmota/tasmota_globals.h index 620c6ff68..f52f7a218 100644 --- a/tasmota/tasmota_globals.h +++ b/tasmota/tasmota_globals.h @@ -88,6 +88,22 @@ String EthernetMacAddress(void); #undef USE_RF_FLASH // Disable RF firmware flash when Sonoff Rf is disabled #endif +#ifndef APP_INTERLOCK_MODE +#define APP_INTERLOCK_MODE false // [Interlock] Relay interlock mode +#endif +#ifndef APP_INTERLOCK_GROUP_1 +#define APP_INTERLOCK_GROUP_1 0xFF // [Interlock] Relay bitmask for interlock group 1 - Legacy support using all relays in one interlock group +#endif +#ifndef APP_INTERLOCK_GROUP_2 +#define APP_INTERLOCK_GROUP_2 0x00 // [Interlock] Relay bitmask for interlock group 2 +#endif +#ifndef APP_INTERLOCK_GROUP_3 +#define APP_INTERLOCK_GROUP_3 0x00 // [Interlock] Relay bitmask for interlock group 3 +#endif +#ifndef APP_INTERLOCK_GROUP_4 +#define APP_INTERLOCK_GROUP_4 0x00 // [Interlock] Relay bitmask for interlock group 4 +#endif + #ifndef SWITCH_MODE #define SWITCH_MODE TOGGLE // TOGGLE, FOLLOW or FOLLOW_INV (the wall switch state) #endif