diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino index d2781b4d47bc..a59ba99cb19d 100644 --- a/sonoff/_changelog.ino +++ b/sonoff/_changelog.ino @@ -3,6 +3,7 @@ * Fix possible exception due to buffer overflow (#3659) * Add Wifi channel number to state message (#3664) * Fix Wemo emulation to select the first relay when more than one relay is present (#3657) + * Add support for Shelly 1 and basic support for Shelly 2 - No energy monitoring yet (#2789) * * 6.2.0 20180901 * Allow user override of define MAX_RULE_VARS and MAX_RULE_TIMERS (#3561) diff --git a/sonoff/sonoff_template.h b/sonoff/sonoff_template.h index 84a0749dc249..8d3fac17605d 100644 --- a/sonoff/sonoff_template.h +++ b/sonoff/sonoff_template.h @@ -136,6 +136,9 @@ enum ProgramSelectablePins { GPIO_DI, // my92x1 PWM input GPIO_DCKI, // my92x1 CLK input GPIO_ARIRFRCV, // AliLux RF Receive input + GPIO_MCP39_TX, // MCP39F501 Serial output + GPIO_MCP39_RX, // MCP39F501 Serial input + GPIO_MCP39_RST, // MCP39F501 Serial reset GPIO_USER, // User configurable GPIO_MAX }; @@ -220,6 +223,8 @@ enum SupportedModules { SONOFF_POW_R2, SONOFF_IFAN02, BLITZWOLF_BWSHP2, + SHELLY1, + SHELLY2, MAXMODULE }; /********************************************************************************************/ @@ -271,6 +276,8 @@ const uint8_t kNiceList[MAXMODULE] PROGMEM = { LUANIHVIO, YUNSHAN, WION, + SHELLY1, + SHELLY2, BLITZWOLF_BWSHP2, H801, MAGICHOME, @@ -906,6 +913,27 @@ const mytmplt kModules[MAXMODULE] PROGMEM = { GPIO_HLW_CF1, // GPIO14 BL0937 or HJL-01 CF1 voltage / current GPIO_REL1, // GPIO15 Relay (0 = Off, 1 = On) 0, 0 + }, + { "Shelly 1", // Shelly1 Open Source (ESP8266 - 2MB) - https://shelly.cloud/shelly1-open-source/ + 0, 0, 0, 0, + GPIO_REL1, // GPIO04 Relay (0 = Off, 1 = On) + GPIO_SWT1_NP, // GPIO05 SW pin + 0, 0, 0, 0, 0, 0, // Flash connection + 0, 0, 0, 0, 0, 0 + }, + { "Shelly 2", // Shelly2 (ESP8266 - 2MB) - https://shelly.cloud/shelly2/ + 0, + GPIO_MCP39_RX, // GPIO01 MCP39F501 Serial input + 0, + GPIO_MCP39_TX, // GPIO03 MCP39F501 Serial output + GPIO_REL1, // GPIO04 + GPIO_REL2, // GPIO05 + 0, 0, 0, 0, 0, 0, // Flash connection + GPIO_SWT1_NP, // GPIO12 + 0, + GPIO_SWT2_NP, // GPIO14 + GPIO_MCP39_RST, // GPIO15 MCP39F501 Reset + 0, 0 } }; @@ -988,29 +1016,7 @@ const mytmplt kModules[MAXMODULE] PROGMEM = { GPIO_USER, // GPIO15 (D15) GPIO_USER, // GPIO16 (D16) 0 // ADC0 Analog input (A0) - }, - - { "Shelly 1", // Shelly1 Open Source (ESP8266 - 2MB) - https://shelly.cloud/shelly1-open-source/ - GPIO_KEY1, // GPIO00 Button - GPIO_USER, // GPIO01 Serial RXD and Optional sensor - 0, - GPIO_USER, // GPIO03 Serial TXD and Optional sensor - GPIO_REL1, // GPIO04 Relay (0 = Off, 1 = On) - GPIO_SWT1_NP, // GPIO05 Switch - 0, 0, 0, 0, 0, 0, // Flash connection - 0, 0, 0, 0, 0, 0 - }, - { "Shelly 2", // Shelly2 (ESP8266 - 2MB) - https://shelly.cloud/shelly2/ - // As Gnd is connected to AC no user GPIO allowed - 0, 0, 0, 0, - GPIO_REL1, // GPIO04 Relay 1 (0 = Off, 1 = On) - GPIO_REL2, // GPIO05 Relay 2 (0 = Off, 1 = On) - 0, 0, 0, 0, 0, 0, // Flash connection - GPIO_SWT1_NP, // GPIO12 Switch 1 - 0, - GPIO_SWT2_NP, // GPIO14 Switch 2 - 0, 0, 0 - }, + } */ #endif // _SONOFF_TEMPLATE_H_ \ No newline at end of file