mirror of https://github.com/arendst/Tasmota.git
Merge remote-tracking branch 'upstream/development' into teleinfo
This commit is contained in:
commit
a10dfbc7c6
|
@ -26,6 +26,7 @@ All notable changes to this project will be documented in this file.
|
||||||
- Limit number of relay/button columns in GUI to 8 (#11546)
|
- Limit number of relay/button columns in GUI to 8 (#11546)
|
||||||
- ADC range result from int to float using command ``FreqRes`` for decimal resolution selection (#11545)
|
- ADC range result from int to float using command ``FreqRes`` for decimal resolution selection (#11545)
|
||||||
- Teleinfo, if raw mode selected also return telemety values in SENSOR data
|
- Teleinfo, if raw mode selected also return telemety values in SENSOR data
|
||||||
|
- Removed overtemp detection on external energy monitoring devices (#11628)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- HC-SR04 on ESP32 release serial interface if not used (#11507)
|
- HC-SR04 on ESP32 release serial interface if not used (#11507)
|
||||||
|
|
|
@ -115,6 +115,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota
|
||||||
- DeepSleep announcement topic [#11223](https://github.com/arendst/Tasmota/issues/11223)
|
- DeepSleep announcement topic [#11223](https://github.com/arendst/Tasmota/issues/11223)
|
||||||
- Limit number of relay/button columns in GUI to 8 [#11546](https://github.com/arendst/Tasmota/issues/11546)
|
- Limit number of relay/button columns in GUI to 8 [#11546](https://github.com/arendst/Tasmota/issues/11546)
|
||||||
- ADC range result from int to float using command ``FreqRes`` for decimal resolution selection [#11545](https://github.com/arendst/Tasmota/issues/11545)
|
- ADC range result from int to float using command ``FreqRes`` for decimal resolution selection [#11545](https://github.com/arendst/Tasmota/issues/11545)
|
||||||
|
- Removed overtemp detection on external energy monitoring devices [#11628](https://github.com/arendst/Tasmota/issues/11628)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- PN532 on ESP32 Serial flush both Tx and Rx buffers [#10910](https://github.com/arendst/Tasmota/issues/10910)
|
- PN532 on ESP32 Serial flush both Tx and Rx buffers [#10910](https://github.com/arendst/Tasmota/issues/10910)
|
||||||
|
|
|
@ -421,6 +421,7 @@
|
||||||
#define D_CMND_VOLTAGESET "VoltageSet"
|
#define D_CMND_VOLTAGESET "VoltageSet"
|
||||||
#define D_CMND_CURRENTSET "CurrentSet"
|
#define D_CMND_CURRENTSET "CurrentSet"
|
||||||
#define D_CMND_FREQUENCYSET "FrequencySet"
|
#define D_CMND_FREQUENCYSET "FrequencySet"
|
||||||
|
#define D_CMND_ENERGYCONFIG "EnergyConfig"
|
||||||
#define D_CMND_MAXPOWER "MaxPower"
|
#define D_CMND_MAXPOWER "MaxPower"
|
||||||
#define D_CMND_MAXPOWERHOLD "MaxPowerHold"
|
#define D_CMND_MAXPOWERHOLD "MaxPowerHold"
|
||||||
#define D_CMND_MAXPOWERWINDOW "MaxPowerWindow"
|
#define D_CMND_MAXPOWERWINDOW "MaxPowerWindow"
|
||||||
|
|
|
@ -411,7 +411,7 @@ void BacklogLoop(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SleepDelay(uint32_t mseconds) {
|
void SleepDelay(uint32_t mseconds) {
|
||||||
if (mseconds) {
|
if (!TasmotaGlobal.backlog_nodelay && mseconds) {
|
||||||
uint32_t wait = millis() + mseconds;
|
uint32_t wait = millis() + mseconds;
|
||||||
while (!TimeReached(wait) && !Serial.available()) { // We need to service serial buffer ASAP as otherwise we get uart buffer overrun
|
while (!TimeReached(wait) && !Serial.available()) { // We need to service serial buffer ASAP as otherwise we get uart buffer overrun
|
||||||
delay(1);
|
delay(1);
|
||||||
|
|
|
@ -1505,16 +1505,16 @@ uint16_t WebGetGpioArg(uint32_t i) {
|
||||||
|
|
||||||
void TemplateSaveSettings(void) {
|
void TemplateSaveSettings(void) {
|
||||||
char tmp[TOPSZ]; // WebGetArg NAME and GPIO/BASE/FLAG byte value
|
char tmp[TOPSZ]; // WebGetArg NAME and GPIO/BASE/FLAG byte value
|
||||||
char svalue[300]; // Template command string
|
char command[300]; // Template command string
|
||||||
|
|
||||||
WebGetArg(PSTR("s1"), tmp, sizeof(tmp)); // NAME
|
WebGetArg(PSTR("s1"), tmp, sizeof(tmp)); // NAME
|
||||||
snprintf_P(svalue, sizeof(svalue), PSTR(D_CMND_TEMPLATE " {\"" D_JSON_NAME "\":\"%s\",\"" D_JSON_GPIO "\":["), tmp);
|
snprintf_P(command, sizeof(command), PSTR(D_CMND_TEMPLATE " {\"" D_JSON_NAME "\":\"%s\",\"" D_JSON_GPIO "\":["), tmp);
|
||||||
|
|
||||||
uint32_t j = 0;
|
uint32_t j = 0;
|
||||||
for (uint32_t i = 0; i < nitems(Settings.user_template.gp.io); i++) {
|
for (uint32_t i = 0; i < nitems(Settings.user_template.gp.io); i++) {
|
||||||
if (6 == i) { j = 9; }
|
if (6 == i) { j = 9; }
|
||||||
if (8 == i) { j = 12; }
|
if (8 == i) { j = 12; }
|
||||||
snprintf_P(svalue, sizeof(svalue), PSTR("%s%s%d"), svalue, (i>0)?",":"", WebGetGpioArg(j));
|
snprintf_P(command, sizeof(command), PSTR("%s%s%d"), command, (i>0)?",":"", WebGetGpioArg(j));
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1528,8 +1528,8 @@ void TemplateSaveSettings(void) {
|
||||||
WebGetArg(PSTR("g99"), tmp, sizeof(tmp)); // BASE
|
WebGetArg(PSTR("g99"), tmp, sizeof(tmp)); // BASE
|
||||||
uint32_t base = atoi(tmp) +1;
|
uint32_t base = atoi(tmp) +1;
|
||||||
|
|
||||||
snprintf_P(svalue, sizeof(svalue), PSTR("%s],\"" D_JSON_FLAG "\":%d,\"" D_JSON_BASE "\":%d}"), svalue, flag, base);
|
snprintf_P(command, sizeof(command), PSTR("%s],\"" D_JSON_FLAG "\":%d,\"" D_JSON_BASE "\":%d}"), command, flag, base);
|
||||||
ExecuteWebCommand(svalue);
|
ExecuteWebCommand(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------------------------*/
|
||||||
|
@ -1958,7 +1958,7 @@ void OtherSaveSettings(void) {
|
||||||
WebGetArg(PSTR("dn"), tmp1, sizeof(tmp1)); // Device name
|
WebGetArg(PSTR("dn"), tmp1, sizeof(tmp1)); // Device name
|
||||||
char tmp2[100];
|
char tmp2[100];
|
||||||
WebGetArg(PSTR("wp"), tmp2, sizeof(tmp2)); // Web password
|
WebGetArg(PSTR("wp"), tmp2, sizeof(tmp2)); // Web password
|
||||||
char command[600];
|
char command[500];
|
||||||
snprintf_P(command, sizeof(command), PSTR(D_CMND_BACKLOG "0 " D_CMND_WEBPASSWORD "2 %s;" D_CMND_SO "3 %d;" D_CMND_DEVICENAME " %s"),
|
snprintf_P(command, sizeof(command), PSTR(D_CMND_BACKLOG "0 " D_CMND_WEBPASSWORD "2 %s;" D_CMND_SO "3 %d;" D_CMND_DEVICENAME " %s"),
|
||||||
(!strlen(tmp2)) ? "\"" : (strlen(tmp2) < 5) ? "" : tmp2,
|
(!strlen(tmp2)) ? "\"" : (strlen(tmp2) < 5) ? "" : tmp2,
|
||||||
Webserver->hasArg(F("b1")), // SetOption3 - Enable MQTT
|
Webserver->hasArg(F("b1")), // SetOption3 - Enable MQTT
|
||||||
|
|
|
@ -43,11 +43,11 @@
|
||||||
|
|
||||||
enum EnergyCommands {
|
enum EnergyCommands {
|
||||||
CMND_POWERCAL, CMND_VOLTAGECAL, CMND_CURRENTCAL, CMND_FREQUENCYCAL,
|
CMND_POWERCAL, CMND_VOLTAGECAL, CMND_CURRENTCAL, CMND_FREQUENCYCAL,
|
||||||
CMND_POWERSET, CMND_VOLTAGESET, CMND_CURRENTSET, CMND_FREQUENCYSET, CMND_MODULEADDRESS };
|
CMND_POWERSET, CMND_VOLTAGESET, CMND_CURRENTSET, CMND_FREQUENCYSET, CMND_MODULEADDRESS, CMND_ENERGYCONFIG };
|
||||||
|
|
||||||
const char kEnergyCommands[] PROGMEM = "|" // No prefix
|
const char kEnergyCommands[] PROGMEM = "|" // No prefix
|
||||||
D_CMND_POWERCAL "|" D_CMND_VOLTAGECAL "|" D_CMND_CURRENTCAL "|" D_CMND_FREQUENCYCAL "|"
|
D_CMND_POWERCAL "|" D_CMND_VOLTAGECAL "|" D_CMND_CURRENTCAL "|" D_CMND_FREQUENCYCAL "|"
|
||||||
D_CMND_POWERSET "|" D_CMND_VOLTAGESET "|" D_CMND_CURRENTSET "|" D_CMND_FREQUENCYSET "|" D_CMND_MODULEADDRESS "|"
|
D_CMND_POWERSET "|" D_CMND_VOLTAGESET "|" D_CMND_CURRENTSET "|" D_CMND_FREQUENCYSET "|" D_CMND_MODULEADDRESS "|" D_CMND_ENERGYCONFIG "|"
|
||||||
#ifdef USE_ENERGY_MARGIN_DETECTION
|
#ifdef USE_ENERGY_MARGIN_DETECTION
|
||||||
D_CMND_POWERDELTA "|" D_CMND_POWERLOW "|" D_CMND_POWERHIGH "|" D_CMND_VOLTAGELOW "|" D_CMND_VOLTAGEHIGH "|" D_CMND_CURRENTLOW "|" D_CMND_CURRENTHIGH "|"
|
D_CMND_POWERDELTA "|" D_CMND_POWERLOW "|" D_CMND_POWERHIGH "|" D_CMND_VOLTAGELOW "|" D_CMND_VOLTAGEHIGH "|" D_CMND_CURRENTLOW "|" D_CMND_CURRENTHIGH "|"
|
||||||
#ifdef USE_ENERGY_POWER_LIMIT
|
#ifdef USE_ENERGY_POWER_LIMIT
|
||||||
|
@ -60,7 +60,7 @@ const char kEnergyCommands[] PROGMEM = "|" // No prefix
|
||||||
|
|
||||||
void (* const EnergyCommand[])(void) PROGMEM = {
|
void (* const EnergyCommand[])(void) PROGMEM = {
|
||||||
&CmndPowerCal, &CmndVoltageCal, &CmndCurrentCal, &CmndFrequencyCal,
|
&CmndPowerCal, &CmndVoltageCal, &CmndCurrentCal, &CmndFrequencyCal,
|
||||||
&CmndPowerSet, &CmndVoltageSet, &CmndCurrentSet, &CmndFrequencySet, &CmndModuleAddress,
|
&CmndPowerSet, &CmndVoltageSet, &CmndCurrentSet, &CmndFrequencySet, &CmndModuleAddress, &CmndEnergyConfig,
|
||||||
#ifdef USE_ENERGY_MARGIN_DETECTION
|
#ifdef USE_ENERGY_MARGIN_DETECTION
|
||||||
&CmndPowerDelta, &CmndPowerLow, &CmndPowerHigh, &CmndVoltageLow, &CmndVoltageHigh, &CmndCurrentLow, &CmndCurrentHigh,
|
&CmndPowerDelta, &CmndPowerLow, &CmndPowerHigh, &CmndVoltageLow, &CmndVoltageHigh, &CmndCurrentLow, &CmndCurrentHigh,
|
||||||
#ifdef USE_ENERGY_POWER_LIMIT
|
#ifdef USE_ENERGY_POWER_LIMIT
|
||||||
|
@ -102,6 +102,7 @@ struct ENERGY {
|
||||||
uint8_t phase_count; // Number of phases active
|
uint8_t phase_count; // Number of phases active
|
||||||
bool voltage_common; // Use single voltage
|
bool voltage_common; // Use single voltage
|
||||||
bool frequency_common; // Use single frequency
|
bool frequency_common; // Use single frequency
|
||||||
|
bool use_overtemp; // Use global temperature as overtemp trigger on internal energy monitor hardware
|
||||||
bool kWhtoday_offset_init;
|
bool kWhtoday_offset_init;
|
||||||
|
|
||||||
bool voltage_available; // Enable if voltage is measured
|
bool voltage_available; // Enable if voltage is measured
|
||||||
|
@ -501,7 +502,7 @@ void EnergyMqttShow(void)
|
||||||
void EnergyEverySecond(void)
|
void EnergyEverySecond(void)
|
||||||
{
|
{
|
||||||
// Overtemp check
|
// Overtemp check
|
||||||
if (TasmotaGlobal.global_update) {
|
if (Energy.use_overtemp && TasmotaGlobal.global_update) {
|
||||||
if (TasmotaGlobal.power && !isnan(TasmotaGlobal.temperature_celsius) && (TasmotaGlobal.temperature_celsius > (float)Settings.param[P_OVER_TEMP])) { // SetOption42 Device overtemp, turn off relays
|
if (TasmotaGlobal.power && !isnan(TasmotaGlobal.temperature_celsius) && (TasmotaGlobal.temperature_celsius > (float)Settings.param[P_OVER_TEMP])) { // SetOption42 Device overtemp, turn off relays
|
||||||
|
|
||||||
AddLog(LOG_LEVEL_DEBUG, PSTR("NRG: Temperature %1_f"), &TasmotaGlobal.temperature_celsius);
|
AddLog(LOG_LEVEL_DEBUG, PSTR("NRG: Temperature %1_f"), &TasmotaGlobal.temperature_celsius);
|
||||||
|
@ -761,6 +762,13 @@ void CmndModuleAddress(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CmndEnergyConfig(void) {
|
||||||
|
Energy.command_code = CMND_ENERGYCONFIG;
|
||||||
|
if (XnrgCall(FUNC_COMMAND)) {
|
||||||
|
ResponseCmndDone();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef USE_ENERGY_MARGIN_DETECTION
|
#ifdef USE_ENERGY_MARGIN_DETECTION
|
||||||
void CmndPowerDelta(void) {
|
void CmndPowerDelta(void) {
|
||||||
if ((XdrvMailbox.index > 0) && (XdrvMailbox.index <= ENERGY_MAX_PHASES)) {
|
if ((XdrvMailbox.index > 0) && (XdrvMailbox.index <= ENERGY_MAX_PHASES)) {
|
||||||
|
|
|
@ -602,36 +602,31 @@ void HandleDomoticzConfiguration(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DomoticzSaveSettings(void) {
|
void DomoticzSaveSettings(void) {
|
||||||
char stemp[20];
|
char tmp1[CMDSZ];
|
||||||
char ssensor_indices[6 * MAX_DOMOTICZ_SNS_IDX];
|
WebGetArg(PSTR("ut"), tmp1, sizeof(tmp1));
|
||||||
char tmp[100];
|
char command[500];
|
||||||
|
snprintf_P(command, sizeof(command), PSTR(D_CMND_BACKLOG "0 " D_PRFX_DOMOTICZ D_CMND_UPDATETIMER " %s"),
|
||||||
for (uint32_t i = 0; i < MAX_DOMOTICZ_IDX; i++) {
|
(!strlen(tmp1)) ? STR(DOMOTICZ_UPDATE_TIMER) : tmp1);
|
||||||
snprintf_P(stemp, sizeof(stemp), PSTR("r%d"), i);
|
char arg_idx[8];
|
||||||
WebGetArg(stemp, tmp, sizeof(tmp));
|
char tmp2[CMDSZ];
|
||||||
Settings.domoticz_relay_idx[i] = (!strlen(tmp)) ? 0 : atoi(tmp);
|
char tmp3[CMDSZ];
|
||||||
snprintf_P(stemp, sizeof(stemp), PSTR("k%d"), i);
|
for (uint32_t i = 1; i <= MAX_DOMOTICZ_IDX; i++) {
|
||||||
WebGetArg(stemp, tmp, sizeof(tmp));
|
snprintf_P(arg_idx, sizeof(arg_idx), PSTR("r%d"), i -1);
|
||||||
Settings.domoticz_key_idx[i] = (!strlen(tmp)) ? 0 : atoi(tmp);
|
WebGetArg(arg_idx, tmp1, sizeof(tmp1));
|
||||||
snprintf_P(stemp, sizeof(stemp), PSTR("s%d"), i);
|
arg_idx[0] = 'k';
|
||||||
WebGetArg(stemp, tmp, sizeof(tmp));
|
WebGetArg(arg_idx, tmp2, sizeof(tmp2));
|
||||||
Settings.domoticz_switch_idx[i] = (!strlen(tmp)) ? 0 : atoi(tmp);
|
arg_idx[0] = 's';
|
||||||
|
WebGetArg(arg_idx, tmp3, sizeof(tmp3));
|
||||||
|
snprintf_P(command, sizeof(command),PSTR("%s;" D_PRFX_DOMOTICZ D_CMND_IDX "%d %s;" D_PRFX_DOMOTICZ D_CMND_KEYIDX "%d %s;" D_PRFX_DOMOTICZ D_CMND_SWITCHIDX "%d %s"),
|
||||||
|
command, i, (!strlen(tmp1)) ? "0" : tmp1, i, (!strlen(tmp2)) ? "0" : tmp2, i, (!strlen(tmp3)) ? "0" : tmp3);
|
||||||
}
|
}
|
||||||
ssensor_indices[0] = '\0';
|
for (uint32_t i = 1; i <= DZ_MAX_SENSORS; i++) {
|
||||||
for (uint32_t i = 0; i < DZ_MAX_SENSORS; i++) {
|
snprintf_P(arg_idx, sizeof(arg_idx), PSTR("l%d"), i -1);
|
||||||
snprintf_P(stemp, sizeof(stemp), PSTR("l%d"), i);
|
WebGetArg(arg_idx, tmp1, sizeof(tmp1));
|
||||||
WebGetArg(stemp, tmp, sizeof(tmp));
|
snprintf_P(command, sizeof(command),PSTR("%s;" D_PRFX_DOMOTICZ D_CMND_SENSORIDX "%d %s"),
|
||||||
Settings.domoticz_sensor_idx[i] = (!strlen(tmp)) ? 0 : atoi(tmp);
|
command, i, (!strlen(tmp1)) ? "0" : tmp1);
|
||||||
snprintf_P(ssensor_indices, sizeof(ssensor_indices), PSTR("%s%s%d"), ssensor_indices, (strlen(ssensor_indices)) ? "," : "", Settings.domoticz_sensor_idx[i]);
|
|
||||||
}
|
}
|
||||||
WebGetArg(PSTR("ut"), tmp, sizeof(tmp));
|
ExecuteWebCommand(command); // Note: beware of max number of commands in backlog currently 30 (MAX_BACKLOG)
|
||||||
Settings.domoticz_update_timer = (!strlen(tmp)) ? DOMOTICZ_UPDATE_TIMER : atoi(tmp);
|
|
||||||
|
|
||||||
AddLog_P(LOG_LEVEL_INFO, PSTR(D_LOG_DOMOTICZ D_CMND_IDX " %d,%d,%d,%d, " D_CMND_KEYIDX " %d,%d,%d,%d, " D_CMND_SWITCHIDX " %d,%d,%d,%d, " D_CMND_SENSORIDX " %s, " D_CMND_UPDATETIMER " %d"),
|
|
||||||
Settings.domoticz_relay_idx[0], Settings.domoticz_relay_idx[1], Settings.domoticz_relay_idx[2], Settings.domoticz_relay_idx[3],
|
|
||||||
Settings.domoticz_key_idx[0], Settings.domoticz_key_idx[1], Settings.domoticz_key_idx[2], Settings.domoticz_key_idx[3],
|
|
||||||
Settings.domoticz_switch_idx[0], Settings.domoticz_switch_idx[1], Settings.domoticz_switch_idx[2], Settings.domoticz_switch_idx[3],
|
|
||||||
ssensor_indices, Settings.domoticz_update_timer);
|
|
||||||
}
|
}
|
||||||
#endif // USE_WEBSERVER
|
#endif // USE_WEBSERVER
|
||||||
|
|
||||||
|
|
|
@ -269,6 +269,7 @@ void HlwDrvInit(void)
|
||||||
Energy.current_available = false;
|
Energy.current_available = false;
|
||||||
Energy.voltage_available = false;
|
Energy.voltage_available = false;
|
||||||
}
|
}
|
||||||
|
Energy.use_overtemp = true; // Use global temperature for overtemp detection
|
||||||
|
|
||||||
TasmotaGlobal.energy_driver = XNRG_01;
|
TasmotaGlobal.energy_driver = XNRG_01;
|
||||||
}
|
}
|
||||||
|
|
|
@ -221,7 +221,7 @@ void CseSnsInit(void) {
|
||||||
// Software serial init needs to be done here as earlier (serial) interrupts may lead to Exceptions
|
// Software serial init needs to be done here as earlier (serial) interrupts may lead to Exceptions
|
||||||
// CseSerial = new TasmotaSerial(Pin(GPIO_CSE7766_RX), Pin(GPIO_CSE7766_TX), 1);
|
// CseSerial = new TasmotaSerial(Pin(GPIO_CSE7766_RX), Pin(GPIO_CSE7766_TX), 1);
|
||||||
CseSerial = new TasmotaSerial(Pin(GPIO_CSE7766_RX), -1, 1);
|
CseSerial = new TasmotaSerial(Pin(GPIO_CSE7766_RX), -1, 1);
|
||||||
if (CseSerial->begin(4800, 2)) { // Fake Software Serial 8E1 by using two stop bits
|
if (CseSerial->begin(4800, SERIAL_8E1)) {
|
||||||
if (CseSerial->hardwareSerial()) {
|
if (CseSerial->hardwareSerial()) {
|
||||||
SetSerial(4800, TS_SERIAL_8E1);
|
SetSerial(4800, TS_SERIAL_8E1);
|
||||||
ClaimSerial();
|
ClaimSerial();
|
||||||
|
@ -230,6 +230,7 @@ void CseSnsInit(void) {
|
||||||
Settings.param[P_CSE7766_INVALID_POWER] = CSE_MAX_INVALID_POWER; // SetOption39 1..255
|
Settings.param[P_CSE7766_INVALID_POWER] = CSE_MAX_INVALID_POWER; // SetOption39 1..255
|
||||||
}
|
}
|
||||||
Cse.power_invalid = Settings.param[P_CSE7766_INVALID_POWER];
|
Cse.power_invalid = Settings.param[P_CSE7766_INVALID_POWER];
|
||||||
|
Energy.use_overtemp = true; // Use global temperature for overtemp detection
|
||||||
} else {
|
} else {
|
||||||
TasmotaGlobal.energy_driver = ENERGY_NONE;
|
TasmotaGlobal.energy_driver = ENERGY_NONE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -573,6 +573,7 @@ void McpSnsInit(void)
|
||||||
mcp_buffer = (char*)(malloc(MCP_BUFFER_SIZE));
|
mcp_buffer = (char*)(malloc(MCP_BUFFER_SIZE));
|
||||||
}
|
}
|
||||||
DigitalWrite(GPIO_MCP39F5_RST, 0, 1); // MCP enable
|
DigitalWrite(GPIO_MCP39F5_RST, 0, 1); // MCP enable
|
||||||
|
Energy.use_overtemp = true; // Use global temperature for overtemp detection
|
||||||
} else {
|
} else {
|
||||||
TasmotaGlobal.energy_driver = ENERGY_NONE;
|
TasmotaGlobal.energy_driver = ENERGY_NONE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -215,6 +215,7 @@ void Ade7953DrvInit(void)
|
||||||
Energy.phase_count = 2; // Handle two channels as two phases
|
Energy.phase_count = 2; // Handle two channels as two phases
|
||||||
Energy.voltage_common = true; // Use common voltage
|
Energy.voltage_common = true; // Use common voltage
|
||||||
Energy.frequency_common = true; // Use common frequency
|
Energy.frequency_common = true; // Use common frequency
|
||||||
|
Energy.use_overtemp = true; // Use global temperature for overtemp detection
|
||||||
TasmotaGlobal.energy_driver = XNRG_07;
|
TasmotaGlobal.energy_driver = XNRG_07;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -219,6 +219,7 @@ void Bl0940SnsInit(void) {
|
||||||
Settings.energy_current_calibration = BL0940_IREF;
|
Settings.energy_current_calibration = BL0940_IREF;
|
||||||
Settings.energy_power_calibration = BL0940_PREF;
|
Settings.energy_power_calibration = BL0940_PREF;
|
||||||
}
|
}
|
||||||
|
Energy.use_overtemp = true; // Use global temperature for overtemp detection
|
||||||
|
|
||||||
for (uint32_t i = 0; i < 5; i++) {
|
for (uint32_t i = 0; i < 5; i++) {
|
||||||
for (uint32_t j = 0; j < 6; j++) {
|
for (uint32_t j = 0; j < 6; j++) {
|
||||||
|
|
|
@ -600,6 +600,7 @@ void Cse7761DrvInit(void) {
|
||||||
#ifdef CSE7761_FREQUENCY
|
#ifdef CSE7761_FREQUENCY
|
||||||
Energy.frequency_common = true; // Use common frequency
|
Energy.frequency_common = true; // Use common frequency
|
||||||
#endif
|
#endif
|
||||||
|
Energy.use_overtemp = true; // Use global temperature for overtemp detection
|
||||||
TasmotaGlobal.energy_driver = XNRG_19;
|
TasmotaGlobal.energy_driver = XNRG_19;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#define NRG_DUMMY_U_COMMON true // Phase voltage = false, Common voltage = true
|
#define NRG_DUMMY_U_COMMON true // Phase voltage = false, Common voltage = true
|
||||||
#define NRG_DUMMY_F_COMMON true // Phase frequency = false, Common frequency = true
|
#define NRG_DUMMY_F_COMMON true // Phase frequency = false, Common frequency = true
|
||||||
#define NRG_DUMMY_DC false // AC = false, DC = true;
|
#define NRG_DUMMY_DC false // AC = false, DC = true;
|
||||||
|
#define NRG_DUMMY_OVERTEMP true // Use global temperature for overtemp detection
|
||||||
|
|
||||||
#define NRG_DUMMY_UREF 24000 // Voltage 240.00 V (= P / I)
|
#define NRG_DUMMY_UREF 24000 // Voltage 240.00 V (= P / I)
|
||||||
#define NRG_DUMMY_IREF 41666 // Current 0.417 A (= P / U)
|
#define NRG_DUMMY_IREF 41666 // Current 0.417 A (= P / U)
|
||||||
|
@ -99,6 +100,10 @@ bool NrgDummyCommand(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (CMND_ENERGYCONFIG == Energy.command_code) {
|
||||||
|
AddLog_P(LOG_LEVEL_DEBUG, PSTR("NRG: Config index %d, payload %d, data '%s'"),
|
||||||
|
XdrvMailbox.index, XdrvMailbox.payload, XdrvMailbox.data ? XdrvMailbox.data : "null" );
|
||||||
|
}
|
||||||
else serviced = false; // Unknown command
|
else serviced = false; // Unknown command
|
||||||
|
|
||||||
return serviced;
|
return serviced;
|
||||||
|
@ -117,6 +122,7 @@ void NrgDummyDrvInit(void) {
|
||||||
Energy.voltage_common = NRG_DUMMY_U_COMMON; // Phase voltage = false, Common voltage = true
|
Energy.voltage_common = NRG_DUMMY_U_COMMON; // Phase voltage = false, Common voltage = true
|
||||||
Energy.frequency_common = NRG_DUMMY_F_COMMON; // Phase frequency = false, Common frequency = true
|
Energy.frequency_common = NRG_DUMMY_F_COMMON; // Phase frequency = false, Common frequency = true
|
||||||
Energy.type_dc = NRG_DUMMY_DC; // AC = false, DC = true;
|
Energy.type_dc = NRG_DUMMY_DC; // AC = false, DC = true;
|
||||||
|
Energy.use_overtemp = NRG_DUMMY_OVERTEMP; // Use global temperature for overtemp detection
|
||||||
|
|
||||||
TasmotaGlobal.energy_driver = XNRG_20;
|
TasmotaGlobal.energy_driver = XNRG_20;
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,8 +233,10 @@ int advertismentCallback(BLE_ESP32::ble_advertisment_t *pStruct)
|
||||||
memcpy(UUID,oBeacon.getProximityUUID().getNative()->u128.value,16);
|
memcpy(UUID,oBeacon.getProximityUUID().getNative()->u128.value,16);
|
||||||
ESP32BLE_ReverseStr(UUID,16);
|
ESP32BLE_ReverseStr(UUID,16);
|
||||||
|
|
||||||
uint16_t Major = ENDIAN_CHANGE_U16(oBeacon.getMajor());
|
// uint16_t Major = ENDIAN_CHANGE_U16(oBeacon.getMajor());
|
||||||
uint16_t Minor = ENDIAN_CHANGE_U16(oBeacon.getMinor());
|
// uint16_t Minor = ENDIAN_CHANGE_U16(oBeacon.getMinor());
|
||||||
|
uint16_t Major = oBeacon.getMajor();
|
||||||
|
uint16_t Minor = oBeacon.getMinor();
|
||||||
uint8_t PWR = oBeacon.getSignalPower();
|
uint8_t PWR = oBeacon.getSignalPower();
|
||||||
|
|
||||||
DumpHex((const unsigned char*)&UUID,16,ib.UID);
|
DumpHex((const unsigned char*)&UUID,16,ib.UID);
|
||||||
|
@ -337,7 +339,7 @@ uint32_t ibeacon_add(struct IBEACON *ib) {
|
||||||
if (!strncmp(ib->MAC,"FFFF",4) || strncmp(ib->FACID,"00000000",8)) {
|
if (!strncmp(ib->MAC,"FFFF",4) || strncmp(ib->FACID,"00000000",8)) {
|
||||||
for (uint32_t cnt=0;cnt<MAX_IBEACONS;cnt++) {
|
for (uint32_t cnt=0;cnt<MAX_IBEACONS;cnt++) {
|
||||||
if (ibeacons[cnt].FLAGS) {
|
if (ibeacons[cnt].FLAGS) {
|
||||||
if (!strncmp_P(ib->UID,PSTR("00000000000000000000000000000000"),32)) {
|
// if (!strncmp_P(ib->UID,PSTR("00000000000000000000000000000000"),32)) {
|
||||||
if (!strncmp(ibeacons[cnt].MAC,ib->MAC,12)) {
|
if (!strncmp(ibeacons[cnt].MAC,ib->MAC,12)) {
|
||||||
// exists
|
// exists
|
||||||
strncpy(ibeacons[cnt].NAME,ib->NAME,sizeof(ibeacons[cnt].NAME));
|
strncpy(ibeacons[cnt].NAME,ib->NAME,sizeof(ibeacons[cnt].NAME));
|
||||||
|
@ -350,7 +352,7 @@ uint32_t ibeacon_add(struct IBEACON *ib) {
|
||||||
ibeacons[cnt].count++;
|
ibeacons[cnt].count++;
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
} else {
|
/* } else {
|
||||||
if (!strncmp(ibeacons[cnt].UID,ib->UID,32)) {
|
if (!strncmp(ibeacons[cnt].UID,ib->UID,32)) {
|
||||||
// exists
|
// exists
|
||||||
strncpy(ibeacons[cnt].NAME,ib->NAME,sizeof(ibeacons[cnt].NAME));
|
strncpy(ibeacons[cnt].NAME,ib->NAME,sizeof(ibeacons[cnt].NAME));
|
||||||
|
@ -363,7 +365,7 @@ uint32_t ibeacon_add(struct IBEACON *ib) {
|
||||||
ibeacons[cnt].count++;
|
ibeacons[cnt].count++;
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (uint32_t cnt=0;cnt<MAX_IBEACONS;cnt++) {
|
for (uint32_t cnt=0;cnt<MAX_IBEACONS;cnt++) {
|
||||||
|
|
Loading…
Reference in New Issue