From 67aaa2777c89d04c789d4b762385b997c5710a36 Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Mon, 30 Apr 2018 11:10:38 +0200 Subject: [PATCH 1/4] Revert "Fix Energy Today and Yesterday overflow" This reverts commit c86a9f8e5321f86dc60a2370f6ecc59c431afb30. --- README.md | 2 +- sonoff/_releasenotes.ino | 5 +---- sonoff/settings.ino | 6 +----- sonoff/sonoff.ino | 2 +- sonoff/xdrv_03_energy.ino | 35 +++++++++++++++++------------------ 5 files changed, 21 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index f4b869751..8d55383d2 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ If you like **Sonoff-Tasmota**, give it a star, or fork it and contribute! ### Development: [![Build Status](https://img.shields.io/travis/arendst/Sonoff-Tasmota.svg)](https://travis-ci.org/arendst/Sonoff-Tasmota) -Current version is **5.12.0o** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information. +Current version is **5.12.0n** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information. ### Quick install Download one of the released binaries from https://github.com/arendst/Sonoff-Tasmota/releases and flash it to your hardware as documented in the wiki. diff --git a/sonoff/_releasenotes.ino b/sonoff/_releasenotes.ino index 804fc4068..d7bed584e 100644 --- a/sonoff/_releasenotes.ino +++ b/sonoff/_releasenotes.ino @@ -1,7 +1,4 @@ -/* 5.12.0o - * Fix Energy Today and Yesterday overflow (#2543) - * - * 5.12.0n +/* 5.12.0n * Change ESP8266 Analog JSON message from {"Analog0:123"} to {"ANALOG":{"A0:123"}} to accomodate rules (#2560) * Change Counter JSON message from {"Counter1":0,"Counter3":0} to {"COUNTER":{"C1":0,"C3":0}} to accomodate rules * Change ADS1115 JSON message from {"ADS1115":{"Analog0":123,"Analog1":123}} to {"ADS1115":{"A0":123,"A1":123}} diff --git a/sonoff/settings.ino b/sonoff/settings.ino index 059383d72..579862457 100644 --- a/sonoff/settings.ino +++ b/sonoff/settings.ino @@ -851,11 +851,7 @@ void SettingsDelta() Settings.knx_CB_registered = 0; memset(&Settings.knx_physsical_addr, 0x00, 0x800 - 0x6b8); // Reset until 0x800 for future use } - if (Settings.version < 0x050C000F) { - Settings.energy_kWhtoday /= 1000; - Settings.energy_kWhyesterday /= 1000; - RtcSettings.energy_kWhtoday /= 1000; - } + Settings.version = VERSION; SettingsSave(1); } diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index ef8708617..2da537983 100644 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -25,7 +25,7 @@ - Select IDE Tools - Flash Size: "1M (no SPIFFS)" ====================================================*/ -#define VERSION 0x050C000F // 5.12.0o +#define VERSION 0x050C000E // 5.12.0n // Location specific includes #include // Arduino_Esp8266 version information (ARDUINO_ESP8266_RELEASE and ARDUINO_ESP8266_RELEASE_2_3_0) diff --git a/sonoff/xdrv_03_energy.ino b/sonoff/xdrv_03_energy.ino index db43cc670..fc70751bf 100644 --- a/sonoff/xdrv_03_energy.ino +++ b/sonoff/xdrv_03_energy.ino @@ -47,12 +47,11 @@ float energy_voltage = 0; // 123.1 V float energy_current = 0; // 123.123 A float energy_power = 0; // 123.1 W float energy_power_factor = 0; // 0.12 -float energy_daily = 0; // 123.123 kWh +float energy_daily = 0; // 12.123 kWh float energy_total = 0; // 12345.12345 kWh float energy_start = 0; // 12345.12345 kWh total previous -unsigned long energy_kWhtoday; // 12312312 Wh * 10^-2 (deca milli Watt hours) - 5764 = 0.05764 kWh = 0.058 kWh = energy_daily -unsigned long energy_period = 0; // 12312312 Wh * 10^-2 (deca milli Watt hours) - 5764 = 0.05764 kWh = 0.058 kWh = energy_daily - +unsigned long energy_kWhtoday; // 1212312345 Wh * 10^-5 (deca micro Watt hours) - 5763924 = 0.05763924 kWh = 0.058 kWh = energy_daily +unsigned long energy_period = 0; // 1212312345 Wh * 10^-5 (deca micro Watt hours) - 5763924 = 0.05763924 kWh = 0.058 kWh = energy_daily float energy_power_last[3] = { 0 }; uint8_t energy_power_delta = 0; @@ -83,8 +82,8 @@ Ticker ticker_energy; void EnergyUpdateToday() { RtcSettings.energy_kWhtoday = energy_kWhtoday; - energy_daily = (float)energy_kWhtoday / 100000; - energy_total = (float)(RtcSettings.energy_kWhtotal + energy_kWhtoday) / 100000; + energy_daily = (float)energy_kWhtoday / 100000000; + energy_total = (float)(RtcSettings.energy_kWhtotal + (energy_kWhtoday / 1000)) / 100000; } /*********************************************************************************************\ @@ -157,7 +156,7 @@ void HlwEverySecond() hlw_len = 10000 / hlw_energy_period_counter; hlw_energy_period_counter = 0; if (hlw_len) { - energy_kWhtoday += ((HLW_PREF * Settings.energy_power_calibration) / hlw_len) / 36000; + energy_kWhtoday += ((HLW_PREF * Settings.energy_power_calibration) / hlw_len) / 36; EnergyUpdateToday(); } } @@ -391,7 +390,7 @@ void CseEverySecond() } if (cf_frequency && energy_power) { cf_pulses_last_time = cf_pulses; - energy_kWhtoday += (cf_frequency * Settings.energy_power_calibration) / 36000; + energy_kWhtoday += (cf_frequency * Settings.energy_power_calibration) / 36; EnergyUpdateToday(); } } @@ -540,7 +539,7 @@ void PzemEvery200ms() break; case 4: // Total energy as 99999Wh if (!energy_start || (value < energy_start)) energy_start = value; // Init after restart and hanlde roll-over if any - energy_kWhtoday += (value - energy_start) * 100; + energy_kWhtoday += (value - energy_start) * 100000; energy_start = value; EnergyUpdateToday(); break; @@ -580,7 +579,7 @@ void Energy200ms() if (RtcTime.valid) { if (LocalTime() == Midnight()) { Settings.energy_kWhyesterday = energy_kWhtoday; - Settings.energy_kWhtotal += energy_kWhtoday; + Settings.energy_kWhtotal += (energy_kWhtoday / 1000); RtcSettings.energy_kWhtotal = Settings.energy_kWhtotal; energy_kWhtoday = 0; energy_period = energy_kWhtoday; @@ -852,14 +851,14 @@ boolean EnergyCommand() if (p != XdrvMailbox.data) { switch (XdrvMailbox.index) { case 1: - energy_kWhtoday = lnum *100; + energy_kWhtoday = lnum *100000; energy_period = energy_kWhtoday; Settings.energy_kWhtoday = energy_kWhtoday; RtcSettings.energy_kWhtoday = energy_kWhtoday; - energy_daily = (float)energy_kWhtoday / 100000; + energy_daily = (float)energy_kWhtoday / 100000000; break; case 2: - Settings.energy_kWhyesterday = lnum *100; + Settings.energy_kWhyesterday = lnum *100000; break; case 3: RtcSettings.energy_kWhtotal = lnum *100; @@ -870,9 +869,9 @@ boolean EnergyCommand() char energy_yesterday_chr[10]; char stoday_energy[10]; char energy_total_chr[10]; - dtostrfd((float)Settings.energy_kWhyesterday / 100000, Settings.flag2.energy_resolution, energy_yesterday_chr); - dtostrfd((float)RtcSettings.energy_kWhtoday / 100000, Settings.flag2.energy_resolution, stoday_energy); - dtostrfd((float)(RtcSettings.energy_kWhtotal + energy_kWhtoday) / 100000, Settings.flag2.energy_resolution, energy_total_chr); + dtostrfd((float)Settings.energy_kWhyesterday / 100000000, Settings.flag2.energy_resolution, energy_yesterday_chr); + dtostrfd((float)RtcSettings.energy_kWhtoday / 100000000, Settings.flag2.energy_resolution, stoday_energy); + dtostrfd((float)(RtcSettings.energy_kWhtotal + (energy_kWhtoday / 1000)) / 100000, Settings.flag2.energy_resolution, energy_total_chr); snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"%s\":{\"" D_JSON_TOTAL "\":%s,\"" D_JSON_YESTERDAY "\":%s,\"" D_JSON_TODAY "\":%s}}"), command, energy_total_chr, energy_yesterday_chr, stoday_energy); status_flag = 1; @@ -1074,7 +1073,7 @@ void EnergyShow(boolean json) float energy = 0; if (show_energy_period) { - if (energy_period) energy = (float)(energy_kWhtoday - energy_period) / 100; + if (energy_period) energy = (float)(energy_kWhtoday - energy_period) / 100000; energy_period = energy_kWhtoday; } @@ -1085,7 +1084,7 @@ void EnergyShow(boolean json) dtostrfd(energy_voltage, Settings.flag2.voltage_resolution, energy_voltage_chr); dtostrfd(energy_current, Settings.flag2.current_resolution, energy_current_chr); dtostrfd(energy_power_factor, 2, energy_power_factor_chr); - dtostrfd((float)Settings.energy_kWhyesterday / 100000, Settings.flag2.energy_resolution, energy_yesterday_chr); + dtostrfd((float)Settings.energy_kWhyesterday / 100000000, Settings.flag2.energy_resolution, energy_yesterday_chr); if (json) { snprintf_P(speriod, sizeof(speriod), PSTR(",\"" D_JSON_PERIOD "\":%s"), energy_period_chr); From 040a7adaf18ac30241a09895b899bf922ed61cdc Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Mon, 30 Apr 2018 12:07:48 +0200 Subject: [PATCH 2/4] v5.12.0o - Fix Energy Today overflow 5.12.0o * Fix Energy Today and Yesterday overflow (#2543) --- README.md | 2 +- sonoff/_releasenotes.ino | 5 ++++- sonoff/settings.ino | 6 +++++- sonoff/sonoff.ino | 2 +- sonoff/xdrv_03_energy.ino | 43 +++++++++++++++++++++++---------------- 5 files changed, 37 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 8d55383d2..f4b869751 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ If you like **Sonoff-Tasmota**, give it a star, or fork it and contribute! ### Development: [![Build Status](https://img.shields.io/travis/arendst/Sonoff-Tasmota.svg)](https://travis-ci.org/arendst/Sonoff-Tasmota) -Current version is **5.12.0n** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information. +Current version is **5.12.0o** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information. ### Quick install Download one of the released binaries from https://github.com/arendst/Sonoff-Tasmota/releases and flash it to your hardware as documented in the wiki. diff --git a/sonoff/_releasenotes.ino b/sonoff/_releasenotes.ino index d7bed584e..804fc4068 100644 --- a/sonoff/_releasenotes.ino +++ b/sonoff/_releasenotes.ino @@ -1,4 +1,7 @@ -/* 5.12.0n +/* 5.12.0o + * Fix Energy Today and Yesterday overflow (#2543) + * + * 5.12.0n * Change ESP8266 Analog JSON message from {"Analog0:123"} to {"ANALOG":{"A0:123"}} to accomodate rules (#2560) * Change Counter JSON message from {"Counter1":0,"Counter3":0} to {"COUNTER":{"C1":0,"C3":0}} to accomodate rules * Change ADS1115 JSON message from {"ADS1115":{"Analog0":123,"Analog1":123}} to {"ADS1115":{"A0":123,"A1":123}} diff --git a/sonoff/settings.ino b/sonoff/settings.ino index 579862457..059383d72 100644 --- a/sonoff/settings.ino +++ b/sonoff/settings.ino @@ -851,7 +851,11 @@ void SettingsDelta() Settings.knx_CB_registered = 0; memset(&Settings.knx_physsical_addr, 0x00, 0x800 - 0x6b8); // Reset until 0x800 for future use } - + if (Settings.version < 0x050C000F) { + Settings.energy_kWhtoday /= 1000; + Settings.energy_kWhyesterday /= 1000; + RtcSettings.energy_kWhtoday /= 1000; + } Settings.version = VERSION; SettingsSave(1); } diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index 2da537983..ef8708617 100644 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -25,7 +25,7 @@ - Select IDE Tools - Flash Size: "1M (no SPIFFS)" ====================================================*/ -#define VERSION 0x050C000E // 5.12.0n +#define VERSION 0x050C000F // 5.12.0o // Location specific includes #include // Arduino_Esp8266 version information (ARDUINO_ESP8266_RELEASE and ARDUINO_ESP8266_RELEASE_2_3_0) diff --git a/sonoff/xdrv_03_energy.ino b/sonoff/xdrv_03_energy.ino index fc70751bf..264613429 100644 --- a/sonoff/xdrv_03_energy.ino +++ b/sonoff/xdrv_03_energy.ino @@ -47,11 +47,12 @@ float energy_voltage = 0; // 123.1 V float energy_current = 0; // 123.123 A float energy_power = 0; // 123.1 W float energy_power_factor = 0; // 0.12 -float energy_daily = 0; // 12.123 kWh +float energy_daily = 0; // 123.123 kWh float energy_total = 0; // 12345.12345 kWh float energy_start = 0; // 12345.12345 kWh total previous -unsigned long energy_kWhtoday; // 1212312345 Wh * 10^-5 (deca micro Watt hours) - 5763924 = 0.05763924 kWh = 0.058 kWh = energy_daily -unsigned long energy_period = 0; // 1212312345 Wh * 10^-5 (deca micro Watt hours) - 5763924 = 0.05763924 kWh = 0.058 kWh = energy_daily +unsigned long energy_kWhtoday_delta = 0; // 1212312345 Wh 10^-5 (deca micro Watt hours) - Overflows to energy_kWhtoday (HLW and CSE only) +unsigned long energy_kWhtoday; // 12312312 Wh * 10^-2 (deca milli Watt hours) - 5764 = 0.05764 kWh = 0.058 kWh = energy_daily +unsigned long energy_period = 0; // 12312312 Wh * 10^-2 (deca milli Watt hours) - 5764 = 0.05764 kWh = 0.058 kWh = energy_daily float energy_power_last[3] = { 0 }; uint8_t energy_power_delta = 0; @@ -81,9 +82,14 @@ Ticker ticker_energy; void EnergyUpdateToday() { + if (energy_kWhtoday_delta > 1000) { + unsigned long delta = energy_kWhtoday_delta / 1000; + energy_kWhtoday_delta -= (delta * 1000); + energy_kWhtoday += delta; + } RtcSettings.energy_kWhtoday = energy_kWhtoday; - energy_daily = (float)energy_kWhtoday / 100000000; - energy_total = (float)(RtcSettings.energy_kWhtotal + (energy_kWhtoday / 1000)) / 100000; + energy_daily = (float)energy_kWhtoday / 100000; + energy_total = (float)(RtcSettings.energy_kWhtotal + energy_kWhtoday) / 100000; } /*********************************************************************************************\ @@ -156,7 +162,7 @@ void HlwEverySecond() hlw_len = 10000 / hlw_energy_period_counter; hlw_energy_period_counter = 0; if (hlw_len) { - energy_kWhtoday += ((HLW_PREF * Settings.energy_power_calibration) / hlw_len) / 36; + energy_kWhtoday_delta += ((HLW_PREF * Settings.energy_power_calibration) / hlw_len) / 36; EnergyUpdateToday(); } } @@ -390,7 +396,7 @@ void CseEverySecond() } if (cf_frequency && energy_power) { cf_pulses_last_time = cf_pulses; - energy_kWhtoday += (cf_frequency * Settings.energy_power_calibration) / 36; + energy_kWhtoday_delta += (cf_frequency * Settings.energy_power_calibration) / 36; EnergyUpdateToday(); } } @@ -539,7 +545,7 @@ void PzemEvery200ms() break; case 4: // Total energy as 99999Wh if (!energy_start || (value < energy_start)) energy_start = value; // Init after restart and hanlde roll-over if any - energy_kWhtoday += (value - energy_start) * 100000; + energy_kWhtoday += (value - energy_start) * 100; energy_start = value; EnergyUpdateToday(); break; @@ -579,9 +585,10 @@ void Energy200ms() if (RtcTime.valid) { if (LocalTime() == Midnight()) { Settings.energy_kWhyesterday = energy_kWhtoday; - Settings.energy_kWhtotal += (energy_kWhtoday / 1000); + Settings.energy_kWhtotal += energy_kWhtoday; RtcSettings.energy_kWhtotal = Settings.energy_kWhtotal; energy_kWhtoday = 0; + energy_kWhtoday_delta = 0; energy_period = energy_kWhtoday; EnergyUpdateToday(); energy_max_energy_state = 3; @@ -851,14 +858,15 @@ boolean EnergyCommand() if (p != XdrvMailbox.data) { switch (XdrvMailbox.index) { case 1: - energy_kWhtoday = lnum *100000; + energy_kWhtoday = lnum *100; + energy_kWhtoday_delta = 0; energy_period = energy_kWhtoday; Settings.energy_kWhtoday = energy_kWhtoday; RtcSettings.energy_kWhtoday = energy_kWhtoday; - energy_daily = (float)energy_kWhtoday / 100000000; + energy_daily = (float)energy_kWhtoday / 100000; break; case 2: - Settings.energy_kWhyesterday = lnum *100000; + Settings.energy_kWhyesterday = lnum *100; break; case 3: RtcSettings.energy_kWhtotal = lnum *100; @@ -869,9 +877,9 @@ boolean EnergyCommand() char energy_yesterday_chr[10]; char stoday_energy[10]; char energy_total_chr[10]; - dtostrfd((float)Settings.energy_kWhyesterday / 100000000, Settings.flag2.energy_resolution, energy_yesterday_chr); - dtostrfd((float)RtcSettings.energy_kWhtoday / 100000000, Settings.flag2.energy_resolution, stoday_energy); - dtostrfd((float)(RtcSettings.energy_kWhtotal + (energy_kWhtoday / 1000)) / 100000, Settings.flag2.energy_resolution, energy_total_chr); + dtostrfd((float)Settings.energy_kWhyesterday / 100000, Settings.flag2.energy_resolution, energy_yesterday_chr); + dtostrfd((float)RtcSettings.energy_kWhtoday / 100000, Settings.flag2.energy_resolution, stoday_energy); + dtostrfd((float)(RtcSettings.energy_kWhtotal + energy_kWhtoday) / 100000, Settings.flag2.energy_resolution, energy_total_chr); snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"%s\":{\"" D_JSON_TOTAL "\":%s,\"" D_JSON_YESTERDAY "\":%s,\"" D_JSON_TODAY "\":%s}}"), command, energy_total_chr, energy_yesterday_chr, stoday_energy); status_flag = 1; @@ -1040,6 +1048,7 @@ void EnergySnsInit() if (energy_flg) { energy_kWhtoday = (RtcSettingsValid()) ? RtcSettings.energy_kWhtoday : (RtcTime.day_of_year == Settings.energy_kWhdoy) ? Settings.energy_kWhtoday : 0; + energy_kWhtoday_delta = 0; energy_period = energy_kWhtoday; EnergyUpdateToday(); ticker_energy.attach_ms(200, Energy200ms); @@ -1073,7 +1082,7 @@ void EnergyShow(boolean json) float energy = 0; if (show_energy_period) { - if (energy_period) energy = (float)(energy_kWhtoday - energy_period) / 100000; + if (energy_period) energy = (float)(energy_kWhtoday - energy_period) / 100; energy_period = energy_kWhtoday; } @@ -1084,7 +1093,7 @@ void EnergyShow(boolean json) dtostrfd(energy_voltage, Settings.flag2.voltage_resolution, energy_voltage_chr); dtostrfd(energy_current, Settings.flag2.current_resolution, energy_current_chr); dtostrfd(energy_power_factor, 2, energy_power_factor_chr); - dtostrfd((float)Settings.energy_kWhyesterday / 100000000, Settings.flag2.energy_resolution, energy_yesterday_chr); + dtostrfd((float)Settings.energy_kWhyesterday / 100000, Settings.flag2.energy_resolution, energy_yesterday_chr); if (json) { snprintf_P(speriod, sizeof(speriod), PSTR(",\"" D_JSON_PERIOD "\":%s"), energy_period_chr); From 2c94ecfb6d1d1531d42cd655fafce83845fd2fbc Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Mon, 30 Apr 2018 14:18:46 +0200 Subject: [PATCH 3/4] Fix uptime 17651+ days 5.12.0o * Fix NTP sync to Thu Jan 01 08:00:10 1970 results in uptime 17651+ days (core2.4.1/sdk2.2.1) --- sonoff/_releasenotes.ino | 1 + sonoff/support.ino | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sonoff/_releasenotes.ino b/sonoff/_releasenotes.ino index 804fc4068..0cb14f97b 100644 --- a/sonoff/_releasenotes.ino +++ b/sonoff/_releasenotes.ino @@ -1,5 +1,6 @@ /* 5.12.0o * Fix Energy Today and Yesterday overflow (#2543) + * Fix NTP sync to Thu Jan 01 08:00:10 1970 results in uptime 17651+ days (core2.4.1/sdk2.2.1) * * 5.12.0n * Change ESP8266 Analog JSON message from {"Analog0:123"} to {"ANALOG":{"A0:123"}} to accomodate rules (#2560) diff --git a/sonoff/support.ino b/sonoff/support.ino index 78ac10c0c..a33c81a1a 100644 --- a/sonoff/support.ino +++ b/sonoff/support.ino @@ -1314,7 +1314,7 @@ void RtcSecond() uint8_t offset = (uptime < 30) ? RtcTime.second : (((ESP.getChipId() & 0xF) * 3) + 3) ; // First try ASAP to sync. If fails try once every 60 seconds based on chip id if ((WL_CONNECTED == WiFi.status()) && (offset == RtcTime.second) && ((RtcTime.year < 2016) || (ntp_sync_minute == RtcTime.minute))) { ntp_time = sntp_get_current_timestamp(); - if (ntp_time) { + if (ntp_time > 1451602800) { // Fix NTP bug in core 2.4.1/SDK 2.2.1 (returns Thu Jan 01 08:00:10 1970 after power on) utc_time = ntp_time; ntp_sync_minute = 60; // Sync so block further requests if (restart_time == 0) { From 962a50452c55f3ae3a06d808c53af82960597426 Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Mon, 30 Apr 2018 17:35:42 +0200 Subject: [PATCH 4/4] v5.13.0 Sync with master --- README.md | 2 +- sonoff/_releasenotes.ino | 188 +++++++++++++++------------------------ sonoff/sonoff.ino | 2 +- 3 files changed, 76 insertions(+), 116 deletions(-) diff --git a/README.md b/README.md index f4b869751..7b38ad191 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ If you like **Sonoff-Tasmota**, give it a star, or fork it and contribute! ### Development: [![Build Status](https://img.shields.io/travis/arendst/Sonoff-Tasmota.svg)](https://travis-ci.org/arendst/Sonoff-Tasmota) -Current version is **5.12.0o** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information. +Current version is **5.13.0** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information. ### Quick install Download one of the released binaries from https://github.com/arendst/Sonoff-Tasmota/releases and flash it to your hardware as documented in the wiki. diff --git a/sonoff/_releasenotes.ino b/sonoff/_releasenotes.ino index 0cb14f97b..d08e1bb39 100644 --- a/sonoff/_releasenotes.ino +++ b/sonoff/_releasenotes.ino @@ -1,118 +1,49 @@ -/* 5.12.0o - * Fix Energy Today and Yesterday overflow (#2543) - * Fix NTP sync to Thu Jan 01 08:00:10 1970 results in uptime 17651+ days (core2.4.1/sdk2.2.1) - * - * 5.12.0n - * Change ESP8266 Analog JSON message from {"Analog0:123"} to {"ANALOG":{"A0:123"}} to accomodate rules (#2560) - * Change Counter JSON message from {"Counter1":0,"Counter3":0} to {"COUNTER":{"C1":0,"C3":0}} to accomodate rules - * Change ADS1115 JSON message from {"ADS1115":{"Analog0":123,"Analog1":123}} to {"ADS1115":{"A0":123,"A1":123}} - * Add ANALOG#A0div10 trigger to rules to be used in rule like on analog#a0div10 do publish cmnd/ailight/dimmer %value% endon - * - * 5.12.0m - * Reinit timers to accomodate random window (#2447) - * Remove sonoff-xxl - * Disable sleep when using Esp/Arduino core 2.4.1 (#2559) - * Add sonoff-classic, sonoff-allsensors and sonoff-knx - * Add some coloring to important web buttons - * Add rule variables and teleperiod trigger to accomodate user HA messages - * Add define MQTT_TELE_RETAIN compile option default set to 0 (#1071) - * Add user selectable defines for Sunrise/set Dawn option (#2378) - * Add random window to timers (#2447) - * Add optional KNX IP Protocol Support (#2402) - * Add Greek language file (#2491) - * Add Bulgarian language file - * Add support for sensor HC-SR04 ultrasonic (#113, #1964, #2444) - * Add support for Sonoff Pow R2 (#2340) - * Add GPIO_User to GPIO02 for all Sonoff T1 (#2524) - * Fix compile error when using ESP/Arduino library v2.3.0 by reverting KNX async UDP library to default UDP library (#2488, #2492, #2493) - * Fix configuration filename truncation when it contains spaces (#2484, #2490) - * - * 5.12.0l - * Release rules up to 511 characters - * Prepare for feature release - call on translators to update their language files - * Add timer sunrise and sunset offset (#2378) - * Fix negative Latitude and Longitude value entry (#2461) - * Fix sunrise and sunset calculation (#2461) - * - * 5.12.0k - * Prepare for simple rules of up to 255 characters by enlarging Settings area to now 2048 bytes - * Change Timer parameter name from Power to Action - * Add commands Publish, Rule, RuleTimer and Event. See Wiki about Rule restriction, usage and examples - * Fix freeing more code space when emulation is disabled (#1592) - * Fix update temperature on DS18x20 drivers (#2328) - * Fix compile error when not defined USE_TIMERS (#2400) - * - * 5.12.0j - * Add optional Sunrise and Sunset timers with commands Latitide and Longitude to be enabled with define USE_SUNRISE in user_config.h (#2317) - * - * 5.12.0i - * Add 16 timers using commands Timer and Timers (#1091) - * Add commands Timer 0 to clear timer and Timer 1..16 to copy timer - * Add optional Timer configuration webpage to be enabled in user_config.h with define USE_TIMERS_WEB - * Add hexadecimal Data entry to command IrSend using 0x notation (#1290, #2314) - * Add Domoticz Battery and RSSI Quality (#1604) - * Add Home Assistant MQTT Discovery for Buttons and change SetOption19 response (#2277) - * Add support for SGP30 gas and air quality sensor (#2307) - * Add multiple color entry support for command Led like Led2 120000 001200 000012 setting led2 as Red, Led3 as Green and Led4 as Blue (#2303) - * Add hexadecimal RGB color entry on RGBCW leds (#2304) +/* 5.13.0 20180430 + * Change platformio option sonoff-ds18x20 to sonoff-allsensors enabling ds18x20 and all other sensors in one image + * Change status display of Ssid and SetOption + * Change default option SetOption15 from 0 to 1 providing better initial PWM experience * Change webpage parameter communication - * Change Timer parameter Device to more obvious Output * Change max number of commands in Backlog from 15 to 30 and ignore commands overflowing + * Change TSL2561 driver to joba library and delete Adafruit library (#1644) + * Change default parameters in user_config.h to undefined for easy installation (#1851) + * Change max user configurable hold time from 10 to 25 seconds (#1851) + * Change Sonoff SC JSON format (#1939) + * Change Polish language to using Diacritics (#2005) * Change user_config_override usage by providing user_config_override_sample.h (#2228) * Change MQTT response topic for Energy changes from ENERGY to SENSOR (#2229, #2251) * Change default Reset configuration time from 4 seconds to 40 seconds on Button hold (#2268) - * - * 5.12.0h - * Add optional Arduino OTA support to be enabled in user_config.h (#1998) - * Add support for Software Serial bridge using commands SerialDelimiter, SBaudrate and SSerialSend. Supports 8N1 and text only (#2190) - * Add support for Hardware Serial bridge using commands SerialDelimiter, Baudrate and SerialSend. Supports 8N1 and text only (#2182) - * Add support for Zengge WF017 PWM Led strip controller (#2202) - * Add PWM status to command State if PWM enabled (#2203) - * Add command HSBColor Hue,Sat,Bri (#1642, #2203) - * Add command Channel 0..100 to control dimmer value for individual color channels (#2111, #2203) - * Add Channel status information (#2211) - * Add all FriendlyNames to Status information (#2208) - * Change status display of Ssid and SetOption - * Change default option SetOption15 from 0 to 1 providing better initial PWM experience - * - * 5.12.0f - * Add compile time support for WS2812 BRG and RBG led configurations to be defined in user_config.h (#1690) - * - * 5.12.0e - * Add Domoticz dust (custom) sensors to PMS5003 and NovaFitness SDS drivers as PM1, PM2.5 and PM10 - * Add a second TLS fingerprint to allow switching keys in TLS mode (#2033, #2102) - * Add display of remaining pulse time to command PulseTime (#2085) - * Add additional time offset to Wifi Retry based on device mac address (#2089) - * Add command Color6 RRGGBB for Clock hour marker color and command Rotation pixels for Clock rotation (#2092) - * Add HTML language header in local language (#2123) - * Add command PowerDelta 0..100 (percentage) to Energy monitoring devices to report on active power load change (#2157) - * Add Restart Reason to Status 1 report (#2161) - * Fix MAX31850 higher temperatures (#1269) - * - * 5.12.0d - * Add support for optional MQTT drivers to be selected in user_config.h (#1992) - * Add Portuguese language file - * Add compiler check for stable lwIP version v1.4 (#1940) - * Add always suffix with device number in Mqtt discovery topic (#1962) - * Add diacritics to Polish language file (#2005) - * Add Hungarian language file (#2024) - * Add Czech language file - * Add Chinese (Traditional) in Taiwan language file (#2108) - * Add support for Nova Fitness SDS011 and possibly SDS021 particle concentration sensor (#2070) - * Add single decimal precision to Nova Fitness SDS0x1 sensor values (#2093) - * Add support for multiple SHT3X sensors (#1949, #2110) - * Add Sonoff SC domoticz support for Sound level as Counter and Air quality (#2118) - * Fix MQTT TLS fingerprint validation (#2033) - * - * 5.12.0c + * Change ESP8266 Analog JSON message from {"Analog0:123"} to {"ANALOG":{"A0:123"}} to accomodate rules (#2560) + * Change Counter JSON message from {"Counter1":0,"Counter3":0} to {"COUNTER":{"C1":0,"C3":0}} to accomodate rules + * Change ADS1115 JSON message from {"ADS1115":{"Analog0":123,"Analog1":123}} to {"ADS1115":{"A0":123,"A1":123}} * Fix intermittent exception when dns lookup is used while sleep is enabled * Fix 5.4.0 regression turning off single press after button hold during 4x hold time * Fix possible wifi connection problem by erasing sdk configuration parameters - * Change Polish language to using Diacritics (#2005) - * - * 5.12.0b + * Fix NTP sync to Thu Jan 01 08:00:10 1970 results in uptime 17651+ days (core2.4.1/sdk2.2.1) + * Fix MAX31850 higher temperatures (#1269) + * Fix freeing more code space when emulation is disabled (#1592) + * Fix providing web page configuratin option for Friendly Name when no device (relay or light) is configured (#1850) + * Fix compile error when define HOME_ASSISTANT_DISCOVERY_ENABLE is not set (#1937) + * Fix MQTT TLS fingerprint validation (#2033) + * Fix update temperature on DS18x20 drivers (#2328) + * Fix compile error when not defined USE_TIMERS (#2400) + * Fix configuration filename truncation when it contains spaces (#2484, #2490) + * Fix Energy Today and Yesterday overflow (#2543) * Add serial debug info + * Add Portuguese language file + * Add Czech language file + * Add Bulgarian language file + * Add Domoticz dust (custom) sensors to PMS5003 and NovaFitness SDS drivers as PM1, PM2.5 and PM10 + * Add commands Publish, Rule, RuleTimer and Event. See Wiki about Rule restriction, usage and examples + * Add sonoff-classic, sonoff-allsensors and sonoff-knx + * Add some coloring to important web buttons + * Add support for sensor HC-SR04 ultrasonic (#113, #1964, #2444) + * Add define MQTT_TELE_RETAIN compile option default set to 0 (#1071) + * Add 16 timers using commands Timer and Timers (#1091) + * Add optional Timer configuration webpage to be enabled in user_config.h with define USE_TIMERS_WEB * Add Multichannel Gas sensor using MultiChannel_Gas_Sensor library (#1245) + * Add Domoticz Battery and RSSI Quality (#1604) + * Add command HSBColor Hue,Sat,Bri (#1642, #2203) + * Add compile time support for WS2812 BRG and RBG led configurations to be defined in user_config.h (#1690) * Add optional usage of %d or %X suffices in MQTT client to append chipid (#1871) * Add optional usage of %d or %X suffices in MQTT topic to append chipid (#1871) * Add optional usage of %d or %04d in ota url to be replaced with chipid (#1871) @@ -122,17 +53,46 @@ * Add Webserver upload preflight request support (#1927) * Add Home Assistant clear other device (#1931) * Add Restart time to Status 1 (#1938) - * Change TSL2561 driver to joba library and delete Adafruit library (#1644) - * Change Sonoff SC JSON format (#1939) - * Fix compile error when define HOME_ASSISTANT_DISCOVERY_ENABLE is not set (#1937) * Add optional TSL2561 driver using library Joba_Tsl2561 to be enabled in user_config.h with define USE_TSL2561_JOBA (#1951) * Add support for sensor SHTC3 (#1967) - * - * 5.12.0a - * Change platformio option sonoff-ds18x20 to sonoff-allsensors enabling ds18x20 and all other sensors in one image - * Fix providing web page configuratin option for Friendly Name when no device (relay or light) is configured (#1850) - * Change default parameters in user_config.h to undefined for easy installation (#1851) - * Change max user configurable hold time from 10 to 25 seconds (#1851) + * Add compiler check for stable lwIP version v1.4 (#1940) + * Add support for multiple SHT3X sensors (#1949, #2110) + * Add always suffix with device number in Mqtt discovery topic (#1962) + * Add support for optional MQTT drivers to be selected in user_config.h (#1992) + * Add optional Arduino OTA support to be enabled in user_config.h (#1998) + * Add diacritics to Polish language file (#2005) + * Add Hungarian language file (#2024) + * Add support for Nova Fitness SDS011 and possibly SDS021 particle concentration sensor (#2070) + * Add single decimal precision to Nova Fitness SDS0x1 sensor values (#2093) + * Add Chinese (Traditional) in Taiwan language file (#2108) + * Add Sonoff SC domoticz support for Sound level as Counter and Air quality (#2118) + * Add a second TLS fingerprint to allow switching keys in TLS mode (#2033, #2102) + * Add display of remaining pulse time to command PulseTime (#2085) + * Add additional time offset to Wifi Retry based on device mac address (#2089) + * Add command Color6 RRGGBB for Clock hour marker color and command Rotation pixels for Clock rotation (#2092) + * Add HTML language header in local language (#2123) + * Add command PowerDelta 0..100 (percentage) to Energy monitoring devices to report on active power load change (#2157) + * Add Restart Reason to Status 1 report (#2161) + * Add command Channel 0..100 to control dimmer value for individual color channels (#2111, #2203) + * Add support for Hardware Serial bridge using commands SerialDelimiter, Baudrate and SerialSend. Supports 8N1 and text only (#2182) + * Add support for Software Serial bridge using commands SerialDelimiter, SBaudrate and SSerialSend. Supports 8N1 and text only (#2190) + * Add support for Zengge WF017 PWM Led strip controller (#2202) + * Add PWM status to command State if PWM enabled (#2203) + * Add all FriendlyNames to Status information (#2208) + * Add Channel status information (#2211) + * Add hexadecimal Data entry to command IrSend using 0x notation (#1290, #2314) + * Add Home Assistant MQTT Discovery for Buttons and change SetOption19 response (#2277) + * Add multiple color entry support for command Led like Led2 120000 001200 000012 setting led2 as Red, Led3 as Green and Led4 as Blue (#2303) + * Add hexadecimal RGB color entry on RGBCW leds (#2304) + * Add support for SGP30 gas and air quality sensor (#2307) + * Add optional Sunrise and Sunset timers with commands Latitide and Longitude to be enabled with define USE_SUNRISE in user_config.h (#2317) + * Add timer sunrise and sunset offset (#2378) + * Add user selectable defines for Sunrise/set Dawn option (#2378) + * Add optional KNX IP Protocol Support (#2402) + * Add random window to timers (#2447) + * Add Greek language file (#2491) + * Add support for Sonoff Pow R2 (#2340) + * Add GPIO_User to GPIO02 for all Sonoff T1 (#2524) * * 5.12.0 20180209 * Change library PubSubClient.h define MQTT_MAX_PACKET_SIZE from 512 to 1000 for Home Assistant support diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index ef8708617..a3f7b2866 100644 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -25,7 +25,7 @@ - Select IDE Tools - Flash Size: "1M (no SPIFFS)" ====================================================*/ -#define VERSION 0x050C000F // 5.12.0o +#define VERSION 0x050D0000 // 5.13.0 // Location specific includes #include // Arduino_Esp8266 version information (ARDUINO_ESP8266_RELEASE and ARDUINO_ESP8266_RELEASE_2_3_0)