Add command SetOption42 0..255 to set over temperature in Celsius. Defaults to 90

Add command SetOption42 0..255 to set over temperature in Celsius. Defaults to 90 (#6036)
This commit is contained in:
Theo Arends 2019-07-08 14:16:33 +02:00
parent 57310a7699
commit 0243e2be7e
6 changed files with 17 additions and 6 deletions

View File

@ -1,6 +1,9 @@
/*********************************************************************************************\
* 6.6.0.1 20190707
* Add blend RGB leds with White leds for better whites #5895 #5704
* 6.6.0.1 20190708
* Add blend RGB leds with White leds for better whites (#5895, #5704)
* Add command SetOption41 0..8 to control number of Tuya switches (#6039)
* Add command SetOption42 0..255 to set overtemperature (Celsius only) threshold resulting in power off all on energy monitoring devices. Default setting is 90 (#6036)
* Fix Domoticz battery level set to 100 if define USE_ADC_VCC is not used (#6033)
*
* 6.6.0 20190707
* Remove support of TLS on core 2.3.0 and extent support on core 2.4.2 and up

View File

@ -1186,6 +1186,9 @@ void SettingsDelta(void)
if (Settings.version < 0x0605000D) {
Settings.param[P_IR_UNKNOW_THRESHOLD] = IR_RCV_MIN_UNKNOWN_SIZE;
}
if (Settings.version < 0x06060001) {
Settings.param[P_OVER_TEMP] = ENERGY_OVERTEMP;
}
Settings.version = VERSION;
SettingsSave(1);

View File

@ -230,7 +230,9 @@ enum ButtonStates { PRESSED, NOT_PRESSED };
enum Shortcuts { SC_CLEAR, SC_DEFAULT, SC_USER };
enum SettingsParmaIndex {P_HOLD_TIME, P_MAX_POWER_RETRY, P_TUYA_DIMMER_ID, P_MDNS_DELAYED_START, P_BOOT_LOOP_OFFSET, P_RGB_REMAP, P_IR_UNKNOW_THRESHOLD, P_CSE7766_INVALID_POWER, P_HOLD_IGNORE, P_TUYA_RELAYS, P_MAX_PARAM8}; // Max is PARAM8_SIZE (18) - SetOption32 until SetOption49
enum SettingsParmaIndex {P_HOLD_TIME, P_MAX_POWER_RETRY, P_TUYA_DIMMER_ID, P_MDNS_DELAYED_START, P_BOOT_LOOP_OFFSET, P_RGB_REMAP, P_IR_UNKNOW_THRESHOLD, // SetOption32 .. SetOption38
P_CSE7766_INVALID_POWER, P_HOLD_IGNORE, P_TUYA_RELAYS, P_OVER_TEMP, // SetOption39 .. SetOption42
P_MAX_PARAM8}; // Max is PARAM8_SIZE (18) - SetOption32 until SetOption49
enum DomoticzSensors {DZ_TEMP, DZ_TEMP_HUM, DZ_TEMP_HUM_BARO, DZ_POWER_ENERGY, DZ_ILLUMINANCE, DZ_COUNT, DZ_VOLTAGE, DZ_CURRENT, DZ_AIRQUALITY, DZ_MAX_SENSORS};

View File

@ -46,6 +46,10 @@ void KNX_CB_Action(message_t const &msg, void *arg);
* Default global defines
\*********************************************************************************************/
#ifndef ENERGY_OVERTEMP
#define ENERGY_OVERTEMP 90 // Overtemp in Celsius
#endif
#ifdef USE_EMULATION_HUE
#define USE_EMULATION
#endif

View File

@ -20,6 +20,6 @@
#ifndef _SONOFF_VERSION_H_
#define _SONOFF_VERSION_H_
const uint32_t VERSION = 0x06060000;
const uint32_t VERSION = 0x06060001;
#endif // _SONOFF_VERSION_H_

View File

@ -27,7 +27,6 @@
#define ENERGY_NONE 0
#define ENERGY_OVERTEMP 73.0 // Industry standard lowest overtemp in Celsius
#define ENERGY_WATCHDOG 4 // Allow up to 4 seconds before deciding no valid data present
#define FEATURE_POWER_LIMIT true
@ -325,7 +324,7 @@ void EnergyMqttShow(void)
void EnergyOverTempCheck()
{
if (global_update) {
if (power && (global_temperature != 9999) && (global_temperature > ENERGY_OVERTEMP)) { // Device overtemp, turn off relays
if (power && (global_temperature != 9999) && (global_temperature > Settings.param[P_OVER_TEMP])) { // Device overtemp, turn off relays
SetAllPower(POWER_ALL_OFF, SRC_OVERTEMP);
}
}