Skip to content

Commit

Permalink
v5.8.0i - Some fixes and Add Sealevel Pressure
Browse files Browse the repository at this point in the history
5.8.0i
 * Add Domoticz counter sensor to IrReceive representing Received
IR Protocol and Data
 * Fix Southern Hemisphere TIME_STD/TIME_DST
(#968)
 * Add Sea level pressure calculation (#974)
 * Fix virtual relay
status message used with Color/Dimmer control (#989)
 * Fix command
IRSend and IRHvac case sensitive parameter regression introduced with
version 5.8.0 (#993)
  • Loading branch information
arendst committed Oct 8, 2017
1 parent 3bc7dd4 commit ff52288
Show file tree
Hide file tree
Showing 14 changed files with 438 additions and 312 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.8.0h** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.
Current version is **5.8.0i** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.

### ATTENTION All versions

Expand Down
11 changes: 9 additions & 2 deletions sonoff/_releasenotes.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
/* 5.8.0h
/* 5.8.0i
* Add Domoticz counter sensor to IrReceive representing Received IR Protocol and Data
* Fix Southern Hemisphere TIME_STD/TIME_DST (#968)
* Add Sea level pressure calculation (#974)
* Fix virtual relay status message used with Color/Dimmer control (#989)
* Fix command IRSend and IRHvac case sensitive parameter regression introduced with version 5.8.0 (#993)
*
* 5.8.0h
* Rename command IRRemote to IRSend (#956)
* Add optional IR Receiver support (#956)
* Add IR Receiver support. Disable in user_config.h (#956)
* Change default PWM assignment for Witty Cloud to support optional Color/Dimmer control (#976)
* GPIO12 (Green) from GPIO_PWM4 to GPIO_PWM2
* GPIO13 (Blue) from GPIO_PWM5 to GPIO_PWM3
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/en-GB.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
#define D_POWERFACTOR "Factor"
#define D_POWERUSAGE "Power"
#define D_PRESSURE "Pressure"
#define D_PRESSUREATSEALEVEL "SeaPressure"
#define D_PROGRAM_FLASH_SIZE "Program Flash Size"
#define D_PROGRAMFLASHSIZE "ProgramFlashSize"
#define D_PROGRAM_SIZE "Program Size"
Expand Down Expand Up @@ -617,6 +618,7 @@
#define D_RESET_AND_RESTARTING "Reset and Restarting"
#define D_ONE_TO_RESET "1 to reset"
#define D_CMND_TIMEZONE "Timezone"
#define D_CMND_ALTITUDE "Altitude"
#define D_CMND_LEDPOWER "LedPower"
#define D_CMND_LEDSTATE "LedState"
#define D_CMND_CFGDUMP "CfgDump"
Expand Down
2 changes: 2 additions & 0 deletions sonoff/language/nl-NL.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
#define D_POWERFACTOR "Factor"
#define D_POWERUSAGE "Vermogen"
#define D_PRESSURE "Luchtdruk"
#define D_PRESSUREATSEALEVEL "ZeeLuchtdruk"
#define D_PROGRAM_FLASH_SIZE "Programma Flash Grootte"
#define D_PROGRAMFLASHSIZE "ProgrammaFlashGrootte"
#define D_PROGRAM_SIZE "Programma Grootte"
Expand Down Expand Up @@ -617,6 +618,7 @@
#define D_RESET_AND_RESTARTING "Reset en herstarten"
#define D_ONE_TO_RESET "1 voor reset"
#define D_CMND_TIMEZONE "Timezone"
#define D_CMND_ALTITUDE "Altitude"
#define D_CMND_LEDPOWER "LedPower"
#define D_CMND_LEDSTATE "LedState"
#define D_CMND_CFGDUMP "CfgDump"
Expand Down
5 changes: 3 additions & 2 deletions sonoff/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ struct SYSCFG {
char ex_state_text[3][11]; // was state_text until 5.1.6, was ex_mqtt_subtopic[33] until 4.1.1
byte ex_mqtt_button_retain; // Not used since 5.0.2
byte ex_mqtt_power_retain; // Not used since 5.0.2
byte ex_value_units; // Not used since 5.0.2
byte ex_button_restrict; // Not used since 5.0.2
//byte ex_value_units; // Not used since 5.0.2
//byte ex_button_restrict; // Not used since 5.0.2
int16_t altitude; // Add since 5.8.0i
uint16_t tele_period;

uint8_t power;
Expand Down
7 changes: 2 additions & 5 deletions sonoff/settings.ino
Original file line number Diff line number Diff line change
Expand Up @@ -639,9 +639,6 @@ void CFG_Delta()
if (sysCfg.version < 0x03091500) {
for (byte i = 0; i < 4; i++) sysCfg.switchmode[i] = SWITCH_MODE;
}
if (sysCfg.version < 0x04000200) {
sysCfg.ex_button_restrict = 0;
}
if (sysCfg.version < 0x04000400) {
CFG_DefaultSet_4_0_4();
}
Expand All @@ -663,8 +660,8 @@ void CFG_Delta()
if (sysCfg.version < 0x05000105) {
sysCfg.flag = { 0 };
sysCfg.flag.savestate = SAVE_STATE;
sysCfg.flag.button_restrict = sysCfg.ex_button_restrict;
sysCfg.flag.value_units = sysCfg.ex_value_units;
sysCfg.flag.button_restrict = 0;
sysCfg.flag.value_units = 0;
sysCfg.flag.mqtt_enabled = sysCfg.ex_mqtt_enabled;
// sysCfg.flag.mqtt_response = 0;
sysCfg.flag.mqtt_power_retain = sysCfg.ex_mqtt_power_retain;
Expand Down
10 changes: 9 additions & 1 deletion sonoff/sonoff.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
- Select IDE Tools - Flash Size: "1M (no SPIFFS)"
====================================================*/

#define VERSION 0x05080008 // 5.8.0h
#define VERSION 0x05080009 // 5.8.0i

enum week_t {Last, First, Second, Third, Fourth};
enum dow_t {Sun=1, Mon, Tue, Wed, Thu, Fri, Sat};
enum month_t {Jan=1, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec};
enum hemis_t {North, South};
enum log_t {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE, LOG_LEVEL_ALL}; // SerialLog, Syslog, Weblog
enum wifi_t {WIFI_RESTART, WIFI_SMARTCONFIG, WIFI_MANAGER, WIFI_WPSCONFIG, WIFI_RETRY, WIFI_WAIT, MAX_WIFI_OPTION}; // WifiConfig
enum swtch_t {TOGGLE, FOLLOW, FOLLOW_INV, PUSHBUTTON, PUSHBUTTON_INV, PUSHBUTTONHOLD, PUSHBUTTONHOLD_INV, MAX_SWITCH_OPTION}; // SwitchMode
Expand Down Expand Up @@ -206,6 +207,7 @@ struct TIME_T {

struct TimeChangeRule
{
uint8_t hemis; // 0-Northern, 1=Southern Hemisphere (=Opposite DST/STD)
uint8_t week; // 1=First, 2=Second, 3=Third, 4=Fourth, or 0=Last week of the month
uint8_t dow; // day of week, 1=Sun, 2=Mon, ... 7=Sat
uint8_t month; // 1=Jan, 2=Feb, ... 12=Dec
Expand Down Expand Up @@ -1510,6 +1512,12 @@ void mqttDataCb(char* topic, byte* data, unsigned int data_len)
}
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_TIMEZONE "\":%d}"), sysCfg.timezone);
}
else if (!strcasecmp_P(type, PSTR(D_CMND_ALTITUDE))) {
if ((data_len > 0) && ((payload >= -30000) && (payload <= 30000))) {
sysCfg.altitude = payload;
}
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_ALTITUDE "\":%d}"), sysCfg.altitude);
}
else if (!strcasecmp_P(type, PSTR(D_CMND_LEDPOWER))) {
if ((payload >= 0) && (payload <= 2)) {
sysCfg.ledstate &= 8;
Expand Down
9 changes: 7 additions & 2 deletions sonoff/support.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1086,8 +1086,13 @@ void rtc_second()
loctime = utctime;
if (loctime > 1451602800) { // 2016-01-01
if (99 == sysCfg.timezone) {
dstoffset = myDST.offset * SECS_PER_MIN;
stdoffset = mySTD.offset * SECS_PER_MIN;
if (myDST.hemis) {
dstoffset = mySTD.offset * SECS_PER_MIN; // Southern hemisphere
stdoffset = myDST.offset * SECS_PER_MIN;
} else {
dstoffset = myDST.offset * SECS_PER_MIN; // Northern hemisphere
stdoffset = mySTD.offset * SECS_PER_MIN;
}
if ((utctime >= (dsttime - stdoffset)) && (utctime < (stdtime - dstoffset))) {
loctime += dstoffset; // Daylight Saving Time
} else {
Expand Down
4 changes: 2 additions & 2 deletions sonoff/user_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@
#define NTP_SERVER3 "0.nl.pool.ntp.org" // [NtpServer3] Select third NTP server by name or IP address (93.94.224.67)

// -- Time - Start Daylight Saving Time and timezone offset from UTC in minutes
#define TIME_DST Last, Sun, Mar, 2, +120 // Last sunday in march at 02:00 +120 minutes
#define TIME_DST North, Last, Sun, Mar, 2, +120 // Northern Hemisphere, Last sunday in march at 02:00 +120 minutes

// -- Time - Start Standard Time and timezone offset from UTC in minutes
#define TIME_STD Last, Sun, Oct, 3, +60 // Last sunday in october 02:00 +60 minutes
#define TIME_STD North, Last, Sun, Oct, 3, +60 // Northern Hemisphere, Last sunday in october 02:00 +60 minutes

// -- Application ---------------------------------
#define APP_TIMEZONE 1 // [Timezone] +1 hour (Amsterdam) (-12 .. 12 = hours from UTC, 99 = use TIME_DST/TIME_STD)
Expand Down
2 changes: 2 additions & 0 deletions sonoff/webserver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ const char HTTP_SNS_HUM[] PROGMEM =
"<tr><th>%s " D_HUMIDITY "</th><td>%s%</td></tr>";
const char HTTP_SNS_PRESSURE[] PROGMEM =
"<tr><th>%s " D_PRESSURE "</th><td>%s " D_UNIT_PRESSURE "</td></tr>";
const char HTTP_SNS_PRESSUREATSEALEVEL[] PROGMEM =
"<tr><th>%s " D_PRESSUREATSEALEVEL "</th><td>%s " D_UNIT_PRESSURE "</td></tr>";
const char HTTP_SNS_LIGHT[] PROGMEM =
"<tr><th>%s " D_LIGHT "</th><td>%d%</td></tr>";
const char HTTP_SNS_NOISE[] PROGMEM =
Expand Down
Loading

0 comments on commit ff52288

Please sign in to comment.