sonoff_template.h 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480
  1. /*
  2. sonoff_template.h - template settings for Sonoff-Tasmota
  3. Copyright (C) 2018 Theo Arends
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. #ifndef _SONOFF_TEMPLATE_H_
  16. #define _SONOFF_TEMPLATE_H_
  17. // User selectable GPIO functionality
  18. // ATTENTION: Only add at the end of this list just before GPIO_SENSOR_END
  19. // Then add the same name(s) in a nice location in array kGpioNiceList
  20. enum UserSelectablePins {
  21. GPIO_NONE, // Not used
  22. GPIO_DHT11, // DHT11
  23. GPIO_DHT22, // DHT21, DHT22, AM2301, AM2302, AM2321
  24. GPIO_SI7021, // iTead SI7021
  25. GPIO_DSB, // Single wire DS18B20 or DS18S20
  26. GPIO_I2C_SCL, // I2C SCL
  27. GPIO_I2C_SDA, // I2C SDA
  28. GPIO_WS2812, // WS2812 Led string
  29. GPIO_IRSEND, // IR remote
  30. GPIO_SWT1, // User connected external switches
  31. GPIO_SWT2,
  32. GPIO_SWT3,
  33. GPIO_SWT4,
  34. GPIO_SWT5,
  35. GPIO_SWT6,
  36. GPIO_SWT7,
  37. GPIO_SWT8,
  38. GPIO_KEY1, // Button usually connected to GPIO0
  39. GPIO_KEY2,
  40. GPIO_KEY3,
  41. GPIO_KEY4,
  42. GPIO_REL1, // Relays
  43. GPIO_REL2,
  44. GPIO_REL3,
  45. GPIO_REL4,
  46. GPIO_REL5,
  47. GPIO_REL6,
  48. GPIO_REL7,
  49. GPIO_REL8,
  50. GPIO_REL1_INV,
  51. GPIO_REL2_INV,
  52. GPIO_REL3_INV,
  53. GPIO_REL4_INV,
  54. GPIO_REL5_INV,
  55. GPIO_REL6_INV,
  56. GPIO_REL7_INV,
  57. GPIO_REL8_INV,
  58. GPIO_PWM1, // RGB Red or C Cold White
  59. GPIO_PWM2, // RGB Green or CW Warm White
  60. GPIO_PWM3, // RGB Blue
  61. GPIO_PWM4, // RGBW (Cold) White
  62. GPIO_PWM5, // RGBCW Warm White
  63. GPIO_CNTR1,
  64. GPIO_CNTR2,
  65. GPIO_CNTR3,
  66. GPIO_CNTR4,
  67. GPIO_PWM1_INV, // RGB Red or C Cold White
  68. GPIO_PWM2_INV, // RGB Green or CW Warm White
  69. GPIO_PWM3_INV, // RGB Blue
  70. GPIO_PWM4_INV, // RGBW (Cold) White
  71. GPIO_PWM5_INV, // RGBCW Warm White
  72. GPIO_IRRECV, // IR receiver
  73. GPIO_LED1, // Leds
  74. GPIO_LED2,
  75. GPIO_LED3,
  76. GPIO_LED4,
  77. GPIO_LED1_INV,
  78. GPIO_LED2_INV,
  79. GPIO_LED3_INV,
  80. GPIO_LED4_INV,
  81. GPIO_MHZ_TXD, // MH-Z19 Serial interface
  82. GPIO_MHZ_RXD, // MH-Z19 Serial interface
  83. GPIO_PZEM0XX_TX, // PZEM0XX Serial interface
  84. GPIO_PZEM004_RX, // PZEM004T Serial interface
  85. GPIO_SAIR_TX, // SenseAir Serial interface
  86. GPIO_SAIR_RX, // SenseAir Serial interface
  87. GPIO_SPI_CS, // SPI Chip Select
  88. GPIO_SPI_DC, // SPI Data Direction
  89. GPIO_BACKLIGHT, // Display backlight control
  90. GPIO_PMS5003, // Plantower PMS5003 Serial interface
  91. GPIO_SDS0X1_RX, // Nova Fitness SDS011 Serial interface
  92. GPIO_SBR_TX, // Serial Bridge Serial interface
  93. GPIO_SBR_RX, // Serial Bridge Serial interface
  94. GPIO_SR04_TRIG, // SR04 Trigger pin
  95. GPIO_SR04_ECHO, // SR04 Echo pin
  96. GPIO_SDM120_TX, // SDM120 Serial interface
  97. GPIO_SDM120_RX, // SDM120 Serial interface
  98. GPIO_SDM630_TX, // SDM630 Serial interface
  99. GPIO_SDM630_RX, // SDM630 Serial interface
  100. GPIO_TM16CLK, // TM1638 Clock
  101. GPIO_TM16DIO, // TM1638 Data I/O
  102. GPIO_TM16STB, // TM1638 Strobe
  103. GPIO_SWT1_NP, // User connected external switches
  104. GPIO_SWT2_NP,
  105. GPIO_SWT3_NP,
  106. GPIO_SWT4_NP,
  107. GPIO_SWT5_NP,
  108. GPIO_SWT6_NP,
  109. GPIO_SWT7_NP,
  110. GPIO_SWT8_NP,
  111. GPIO_KEY1_NP, // Button usually connected to GPIO0
  112. GPIO_KEY2_NP,
  113. GPIO_KEY3_NP,
  114. GPIO_KEY4_NP,
  115. GPIO_CNTR1_NP,
  116. GPIO_CNTR2_NP,
  117. GPIO_CNTR3_NP,
  118. GPIO_CNTR4_NP,
  119. GPIO_PZEM016_RX, // PZEM-014,016 Serial Modbus interface
  120. GPIO_PZEM017_RX, // PZEM-003,017 Serial Modbus interface
  121. GPIO_MP3_DFR562, // RB-DFR-562, DFPlayer Mini MP3 Player
  122. GPIO_SDS0X1_TX, // Nova Fitness SDS011 Serial interface
  123. GPIO_HX711_SCK, // HX711 Load Cell clock
  124. GPIO_HX711_DAT, // HX711 Load Cell data
  125. GPIO_TX20_TXD_BLACK, // TX20 Transmission Pin
  126. GPIO_RFSEND, // RF transmitter
  127. GPIO_RFRECV, // RF receiver
  128. GPIO_TUYA_TX, // Tuya Serial interface
  129. GPIO_TUYA_RX, // Tuya Serial interface
  130. GPIO_MGC3130_XFER, // MGC3130 Transfer
  131. GPIO_MGC3130_RESET, // MGC3130 Reset
  132. GPIO_SSPI_MISO, // Software SPI Master Input Slave Output
  133. GPIO_SSPI_MOSI, // Software SPI Master Output Slave Input
  134. GPIO_SSPI_SCLK, // Software SPI Serial Clock
  135. GPIO_SSPI_CS, // Software SPI Chip Select
  136. GPIO_SSPI_DC, // Software SPI Data or Command
  137. GPIO_RF_SENSOR, // Rf receiver with sensor decoding
  138. GPIO_AZ_TXD, // AZ-Instrument 7798 Serial interface
  139. GPIO_AZ_RXD, // AZ-Instrument 7798 Serial interface
  140. GPIO_SENSOR_END };
  141. // Programmer selectable GPIO functionality offset by user selectable GPIOs
  142. enum ProgramSelectablePins {
  143. GPIO_RXD = GPIO_SENSOR_END, // Serial interface
  144. GPIO_TXD, // Serial interface
  145. GPIO_SPI_MISO, // SPI MISO library fixed pin GPIO12
  146. GPIO_SPI_MOSI, // SPI MOSI library fixed pin GPIO13
  147. GPIO_SPI_CLK, // SPI Clk library fixed pin GPIO14
  148. GPIO_NRG_SEL, // HLW8012/HLJ-01 Sel output (1 = Voltage)
  149. GPIO_NRG_SEL_INV, // HLW8012/HLJ-01 Sel output (0 = Voltage)
  150. GPIO_NRG_CF1, // HLW8012/HLJ-01 CF1 voltage / current
  151. GPIO_HLW_CF, // HLW8012 CF power
  152. GPIO_HJL_CF, // HJL-01/BL0937 CF power
  153. GPIO_ADC0, // ADC
  154. GPIO_DI, // my92x1 PWM input
  155. GPIO_DCKI, // my92x1 CLK input
  156. GPIO_ARIRFRCV, // AliLux RF Receive input
  157. GPIO_USER, // User configurable
  158. GPIO_MAX };
  159. // Text in webpage Module Parameters and commands GPIOS and GPIO
  160. const char kSensorNames[] PROGMEM =
  161. D_SENSOR_NONE "|"
  162. D_SENSOR_DHT11 "|" D_SENSOR_AM2301 "|" D_SENSOR_SI7021 "|"
  163. D_SENSOR_DS18X20 "|"
  164. D_SENSOR_I2C_SCL "|" D_SENSOR_I2C_SDA "|"
  165. D_SENSOR_WS2812 "|"
  166. D_SENSOR_IRSEND "|"
  167. D_SENSOR_SWITCH "1|" D_SENSOR_SWITCH "2|" D_SENSOR_SWITCH "3|" D_SENSOR_SWITCH "4|" D_SENSOR_SWITCH "5|" D_SENSOR_SWITCH "6|" D_SENSOR_SWITCH "7|" D_SENSOR_SWITCH "8|"
  168. D_SENSOR_BUTTON "1|" D_SENSOR_BUTTON "2|" D_SENSOR_BUTTON "3|" D_SENSOR_BUTTON "4|"
  169. D_SENSOR_RELAY "1|" D_SENSOR_RELAY "2|" D_SENSOR_RELAY "3|" D_SENSOR_RELAY "4|" D_SENSOR_RELAY "5|" D_SENSOR_RELAY "6|" D_SENSOR_RELAY "7|" D_SENSOR_RELAY "8|"
  170. D_SENSOR_RELAY "1i|" D_SENSOR_RELAY "2i|" D_SENSOR_RELAY "3i|" D_SENSOR_RELAY "4i|" D_SENSOR_RELAY "5i|" D_SENSOR_RELAY "6i|" D_SENSOR_RELAY "7i|" D_SENSOR_RELAY "8i|"
  171. D_SENSOR_PWM "1|" D_SENSOR_PWM "2|" D_SENSOR_PWM "3|" D_SENSOR_PWM "4|" D_SENSOR_PWM "5|"
  172. D_SENSOR_COUNTER "1|" D_SENSOR_COUNTER "2|" D_SENSOR_COUNTER "3|" D_SENSOR_COUNTER "4|"
  173. D_SENSOR_PWM "1i|" D_SENSOR_PWM "2i|" D_SENSOR_PWM "3i|" D_SENSOR_PWM "4i|" D_SENSOR_PWM "5i|"
  174. D_SENSOR_IRRECV "|"
  175. D_SENSOR_LED "1|" D_SENSOR_LED "2|" D_SENSOR_LED "3|" D_SENSOR_LED "4|"
  176. D_SENSOR_LED "1i|" D_SENSOR_LED "2i|" D_SENSOR_LED "3i|" D_SENSOR_LED "4i|"
  177. D_SENSOR_MHZ_TX "|" D_SENSOR_MHZ_RX "|"
  178. D_SENSOR_PZEM0XX_TX "|" D_SENSOR_PZEM004_RX "|"
  179. D_SENSOR_SAIR_TX "|" D_SENSOR_SAIR_RX "|"
  180. D_SENSOR_SPI_CS "|" D_SENSOR_SPI_DC "|" D_SENSOR_BACKLIGHT "|"
  181. D_SENSOR_PMS5003 "|" D_SENSOR_SDS0X1_RX "|"
  182. D_SENSOR_SBR_TX "|" D_SENSOR_SBR_RX "|"
  183. D_SENSOR_SR04_TRIG "|" D_SENSOR_SR04_ECHO "|"
  184. D_SENSOR_SDM120_TX "|" D_SENSOR_SDM120_RX "|"
  185. D_SENSOR_SDM630_TX "|" D_SENSOR_SDM630_RX "|"
  186. D_SENSOR_TM1638_CLK "|" D_SENSOR_TM1638_DIO "|" D_SENSOR_TM1638_STB "|"
  187. D_SENSOR_SWITCH "1n|" D_SENSOR_SWITCH "2n|" D_SENSOR_SWITCH "3n|" D_SENSOR_SWITCH "4n|" D_SENSOR_SWITCH "5n|" D_SENSOR_SWITCH "6n|" D_SENSOR_SWITCH "7n|" D_SENSOR_SWITCH "8n|"
  188. D_SENSOR_BUTTON "1n|" D_SENSOR_BUTTON "2n|" D_SENSOR_BUTTON "3n|" D_SENSOR_BUTTON "4n|"
  189. D_SENSOR_COUNTER "1n|" D_SENSOR_COUNTER "2n|" D_SENSOR_COUNTER "3n|" D_SENSOR_COUNTER "4n|"
  190. D_SENSOR_PZEM016_RX "|" D_SENSOR_PZEM017_RX "|"
  191. D_SENSOR_DFR562 "|" D_SENSOR_SDS0X1_TX "|"
  192. D_SENSOR_HX711_SCK "|" D_SENSOR_HX711_DAT "|"
  193. D_SENSOR_TX20_TX "|"
  194. D_SENSOR_RFSEND "|" D_SENSOR_RFRECV "|"
  195. D_SENSOR_TUYA_TX "|" D_SENSOR_TUYA_RX "|"
  196. D_SENSOR_MGC3130_XFER "|" D_SENSOR_MGC3130_RESET "|"
  197. D_SENSOR_SSPI_MISO "|" D_SENSOR_SSPI_MOSI "|" D_SENSOR_SSPI_SCLK "|" D_SENSOR_SSPI_CS "|" D_SENSOR_SSPI_DC "|"
  198. D_SENSOR_RF_SENSOR "|"
  199. D_SENSOR_AZ_TX "|" D_SENSOR_AZ_RX;
  200. /********************************************************************************************/
  201. // Supported hardware modules
  202. enum SupportedModules {
  203. SONOFF_BASIC,
  204. SONOFF_RF,
  205. SONOFF_SV,
  206. SONOFF_TH,
  207. SONOFF_DUAL,
  208. SONOFF_POW,
  209. SONOFF_4CH,
  210. SONOFF_S2X,
  211. SLAMPHER,
  212. SONOFF_TOUCH,
  213. SONOFF_LED,
  214. CH1,
  215. CH4,
  216. MOTOR,
  217. ELECTRODRAGON,
  218. EXS_RELAY,
  219. WION,
  220. WEMOS,
  221. SONOFF_DEV,
  222. H801,
  223. SONOFF_SC,
  224. SONOFF_BN,
  225. SONOFF_4CHPRO,
  226. HUAFAN_SS,
  227. SONOFF_BRIDGE,
  228. SONOFF_B1,
  229. AILIGHT,
  230. SONOFF_T11,
  231. SONOFF_T12,
  232. SONOFF_T13,
  233. SUPLA1,
  234. WITTY,
  235. YUNSHAN,
  236. MAGICHOME,
  237. LUANIHVIO,
  238. KMC_70011,
  239. ARILUX_LC01,
  240. ARILUX_LC11,
  241. SONOFF_DUAL_R2,
  242. ARILUX_LC06,
  243. SONOFF_S31,
  244. ZENGGE_ZF_WF017,
  245. SONOFF_POW_R2,
  246. SONOFF_IFAN02,
  247. BLITZWOLF_BWSHP,
  248. SHELLY1,
  249. SHELLY2,
  250. PHILIPS,
  251. NEO_COOLCAM,
  252. ESP_SWITCH,
  253. OBI,
  254. TECKIN,
  255. APLIC_WDP303075,
  256. TUYA_DIMMER,
  257. GOSUND,
  258. ARMTRONIX_DIMMERS,
  259. SK03_TUYA,
  260. PS_16_DZ,
  261. TECKIN_US,
  262. MANZOKU_EU_4,
  263. MAXMODULE };
  264. /********************************************************************************************/
  265. #define MAX_GPIO_PIN 18 // Number of supported GPIO
  266. const char PINS_WEMOS[] PROGMEM = "D3TXD4RXD2D1flashcFLFLolD6D7D5D8D0A0";
  267. typedef struct MYIO {
  268. uint8_t io[MAX_GPIO_PIN];
  269. } myio;
  270. typedef struct MYTMPLT {
  271. char name[15];
  272. myio gp;
  273. } mytmplt;
  274. const uint8_t kGpioNiceList[] PROGMEM = {
  275. GPIO_NONE, // Not used
  276. GPIO_KEY1, // Buttons
  277. GPIO_KEY1_NP,
  278. GPIO_KEY2,
  279. GPIO_KEY2_NP,
  280. GPIO_KEY3,
  281. GPIO_KEY3_NP,
  282. GPIO_KEY4,
  283. GPIO_KEY4_NP,
  284. GPIO_SWT1, // User connected external switches
  285. GPIO_SWT1_NP,
  286. GPIO_SWT2,
  287. GPIO_SWT2_NP,
  288. GPIO_SWT3,
  289. GPIO_SWT3_NP,
  290. GPIO_SWT4,
  291. GPIO_SWT4_NP,
  292. GPIO_SWT5,
  293. GPIO_SWT5_NP,
  294. GPIO_SWT6,
  295. GPIO_SWT6_NP,
  296. GPIO_SWT7,
  297. GPIO_SWT7_NP,
  298. GPIO_SWT8,
  299. GPIO_SWT8_NP,
  300. GPIO_REL1, // Relays
  301. GPIO_REL1_INV,
  302. GPIO_REL2,
  303. GPIO_REL2_INV,
  304. GPIO_REL3,
  305. GPIO_REL3_INV,
  306. GPIO_REL4,
  307. GPIO_REL4_INV,
  308. GPIO_REL5,
  309. GPIO_REL5_INV,
  310. GPIO_REL6,
  311. GPIO_REL6_INV,
  312. GPIO_REL7,
  313. GPIO_REL7_INV,
  314. GPIO_REL8,
  315. GPIO_REL8_INV,
  316. GPIO_LED1, // Leds
  317. GPIO_LED1_INV,
  318. GPIO_LED2,
  319. GPIO_LED2_INV,
  320. GPIO_LED3,
  321. GPIO_LED3_INV,
  322. GPIO_LED4,
  323. GPIO_LED4_INV,
  324. GPIO_PWM1, // RGB Red or C Cold White
  325. GPIO_PWM1_INV,
  326. GPIO_PWM2, // RGB Green or CW Warm White
  327. GPIO_PWM2_INV,
  328. GPIO_PWM3, // RGB Blue
  329. GPIO_PWM3_INV,
  330. GPIO_PWM4, // RGBW (Cold) White
  331. GPIO_PWM4_INV,
  332. GPIO_PWM5, // RGBCW Warm White
  333. GPIO_PWM5_INV,
  334. GPIO_CNTR1, // Counters
  335. GPIO_CNTR1_NP,
  336. GPIO_CNTR2,
  337. GPIO_CNTR2_NP,
  338. GPIO_CNTR3,
  339. GPIO_CNTR3_NP,
  340. GPIO_CNTR4,
  341. GPIO_CNTR4_NP,
  342. #ifdef USE_I2C
  343. GPIO_I2C_SCL, // I2C SCL
  344. GPIO_I2C_SDA, // I2C SDA
  345. #endif
  346. #ifdef USE_SPI
  347. GPIO_SPI_CS, // SPI Chip Select
  348. GPIO_SPI_DC, // SPI Data Direction
  349. GPIO_SSPI_MISO, // Software SPI Master Input Slave Output
  350. GPIO_SSPI_MOSI, // Software SPI Master Output Slave Input
  351. GPIO_SSPI_SCLK, // Software SPI Serial Clock
  352. GPIO_SSPI_CS, // Software SPI Chip Select
  353. GPIO_SSPI_DC, // Software SPI Data or Command
  354. #endif
  355. #ifdef USE_DISPLAY
  356. GPIO_BACKLIGHT, // Display backlight control
  357. #endif
  358. GPIO_DHT11, // DHT11
  359. GPIO_DHT22, // DHT21, DHT22, AM2301, AM2302, AM2321
  360. GPIO_SI7021, // iTead SI7021
  361. GPIO_DSB, // Single wire DS18B20 or DS18S20
  362. #ifdef USE_WS2812
  363. GPIO_WS2812, // WS2812 Led string
  364. #endif
  365. #ifdef USE_IR_REMOTE
  366. GPIO_IRSEND, // IR remote
  367. #ifdef USE_IR_RECEIVE
  368. GPIO_IRRECV, // IR receiver
  369. #endif
  370. #endif
  371. #ifdef USE_RC_SWITCH
  372. GPIO_RFSEND, // RF transmitter
  373. GPIO_RFRECV, // RF receiver
  374. #endif
  375. #ifdef USE_RF_SENSOR
  376. GPIO_RF_SENSOR, // Rf receiver with sensor decoding
  377. #endif
  378. #ifdef USE_SR04
  379. GPIO_SR04_TRIG, // SR04 Trigger pin
  380. GPIO_SR04_ECHO, // SR04 Echo pin
  381. #endif
  382. #ifdef USE_TM1638
  383. GPIO_TM16CLK, // TM1638 Clock
  384. GPIO_TM16DIO, // TM1638 Data I/O
  385. GPIO_TM16STB, // TM1638 Strobe
  386. #endif
  387. #ifdef USE_HX711
  388. GPIO_HX711_SCK, // HX711 Load Cell clock
  389. GPIO_HX711_DAT, // HX711 Load Cell data
  390. #endif
  391. #ifdef USE_SERIAL_BRIDGE
  392. GPIO_SBR_TX, // Serial Bridge Serial interface
  393. GPIO_SBR_RX, // Serial Bridge Serial interface
  394. #endif
  395. #ifdef USE_MHZ19
  396. GPIO_MHZ_TXD, // MH-Z19 Serial interface
  397. GPIO_MHZ_RXD, // MH-Z19 Serial interface
  398. #endif
  399. #ifdef USE_SENSEAIR
  400. GPIO_SAIR_TX, // SenseAir Serial interface
  401. GPIO_SAIR_RX, // SenseAir Serial interface
  402. #endif
  403. #ifdef USE_NOVA_SDS
  404. GPIO_SDS0X1_TX, // Nova Fitness SDS011 Serial interface
  405. GPIO_SDS0X1_RX, // Nova Fitness SDS011 Serial interface
  406. #endif
  407. #if defined(USE_PZEM004T) || defined(USE_PZEM_AC) || defined(USE_PZEM_DC)
  408. GPIO_PZEM0XX_TX, // PZEM0XX Serial interface
  409. #endif
  410. #ifdef USE_PZEM004T
  411. GPIO_PZEM004_RX, // PZEM004T Serial interface
  412. #endif
  413. #ifdef USE_PZEM_AC
  414. GPIO_PZEM016_RX, // PZEM-014,016 Serial Modbus interface
  415. #endif
  416. #ifdef USE_PZEM_DC
  417. GPIO_PZEM017_RX, // PZEM-003,017 Serial Modbus interface
  418. #endif
  419. #ifdef USE_SDM120
  420. GPIO_SDM120_TX, // SDM120 Serial interface
  421. GPIO_SDM120_RX, // SDM120 Serial interface
  422. #endif
  423. #ifdef USE_SDM630
  424. GPIO_SDM630_TX, // SDM630 Serial interface
  425. GPIO_SDM630_RX, // SDM630 Serial interface
  426. #endif
  427. #ifdef USE_PMS5003
  428. GPIO_PMS5003, // Plantower PMS5003 Serial interface
  429. #endif
  430. #ifdef USE_TX20_WIND_SENSOR
  431. GPIO_TX20_TXD_BLACK, // TX20 Transmission Pin
  432. #endif
  433. #ifdef USE_MP3_PLAYER
  434. GPIO_MP3_DFR562, // RB-DFR-562, DFPlayer Mini MP3 Player Serial interface
  435. #endif
  436. #ifdef USE_TUYA_DIMMER
  437. GPIO_TUYA_TX, // Tuya Serial interface
  438. GPIO_TUYA_RX, // Tuya Serial interface
  439. #endif
  440. #ifdef USE_MGC3130
  441. GPIO_MGC3130_XFER,
  442. GPIO_MGC3130_RESET
  443. #endif
  444. #ifdef USE_AZ7798
  445. GPIO_AZ_TXD, // AZ-Instrument 7798 CO2 datalogger Serial interface
  446. GPIO_AZ_RXD // AZ-Instrument 7798 CO2 datalogger Serial interface
  447. #endif
  448. };
  449. const uint8_t kModuleNiceList[MAXMODULE] PROGMEM = {
  450. SONOFF_BASIC, // Sonoff Relay Devices
  451. SONOFF_RF,
  452. SONOFF_TH,
  453. SONOFF_DUAL,
  454. SONOFF_DUAL_R2,
  455. SONOFF_POW,
  456. SONOFF_POW_R2,
  457. SONOFF_4CH,
  458. SONOFF_4CHPRO,
  459. SONOFF_S31, // Sonoff Socket Relay Devices with Energy Monitoring
  460. SONOFF_S2X, // Sonoff Socket Relay Devices
  461. SONOFF_TOUCH, // Sonoff Switch Devices
  462. SONOFF_T11,
  463. SONOFF_T12,
  464. SONOFF_T13,
  465. SONOFF_LED, // Sonoff Light Devices
  466. SONOFF_BN,
  467. SONOFF_B1, // Sonoff Light Bulbs
  468. SLAMPHER,
  469. SONOFF_SC, // Sonoff Environmemtal Sensor
  470. SONOFF_IFAN02, // Sonoff Fan
  471. SONOFF_BRIDGE, // Sonoff Bridge
  472. SONOFF_SV, // Sonoff Development Devices
  473. SONOFF_DEV,
  474. CH1, // Relay Devices
  475. CH4,
  476. MOTOR,
  477. ELECTRODRAGON,
  478. EXS_RELAY,
  479. SUPLA1,
  480. LUANIHVIO,
  481. YUNSHAN,
  482. WION,
  483. SHELLY1,
  484. SHELLY2,
  485. BLITZWOLF_BWSHP, // Socket Relay Devices with Energy Monitoring
  486. TECKIN,
  487. TECKIN_US,
  488. APLIC_WDP303075,
  489. GOSUND,
  490. SK03_TUYA,
  491. NEO_COOLCAM, // Socket Relay Devices
  492. OBI,
  493. MANZOKU_EU_4,
  494. ESP_SWITCH, // Switch Devices
  495. TUYA_DIMMER, // Dimmer Devices
  496. ARMTRONIX_DIMMERS,
  497. PS_16_DZ,
  498. H801, // Light Devices
  499. MAGICHOME,
  500. ARILUX_LC01,
  501. ARILUX_LC06,
  502. ARILUX_LC11,
  503. ZENGGE_ZF_WF017,
  504. HUAFAN_SS,
  505. KMC_70011,
  506. AILIGHT, // Light Bulbs
  507. PHILIPS,
  508. WITTY, // Development Devices
  509. WEMOS
  510. };
  511. // Default module settings
  512. const mytmplt kModules[MAXMODULE] PROGMEM = {
  513. { "Sonoff Basic", // Sonoff Basic (ESP8266)
  514. GPIO_KEY1, // GPIO00 Button
  515. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  516. GPIO_USER, // GPIO02 Only available on newer Sonoff Basic R2 V1
  517. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  518. GPIO_USER, // GPIO04 Optional sensor
  519. 0, // GPIO05
  520. 0, // GPIO06 (SD_CLK Flash)
  521. 0, // GPIO07 (SD_DATA0 Flash QIO/DIO/DOUT)
  522. 0, // GPIO08 (SD_DATA1 Flash QIO/DIO/DOUT)
  523. 0, // GPIO09 (SD_DATA2 Flash QIO)
  524. 0, // GPIO10 (SD_DATA3 Flash QIO)
  525. 0, // GPIO11 (SD_CMD Flash)
  526. GPIO_REL1, // GPIO12 Red Led and Relay (0 = Off, 1 = On)
  527. GPIO_LED1_INV, // GPIO13 Green Led (0 = On, 1 = Off)
  528. GPIO_USER, // GPIO14 Optional sensor
  529. 0, // GPIO15
  530. 0, // GPIO16
  531. 0 // ADC0 Analog input
  532. },
  533. { "Sonoff RF", // Sonoff RF (ESP8266)
  534. GPIO_KEY1, // GPIO00 Button
  535. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  536. 0,
  537. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  538. GPIO_USER, // GPIO04 Optional sensor
  539. 0,
  540. 0, 0, 0, 0, 0, 0, // Flash connection
  541. GPIO_REL1, // GPIO12 Red Led and Relay (0 = Off, 1 = On)
  542. GPIO_LED1_INV, // GPIO13 Green Led (0 = On, 1 = Off)
  543. GPIO_USER, // GPIO14 Optional sensor
  544. 0, 0, 0
  545. },
  546. { "Sonoff SV", // Sonoff SV (ESP8266)
  547. GPIO_KEY1, // GPIO00 Button
  548. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  549. 0,
  550. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  551. GPIO_USER, // GPIO04 Optional sensor
  552. GPIO_USER, // GPIO05 Optional sensor
  553. 0, 0, 0, 0, 0, 0, // Flash connection
  554. GPIO_REL1, // GPIO12 Red Led and Relay (0 = Off, 1 = On)
  555. GPIO_LED1_INV, // GPIO13 Green Led (0 = On, 1 = Off)
  556. GPIO_USER, // GPIO14 Optional sensor
  557. 0, 0,
  558. GPIO_ADC0 // ADC0 Analog input
  559. },
  560. { "Sonoff TH", // Sonoff TH10/16 (ESP8266)
  561. GPIO_KEY1, // GPIO00 Button
  562. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  563. 0,
  564. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  565. GPIO_USER, // GPIO04 Optional sensor
  566. 0,
  567. 0, 0, 0, 0, 0, 0, // Flash connection
  568. GPIO_REL1, // GPIO12 Red Led and Relay (0 = Off, 1 = On)
  569. GPIO_LED1_INV, // GPIO13 Green Led (0 = On, 1 = Off)
  570. GPIO_USER, // GPIO14 Optional sensor
  571. 0, 0, 0
  572. },
  573. { "Sonoff Dual", // Sonoff Dual (ESP8266)
  574. 0,
  575. GPIO_TXD, // GPIO01 Relay control
  576. 0,
  577. GPIO_RXD, // GPIO03 Relay control
  578. GPIO_USER, // GPIO04 Optional sensor
  579. 0,
  580. 0, 0, 0, 0, 0, 0, // Flash connection
  581. 0,
  582. GPIO_LED1_INV, // GPIO13 Blue Led (0 = On, 1 = Off)
  583. GPIO_USER, // GPIO14 Optional sensor
  584. 0, 0, 0
  585. },
  586. { "Sonoff Pow", // Sonoff Pow (ESP8266 - HLW8012)
  587. GPIO_KEY1, // GPIO00 Button
  588. 0, 0, 0, 0,
  589. GPIO_NRG_SEL, // GPIO05 HLW8012 Sel output (1 = Voltage)
  590. 0, 0, 0, 0, 0, 0, // Flash connection
  591. GPIO_REL1, // GPIO12 Red Led and Relay (0 = Off, 1 = On)
  592. GPIO_NRG_CF1, // GPIO13 HLW8012 CF1 voltage / current
  593. GPIO_HLW_CF, // GPIO14 HLW8012 CF power
  594. GPIO_LED1, // GPIO15 Blue Led (0 = On, 1 = Off)
  595. 0, 0
  596. },
  597. { "Sonoff 4CH", // Sonoff 4CH (ESP8285)
  598. GPIO_KEY1, // GPIO00 Button 1
  599. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  600. GPIO_USER, // GPIO02 Optional sensor
  601. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  602. GPIO_REL3, // GPIO04 Sonoff 4CH Red Led and Relay 3 (0 = Off, 1 = On)
  603. GPIO_REL2, // GPIO05 Sonoff 4CH Red Led and Relay 2 (0 = Off, 1 = On)
  604. 0, 0, 0, // Flash connection
  605. GPIO_KEY2, // GPIO09 Button 2
  606. GPIO_KEY3, // GPIO10 Button 3
  607. 0, // Flash connection
  608. GPIO_REL1, // GPIO12 Red Led and Relay 1 (0 = Off, 1 = On)
  609. GPIO_LED1_INV, // GPIO13 Blue Led (0 = On, 1 = Off)
  610. GPIO_KEY4, // GPIO14 Button 4
  611. GPIO_REL4, // GPIO15 Red Led and Relay 4 (0 = Off, 1 = On)
  612. 0, 0
  613. },
  614. { "Sonoff S2X", // Sonoff S20, S22 and S26 Smart Socket (ESP8266)
  615. GPIO_KEY1, // GPIO00 Button
  616. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  617. GPIO_USER, // GPIO02 Optional sensor
  618. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  619. 0, 0,
  620. 0, 0, 0, 0, 0, 0, // Flash connection
  621. GPIO_REL1, // GPIO12 Red Led and Relay (0 = Off, 1 = On)
  622. GPIO_LED1_INV, // GPIO13 Green/Blue Led (0 = On, 1 = Off)
  623. 0, 0, 0, 0
  624. },
  625. { "Slampher", // Slampher (ESP8266)
  626. GPIO_KEY1, // GPIO00 Button
  627. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  628. 0,
  629. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  630. 0, 0,
  631. 0, 0, 0, 0, 0, 0, // Flash connection
  632. GPIO_REL1, // GPIO12 Red Led and Relay (0 = Off, 1 = On)
  633. GPIO_LED1_INV, // GPIO13 Blue Led (0 = On, 1 = Off)
  634. 0, 0, 0, 0
  635. },
  636. { "Sonoff Touch", // Sonoff Touch (ESP8285)
  637. GPIO_KEY1, // GPIO00 Button
  638. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  639. 0,
  640. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  641. 0, 0,
  642. 0, 0, 0, // Flash connection
  643. 0, 0,
  644. 0, // Flash connection
  645. GPIO_REL1, // GPIO12 Red Led and Relay (0 = Off, 1 = On)
  646. GPIO_LED1_INV, // GPIO13 Blue Led (0 = On, 1 = Off)
  647. 0, 0, 0, 0
  648. },
  649. { "Sonoff LED", // Sonoff LED (ESP8266)
  650. GPIO_KEY1, // GPIO00 Button
  651. 0, 0, 0,
  652. GPIO_USER, // GPIO04 Optional sensor (PWM3 Green)
  653. GPIO_USER, // GPIO05 Optional sensor (PWM2 Red)
  654. 0, 0, 0, 0, 0, 0, // Flash connection
  655. GPIO_PWM1, // GPIO12 Cold light (PWM0 Cold)
  656. GPIO_LED1_INV, // GPIO13 Blue Led (0 = On, 1 = Off)
  657. GPIO_PWM2, // GPIO14 Warm light (PWM1 Warm)
  658. GPIO_USER, // GPIO15 Optional sensor (PWM4 Blue)
  659. 0, 0
  660. },
  661. { "1 Channel", // 1 Channel Inching/Latching Relay using (PSA-B01 - ESP8266 and PSF-B01 - ESP8285)
  662. GPIO_KEY1, // GPIO00 Button
  663. 0, 0, 0, 0, 0,
  664. 0, 0, 0, 0, 0, 0, // Flash connection
  665. GPIO_REL1, // GPIO12 Red Led and Relay (0 = Off, 1 = On)
  666. GPIO_LED1_INV, // GPIO13 Green Led (0 = On, 1 = Off)
  667. 0, 0, 0, 0
  668. },
  669. { "4 Channel", // 4 Channel Inching/Latching Relays (ESP8266)
  670. 0,
  671. GPIO_TXD, // GPIO01 Relay control
  672. 0,
  673. GPIO_RXD, // GPIO03 Relay control
  674. 0, 0,
  675. 0, 0, 0, 0, 0, 0, // Flash connection
  676. 0,
  677. GPIO_LED1_INV, // GPIO13 Blue Led (0 = On, 1 = Off)
  678. 0, 0, 0, 0
  679. },
  680. { "Motor C/AC", // Motor Clockwise / Anti clockwise (PSA-B01 - ESP8266)
  681. GPIO_KEY1, // GPIO00 Button
  682. 0, 0, 0, 0, 0,
  683. 0, 0, 0, 0, 0, 0, // Flash connection
  684. GPIO_REL1, // GPIO12 Red Led and Relay (0 = Off, 1 = On)
  685. GPIO_LED1_INV, // GPIO13 Green Led (0 = On, 1 = Off)
  686. 0, 0, 0, 0
  687. },
  688. { "ElectroDragon", // ElectroDragon IoT Relay Board (ESP8266)
  689. GPIO_KEY2, // GPIO00 Button 2
  690. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  691. GPIO_KEY1, // GPIO02 Button 1
  692. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  693. GPIO_USER, // GPIO04 Optional sensor
  694. GPIO_USER, // GPIO05 Optional sensor
  695. 0, 0, 0, 0, 0, 0, // Flash connection
  696. GPIO_REL2, // GPIO12 Red Led and Relay 2 (0 = Off, 1 = On)
  697. GPIO_REL1, // GPIO13 Red Led and Relay 1 (0 = Off, 1 = On)
  698. GPIO_USER, // GPIO14 Optional sensor
  699. GPIO_USER, // GPIO15 Optional sensor
  700. GPIO_LED1, // GPIO16 Green/Blue Led (1 = On, 0 = Off)
  701. GPIO_ADC0 // ADC0 A0 Analog input
  702. },
  703. { "EXS Relay(s)", // ES-Store Latching relay(s) (ESP8266)
  704. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  705. // V3.1 Module Pin 1 VCC 3V3, Module Pin 6 GND
  706. // https://ex-store.de/2-Kanal-WiFi-WLan-Relay-V5-Blackline-fuer-Unterputzmontage
  707. GPIO_USER, // GPIO00 V3.1 Module Pin 8 - V5.0 Module Pin 4
  708. GPIO_USER, // GPIO01 UART0_TXD V3.1 Module Pin 2 - V5.0 Module Pin 3
  709. GPIO_USER, // GPIO02 V3.1 Module Pin 7
  710. GPIO_USER, // GPIO03 UART0_RXD V3.1 Module Pin 3
  711. GPIO_USER, // GPIO04 V3.1 Module Pin 10 - V5.0 Module Pin 2
  712. GPIO_USER, // GPIO05 V3.1 Module Pin 9 - V5.0 Module Pin 1
  713. 0, 0, 0, 0, 0, 0, // Flash connection
  714. GPIO_REL1, // GPIO12 Relay1 ( 1 = Off)
  715. GPIO_REL2, // GPIO13 Relay1 ( 1 = On)
  716. GPIO_USER, // GPIO14 V3.1 Module Pin 5 - V5.0 GPIO_REL3_INV Relay2 ( 1 = Off)
  717. GPIO_LED1, // GPIO15 V5.0 LED1
  718. GPIO_USER, // GPIO16 V3.1 Module Pin 4 - V5.0 GPIO_REL4_INV Relay2 ( 1 = On)
  719. 0
  720. },
  721. { "WiOn", // Indoor Tap (ESP8266)
  722. // https://www.amazon.com/gp/product/B00ZYLUBJU/ref=s9_acsd_al_bw_c_x_3_w
  723. GPIO_USER, // GPIO00 Optional sensor (pm clock)
  724. 0,
  725. GPIO_LED1, // GPIO02 Green Led (1 = On, 0 = Off)
  726. 0, 0, 0,
  727. 0, 0, 0, 0, 0, 0, // Flash connection
  728. GPIO_USER, // GPIO12 Optional sensor (pm data)
  729. GPIO_KEY1, // GPIO13 Button
  730. 0,
  731. GPIO_REL1, // GPIO15 Relay (0 = Off, 1 = On)
  732. 0, 0
  733. },
  734. { "Generic", // Any ESP8266/ESP8285 device like WeMos and NodeMCU hardware (ESP8266)
  735. GPIO_USER, // GPIO00 D3 Wemos Button Shield
  736. GPIO_USER, // GPIO01 TX Serial RXD
  737. GPIO_USER, // GPIO02 D4 Wemos DHT Shield
  738. GPIO_USER, // GPIO03 RX Serial TXD and Optional sensor
  739. GPIO_USER, // GPIO04 D2 Wemos I2C SDA
  740. GPIO_USER, // GPIO05 D1 Wemos I2C SCL / Wemos Relay Shield (0 = Off, 1 = On) / Wemos WS2812B RGB led Shield
  741. 0, 0, 0, // Flash connection
  742. GPIO_USER, // Flash connection or GPIO09 on ESP8285 only!
  743. GPIO_USER, // Flash connection or GPIO10 on ESP8285 only!
  744. 0, // Flash connection
  745. GPIO_USER, // GPIO12 D6
  746. GPIO_USER, // GPIO13 D7
  747. GPIO_USER, // GPIO14 D5
  748. GPIO_USER, // GPIO15 D8
  749. GPIO_USER, // GPIO16 D0 Wemos Wake
  750. GPIO_ADC0 // ADC0 A0 Analog input
  751. },
  752. { "Sonoff Dev", // Sonoff Dev (ESP8266)
  753. GPIO_KEY1, // GPIO00 E-FW Button
  754. GPIO_USER, // GPIO01 TX Serial RXD and Optional sensor
  755. 0, // GPIO02
  756. GPIO_USER, // GPIO03 RX Serial TXD and Optional sensor
  757. GPIO_USER, // GPIO04 Optional sensor
  758. GPIO_USER, // GPIO05 Optional sensor
  759. 0, 0, 0, 0, 0, 0, // Flash connection
  760. GPIO_USER, // GPIO12
  761. GPIO_USER, // GPIO13 BLUE LED
  762. GPIO_USER, // GPIO14 Optional sensor
  763. 0, // GPIO15
  764. 0, // GPIO16
  765. GPIO_ADC0 // ADC0 A0 Analog input
  766. },
  767. { "H801", // Lixada H801 Wifi (ESP8266)
  768. GPIO_USER, // GPIO00 E-FW Button
  769. GPIO_LED1, // GPIO01 Green LED
  770. GPIO_USER, // GPIO02 TX and Optional sensor - Pin next to TX on the PCB
  771. GPIO_USER, // GPIO03 RX and Optional sensor - Pin next to GND on the PCB
  772. GPIO_PWM5, // GPIO04 W2 - PWM5
  773. GPIO_LED2_INV, // GPIO05 Red LED
  774. 0, 0, 0, 0, 0, 0, // Flash connection
  775. GPIO_PWM3, // GPIO12 Blue
  776. GPIO_PWM2, // GPIO13 Green
  777. GPIO_PWM4, // GPIO14 W1 - PWM4
  778. GPIO_PWM1, // GPIO15 Red
  779. 0, 0
  780. },
  781. { "Sonoff SC", // Sonoff SC (ESP8266)
  782. GPIO_KEY1, // GPIO00 Button
  783. GPIO_TXD, // GPIO01 RXD to ATMEGA328P
  784. GPIO_USER, // GPIO02 Optional sensor
  785. GPIO_RXD, // GPIO03 TXD to ATMEGA328P
  786. 0, 0,
  787. 0, 0, 0, 0, 0, 0, // Flash connection
  788. 0,
  789. GPIO_LED1_INV, // GPIO13 Green Led (0 = On, 1 = Off)
  790. 0, 0, 0, 0
  791. },
  792. { "Sonoff BN-SZ", // Sonoff BN-SZ01 Ceiling led (ESP8285)
  793. 0, 0, 0, 0, 0, 0,
  794. 0, 0, 0, // Flash connection
  795. 0, 0,
  796. 0, // Flash connection
  797. GPIO_PWM1, // GPIO12 Light
  798. GPIO_LED1_INV, // GPIO13 Red Led (0 = On, 1 = Off)
  799. 0, 0,
  800. 0, 0
  801. },
  802. { "Sonoff 4CH Pro", // Sonoff 4CH Pro (ESP8285)
  803. GPIO_KEY1, // GPIO00 Button 1
  804. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  805. GPIO_USER, // GPIO02 Optional sensor
  806. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  807. GPIO_REL3, // GPIO04 Sonoff 4CH Red Led and Relay 3 (0 = Off, 1 = On)
  808. GPIO_REL2, // GPIO05 Sonoff 4CH Red Led and Relay 2 (0 = Off, 1 = On)
  809. 0, 0, 0, // Flash connection
  810. GPIO_KEY2, // GPIO09 Button 2
  811. GPIO_KEY3, // GPIO10 Button 3
  812. 0, // Flash connection
  813. GPIO_REL1, // GPIO12 Red Led and Relay 1 (0 = Off, 1 = On)
  814. GPIO_LED1_INV, // GPIO13 Blue Led (0 = On, 1 = Off)
  815. GPIO_KEY4, // GPIO14 Button 4
  816. GPIO_REL4, // GPIO15 Red Led and Relay 4 (0 = Off, 1 = On)
  817. 0, 0
  818. },
  819. { "Huafan SS", // Hua Fan Smart Socket (ESP8266) - like Sonoff Pow
  820. GPIO_LED1_INV, // GPIO0 Blue Led (0 = On, 1 = Off)
  821. 0, 0,
  822. GPIO_LED2_INV, // GPIO3 Red Led (0 = On, 1 = Off)
  823. GPIO_KEY1, // GPIO4 Button
  824. GPIO_REL1_INV, // GPIO5 Relay (0 = On, 1 = Off)
  825. 0, 0, 0, 0, 0, 0, // Flash connection
  826. GPIO_NRG_CF1, // GPIO12 HLW8012 CF1 voltage / current
  827. GPIO_NRG_SEL, // GPIO13 HLW8012 Sel output (1 = Voltage)
  828. GPIO_HLW_CF, // GPIO14 HLW8012 CF power
  829. 0, 0, 0
  830. },
  831. { "Sonoff Bridge", // Sonoff RF Bridge 433 (ESP8285)
  832. GPIO_KEY1, // GPIO00 Button
  833. GPIO_TXD, // GPIO01 RF bridge control
  834. GPIO_USER, // GPIO02 Optional sensor
  835. GPIO_RXD, // GPIO03 RF bridge control
  836. GPIO_USER, // GPIO04 Optional sensor
  837. GPIO_USER, // GPIO05 Optional sensor
  838. 0, 0, 0, // Flash connection
  839. 0, 0,
  840. 0, // Flash connection
  841. 0,
  842. GPIO_LED1_INV, // GPIO13 Blue Led (0 = On, 1 = Off)
  843. 0, 0, 0, 0
  844. },
  845. { "Sonoff B1", // Sonoff B1 (ESP8285 - my9231)
  846. GPIO_KEY1, // GPIO00 Pad
  847. GPIO_USER, // GPIO01 Serial RXD and Optional sensor pad
  848. GPIO_USER, // GPIO02 Optional sensor SDA pad
  849. GPIO_USER, // GPIO03 Serial TXD and Optional sensor pad
  850. 0, 0,
  851. 0, 0, 0, // Flash connection
  852. 0, 0,
  853. 0, // Flash connection
  854. GPIO_DI, // GPIO12 my9231 DI
  855. 0,
  856. GPIO_DCKI, // GPIO14 my9231 DCKI
  857. 0, 0, 0
  858. },
  859. { "AiLight", // Ai-Thinker RGBW led (ESP8266 - my9291)
  860. GPIO_KEY1, // GPIO00 Pad
  861. GPIO_USER, // GPIO01 Serial RXD and Optional sensor pad
  862. GPIO_USER, // GPIO02 Optional sensor SDA pad
  863. GPIO_USER, // GPIO03 Serial TXD and Optional sensor pad
  864. 0, 0,
  865. 0, 0, 0, // Flash connection
  866. 0, 0,
  867. 0, // Flash connection
  868. 0,
  869. GPIO_DI, // GPIO13 my9291 DI
  870. 0,
  871. GPIO_DCKI, // GPIO15 my9291 DCKI
  872. 0, 0
  873. },
  874. { "Sonoff T1 1CH", // Sonoff T1 1CH (ESP8285)
  875. GPIO_KEY1, // GPIO00 Button 1
  876. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  877. GPIO_USER, // GPIO02 Optional Sensor (J3 Pin 5)
  878. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  879. 0, 0,
  880. 0, 0, 0, // Flash connection
  881. 0, 0,
  882. 0, // Flash connection
  883. GPIO_REL1, // GPIO12 Blue Led and Relay 1 (0 = Off, 1 = On)
  884. GPIO_LED1_INV, // GPIO13 Blue Led (0 = On, 1 = Off)
  885. 0, 0, 0, 0
  886. },
  887. { "Sonoff T1 2CH", // Sonoff T1 2CH (ESP8285)
  888. GPIO_KEY1, // GPIO00 Button 1
  889. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  890. GPIO_USER, // GPIO02 Optional Sensor (J3 Pin 5)
  891. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  892. 0,
  893. GPIO_REL2, // GPIO05 Blue Led and Relay 2 (0 = Off, 1 = On)
  894. 0, 0, 0, // Flash connection
  895. GPIO_KEY2, // GPIO09 Button 2
  896. 0,
  897. 0, // Flash connection
  898. GPIO_REL1, // GPIO12 Blue Led and Relay 1 (0 = Off, 1 = On)
  899. GPIO_LED1_INV, // GPIO13 Blue Led (0 = On, 1 = Off)
  900. 0, 0, 0, 0
  901. },
  902. { "Sonoff T1 3CH", // Sonoff T1 3CH (ESP8285)
  903. GPIO_KEY1, // GPIO00 Button 1
  904. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  905. GPIO_USER, // GPIO02 Optional Sensor (J3 Pin 5)
  906. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  907. GPIO_REL3, // GPIO04 Blue Led and Relay 3 (0 = Off, 1 = On)
  908. GPIO_REL2, // GPIO05 Blue Led and Relay 2 (0 = Off, 1 = On)
  909. 0, 0, 0, // Flash connection
  910. GPIO_KEY2, // GPIO09 Button 2
  911. GPIO_KEY3, // GPIO10 Button 3
  912. 0, // Flash connection
  913. GPIO_REL1, // GPIO12 Blue Led and Relay 1 (0 = Off, 1 = On)
  914. GPIO_LED1_INV, // GPIO13 Blue Led (0 = On, 1 = Off)
  915. 0, 0, 0, 0
  916. },
  917. { "Supla Espablo", // Supla Espablo (ESP8266)
  918. // http://www.wykop.pl/ramka/3325399/diy-supla-do-puszki-instalacyjnej-podtynkowej-supla-org/
  919. 0, // GPIO00 Flash jumper
  920. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  921. GPIO_DSB, // GPIO02 DS18B20 sensor
  922. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  923. GPIO_KEY1, // GPIO04 Button 1
  924. GPIO_REL1, // GPIO05 Relay 1 (0 = Off, 1 = On)
  925. 0, 0, 0, 0, 0, 0, // Flash connection
  926. GPIO_USER, // GPIO12 Optional sensor
  927. GPIO_REL2, // GPIO13 Relay 2 (0 = Off, 1 = On)
  928. GPIO_USER, // GPIO14 Optional sensor
  929. 0,
  930. GPIO_LED1, // GPIO16 Led (1 = On, 0 = Off)
  931. GPIO_ADC0 // ADC0 A0 Analog input
  932. },
  933. { "Witty Cloud", // Witty Cloud Dev Board (ESP8266)
  934. // https://www.aliexpress.com/item/ESP8266-serial-WIFI-Witty-cloud-Development-Board-ESP-12F-module-MINI-nodemcu/32643464555.html
  935. GPIO_USER, // GPIO00 D3 flash push button on interface board
  936. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  937. GPIO_LED1_INV, // GPIO02 D4 Blue Led (0 = On, 1 = Off) on ESP-12F
  938. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  939. GPIO_KEY1, // GPIO04 D2 push button on ESP-12F board
  940. GPIO_USER, // GPIO05 D1 optional sensor
  941. 0, 0, 0, 0, 0, 0, // Flash connection
  942. GPIO_PWM2, // GPIO12 D6 RGB LED Green
  943. GPIO_PWM3, // GPIO13 D7 RGB LED Blue
  944. GPIO_USER, // GPIO14 D5 optional sensor
  945. GPIO_PWM1, // GPIO15 D8 RGB LED Red
  946. GPIO_USER, // GPIO16 D0 optional sensor
  947. GPIO_ADC0 // ADC0 A0 Light sensor / Requires USE_ADC_VCC in user_config.h to be disabled
  948. },
  949. { "Yunshan Relay", // Yunshan Wifi Relay (ESP8266)
  950. // https://www.ebay.com/p/Esp8266-220v-10a-Network-Relay-WiFi-Module/1369583381
  951. // Schematics and Info https://ucexperiment.wordpress.com/2016/12/18/yunshan-esp8266-250v-15a-acdc-network-wifi-relay-module/
  952. 0, // GPIO00 Flash jumper - Module Pin 8
  953. GPIO_USER, // GPIO01 Serial RXD and Optional sensor - Module Pin 2
  954. GPIO_LED1_INV, // GPIO02 Blue Led (0 = On, 1 = Off) on ESP-12F - Module Pin 7
  955. GPIO_USER, // GPIO03 Serial TXD and Optional sensor - Module Pin 3
  956. GPIO_REL1, // GPIO04 Red Led and Relay (0 = Off, 1 = On) - Module Pin 10
  957. GPIO_KEY1, // GPIO05 Blue Led and OptoCoupler input - Module Pin 9
  958. 0, 0, 0, 0, 0, 0, // Flash connection
  959. 0, 0, 0, 0, 0
  960. },
  961. { "MagicHome", // Magic Home (aka Flux-light) (ESP8266) and Arilux LC10 (ESP8285)
  962. // https://www.aliexpress.com/item/Magic-Home-Mini-RGB-RGBW-Wifi-Controller-For-Led-Strip-Panel-light-Timing-Function-16million-colors/32686853650.html
  963. 0,
  964. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  965. GPIO_LED1_INV, // GPIO02 Blue onboard LED
  966. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  967. GPIO_ARIRFRCV, // GPIO04 IR or RF receiver (optional) (Arilux LC10)
  968. GPIO_PWM2, // GPIO05 RGB LED Green
  969. 0, 0, 0, 0, 0, 0, // Flash connection
  970. GPIO_PWM3, // GPIO12 RGB LED Blue
  971. GPIO_USER, // GPIO13 RGBW LED White (optional - set to PWM4 for Cold White or Warm White as used on Arilux LC10)
  972. GPIO_PWM1, // GPIO14 RGB LED Red
  973. GPIO_LED2_INV, // GPIO15 RF receiver control (Arilux LC10)
  974. 0, 0
  975. },
  976. { "Luani HVIO", // ESP8266_HVIO
  977. // https://luani.de/projekte/esp8266-hvio/
  978. 0, // GPIO00 Flash jumper
  979. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  980. GPIO_USER, // GPIO02 Optional sensor / I2C SDA pad
  981. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  982. GPIO_REL1, // GPIO04 Relay 1 (0 = Off, 1 = On)
  983. GPIO_REL2, // GPIO05 Relay 2 (0 = Off, 1 = On)
  984. 0, 0, 0, 0, 0, 0, // Flash connection
  985. GPIO_SWT1, // GPIO12 External input 1 (0 = On, 1 = Off)
  986. GPIO_SWT2, // GPIO13 External input 2 (0 = On, 1 = Off)
  987. GPIO_USER, // GPIO14 Optional sensor / I2C SCL pad
  988. GPIO_LED1, // GPIO15 Led (1 = On, 0 = Off)
  989. 0,
  990. GPIO_ADC0 // ADC0 A0 Analog input
  991. },
  992. { "KMC 70011", // KMC 70011
  993. // https://www.amazon.com/KMC-Timing-Monitoring-Network-125V-240V/dp/B06XRX2GTQ
  994. GPIO_KEY1, // GPIO00 Button
  995. 0, 0, 0,
  996. GPIO_HLW_CF, // GPIO04 HLW8012 CF power
  997. GPIO_NRG_CF1, // GPIO05 HLW8012 CF1 voltage / current
  998. 0, 0, 0, 0, 0, 0, // Flash connection
  999. GPIO_NRG_SEL, // GPIO12 HLW8012 SEL (1 = Voltage)
  1000. GPIO_LED1_INV, // GPIO13 Green Led
  1001. GPIO_REL1, // GPIO14 Relay
  1002. 0, 0, 0
  1003. },
  1004. { "Arilux LC01", // Arilux AL-LC01 (ESP8285)
  1005. // https://www.banggood.com/nl/ARILUX-AL-LC01-Super-Mini-LED-WIFI-Smart-RGB-Controller-For-RGB-LED-Strip-Light-DC-9-12V-p-1058603.html
  1006. // (PwmFrequency 1111Hz)
  1007. GPIO_KEY1, // GPIO00 Optional Button
  1008. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  1009. GPIO_LED2_INV, // GPIO02 RF receiver control
  1010. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  1011. GPIO_ARIRFRCV, // GPIO04 IR or RF receiver (optional)
  1012. GPIO_PWM1, // GPIO05 RGB LED Red
  1013. 0, 0, 0, 0, 0, 0, // Flash connection
  1014. GPIO_PWM2, // GPIO12 RGB LED Green
  1015. GPIO_PWM3, // GPIO13 RGB LED Blue
  1016. GPIO_USER, // GPIO14 RGBW LED White (optional - set to PWM4 for Cold White or Warm White)
  1017. 0, 0, 0
  1018. },
  1019. { "Arilux LC11", // Arilux AL-LC11 (ESP8266)
  1020. // https://www.banggood.com/nl/ARILUX-AL-LC11-Super-Mini-LED-WIFI-APP-Controller-RF-Remote-Control-For-RGBWW-LED-Strip-DC9-28V-p-1085112.html
  1021. // (PwmFrequency 540Hz)
  1022. GPIO_KEY1, // GPIO00 Optional Button
  1023. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  1024. GPIO_LED2_INV, // GPIO02 RF receiver control
  1025. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  1026. GPIO_PWM2, // GPIO04 RGB LED Green
  1027. GPIO_PWM1, // GPIO05 RGB LED Red
  1028. 0, 0, 0, 0, 0, 0, // Flash connection
  1029. GPIO_PWM5, // GPIO12 RGBCW LED Warm
  1030. GPIO_PWM4, // GPIO13 RGBW LED Cold
  1031. GPIO_PWM3, // GPIO14 RGB LED Blue
  1032. GPIO_ARIRFRCV, // GPIO15 RF receiver input
  1033. 0, 0
  1034. },
  1035. { "Sonoff Dual R2", // Sonoff Dual R2 (ESP8285)
  1036. GPIO_USER, // GPIO00 Button 0 on header (0 = On, 1 = Off)
  1037. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  1038. 0,
  1039. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  1040. 0,
  1041. GPIO_REL2, // GPIO05 Relay 2 (0 = Off, 1 = On)
  1042. 0, 0, 0, // Flash connection
  1043. GPIO_USER, // GPIO09 Button 1 on header (0 = On, 1 = Off)
  1044. GPIO_KEY1, // GPIO10 Button on casing
  1045. 0, // Flash connection
  1046. GPIO_REL1, // GPIO12 Relay 1 (0 = Off, 1 = On)
  1047. GPIO_LED1_INV, // GPIO13 Blue Led (0 = On, 1 = Off)
  1048. 0, 0, 0, 0
  1049. },
  1050. { "Arilux LC06", // Arilux AL-LC06 (ESP8285)
  1051. // https://www.banggood.com/ARILUX-AL-LC06-LED-WIFI-Smartphone-Controller-Romote-5-Channels-DC12-24V-For-RGBWW-Strip-light-p-1061476.html
  1052. GPIO_KEY1, // GPIO00 Optional Button
  1053. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  1054. GPIO_USER, // GPIO02 Empty pad
  1055. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  1056. GPIO_USER, // GPIO04 W2 - PWM5
  1057. 0,
  1058. 0, 0, 0, 0, 0, 0, // Flash connection
  1059. GPIO_PWM2, // GPIO12 RGB LED Green
  1060. GPIO_PWM3, // GPIO13 RGB LED Blue
  1061. GPIO_PWM1, // GPIO14 RGB LED Red
  1062. GPIO_USER, // GPIO15 RGBW LED White
  1063. 0, 0
  1064. },
  1065. { "Sonoff S31", // Sonoff S31 (ESP8266 - CSE7766)
  1066. GPIO_KEY1, // GPIO00 Button
  1067. 0, // GPIO01 Serial RXD 4800 baud 8E1 CSE7766 energy sensor
  1068. 0,
  1069. 0, // GPIO03 Serial TXD
  1070. 0, 0,
  1071. 0, 0, 0, 0, 0, 0, // Flash connection
  1072. GPIO_REL1, // GPIO12 Red Led and Relay (0 = Off, 1 = On)
  1073. GPIO_LED1_INV, // GPIO13 Green Led (0 = On, 1 = Off)
  1074. 0, 0, 0, 0
  1075. },
  1076. { "Zengge WF017", // Zenggee ZJ-WF017-A (ESP12S))
  1077. // https://www.ebay.com/p/Smartphone-Android-IOS-WiFi-Music-Controller-for-RGB-5050-3528-LED-Strip-Light/534446632?_trksid=p2047675.l2644
  1078. GPIO_KEY1, // GPIO00 Optional Button
  1079. 0,
  1080. GPIO_USER, // GPIO02 Empty pad
  1081. 0,
  1082. GPIO_USER, // GPIO04 W2 - PWM5
  1083. 0,
  1084. 0, 0, 0, 0, 0, 0, // Flash connection
  1085. GPIO_PWM2, // GPIO12 RGB LED Green
  1086. GPIO_PWM1, // GPIO13 RGB LED Red
  1087. GPIO_PWM3, // GPIO14 RGB LED Blue
  1088. 0, 0, 0
  1089. },
  1090. { "Sonoff Pow R2", // Sonoff Pow R2 (ESP8285 - CSE7766)
  1091. GPIO_KEY1, // GPIO00 Button
  1092. 0, // GPIO01 Serial RXD 4800 baud 8E1 CSE7766 energy sensor
  1093. 0,
  1094. 0, // GPIO03 Serial TXD
  1095. 0, 0,
  1096. 0, 0, 0, 0, 0, 0, // Flash connection
  1097. GPIO_REL1, // GPIO12 Red Led and Relay (0 = Off, 1 = On)
  1098. GPIO_LED1_INV, // GPIO13 Blue Led (0 = On, 1 = Off)
  1099. 0, 0, 0, 0
  1100. },
  1101. { "Sonoff iFan02", // Sonoff iFan02 (ESP8285)
  1102. GPIO_KEY1, // GPIO00 WIFI_KEY0 Virtual button 1 as feedback from RC
  1103. GPIO_USER, // GPIO01 ESP_TXD Serial RXD and Optional sensor
  1104. 0, // GPIO02 ESP_LOG
  1105. GPIO_USER, // GPIO03 ESP_RXD Serial TXD and Optional sensor
  1106. GPIO_REL3, // GPIO04 WIFI_O2 Relay 3 (0 = Off, 1 = On) controlling the fan
  1107. GPIO_REL2, // GPIO05 WIFI_O1 Relay 2 (0 = Off, 1 = On) controlling the fan
  1108. 0, 0, 0, // Flash connection
  1109. GPIO_KEY2, // GPIO09 WIFI_KEY1 Virtual button 2 as feedback from RC
  1110. GPIO_KEY3, // GPIO10 WIFI_KEY2 Virtual button 3 as feedback from RC
  1111. 0, // Flash connection
  1112. GPIO_REL1, // GPIO12 WIFI_O0 Relay 1 (0 = Off, 1 = On) controlling the light
  1113. GPIO_LED1_INV, // GPIO13 WIFI_CHK Blue Led on PCA (0 = On, 1 = Off)
  1114. GPIO_KEY4, // GPIO14 WIFI_KEY3 Virtual button 4 as feedback from RC
  1115. GPIO_REL4, // GPIO15 WIFI_O3 Relay 4 (0 = Off, 1 = On) controlling the fan
  1116. 0, 0
  1117. },
  1118. { "BlitzWolf SHP", // BlitzWolf BW-SHP2 and BW-SHP6 (ESP8285 - BL0937 or HJL-01 Energy Monitoring)
  1119. // https://www.banggood.com/BlitzWolf-BW-SHP2-Smart-WIFI-Socket-EU-Plug-220V-16A-Work-with-Amazon-Alexa-Google-Assistant-p-1292899.html
  1120. // https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG/ref=sr_1_fkmr0_1
  1121. // https://www.amazon.de/Intelligente-Stromverbrauch-Fernsteurung-Schaltbare-Energieklasse/dp/B076WZQS4S/ref=sr_1_1
  1122. // https://www.aliexpress.com/store/product/BlitzWolf-BW-SHP6-EU-Plug-Metering-Version-WIFI-Smart-Socket-220V-240V-10A-Work-with-Amazon/1965360_32945504669.html
  1123. GPIO_LED2_INV, // GPIO00 Red Led (1 = On, 0 = Off)
  1124. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  1125. GPIO_LED1_INV, // GPIO02 Blue Led (1 = On, 0 = Off)
  1126. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  1127. 0,
  1128. GPIO_HJL_CF, // GPIO05 BL0937 or HJL-01 CF power
  1129. 0, 0, 0, 0, 0, 0, // Flash connection
  1130. GPIO_NRG_SEL_INV, // GPIO12 BL0937 or HJL-01 Sel output (0 = Voltage)
  1131. GPIO_KEY1, // GPIO13 Button
  1132. GPIO_NRG_CF1, // GPIO14 BL0937 or HJL-01 CF1 current / voltage
  1133. GPIO_REL1, // GPIO15 Relay (0 = Off, 1 = On)
  1134. 0, 0
  1135. },
  1136. { "Shelly 1", // Shelly1 Open Source (ESP8266 - 2MB) - https://shelly.cloud/shelly1-open-source/
  1137. 0, 0, 0, 0,
  1138. GPIO_REL1, // GPIO04 Relay (0 = Off, 1 = On)
  1139. GPIO_SWT1_NP, // GPIO05 SW pin
  1140. 0, 0, 0, 0, 0, 0, // Flash connection
  1141. 0, 0, 0, 0, 0, 0
  1142. },
  1143. { "Shelly 2", // Shelly2 (ESP8266 - 2MB) - https://shelly.cloud/shelly2/
  1144. 0,
  1145. GPIO_TXD, // GPIO01 MCP39F501 Serial input
  1146. 0,
  1147. GPIO_RXD, // GPIO03 MCP39F501 Serial output
  1148. GPIO_REL1, // GPIO04
  1149. GPIO_REL2, // GPIO05
  1150. 0, 0, 0, 0, 0, 0, // Flash connection
  1151. GPIO_SWT1, // GPIO12
  1152. 0,
  1153. GPIO_SWT2, // GPIO14
  1154. 0, // GPIO15 MCP39F501 Reset
  1155. 0, 0
  1156. },
  1157. { "Xiaomi Philips", // Xiaomi Philips bulb (ESP8266)
  1158. 0, 0, 0, 0, 0, 0,
  1159. 0, 0, 0, 0, 0, 0,
  1160. GPIO_PWM2, // GPIO12 cold/warm light
  1161. 0, 0,
  1162. GPIO_PWM1, // GPIO15 light intensity
  1163. 0, 0
  1164. },
  1165. { "Neo Coolcam", // Neo Coolcam (ESP8266)
  1166. // https://www.banggood.com/NEO-COOLCAM-WiFi-Mini-Smart-Plug-APP-Remote-Control-Timing-Smart-Socket-EU-Plug-p-1288562.html?cur_warehouse=CN
  1167. 0, 0, 0, 0,
  1168. GPIO_LED1_INV, // GPIO04 Red Led (0 = On, 1 = Off)
  1169. 0,
  1170. 0, 0, 0, 0, 0, 0, // Flash connection
  1171. GPIO_REL1, // GPIO12 Red Led and Relay (0 = Off, 1 = On)
  1172. GPIO_KEY1, // GPIO13 Button
  1173. 0, 0, 0, 0
  1174. },
  1175. { "ESP Switch", // Michael Haustein 4 channel wall switch (ESP07 = ESP8266)
  1176. // Use rules for further actions like - rule on power1#state do publish cmnd/other_device/power %value% endon
  1177. GPIO_KEY2, // GPIO00 Button 2
  1178. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  1179. GPIO_REL3_INV, // GPIO02 Yellow Led 3 (0 = On, 1 = Off)
  1180. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  1181. GPIO_KEY1, // GPIO04 Button 1
  1182. GPIO_REL2_INV, // GPIO05 Red Led 2 (0 = On, 1 = Off)
  1183. 0, 0, 0, 0, 0, 0, // Flash connection
  1184. GPIO_REL4_INV, // GPIO12 Blue Led 4 (0 = On, 1 = Off)
  1185. GPIO_KEY4, // GPIO13 Button 4
  1186. GPIO_KEY3, // GPIO14 Button 3
  1187. GPIO_LED1, // GPIO15 Optional sensor
  1188. GPIO_REL1_INV, // GPIO16 Green Led 1 (0 = On, 1 = Off)
  1189. },
  1190. { "OBI Socket", // OBI socket (ESP8266) - https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  1191. GPIO_USER, // GPIO00
  1192. GPIO_USER, // GPIO01 Serial RXD
  1193. 0,
  1194. GPIO_USER, // GPIO03 Serial TXD
  1195. GPIO_LED1, // GPIO04 Blue LED
  1196. GPIO_REL1, // GPIO05 (Relay OFF, but used as Relay Switch)
  1197. 0, 0, 0, 0, 0, 0, // Flash connection
  1198. GPIO_LED2, // GPIO12 (Relay ON, but set to LOW, so we can switch with GPIO05)
  1199. GPIO_USER, // GPIO13
  1200. GPIO_KEY1, // GPIO14 Button
  1201. 0,
  1202. GPIO_USER, // GPIO16
  1203. GPIO_ADC0 // ADC0 A0 Analog input
  1204. },
  1205. { "Teckin", // https://www.amazon.de/gp/product/B07D5V139R
  1206. 0,
  1207. GPIO_KEY1, // GPIO01 Serial TXD and Button
  1208. 0,
  1209. GPIO_LED2_INV, // GPIO03 Serial RXD and Red Led (0 = On, 1 = Off)
  1210. GPIO_HJL_CF, // GPIO04 BL0937 or HJL-01 CF power
  1211. GPIO_NRG_CF1, // GPIO05 BL0937 or HJL-01 CF1 current / voltage
  1212. 0, 0, 0, 0, 0, 0, // Flash connection
  1213. GPIO_NRG_SEL_INV, // GPIO12 BL0937 or HJL-01 Sel output (0 = Voltage)
  1214. GPIO_LED1_INV, // GPIO13 Blue Led (0 = On, 1 = Off)
  1215. GPIO_REL1, // GPIO14 Relay (0 = Off, 1 = On)
  1216. 0, 0, 0
  1217. },
  1218. { "AplicWDP303075", // Aplic WDP 303075 (ESP8285 - HLW8012 Energy Monitoring)
  1219. // https://www.amazon.de/dp/B07CNWVNJ2
  1220. 0, 0, 0,
  1221. GPIO_KEY1, // GPIO03 Button
  1222. GPIO_HLW_CF, // GPIO04 HLW8012 CF power
  1223. GPIO_NRG_CF1, // GPIO05 HLW8012 CF1 current / voltage
  1224. 0, 0, 0, 0, 0, 0, // Flash connection
  1225. GPIO_NRG_SEL_INV, // GPIO12 HLW8012 CF Sel output (0 = Voltage)
  1226. GPIO_LED1_INV, // GPIO13 LED (0 = On, 1 = Off)
  1227. GPIO_REL1, // GPIO14 Relay SRU 5VDC SDA (0 = Off, 1 = On )
  1228. 0, 0, 0
  1229. },
  1230. { "Tuya Dimmer", // Tuya Dimmer (ESP8266 w/ separate MCU dimmer)
  1231. // https://www.amazon.com/gp/product/B07CTNSZZ8/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1
  1232. GPIO_USER, // Virtual Button (controlled by MCU)
  1233. GPIO_USER, // GPIO01 MCU serial control
  1234. GPIO_USER,
  1235. GPIO_USER, // GPIO03 MCU serial control
  1236. GPIO_USER,
  1237. GPIO_USER,
  1238. 0, 0, 0, 0, 0, 0, // Flash connection
  1239. GPIO_USER,
  1240. GPIO_USER,
  1241. GPIO_USER, // GPIO14 Green Led
  1242. GPIO_USER,
  1243. GPIO_USER,
  1244. 0
  1245. },
  1246. { "Gosund SP1 v23", // https://www.amazon.de/gp/product/B0777BWS1P
  1247. 0,
  1248. GPIO_LED1_INV, // GPIO01 Serial RXD and LED1 (blue) inv
  1249. 0,
  1250. GPIO_KEY1, // GPIO03 Serial TXD and Button
  1251. GPIO_HJL_CF, // GPIO04 BL0937 or HJL-01 CF power
  1252. GPIO_NRG_CF1, // GPIO05 BL0937 or HJL-01 CF1 current / voltage
  1253. 0, 0, 0, 0, 0, 0, // Flash connection
  1254. GPIO_NRG_SEL_INV, // GPIO12 BL0937 or HJL-01 Sel output (0 = Voltage)
  1255. GPIO_LED2_INV, // GPIO13 LED2 (red) inv
  1256. GPIO_REL1, // GPIO14 Relay (0 = Off, 1 = On)
  1257. 0, 0, 0
  1258. },
  1259. { "ARMTR Dimmer", // ARMTRONIX Dimmer, one or two channel (ESP8266 w/ separate MCU dimmer)
  1260. // https://www.tindie.com/products/Armtronix/wifi-ac-dimmer-two-triac-board/
  1261. // https://www.tindie.com/products/Armtronix/wifi-ac-dimmer-esp8266-one-triac-board-alexaecho/
  1262. GPIO_USER,
  1263. GPIO_TXD, // GPIO01 MCU serial control
  1264. GPIO_USER,
  1265. GPIO_RXD, // GPIO03 MCU serial control
  1266. GPIO_USER,
  1267. GPIO_USER,
  1268. 0, 0, 0, 0, 0, 0, // Flash connection
  1269. GPIO_USER,
  1270. GPIO_USER,
  1271. GPIO_USER,
  1272. GPIO_USER,
  1273. GPIO_USER,
  1274. 0
  1275. },
  1276. { "SK03 Outdoor", // Outdoor smart plug with power monitoring HLW8012 chip - https://www.amazon.com/gp/product/B07CG7MBPV
  1277. GPIO_KEY1, // GPIO00 Button
  1278. 0, 0, 0,
  1279. GPIO_HLW_CF, // GPIO04 HLW8012 CF power
  1280. GPIO_NRG_CF1, // GPIO05 HLW8012 CF1 current / voltage
  1281. 0, 0, 0, 0, 0, 0, // Flash connection
  1282. GPIO_NRG_SEL_INV, // GPIO12 HLW8012 CF Sel output (0 = Voltage)
  1283. GPIO_LED2_INV, // GPIO13 Red Led (0 = On, 1 = Off)
  1284. GPIO_LED1_INV, // GPIO14 Blue Led (0 = On, 1 = Off)
  1285. GPIO_REL1, // GPIO15 Relay (0 = Off, 1 = On)
  1286. 0, 0
  1287. },
  1288. { "PS-16-DZ", // PS-16-DZ Dimmer (ESP8266 w/ separate Nuvoton MCU dimmer)
  1289. // https://www.aliexpress.com/item/SM-Smart-WIFI-Wall-Dimmer-Light-Switch-US-Ewelink-APP-Remote-Control-Wi-Fi-Wirele-Work/32871151902.html
  1290. GPIO_USER,
  1291. GPIO_TXD, // GPIO01 MCU serial control
  1292. GPIO_USER,
  1293. GPIO_RXD, // GPIO03 MCU serial control
  1294. GPIO_USER,
  1295. GPIO_USER,
  1296. 0, 0, 0, 0, 0, 0, // Flash connection
  1297. GPIO_USER,
  1298. GPIO_LED1, // GPIO13 WiFi LED
  1299. GPIO_USER,
  1300. GPIO_USER,
  1301. GPIO_USER,
  1302. 0
  1303. },
  1304. { "Teckin US", // Teckin SP20 US with Energy Monitoring
  1305. // https://www.amazon.com/Outlet-Compatible-Monitoring-Function-Required/dp/B079Q5W22B
  1306. // https://www.amazon.com/Outlet-ZOOZEE-Monitoring-Function-Compatible/dp/B07J2LR5KN
  1307. GPIO_LED2_INV, // GPIO00 Red Led (1 = On, 0 = Off)
  1308. 0,
  1309. GPIO_LED1_INV, // GPIO02 Blue Led (1 = On, 0 = Off)
  1310. 0,
  1311. GPIO_REL1, // GPIO04 Relay (0 = Off, 1 = On)
  1312. GPIO_HJL_CF, // GPIO05 BL0937 or HJL-01 CF power
  1313. 0, 0, 0, 0, 0, 0, // Flash connection
  1314. GPIO_NRG_SEL_INV, // GPIO12 BL0937 or HJL-01 Sel output (0 = Voltage)
  1315. GPIO_KEY1, // GPIO13 Button
  1316. GPIO_NRG_CF1, // GPIO14 BL0937 or HJL-01 CF1 current / voltage
  1317. 0, 0, 0
  1318. },
  1319. { "Manzoku strip", // "MANZOKU" labeled power strip, EU version
  1320. // https://www.amazon.de/Steckdosenleiste-AOFO-Mehrfachsteckdose-Überspannungsschutz-Sprachsteuerung/dp/B07GBSD11P/
  1321. // https://www.amazon.de/Steckdosenleiste-Geekbes-USB-Anschluss-Kompatibel-gesteuert/dp/B078W23BW9/
  1322. 0, // GPIO00
  1323. 0, // GPIO01 Serial RXD
  1324. 0,
  1325. GPIO_KEY1, // GPIO03 Serial TXD + Button
  1326. GPIO_REL2, // GPIO04 Relay 2
  1327. GPIO_REL1, // GPIO05 Relay 1
  1328. 0, 0, 0, 0, 0, 0, // Flash connection
  1329. GPIO_REL3, // GPIO12 Relay 3
  1330. GPIO_REL4, // GPIO13 Relay 4
  1331. GPIO_USER, // GPIO14
  1332. 0,
  1333. GPIO_USER, // GPIO16
  1334. 0
  1335. }
  1336. };
  1337. /*
  1338. Optionals
  1339. { "MagicHome", // Magic Home (aka Flux-light) (ESP8266)
  1340. // https://www.aliexpress.com/item/Magic-Home-Mini-RGB-RGBW-Wifi-Controller-For-Led-Strip-Panel-light-Timing-Function-16million-colors/32686853650.html
  1341. 0,
  1342. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  1343. GPIO_LED1_INV, // GPIO02 Blue onboard LED
  1344. GPIO_USER, // GPIO03 Serial TXD and Optional sensor
  1345. GPIO_USER, // GPIO04 IR receiver (optional)
  1346. GPIO_PWM2, // GPIO05 RGB LED Green
  1347. 0, 0, 0, 0, 0, 0, // Flash connection
  1348. GPIO_PWM3, // GPIO12 RGB LED Blue
  1349. GPIO_USER, // GPIO13 RGBW LED White (optional - set to PWM4 for Cold White or Warm White)
  1350. GPIO_PWM1, // GPIO14 RGB LED Red
  1351. 0, 0, 0
  1352. },
  1353. { "Arilux LC10", // Arilux LC10 (ESP8285), RGBW + RF
  1354. // https://github.com/arendst/Sonoff-Tasmota/wiki/MagicHome-with-ESP8285
  1355. // https://www.aliexpress.com/item/DC5-24V-Wireless-WIFI-LED-RGB-Controller-RGBW-Controller-IR-RF-Remote-Control-IOS-Android-for/32827253255.html
  1356. // https://www.aliexpress.com/item/Wifi-LED-RGB-Controler-DC12V-MIni-Wifi-RGB-RGBW-LED-Controller-for-RGB-RGBW-LED-Strip/32673444047.html
  1357. GPIO_USER, // GPIO00 Optional Button
  1358. GPIO_USER, // GPIO01 Serial RXD and Optional sensor
  1359. 0,
  1360. GPIO_USER, // GPIO03 Serial TXD and Optional sensor0
  1361. GPIO_ARIRFRCV, // GPIO04 RF receiver input
  1362. GPIO_PWM2, // GPIO05 RGB LED Green
  1363. 0, 0, 0, 0, 0, 0, // Flash connection
  1364. GPIO_PWM3, // GPIO12 RGB LED Blue
  1365. GPIO_PWM4, // GPIO13 RGBW LED White
  1366. GPIO_PWM1, // GPIO14 RGB LED Red
  1367. GPIO_LED2_INV, // GPIO15 RF receiver control
  1368. 0, 0
  1369. }
  1370. { "Xenon 3CH", // Xenon 3CH (ESP8266) - (#1128)
  1371. 0, 0, 0,
  1372. GPIO_KEY2, // GPIO03 Serial TXD and Optional sensor
  1373. GPIO_REL2, // GPIO04 Relay 2
  1374. GPIO_KEY3, // GPIO05 Input 2
  1375. 0, 0, 0, 0, 0, 0, // Flash connection
  1376. GPIO_KEY1, // GPIO12 Key input
  1377. GPIO_REL1, // GPIO13 Relay 1
  1378. 0,
  1379. GPIO_REL3, // GPIO15 Relay 3
  1380. 0, 0
  1381. }
  1382. { "PowStro Basic", // PowStro (ESP8266) - (#1419)
  1383. 0, 0, 0, 0,
  1384. GPIO_REL1, // GPIO04 Relay (0 = Off, 1 = On)
  1385. 0,
  1386. 0, 0, 0, 0, 0, 0, // Flash connection
  1387. GPIO_KEY1, // GPIO12 Button
  1388. 0, 0,
  1389. GPIO_LED1, // GPIO15 Led (1 = On, 0 = Off)
  1390. 0, 0
  1391. }
  1392. { "SMPW701E", // SM-PW701E WLAN Socket (#1190)
  1393. 0, 0, 0, 0,
  1394. GPIO_LED1_INV, // GPIO04 Blue Led (0 = On, 1 = Off)
  1395. 0, // GPIO05 IR or RF receiver (optional)
  1396. 0, 0, 0, 0, 0, 0, // Flash connection
  1397. GPIO_REL1, // GPIO12 Relay and Red Led (0 = Off, 1 = On)
  1398. GPIO_KEY1, // GPIO13 Button
  1399. 0, 0, 0, 0
  1400. }
  1401. { "SWA1", // Smart Plugs (ESP8266)
  1402. 0,
  1403. GPIO_USER, // GPIO01
  1404. 0,
  1405. GPIO_USER, // GPIO03
  1406. GPIO_LED1_INV, // GPIO04 Blue LED
  1407. GPIO_REL1, // GPIO05 Red LED and relay
  1408. 0, 0, 0, 0, 0, 0, // Flash connection
  1409. 0,
  1410. GPIO_KEY1, // GPIO13 Button (normally GPIO00)
  1411. GPIO_USER, // GPIO14
  1412. 0, 0, 0
  1413. }
  1414. { "MagicHome v2.3", // Magic Home (aka Flux-light) (ESP8266) (#1353)
  1415. 0, 0,
  1416. GPIO_LED1_INV, // GPIO02 Blue onboard LED
  1417. 0,
  1418. GPIO_USER, // GPIO04 IR receiver (optional)
  1419. GPIO_PWM2, // GPIO05 RGB LED Green
  1420. 0, 0, 0, 0, 0, 0, // Flash connection
  1421. GPIO_PWM1, // GPIO12 RGB LED Red
  1422. GPIO_PWM3, // GPIO13 RGB LED Blue
  1423. 0,
  1424. GPIO_PWM4, // GPIO15 RGBW LED White
  1425. 0, 0
  1426. }
  1427. { "Ledunia", // Ledunia (ESP8266 - 32MB) - http://ledunia.de/
  1428. GPIO_USER, // GPIO00 (D0)
  1429. GPIO_USER, // GPIO01 (D7) Serial RXD
  1430. GPIO_USER, // GPIO02 (D2)
  1431. GPIO_USER, // GPIO03 (D8) Serial TXD
  1432. GPIO_USER, // GPIO04 (D4) 4 x WS2812 Leds, (DOUT) Extents WS2812 string
  1433. GPIO_USER, // GPIO05 (D5) Blue Led
  1434. 0, 0, 0, 0, 0, 0, // Flash connection
  1435. GPIO_USER, // GPIO12 (D12)
  1436. GPIO_USER, // GPIO13 (D13)
  1437. GPIO_USER, // GPIO14 (D14)
  1438. GPIO_USER, // GPIO15 (D15)
  1439. GPIO_USER, // GPIO16 (D16)
  1440. 0 // ADC0 Analog input (A0)
  1441. }
  1442. { "Delock 11826", // Delock 11826 (ESP8285) = Sonoff Basic
  1443. GPIO_KEY1, // GPIO00 Button
  1444. 0, 0, 0, 0, 0,
  1445. 0, 0, 0, 0, 0, 0, // Flash connection
  1446. GPIO_REL1, // GPIO12 Red Led and Relay (0 = Off, 1 = On)
  1447. GPIO_LED1_INV, // GPIO13 Green Led (0 = On, 1 = Off)
  1448. 0, 0, 0, 0
  1449. }
  1450. */
  1451. #endif // _SONOFF_TEMPLATE_H_