Skip to content

Commit

Permalink
Add compile time interlock parameters
Browse files Browse the repository at this point in the history
Add compile time interlock parameters (#8759)
  • Loading branch information
arendst committed Jun 22, 2020
1 parent c8e08d7 commit 7c8b06c
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 5 deletions.
2 changes: 2 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
2 changes: 2 additions & 0 deletions tasmota/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down
6 changes: 6 additions & 0 deletions tasmota/my_user_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 10 additions & 4 deletions tasmota/settings.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tasmota/support_command.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
16 changes: 16 additions & 0 deletions tasmota/tasmota_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7c8b06c

Please sign in to comment.