mirror of https://github.com/arendst/Tasmota.git
Remove HLW Power Timer (#759)
This commit is contained in:
parent
0de07df099
commit
65681a7054
|
@ -1,7 +1,7 @@
|
|||
## Sonoff-Tasmota
|
||||
Provide ESP8266 based Sonoff by [iTead Studio](https://www.itead.cc/) and ElectroDragon IoT Relay with Serial, Web and MQTT control allowing 'Over the Air' or OTA firmware updates using Arduino IDE.
|
||||
|
||||
Current version is **5.6.1d** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/master/sonoff/_releasenotes.ino) for change information.
|
||||
Current version is **5.6.1e** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/master/sonoff/_releasenotes.ino) for change information.
|
||||
|
||||
### ATTENTION All versions
|
||||
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
/* 5.6.1d
|
||||
/* 5.6.1e
|
||||
* Remove Sonoff Pow HLW power timer to enable low power readings. Unstable below 3W due to used hardware. (#759)
|
||||
*
|
||||
* 5.6.1d
|
||||
* Fix settings order during startup to allow for displaying debug messages
|
||||
* Add more Sonoff Pow range checking (#772)
|
||||
*
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
- Select IDE Tools - Flash Size: "1M (no SPIFFS)"
|
||||
====================================================*/
|
||||
|
||||
#define VERSION 0x05060104 // 5.6.1d
|
||||
#define VERSION 0x05060105 // 5.6.1e
|
||||
|
||||
enum log_t {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE, LOG_LEVEL_ALL};
|
||||
enum week_t {Last, First, Second, Third, Fourth};
|
||||
|
|
|
@ -48,7 +48,6 @@ byte hlw_mkwh_state = 0;
|
|||
#endif // FEATURE_POWER_LIMIT
|
||||
|
||||
byte hlw_SELflag;
|
||||
byte hlw_cf_timer;
|
||||
byte hlw_cf1_timer;
|
||||
byte hlw_fifth_second;
|
||||
byte hlw_startup;
|
||||
|
@ -79,10 +78,6 @@ void hlw_cf_interrupt() // Service Power
|
|||
{
|
||||
hlw_cf_plen = micros() - hlw_cf_last;
|
||||
hlw_cf_last = micros();
|
||||
if (hlw_cf_plen > 4000000) { // 4 seconds
|
||||
hlw_cf_plen = 0; // Just powered on
|
||||
}
|
||||
hlw_cf_timer = 15; // Support down to 4W which takes about 3 seconds
|
||||
hlw_EDcntr++;
|
||||
hlw_Ecntr++;
|
||||
}
|
||||
|
@ -138,13 +133,6 @@ void hlw_200mS()
|
|||
}
|
||||
}
|
||||
|
||||
if (hlw_cf_timer) {
|
||||
hlw_cf_timer--;
|
||||
if (!hlw_cf_timer) {
|
||||
hlw_cf_plen = 0; // No load for over 3 seconds
|
||||
}
|
||||
}
|
||||
|
||||
hlw_cf1_timer++;
|
||||
if (hlw_cf1_timer >= 8) {
|
||||
hlw_cf1_timer = 0;
|
||||
|
@ -193,6 +181,9 @@ void hlw_readEnergy(byte option, float &et, float &ed, float &e, float &w, float
|
|||
//snprintf_P(log, sizeof(log), PSTR("HLW: CF %d, CF1U %d (%d), CF1I %d (%d)"), hlw_cf_plen, hlw_cf1u_plen, hlw_cf1u_pcntmax, hlw_cf1i_plen, hlw_cf1i_pcntmax);
|
||||
//addLog(LOG_LEVEL_DEBUG, log);
|
||||
|
||||
if (!(power &1)) {
|
||||
hlw_cf_plen = 0; // Powered off
|
||||
}
|
||||
et = (float)(rtcMem.hlw_kWhtotal + (cur_kWhtoday / 1000)) / 100000;
|
||||
ed = 0;
|
||||
if (cur_kWhtoday) {
|
||||
|
@ -224,7 +215,7 @@ void hlw_readEnergy(byte option, float &et, float &ed, float &e, float &w, float
|
|||
w = (float)hlw_w / 10;
|
||||
}
|
||||
u = 0;
|
||||
if (hlw_cf1u_plen && (w || (power &1))) {
|
||||
if (hlw_cf1u_plen && w) {
|
||||
hlw_u = (HLW_UREF * sysCfg.hlw_ucal) / hlw_cf1u_plen;
|
||||
u = (float)hlw_u / 10;
|
||||
}
|
||||
|
@ -276,7 +267,6 @@ void hlw_init()
|
|||
hlw_startup = 1;
|
||||
hlw_lasttime = 0;
|
||||
hlw_fifth_second = 0;
|
||||
hlw_cf_timer = 0;
|
||||
hlw_cf1_timer = 0;
|
||||
tickerHLW.attach_ms(200, hlw_200mS);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue