Skip to content

Commit

Permalink
Add support for Shelly
Browse files Browse the repository at this point in the history
Add support for Shelly 1 and basic support for Shelly 2 - No energy monitoring yet (arendst#2789)
  • Loading branch information
arendst committed Sep 2, 2018
1 parent 2210bda commit 44ecdaf
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 23 deletions.
1 change: 1 addition & 0 deletions sonoff/_changelog.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
52 changes: 29 additions & 23 deletions sonoff/sonoff_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand Down Expand Up @@ -220,6 +223,8 @@ enum SupportedModules {
SONOFF_POW_R2,
SONOFF_IFAN02,
BLITZWOLF_BWSHP2,
SHELLY1,
SHELLY2,
MAXMODULE };

/********************************************************************************************/
Expand Down Expand Up @@ -271,6 +276,8 @@ const uint8_t kNiceList[MAXMODULE] PROGMEM = {
LUANIHVIO,
YUNSHAN,
WION,
SHELLY1,
SHELLY2,
BLITZWOLF_BWSHP2,
H801,
MAGICHOME,
Expand Down Expand Up @@ -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
}
};

Expand Down Expand Up @@ -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_

0 comments on commit 44ecdaf

Please sign in to comment.