Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1590 lines
54 KiB

7 years ago
  1. /*
  2. MIGRATE MODULE
  3. Copyright (C) 2016-2018 by Xose Pérez <xose dot perez at gmail dot com>
  4. */
  5. void _migrateMoveIndexDown(const char * key, int offset = 0) {
  6. if (hasSetting(key, 0)) return;
  7. for (unsigned char index = 1; index < SETTINGS_MAX_LIST_COUNT; index++) {
  8. if (hasSetting(key, index)) {
  9. setSetting(key, index - 1, getSetting(key, index).toInt() + offset);
  10. } else {
  11. delSetting(key, index - 1);
  12. }
  13. }
  14. }
  15. void _migrateBackwards() {
  16. moveSettings("relayGPIO", "rlyGPIO");
  17. moveSettings("relayResetGPIO", "rlyResetGPIO");
  18. moveSettings("relayType", "rlyType");
  19. moveSetting("selGPIO", "hlwSELGPIO");
  20. moveSetting("cfGPIO", "hlwCFGPIO");
  21. moveSetting("cf1GPIO", "hlwCF1GPIO");
  22. moveSetting("relayProvider", "rlyProvider");
  23. moveSetting("lightProvider", "litProvider");
  24. moveSetting("relays", "rlyCount");
  25. moveSettings("chGPIO", "litChGPIO");
  26. moveSettings("chLogic", "litChLogic");
  27. moveSetting("enGPIO", "litEnableGPIO");
  28. moveSetting("hlwSelC", "hlwCurLevel");
  29. moveSetting("hlwIntM", "hlwInt");
  30. delSetting("ledWifi");
  31. }
  32. // Configuration versions
  33. //
  34. // 1: based on Embedis, no board definitions
  35. // 2: based on Embedis, with board definitions 1-based
  36. // 3: based on Embedis, with board definitions 0-based
  37. // 4: based on Embedis, added sensors and force resetting
  38. void migrate() {
  39. _migrateBackwards();
  40. // Get config version
  41. unsigned int board = getSetting("board", 0).toInt();
  42. unsigned int config_version = getSetting("cfg", board > 0 ? 2 : 1).toInt();
  43. // Update if not on latest version
  44. if (config_version == CFG_VERSION) return;
  45. setSetting("cfg", CFG_VERSION);
  46. if (config_version == 2) {
  47. _migrateMoveIndexDown("ledGPIO");
  48. _migrateMoveIndexDown("ledLogic");
  49. _migrateMoveIndexDown("btnGPIO");
  50. _migrateMoveIndexDown("btnRelay", -1);
  51. _migrateMoveIndexDown("rlyGPIO");
  52. _migrateMoveIndexDown("rlyType");
  53. }
  54. // -------------------------------------------------------------------------
  55. // Board definitions
  56. // -------------------------------------------------------------------------
  57. #if defined(ITEAD_SONOFF_BASIC) || \
  58. defined(ITEAD_SONOFF_TH) || \
  59. defined(ITEAD_SONOFF_SV) || \
  60. defined(ITEAD_SONOFF_TOUCH) || \
  61. defined(ITEAD_1CH_INCHING) || \
  62. defined(ITEAD_SONOFF_4CH) || \
  63. defined(ITEAD_SLAMPHER) || \
  64. defined(ITEAD_S20) || \
  65. defined(ITEAD_MOTOR) || \
  66. defined(ITEAD_SONOFF_4CH_PRO) || \
  67. defined(ITEAD_SONOFF_T1_1CH) || \
  68. defined(ITEAD_SONOFF_T1_2CH) || \
  69. defined(ITEAD_SONOFF_T1_3CH) || \
  70. defined(ITEAD_SONOFF_RF) || \
  71. defined(ITEAD_SONOFF_DUAL_R2) || \
  72. defined(ITEAD_SONOFF_POW_R2) || \
  73. defined(ITEAD_SONOFF_S31)
  74. setSetting("btnGPIO", 0, 0);
  75. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  76. setSetting("btnRelay", 0, 0);
  77. setSetting("ledGPIO", 0, 13);
  78. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  79. setSetting("rlyGPIO", 0, 12);
  80. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  81. #endif
  82. // -------------------------------------------------------------------------
  83. #if defined(NODEMCU_LOLIN)
  84. setSetting("board", 2);
  85. setSetting("btnGPIO", 0, 0);
  86. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  87. setSetting("btnRelay", 0, 0);
  88. setSetting("ledGPIO", 0, 2);
  89. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  90. setSetting("rlyGPIO", 0, 12);
  91. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  92. #elif defined(WEMOS_D1_MINI_RELAYSHIELD)
  93. setSetting("board", 3);
  94. setSetting("btnGPIO", 0, 0);
  95. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  96. setSetting("btnRelay", 0, 0);
  97. setSetting("ledGPIO", 0, 2);
  98. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  99. setSetting("rlyGPIO", 0, 5);
  100. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  101. #elif defined(ITEAD_SONOFF_BASIC)
  102. setSetting("board", 4);
  103. #elif defined(ITEAD_SONOFF_TH)
  104. setSetting("board", 5);
  105. #elif defined(ITEAD_SONOFF_SV)
  106. setSetting("board", 6);
  107. #elif defined(ITEAD_SONOFF_TOUCH)
  108. setSetting("board", 7);
  109. setSetting("btnPress", 0, BUTTON_MODE_TOGGLE);
  110. setSetting("btnClick", 0, BUTTON_MODE_NONE);
  111. setSetting("btnDblClick", 0, BUTTON_MODE_NONE);
  112. setSetting("btnLngClick", 0, BUTTON_MODE_NONE);
  113. setSetting("btnLngLngClick", 0, BUTTON_MODE_RESET);
  114. #elif defined(ITEAD_SONOFF_POW)
  115. setSetting("board", 8);
  116. setSetting("btnGPIO", 0, 0);
  117. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  118. setSetting("btnRelay", 0, 0);
  119. setSetting("ledGPIO", 0, 15);
  120. setSetting("ledLogic", 0, GPIO_LOGIC_DIRECT);
  121. setSetting("rlyGPIO", 0, 12);
  122. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  123. setSetting("hlwEnabled", 1);
  124. setSetting("hlwSELGPIO", 5);
  125. setSetting("hlwCF1GPIO", 13);
  126. setSetting("hlwCFGPIO", 14);
  127. #elif defined(ITEAD_SONOFF_DUAL)
  128. setSetting("board", 9);
  129. setSetting("btnRelay", 0, GPIO_INVALID);
  130. setSetting("btnRelay", 1, GPIO_INVALID);
  131. setSetting("btnRelay", 2, 0);
  132. setSetting("ledGPIO", 0, 13);
  133. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  134. setSetting("rlyProvider", RELAY_PROVIDER_DUAL);
  135. setSetting("rlyCount", 2);
  136. setSetting("dbgSerial", 0);
  137. setSetting("dbgBaudrate", 19230);
  138. #elif defined(ITEAD_1CH_INCHING)
  139. // The inching functionality is managed by a misterious IC in the board.
  140. // You cannot control the inching button and functionality from the ESP8266
  141. // Besides, enabling the inching functionality using the hardware button
  142. // will result in the relay switching on and off continuously.
  143. // Fortunately the unkown IC keeps memory of the hardware inching status
  144. // so you can just disable it and forget. The inching LED must be lit.
  145. // You can still use the pulse options from the web interface
  146. // without problem.
  147. setSetting("board", 10);
  148. #elif defined(ITEAD_SONOFF_4CH)
  149. setSetting("board", 11);
  150. setSetting("btnGPIO", 1, 9);
  151. setSetting("btnGPIO", 2, 10);
  152. setSetting("btnGPIO", 3, 14);
  153. setSetting("btnMode", 1, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  154. setSetting("btnMode", 2, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  155. setSetting("btnMode", 3, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  156. setSetting("btnRelay", 1, 1);
  157. setSetting("btnRelay", 2, 2);
  158. setSetting("btnRelay", 3, 3);
  159. setSetting("rlyGPIO", 1, 5);
  160. setSetting("rlyGPIO", 2, 4);
  161. setSetting("rlyGPIO", 3, 15);
  162. setSetting("rlyType", 1, RELAY_TYPE_NORMAL);
  163. setSetting("rlyType", 2, RELAY_TYPE_NORMAL);
  164. setSetting("rlyType", 3, RELAY_TYPE_NORMAL);
  165. #elif defined(ITEAD_SLAMPHER)
  166. setSetting("board", 12);
  167. #elif defined(ITEAD_S20)
  168. setSetting("board", 13);
  169. #elif defined(ELECTRODRAGON_WIFI_IOT)
  170. setSetting("board", 14);
  171. setSetting("btnGPIO", 0, 0);
  172. setSetting("btnGPIO", 1, 2);
  173. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  174. setSetting("btnMode", 1, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  175. setSetting("btnRelay", 0, 0);
  176. setSetting("btnRelay", 1, 1);
  177. setSetting("ledGPIO", 0, 16);
  178. setSetting("ledLogic", 0, GPIO_LOGIC_DIRECT);
  179. setSetting("rlyGPIO", 0, 12);
  180. setSetting("rlyGPIO", 1, 13);
  181. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  182. setSetting("rlyType", 1, RELAY_TYPE_NORMAL);
  183. #elif defined(WORKCHOICE_ECOPLUG)
  184. setSetting("board", 15);
  185. setSetting("btnGPIO", 0, 13);
  186. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  187. setSetting("btnRelay", 0, 0);
  188. setSetting("ledGPIO", 0, 2);
  189. setSetting("ledLogic", 0, GPIO_LOGIC_DIRECT);
  190. setSetting("rlyGPIO", 0, 15);
  191. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  192. #elif defined(JANGOE_WIFI_RELAY_NC)
  193. // Jan Goedeke Wifi Relay
  194. // https://github.com/JanGoe/esp8266-wifi-relay
  195. setSetting("board", 16);
  196. setSetting("btnGPIO", 0, 12);
  197. setSetting("btnGPIO", 1, 13);
  198. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  199. setSetting("btnMode", 1, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  200. setSetting("btnRelay", 0, 0);
  201. setSetting("btnRelay", 1, 1);
  202. setSetting("rlyGPIO", 0, 2);
  203. setSetting("rlyGPIO", 1, 14);
  204. setSetting("rlyType", 0, RELAY_TYPE_INVERSE);
  205. setSetting("rlyType", 1, RELAY_TYPE_INVERSE);
  206. #elif defined(JANGOE_WIFI_RELAY_NO)
  207. setSetting("board", 17);
  208. setSetting("btnGPIO", 0, 12);
  209. setSetting("btnGPIO", 1, 13);
  210. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  211. setSetting("btnMode", 1, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  212. setSetting("btnRelay", 0, 0);
  213. setSetting("btnRelay", 1, 1);
  214. setSetting("rlyGPIO", 0, 2);
  215. setSetting("rlyGPIO", 1, 14);
  216. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  217. setSetting("rlyType", 1, RELAY_TYPE_NORMAL);
  218. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  219. setSetting("board", 18);
  220. setSetting("btnGPIO", 0, 0);
  221. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  222. setSetting("btnRelay", 0, 0);
  223. setSetting("ledGPIO", 0, 16);
  224. setSetting("ledLogic", 0, GPIO_LOGIC_DIRECT);
  225. setSetting("rlyGPIO", 0, 12);
  226. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  227. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  228. // Jorge García Wifi+Relays Board Kit
  229. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  230. // https://github.com/jorgegarciadev/wifikit
  231. setSetting("board", 19);
  232. setSetting("rlyGPIO", 0, 0);
  233. setSetting("rlyGPIO", 1, 2);
  234. setSetting("rlyType", 0, RELAY_TYPE_INVERSE);
  235. setSetting("rlyType", 1, RELAY_TYPE_INVERSE);
  236. #elif defined(AITHINKER_AI_LIGHT)
  237. setSetting("board", 20);
  238. setSetting("rlyProvider", RELAY_PROVIDER_LIGHT);
  239. setSetting("rlyCount", 1);
  240. setSetting("litProvider", LIGHT_PROVIDER_MY92XX);
  241. setSetting("myModel", MY92XX_MODEL_MY9291); // 4 channels per chip
  242. setSetting("myChips", 1);
  243. setSetting("myDIGPIO", 13);
  244. setSetting("myDCKIGPIO", 15);
  245. setSetting("myMapping", "0123");
  246. #elif defined(MAGICHOME_LED_CONTROLLER)
  247. setSetting("board", 21);
  248. setSetting("ledGPIO", 0, 2);
  249. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  250. setSetting("rlyProvider", RELAY_PROVIDER_LIGHT);
  251. setSetting("rlyCount", 1);
  252. setSetting("irEnabled", 1);
  253. setSetting("irGPIO", 4);
  254. setSetting("irSet", 1);
  255. setSetting("litProvider", LIGHT_PROVIDER_DIMMER);
  256. setSetting("litChGPIO", 0, 14);
  257. setSetting("litChGPIO", 1, 5);
  258. setSetting("litChGPIO", 2, 12);
  259. setSetting("litChGPIO", 3, 13);
  260. setSetting("litChLogic", 0, GPIO_LOGIC_DIRECT);
  261. setSetting("litChLogic", 1, GPIO_LOGIC_DIRECT);
  262. setSetting("litChLogic", 2, GPIO_LOGIC_DIRECT);
  263. setSetting("litChLogic", 3, GPIO_LOGIC_DIRECT);
  264. #elif defined(ITEAD_MOTOR)
  265. setSetting("board", 22);
  266. #elif defined(TINKERMAN_ESPURNA_H06)
  267. setSetting("board", 23);
  268. setSetting("btnGPIO", 0, 4);
  269. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  270. setSetting("btnRelay", 0, 0);
  271. setSetting("ledGPIO", 0, 5);
  272. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  273. setSetting("rlyGPIO", 0, 12);
  274. setSetting("rlyType", 0, RELAY_TYPE_INVERSE);
  275. setSetting("hlwEnabled", 1);
  276. setSetting("hlwSELGPIO", 2);
  277. setSetting("hlwCF1GPIO", 13);
  278. setSetting("hlwCFGPIO", 14);
  279. #elif defined(HUACANXING_H801)
  280. setSetting("board", 24);
  281. setSetting("ledGPIO", 0, 5);
  282. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  283. setSetting("rlyProvider", RELAY_PROVIDER_LIGHT);
  284. setSetting("rlyCount", 1);
  285. setSetting("dbgPort", 1);
  286. setSetting("dbgRXEnabled", 1);
  287. setSetting("litProvider", LIGHT_PROVIDER_DIMMER);
  288. setSetting("litChGPIO", 0, 15);
  289. setSetting("litChGPIO", 1, 13);
  290. setSetting("litChGPIO", 2, 12);
  291. setSetting("litChGPIO", 3, 14);
  292. setSetting("litChGPIO", 4, 4);
  293. setSetting("litChLogic", 0, GPIO_LOGIC_DIRECT);
  294. setSetting("litChLogic", 1, GPIO_LOGIC_DIRECT);
  295. setSetting("litChLogic", 2, GPIO_LOGIC_DIRECT);
  296. setSetting("litChLogic", 3, GPIO_LOGIC_DIRECT);
  297. setSetting("litChLogic", 4, GPIO_LOGIC_DIRECT);
  298. #elif defined(ITEAD_BNSZ01)
  299. setSetting("board", 25);
  300. setSetting("ledGPIO", 0, 13);
  301. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  302. setSetting("rlyProvider", RELAY_PROVIDER_LIGHT);
  303. setSetting("rlyCount", 1);
  304. setSetting("litProvider", LIGHT_PROVIDER_DIMMER);
  305. setSetting("litChGPIO", 0, 12);
  306. setSetting("litChLogic", 0, GPIO_LOGIC_DIRECT);
  307. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  308. setSetting("board", 26);
  309. setSetting("btnGPIO", 0, 0);
  310. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  311. setSetting("ledGPIO", 0, 13);
  312. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  313. setSetting("rlyProvider", RELAY_PROVIDER_RFBRIDGE);
  314. setSetting("rlyCount", 8);
  315. // When using un-modified harware, ESPurna communicates with the secondary
  316. // MCU EFM8BB1 via UART at 19200 bps so we need to change the speed of
  317. // the port and remove UART noise on serial line
  318. setSetting("dbgSerial", 0);
  319. setSetting("dbgBaudrate", 19200);
  320. setSetting("rfbDirect", 0);
  321. setSetting("rfbRXGPIO", 4);
  322. setSetting("rfbTXGPIO", 5);
  323. #elif defined(ITEAD_SONOFF_4CH_PRO)
  324. setSetting("board", 27);
  325. setSetting("btnGPIO", 1, 9);
  326. setSetting("btnGPIO", 2, 10);
  327. setSetting("btnGPIO", 3, 14);
  328. setSetting("btnMode", 1, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  329. setSetting("btnMode", 2, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  330. setSetting("btnMode", 3, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  331. setSetting("btnRelay", 1, 1);
  332. setSetting("btnRelay", 2, 2);
  333. setSetting("btnRelay", 3, 3);
  334. // Sonoff 4CH Pro uses a secondary STM32 microcontroller to handle
  335. // buttons and relays, but it also forwards button presses to the ESP8285.
  336. // This allows ESPurna to handle button presses -almost- the same way
  337. // as with other devices except:
  338. // * Double click seems to break/disable the button on the STM32 side
  339. // * With S6 switch to 1 (self-locking and inching modes) everything's OK
  340. // * With S6 switch to 0 (interlock mode) if there is a relay ON
  341. // and you click on another relay button, the STM32 sends a "press"
  342. // event for the button of the first relay (to turn it OFF) but it
  343. // does not send a "release" event. It's like it's holding the
  344. // button down since you can see it is still LOW.
  345. // Whatever reason the result is that it may actually perform a
  346. // long click or long-long click.
  347. // The configuration below make the button toggle the relay on press events
  348. // and disables any possibly harmful combination with S6 set to 0.
  349. // If you are sure you will only use S6 to 1 you can comment the
  350. // btnLngClick(0) and btnLngLngClick(0) options below to recover the
  351. // reset mode and factory reset functionalities, or link other actions like
  352. // AP mode in the commented line below.
  353. setSetting("btnPress", 0, BUTTON_MODE_TOGGLE);
  354. setSetting("btnClick", 0, BUTTON_MODE_NONE);
  355. setSetting("btnDblClick", 0, BUTTON_MODE_NONE);
  356. setSetting("btnLngClick", 0, BUTTON_MODE_NONE); // or BUTTON_MODE_AP
  357. setSetting("btnLngLngClick", 0, BUTTON_MODE_NONE); // or BUTTON_MODE_FACTORY
  358. setSetting("btnPress", 1, BUTTON_MODE_TOGGLE);
  359. setSetting("btnClick", 1, BUTTON_MODE_NONE);
  360. setSetting("btnPress", 2, BUTTON_MODE_TOGGLE);
  361. setSetting("btnClick", 2, BUTTON_MODE_NONE);
  362. setSetting("btnPress", 3, BUTTON_MODE_TOGGLE);
  363. setSetting("btnClick", 3, BUTTON_MODE_NONE);
  364. setSetting("rlyGPIO", 1, 5);
  365. setSetting("rlyGPIO", 2, 4);
  366. setSetting("rlyGPIO", 3, 15);
  367. setSetting("rlyType", 1, RELAY_TYPE_NORMAL);
  368. setSetting("rlyType", 2, RELAY_TYPE_NORMAL);
  369. setSetting("rlyType", 3, RELAY_TYPE_NORMAL);
  370. #elif defined(ITEAD_SONOFF_B1)
  371. setSetting("board", 28);
  372. setSetting("rlyProvider", RELAY_PROVIDER_LIGHT);
  373. setSetting("rlyCount", 1);
  374. setSetting("litProvider", LIGHT_PROVIDER_MY92XX);
  375. setSetting("litChFactor", 4, 0.1); // White LEDs are way more bright in the B1
  376. setSetting("litChFactor", 5, 0.1); // White LEDs are way more bright in the B1
  377. setSetting("myModel", MY92XX_MODEL_MY9231); // 3 channels per chip
  378. setSetting("myChips", 2);
  379. setSetting("myDIGPIO", 12);
  380. setSetting("myDCKIGPIO", 14);
  381. setSetting("myMapping", "43501"); // TODO
  382. #elif defined(ITEAD_SONOFF_LED)
  383. setSetting("board", 29);
  384. setSetting("ledGPIO", 0, 13);
  385. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  386. setSetting("rlyProvider", RELAY_PROVIDER_LIGHT);
  387. setSetting("rlyCount", 1);
  388. setSetting("litProvider", LIGHT_PROVIDER_DIMMER);
  389. setSetting("litChGPIO", 0, 12); // Cold white
  390. setSetting("litChGPIO", 1, 14); // Warm white
  391. setSetting("litChLogic", 0, GPIO_LOGIC_DIRECT);
  392. setSetting("litChLogic", 1, GPIO_LOGIC_DIRECT);
  393. #elif defined(ITEAD_SONOFF_T1_1CH)
  394. setSetting("board", 30);
  395. setSetting("btnPress", 0, BUTTON_MODE_TOGGLE);
  396. setSetting("btnClick", 0, BUTTON_MODE_NONE);
  397. setSetting("btnDblClick", 0, BUTTON_MODE_NONE);
  398. setSetting("btnLngClick", 0, BUTTON_MODE_NONE);
  399. setSetting("btnLngLngClick", 0, BUTTON_MODE_RESET);
  400. #elif defined(ITEAD_SONOFF_T1_2CH)
  401. setSetting("board", 31);
  402. setSetting("btnGPIO", 1, 9);
  403. setSetting("btnMode", 1, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  404. setSetting("btnRelay", 1, 1);
  405. setSetting("btnPress", 0, BUTTON_MODE_TOGGLE);
  406. setSetting("btnPress", 1, BUTTON_MODE_TOGGLE);
  407. setSetting("btnClick", 0, BUTTON_MODE_NONE);
  408. setSetting("btnClick", 1, BUTTON_MODE_NONE);
  409. setSetting("btnDblClick", 0, BUTTON_MODE_NONE);
  410. setSetting("btnDblClick", 1, BUTTON_MODE_NONE);
  411. setSetting("btnLngClick", 0, BUTTON_MODE_NONE);
  412. setSetting("btnLngClick", 1, BUTTON_MODE_NONE);
  413. setSetting("btnLngLngClick", 0, BUTTON_MODE_RESET);
  414. setSetting("btnLngLngClick", 1, BUTTON_MODE_RESET);
  415. setSetting("rlyGPIO", 1, 5);
  416. setSetting("rlyType", 1, RELAY_TYPE_NORMAL);
  417. #elif defined(ITEAD_SONOFF_T1_3CH)
  418. setSetting("board", 32);
  419. setSetting("btnGPIO", 1, 9);
  420. setSetting("btnGPIO", 2, 10);
  421. setSetting("btnMode", 1, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  422. setSetting("btnMode", 2, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  423. setSetting("btnRelay", 1, 1);
  424. setSetting("btnRelay", 2, 2);
  425. setSetting("btnPress", 0, BUTTON_MODE_TOGGLE);
  426. setSetting("btnPress", 1, BUTTON_MODE_TOGGLE);
  427. setSetting("btnPress", 2, BUTTON_MODE_TOGGLE);
  428. setSetting("btnClick", 0, BUTTON_MODE_NONE);
  429. setSetting("btnClick", 1, BUTTON_MODE_NONE);
  430. setSetting("btnClick", 2, BUTTON_MODE_NONE);
  431. setSetting("btnDblClick", 0, BUTTON_MODE_NONE);
  432. setSetting("btnDblClick", 1, BUTTON_MODE_NONE);
  433. setSetting("btnDblClick", 2, BUTTON_MODE_NONE);
  434. setSetting("btnLngClick", 0, BUTTON_MODE_NONE);
  435. setSetting("btnLngClick", 1, BUTTON_MODE_NONE);
  436. setSetting("btnLngClick", 2, BUTTON_MODE_NONE);
  437. setSetting("btnLngLngClick", 0, BUTTON_MODE_RESET);
  438. setSetting("btnLngLngClick", 1, BUTTON_MODE_RESET);
  439. setSetting("btnLngLngClick", 2, BUTTON_MODE_RESET);
  440. setSetting("rlyGPIO", 1, 5);
  441. setSetting("rlyGPIO", 2, 4);
  442. setSetting("rlyType", 1, RELAY_TYPE_NORMAL);
  443. setSetting("rlyType", 2, RELAY_TYPE_NORMAL);
  444. #elif defined(ITEAD_SONOFF_RF)
  445. setSetting("board", 33);
  446. #elif defined(WION_50055)
  447. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  448. // https://rover.ebay.com/rover/1/711-53200-19255-0/1?icep_id=114&ipn=icep&toolid=20004&campid=5338044841&mpre=http%3A%2F%2Fwww.ebay.com%2Fitm%2FWiOn-50050-Indoor-Wi-Fi-Outlet-Wireless-Switch-Programmable-Timer-%2F263112281551
  449. // https://rover.ebay.com/rover/1/711-53200-19255-0/1?icep_id=114&ipn=icep&toolid=20004&campid=5338044841&mpre=http%3A%2F%2Fwww.ebay.com%2Fitm%2FWiOn-50055-Indoor-Wi-Fi-Wall-Tap-Monitor-Energy-Usage-Wireless-Smart-Switch-%2F263020837777
  450. // Does not support power monitoring yet
  451. setSetting("board", 34);
  452. setSetting("btnGPIO", 0, 13);
  453. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  454. setSetting("btnRelay", 0, 0);
  455. setSetting("ledGPIO", 0, 2);
  456. setSetting("ledLogic", 0, GPIO_LOGIC_DIRECT);
  457. setSetting("rlyGPIO", 0, 15);
  458. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  459. #elif defined(EXS_WIFI_RELAY_V31)
  460. // EX-Store Wifi Relay v3.1
  461. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  462. setSetting("board", 35);
  463. setSetting("btnGPIO", 0, 0);
  464. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  465. setSetting("btnRelay", 0, 0);
  466. setSetting("rlyGPIO", 0, 13);
  467. setSetting("rlyResetGPIO", 0, 12);
  468. setSetting("rlyType", 0, RELAY_TYPE_LATCHED);
  469. #elif defined(HUACANXING_H802)
  470. setSetting("board", 36);
  471. setSetting("rlyProvider", RELAY_PROVIDER_LIGHT);
  472. setSetting("rlyCount", 1);
  473. setSetting("dbgPort", 1);
  474. setSetting("dbgRXEnabled", 1);
  475. setSetting("litProvider", LIGHT_PROVIDER_DIMMER);
  476. setSetting("litChGPIO", 0, 12);
  477. setSetting("litChGPIO", 1, 14);
  478. setSetting("litChGPIO", 2, 13);
  479. setSetting("litChGPIO", 3, 15);
  480. setSetting("litChLogic", 0, GPIO_LOGIC_DIRECT);
  481. setSetting("litChLogic", 1, GPIO_LOGIC_DIRECT);
  482. setSetting("litChLogic", 2, GPIO_LOGIC_DIRECT);
  483. setSetting("litChLogic", 3, GPIO_LOGIC_DIRECT);
  484. #elif defined(GENERIC_V9261F)
  485. setSetting("board", 37);
  486. setSetting("v92Enabled", 1);
  487. setSetting("v92GPIO", 2);
  488. setSetting("v92Logic", GPIO_LOGIC_INVERSE);
  489. #elif defined(GENERIC_ECH1560)
  490. setSetting("board", 38);
  491. setSetting("echEnabled", 1);
  492. setSetting("echCLKGPIO", 4);
  493. setSetting("echMISOGPIO", 5);
  494. setSetting("echLogic", GPIO_LOGIC_INVERSE);
  495. #elif defined(TINKERMAN_ESPURNA_H08)
  496. setSetting("board", 39);
  497. setSetting("btnGPIO", 0, 4);
  498. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  499. setSetting("btnRelay", 0, 0);
  500. setSetting("ledGPIO", 0, 2);
  501. setSetting("ledLogic", 0, GPIO_LOGIC_DIRECT);
  502. setSetting("rlyGPIO", 0, 12);
  503. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  504. setSetting("hlwEnabled", 1);
  505. setSetting("hlwSELGPIO", 5);
  506. setSetting("hlwCF1GPIO", 13);
  507. setSetting("hlwCFGPIO", 14);
  508. #elif defined(MANCAVEMADE_ESPLIVE)
  509. // ESPLive
  510. // https://github.com/ManCaveMade/ESP-Live
  511. setSetting("board", 40);
  512. setSetting("btnGPIO", 0, 4);
  513. setSetting("btnGPIO", 1, 5);
  514. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  515. setSetting("btnMode", 1, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  516. setSetting("btnRelay", 0, 0);
  517. setSetting("btnRelay", 1, 1);
  518. setSetting("rlyGPIO", 0, 12);
  519. setSetting("rlyGPIO", 1, 13);
  520. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  521. setSetting("rlyType", 1, RELAY_TYPE_NORMAL);
  522. setSetting("dsEnabled", 1);
  523. setSetting("dsGPIO", 0, 2);
  524. #elif defined(INTERMITTECH_QUINLED)
  525. // QuinLED
  526. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  527. setSetting("board", 41);
  528. setSetting("ledGPIO", 0, 5);
  529. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  530. setSetting("rlyProvider", RELAY_PROVIDER_LIGHT);
  531. setSetting("rlyCount", 1);
  532. setSetting("litProvider", LIGHT_PROVIDER_DIMMER);
  533. setSetting("litChGPIO", 0, 0);
  534. setSetting("litChGPIO", 1, 2);
  535. setSetting("litChLogic", 0, GPIO_LOGIC_DIRECT);
  536. setSetting("litChLogic", 1, GPIO_LOGIC_DIRECT);
  537. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  538. setSetting("board", 42);
  539. setSetting("ledGPIO", 0, 2);
  540. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  541. setSetting("rlyProvider", RELAY_PROVIDER_LIGHT);
  542. setSetting("rlyCount", 1);
  543. setSetting("irEnabled", 1);
  544. setSetting("irGPIO", 4);
  545. setSetting("irSet", 1);
  546. setSetting("litProvider", LIGHT_PROVIDER_DIMMER);
  547. setSetting("litChGPIO", 0, 5);
  548. setSetting("litChGPIO", 1, 12);
  549. setSetting("litChGPIO", 2, 13);
  550. setSetting("litChGPIO", 3, 15);
  551. setSetting("litChLogic", 0, GPIO_LOGIC_DIRECT);
  552. setSetting("litChLogic", 1, GPIO_LOGIC_DIRECT);
  553. setSetting("litChLogic", 2, GPIO_LOGIC_DIRECT);
  554. setSetting("litChLogic", 3, GPIO_LOGIC_DIRECT);
  555. #elif defined(ARILUX_AL_LC06)
  556. setSetting("board", 43);
  557. setSetting("rlyProvider", RELAY_PROVIDER_LIGHT);
  558. setSetting("rlyCount", 1);
  559. setSetting("litProvider", LIGHT_PROVIDER_DIMMER);
  560. setSetting("litChGPIO", 0, 14);
  561. setSetting("litChGPIO", 1, 12);
  562. setSetting("litChGPIO", 2, 13);
  563. setSetting("litChGPIO", 3, 15);
  564. setSetting("litChGPIO", 4, 5);
  565. setSetting("litChLogic", 0, GPIO_LOGIC_DIRECT);
  566. setSetting("litChLogic", 1, GPIO_LOGIC_DIRECT);
  567. setSetting("litChLogic", 2, GPIO_LOGIC_DIRECT);
  568. setSetting("litChLogic", 3, GPIO_LOGIC_DIRECT);
  569. setSetting("litChLogic", 4, GPIO_LOGIC_DIRECT);
  570. #elif defined(XENON_SM_PW702U)
  571. setSetting("board", 44);
  572. setSetting("btnGPIO", 0, 13);
  573. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  574. setSetting("btnRelay", 0, 0);
  575. setSetting("ledGPIO", 0, 4);
  576. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  577. setSetting("rlyGPIO", 0, 12);
  578. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  579. #elif defined(AUTHOMETION_LYT8266)
  580. // AUTHOMETION LYT8266
  581. // https://authometion.com/shop/en/home/13-lyt8266.html
  582. setSetting("board", 45);
  583. setSetting("rlyProvider", RELAY_PROVIDER_LIGHT);
  584. setSetting("rlyCount", 1);
  585. setSetting("litProvider", LIGHT_PROVIDER_DIMMER);
  586. setSetting("litChGPIO", 0, 13);
  587. setSetting("litChGPIO", 1, 12);
  588. setSetting("litChGPIO", 2, 14);
  589. setSetting("litChGPIO", 3, 2);
  590. setSetting("litChLogic", 0, GPIO_LOGIC_DIRECT);
  591. setSetting("litChLogic", 1, GPIO_LOGIC_DIRECT);
  592. setSetting("litChLogic", 2, GPIO_LOGIC_DIRECT);
  593. setSetting("litChLogic", 3, GPIO_LOGIC_DIRECT);
  594. setSetting("litEnableGPIO", 15);
  595. setSetting("litEnableLogic", GPIO_LOGIC_DIRECT);
  596. #elif defined(ARILUX_E27)
  597. setSetting("board", 46);
  598. setSetting("rlyProvider", RELAY_PROVIDER_LIGHT);
  599. setSetting("rlyCount", 1);
  600. setSetting("litProvider", LIGHT_PROVIDER_MY92XX);
  601. setSetting("myModel", MY92XX_MODEL_MY9291); // 4 channels per chip
  602. setSetting("myChips", 1);
  603. setSetting("myDIGPIO", 13);
  604. setSetting("myDCKIGPIO", 15);
  605. setSetting("myMapping", "0123");
  606. #elif defined(YJZK_SWITCH_2CH)
  607. setSetting("board", 47);
  608. setSetting("btnGPIO", 0, 0);
  609. setSetting("btnGPIO", 1, 9);
  610. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  611. setSetting("btnMode", 1, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  612. setSetting("btnRelay", 0, 0);
  613. setSetting("btnRelay", 1, 1);
  614. setSetting("ledGPIO", 0, 13);
  615. setSetting("ledLogic", 0, GPIO_LOGIC_DIRECT);
  616. setSetting("rlyGPIO", 0, 12);
  617. setSetting("rlyGPIO", 1, 5);
  618. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  619. setSetting("rlyType", 1, RELAY_TYPE_NORMAL);
  620. #elif defined(ITEAD_SONOFF_DUAL_R2)
  621. setSetting("board", 48);
  622. setSetting("btnGPIO", 1, 9);
  623. setSetting("btnGPIO", 2, 10);
  624. setSetting("btnMode", 1, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  625. setSetting("btnMode", 2, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  626. setSetting("btnRelay", 1, 1);
  627. setSetting("btnRelay", 2, 0);
  628. setSetting("rlyGPIO", 1, 5);
  629. setSetting("rlyType", 1, RELAY_TYPE_NORMAL);
  630. #elif defined(GENERIC_8CH)
  631. setSetting("board", 49);
  632. setSetting("rlyGPIO", 0, 0);
  633. setSetting("rlyGPIO", 1, 2);
  634. setSetting("rlyGPIO", 2, 4);
  635. setSetting("rlyGPIO", 3, 5);
  636. setSetting("rlyGPIO", 4, 12);
  637. setSetting("rlyGPIO", 5, 13);
  638. setSetting("rlyGPIO", 6, 14);
  639. setSetting("rlyGPIO", 7, 15);
  640. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  641. setSetting("rlyType", 1, RELAY_TYPE_NORMAL);
  642. setSetting("rlyType", 2, RELAY_TYPE_NORMAL);
  643. setSetting("rlyType", 3, RELAY_TYPE_NORMAL);
  644. setSetting("rlyType", 4, RELAY_TYPE_NORMAL);
  645. setSetting("rlyType", 5, RELAY_TYPE_NORMAL);
  646. setSetting("rlyType", 6, RELAY_TYPE_NORMAL);
  647. setSetting("rlyType", 7, RELAY_TYPE_NORMAL);
  648. #elif defined(ARILUX_AL_LC01)
  649. setSetting("board", 50);
  650. setSetting("rlyProvider", RELAY_PROVIDER_LIGHT);
  651. setSetting("rlyCount", 1);
  652. setSetting("litProvider", LIGHT_PROVIDER_DIMMER);
  653. setSetting("litChGPIO", 0, 5);
  654. setSetting("litChGPIO", 1, 12);
  655. setSetting("litChGPIO", 2, 13);
  656. setSetting("litChLogic", 0, GPIO_LOGIC_DIRECT);
  657. setSetting("litChLogic", 1, GPIO_LOGIC_DIRECT);
  658. setSetting("litChLogic", 2, GPIO_LOGIC_DIRECT);
  659. #elif defined(ARILUX_AL_LC11)
  660. setSetting("board", 51);
  661. setSetting("rlyProvider", RELAY_PROVIDER_LIGHT);
  662. setSetting("rlyCount", 1);
  663. setSetting("litProvider", LIGHT_PROVIDER_DIMMER);
  664. setSetting("litChGPIO", 0, 5);
  665. setSetting("litChGPIO", 1, 4);
  666. setSetting("litChGPIO", 2, 14);
  667. setSetting("litChGPIO", 3, 13);
  668. setSetting("litChGPIO", 4, 12);
  669. setSetting("litChLogic", 0, GPIO_LOGIC_DIRECT);
  670. setSetting("litChLogic", 1, GPIO_LOGIC_DIRECT);
  671. setSetting("litChLogic", 2, GPIO_LOGIC_DIRECT);
  672. setSetting("litChLogic", 3, GPIO_LOGIC_DIRECT);
  673. setSetting("litChLogic", 4, GPIO_LOGIC_DIRECT);
  674. #elif defined(ARILUX_AL_LC02)
  675. setSetting("board", 52);
  676. setSetting("rlyProvider", RELAY_PROVIDER_LIGHT);
  677. setSetting("rlyCount", 1);
  678. setSetting("litProvider", LIGHT_PROVIDER_DIMMER);
  679. setSetting("litChGPIO", 0, 12);
  680. setSetting("litChGPIO", 1, 5);
  681. setSetting("litChGPIO", 2, 13);
  682. setSetting("litChGPIO", 3, 15);
  683. setSetting("litChLogic", 0, GPIO_LOGIC_DIRECT);
  684. setSetting("litChLogic", 1, GPIO_LOGIC_DIRECT);
  685. setSetting("litChLogic", 2, GPIO_LOGIC_DIRECT);
  686. setSetting("litChLogic", 3, GPIO_LOGIC_DIRECT);
  687. #elif defined(KMC_70011)
  688. // KMC 70011
  689. // https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
  690. setSetting("board", 53);
  691. setSetting("btnGPIO", 0, 0);
  692. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  693. setSetting("btnRelay", 0, 0);
  694. setSetting("ledGPIO", 0, 13);
  695. setSetting("ledLogic", 0, GPIO_LOGIC_DIRECT);
  696. setSetting("rlyGPIO", 0, 14);
  697. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  698. setSetting("hlwEnabled", 1);
  699. setSetting("hlwSELGPIO", 12);
  700. setSetting("hlwCF1GPIO", 5);
  701. setSetting("hlwCFGPIO", 4);
  702. setSetting("hlwVolResUp", 2000000);
  703. #elif defined(GIZWITS_WITTY_CLOUD)
  704. setSetting("board", 54);
  705. setSetting("btnGPIO", 0, 4);
  706. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  707. setSetting("btnPress", 0, BUTTON_MODE_TOGGLE);
  708. setSetting("btnClick", 0, BUTTON_MODE_NONE);
  709. setSetting("btnDblClick", 0, BUTTON_MODE_NONE);
  710. setSetting("btnLngClick", 0, BUTTON_MODE_NONE);
  711. setSetting("btnLngLngClick", 0, BUTTON_MODE_RESET);
  712. setSetting("ledGPIO", 0, 2);
  713. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  714. setSetting("rlyProvider", RELAY_PROVIDER_LIGHT);
  715. setSetting("rlyCount", 1);
  716. setSetting("anaEnabled", 1);
  717. setSetting("litProvider", LIGHT_PROVIDER_DIMMER);
  718. setSetting("litChGPIO", 0, 15);
  719. setSetting("litChGPIO", 1, 12);
  720. setSetting("litChGPIO", 2, 13);
  721. setSetting("litChLogic", 0, GPIO_LOGIC_DIRECT);
  722. setSetting("litChLogic", 1, GPIO_LOGIC_DIRECT);
  723. setSetting("litChLogic", 2, GPIO_LOGIC_DIRECT);
  724. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  725. // Euromate (?) Wifi Stecker Shuko
  726. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  727. // Thanks to @Geitde
  728. // The relay in the device is not a bistable (latched) relay.
  729. // The device is reported to have a flip-flop circuit to drive the relay
  730. // So @Geitde hack is still the only possible
  731. // Hack: drive GPIO12 low and use GPIO5 as normal relay pin:
  732. setSetting("board", 55);
  733. setSetting("btnGPIO", 0, 14);
  734. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP);
  735. setSetting("btnRelay", 0, 0);
  736. setSetting("ledGPIO", 0, 4);
  737. setSetting("ledGPIO", 1, 12);
  738. setSetting("ledLogic", 0, GPIO_LOGIC_DIRECT);
  739. setSetting("ledLogic", 1, GPIO_LOGIC_DIRECT);
  740. setSetting("rlyGPIO", 0, 5);
  741. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  742. #elif defined(TONBUX_POWERSTRIP02)
  743. setSetting("board", 56);
  744. setSetting("btnGPIO", 0, 5);
  745. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  746. setSetting("btnRelay", 0, 1);
  747. setSetting("ledGPIO", 0, 0); // 1 blue led
  748. setSetting("ledGPIO", 1, 3); // 3 red leds
  749. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  750. setSetting("ledLogic", 1, GPIO_LOGIC_INVERSE);
  751. setSetting("rlyGPIO", 0, 4);
  752. setSetting("rlyGPIO", 1, 13);
  753. setSetting("rlyGPIO", 2, 12);
  754. setSetting("rlyGPIO", 3, 14);
  755. setSetting("rlyGPIO", 4, 16); // Not a relay. USB ports on/off
  756. setSetting("rlyType", 0, RELAY_TYPE_INVERSE);
  757. setSetting("rlyType", 1, RELAY_TYPE_INVERSE);
  758. setSetting("rlyType", 2, RELAY_TYPE_INVERSE);
  759. setSetting("rlyType", 3, RELAY_TYPE_INVERSE);
  760. setSetting("rlyType", 4, RELAY_TYPE_NORMAL); // Not a relay. USB ports on/off
  761. #elif defined(LINGAN_SWA1)
  762. setSetting("board", 57);
  763. setSetting("btnGPIO", 0, 13);
  764. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP);
  765. setSetting("btnRelay", 0, 0);
  766. setSetting("ledGPIO", 0, 4);
  767. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  768. setSetting("rlyGPIO", 0, 5);
  769. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  770. #elif defined(HEYGO_HY02)
  771. setSetting("board", 58);
  772. setSetting("btnGPIO", 0, 13);
  773. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  774. setSetting("btnRelay", 0, 0);
  775. setSetting("ledGPIO", 0, 4);
  776. setSetting("ledLogic", 0, GPIO_LOGIC_DIRECT);
  777. setSetting("rlyGPIO", 0, 12);
  778. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  779. #elif defined(MAXCIO_WUS002S)
  780. setSetting("board", 59);
  781. setSetting("btnGPIO", 0, 2);
  782. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  783. setSetting("btnRelay", 0, 0);
  784. setSetting("ledGPIO", 0, 3);
  785. setSetting("ledLogic", 0, GPIO_LOGIC_DIRECT);
  786. setSetting("rlyGPIO", 0, 13);
  787. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  788. setSetting("hlwEnabled", 1);
  789. setSetting("hlwSELGPIO", 12);
  790. setSetting("hlwCF1GPIO", 5);
  791. setSetting("hlwCFGPIO", 4);
  792. setSetting("hlwCurRes", 0.002);
  793. setSetting("hlwVolResUp", 2000000);
  794. #elif defined(YIDIAN_XSSSA05)
  795. setSetting("board", 60);
  796. setSetting("btnGPIO", 0, 13);
  797. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  798. setSetting("btnRelay", 0, 0);
  799. setSetting("ledGPIO", 0, 4);
  800. setSetting("ledGPIO", 2, 2);
  801. setSetting("ledLogic", 0, GPIO_LOGIC_DIRECT);
  802. setSetting("ledLogic", 2, GPIO_LOGIC_DIRECT);
  803. setSetting("rlyGPIO", 0, 12);
  804. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  805. setSetting("hlwEnabled", 1);
  806. setSetting("hlwSELGPIO", 3);
  807. setSetting("hlwCF1GPIO", 14);
  808. setSetting("hlwCFGPIO", 5);
  809. setSetting("hlwVolResUp", 2400000);
  810. #elif defined(TONBUX_XSSSA06)
  811. setSetting("board", 61);
  812. setSetting("btnGPIO", 0, 13);
  813. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  814. setSetting("btnRelay", 0, 0);
  815. setSetting("ledGPIO", 0, 0); // Red
  816. setSetting("ledGPIO", 0, 5); // Green
  817. setSetting("ledGPIO", 0, 2); // Blue
  818. setSetting("ledLogic", 0, GPIO_LOGIC_DIRECT);
  819. setSetting("ledLogic", 0, GPIO_LOGIC_DIRECT);
  820. setSetting("ledLogic", 0, GPIO_LOGIC_DIRECT);
  821. setSetting("rlyGPIO", 0, 15);
  822. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  823. #elif defined(GREEN_ESP8266RELAY)
  824. // GREEN ESP8266 RELAY MODULE
  825. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  826. setSetting("board", 62);
  827. setSetting("btnGPIO", 0, 5);
  828. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  829. setSetting("btnRelay", 0, 0);
  830. setSetting("ledGPIO", 0, 2);
  831. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  832. setSetting("rlyGPIO", 0, 4);
  833. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  834. #elif defined(IKE_ESPIKE)
  835. // Henrique Gravina ESPIKE
  836. // https://github.com/Henriquegravina/Espike
  837. setSetting("board", 63);
  838. setSetting("btnGPIO", 0, 13);
  839. setSetting("btnGPIO", 1, 12);
  840. setSetting("btnGPIO", 2, 14);
  841. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  842. setSetting("btnMode", 1, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  843. setSetting("btnMode", 2, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  844. setSetting("btnRelay", 0, 0);
  845. setSetting("btnRelay", 1, 1);
  846. setSetting("btnRelay", 2, 2);
  847. setSetting("btnDblClick", 0, BUTTON_MODE_NONE);
  848. setSetting("btnLngClick", 0, BUTTON_MODE_NONE);
  849. setSetting("btnLngLngClick", 0, BUTTON_MODE_NONE);
  850. setSetting("ledGPIO", 0, 2);
  851. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  852. setSetting("rlyGPIO", 0, 4);
  853. setSetting("rlyGPIO", 1, 5);
  854. setSetting("rlyGPIO", 2, 16);
  855. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  856. setSetting("rlyType", 1, RELAY_TYPE_NORMAL);
  857. setSetting("rlyType", 2, RELAY_TYPE_NORMAL);
  858. #elif defined(ARNIEX_SWIFITCH)
  859. // SWIFITCH
  860. // https://github.com/ArnieX/swifitch
  861. setSetting("board", 64);
  862. setSetting("btnGPIO", 0, 4);
  863. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP);
  864. setSetting("btnRelay", 0, 1);
  865. setSetting("btnPress", 0, BUTTON_MODE_NONE);
  866. setSetting("btnClick", 0, BUTTON_MODE_TOGGLE);
  867. setSetting("btnDblClick", 0, BUTTON_MODE_NONE);
  868. setSetting("btnLngClick", 0, BUTTON_MODE_NONE);
  869. setSetting("btnLngLngClick", 0, BUTTON_MODE_NONE);
  870. setSetting("ledGPIO", 0, 12);
  871. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  872. setSetting("rlyGPIO", 0, 5);
  873. setSetting("rlyType", 0, RELAY_TYPE_INVERSE);
  874. #elif defined(GENERIC_ESP01S_RELAY_V40)
  875. // ESP-01S RELAY v4.0
  876. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  877. setSetting("board", 65);
  878. setSetting("ledGPIO", 0, 2);
  879. setSetting("ledLogic", 0, GPIO_LOGIC_DIRECT);
  880. setSetting("rlyGPIO", 0, 0);
  881. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  882. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  883. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  884. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  885. setSetting("board", 66);
  886. setSetting("ledGPIO", 0, 2);
  887. setSetting("ledLogic", 0, GPIO_LOGIC_DIRECT);
  888. #elif defined(HELTEC_TOUCHRELAY)
  889. // Heltec Touch Relay
  890. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  891. setSetting("board", 67);
  892. setSetting("btnGPIO", 0, 14);
  893. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  894. setSetting("btnRelay", 0, 1);
  895. setSetting("rlyGPIO", 0, 12);
  896. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  897. #elif defined(GENERIC_ESP01S_DHT11_V10)
  898. // ESP-01S DHT11 v1.0
  899. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  900. setSetting("board", 68);
  901. setSetting("dhtEnabled", 1);
  902. setSetting("dhtGPIO", 0, 2);
  903. setSetting("dhtType", 0, DHT_CHIP_DHT11);
  904. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  905. // ESP-01S DS18B20 v1.0
  906. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  907. setSetting("board", 69);
  908. setSetting("dsEnabled", 1);
  909. setSetting("dsGPIO", 0, 2);
  910. #elif defined(ZHILDE_EU44_W)
  911. // Zhilde ZLD-EU44-W
  912. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  913. setSetting("board", 70);
  914. setSetting("btnGPIO", 0, 3);
  915. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  916. setSetting("btnRelay", 0, 0);
  917. setSetting("ledGPIO", 0, 1);
  918. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  919. setSetting("rlyGPIO", 0, 5);
  920. setSetting("rlyGPIO", 1, 4);
  921. setSetting("rlyGPIO", 2, 12);
  922. setSetting("rlyGPIO", 3, 13);
  923. setSetting("rlyGPIO", 4, 14);
  924. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  925. setSetting("rlyType", 1, RELAY_TYPE_NORMAL);
  926. setSetting("rlyType", 2, RELAY_TYPE_NORMAL);
  927. setSetting("rlyType", 3, RELAY_TYPE_NORMAL);
  928. setSetting("rlyType", 4, RELAY_TYPE_NORMAL);
  929. // Based on the reporter, this product uses GPIO1 and 3 for the button
  930. // and onboard LED, so hardware serial should be disabled...
  931. setSetting("dbgSerial", 0);
  932. #elif defined(ITEAD_SONOFF_POW_R2)
  933. setSetting("board", 71);
  934. setSetting("cseEnabled", 1);
  935. setSetting("cseGPIO", 1);
  936. setSetting("dbgSerial", 0);
  937. #elif defined(LUANI_HVIO)
  938. // Luani HVIO
  939. // https://luani.de/projekte/esp8266-hvio/
  940. // https://luani.de/blog/esp8266-230v-io-modul/
  941. setSetting("board", 72);
  942. setSetting("ledGPIO", 0, 15);
  943. setSetting("ledLogic", 0, GPIO_LOGIC_DIRECT);
  944. setSetting("btnGPIO", 0, 12);
  945. setSetting("btnGPIO", 1, 13);
  946. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  947. setSetting("btnMode", 1, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  948. setSetting("btnRelay", 0, 0);
  949. setSetting("btnRelay", 1, 1);
  950. setSetting("btnDblClick", 0, BUTTON_MODE_NONE);
  951. setSetting("rlyGPIO", 0, 4);
  952. setSetting("rlyGPIO", 1, 5);
  953. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  954. setSetting("rlyType", 1, RELAY_TYPE_NORMAL);
  955. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  956. // Allnet 4duino ESP8266-UP-Relais
  957. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  958. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  959. setSetting("board", 73);
  960. setSetting("ledGPIO", 0, 0);
  961. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  962. setSetting("rlyGPIO", 0, 14);
  963. setSetting("rlyResetGPIO", 0, 12);
  964. setSetting("rlyType", 0, RELAY_TYPE_LATCHED);
  965. #elif defined(TONBUX_MOSQUITO_KILLER)
  966. // Tonbux 50-100M Smart Mosquito Killer USB
  967. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  968. setSetting("board", 74);
  969. setSetting("btnGPIO", 0, 2);
  970. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  971. setSetting("btnRelay", 0, 0);
  972. setSetting("ledGPIO", 0, 15);
  973. setSetting("ledGPIO", 1, 14);
  974. setSetting("ledGPIO", 2, 12);
  975. setSetting("ledGPIO", 3, 16);
  976. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  977. setSetting("ledLogic", 1, GPIO_LOGIC_INVERSE);
  978. setSetting("ledLogic", 2, GPIO_LOGIC_DIRECT);
  979. setSetting("ledLogic", 3, GPIO_LOGIC_DIRECT);
  980. setSetting("ledMode", 0, LED_MODE_WIFI);
  981. setSetting("ledMode", 1, LED_MODE_RELAY);
  982. setSetting("ledRelay", 1, 0);
  983. setSetting("rlyGPIO", 0, 5); // Fan
  984. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  985. #elif defined(NEO_COOLCAM_NAS_WR01W)
  986. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  987. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  988. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  989. setSetting("board", 75);
  990. setSetting("btnGPIO", 0, 13);
  991. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  992. setSetting("btnRelay", 0, 0);
  993. setSetting("ledGPIO", 0, 4);
  994. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  995. setSetting("rlyGPIO", 0, 12);
  996. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  997. #elif defined(PILOTAK_ESP_DIN_V1)
  998. // ESP-DIN relay board V1
  999. // https://github.com/pilotak/esp_din
  1000. setSetting("board", 76);
  1001. setSetting("btnGPIO", 0, 0);
  1002. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  1003. setSetting("btnRelay", 0, 0);
  1004. setSetting("ledGPIO", 0, 15);
  1005. setSetting("ledLogic", 0, GPIO_LOGIC_DIRECT);
  1006. setSetting("rlyGPIO", 0, 4);
  1007. setSetting("rlyGPIO", 1, 5);
  1008. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  1009. setSetting("rlyType", 1, RELAY_TYPE_NORMAL);
  1010. setSetting("digEnabled", 1);
  1011. setSetting("digGPIO", 0, 16);
  1012. setSetting("digMode", 0, INPUT);
  1013. setSetting("dsEnabled", 1);
  1014. setSetting("dsGPIO", 0, 2);
  1015. setSetting("i2cEnable", 1);
  1016. setSetting("i2cSDAGPIO", 12);
  1017. setSetting("i2cSCLGPIO", 13);
  1018. setSetting("rfEnabled", 1);
  1019. setSetting("rfGPIO", 14);
  1020. #elif defined(ESTINK_WIFI_POWER_STRIP)
  1021. // Estink Wifi Power Strip
  1022. // https://www.amazon.de/Steckdosenleiste-Ladeger%C3%A4t-Sprachsteuerung-SmartphonesTablets-Android/dp/B0796W5FZY
  1023. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  1024. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  1025. setSetting("board", 77);
  1026. setSetting("btnGPIO", 0, 16);
  1027. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  1028. setSetting("btnRelay", 0, 3);
  1029. setSetting("ledGPIO", 0, 0);
  1030. setSetting("ledGPIO", 1, 12);
  1031. setSetting("ledGPIO", 2, 3);
  1032. setSetting("ledGPIO", 3, 5);
  1033. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  1034. setSetting("ledLogic", 1, GPIO_LOGIC_INVERSE);
  1035. setSetting("ledLogic", 2, GPIO_LOGIC_INVERSE);
  1036. setSetting("ledLogic", 3, GPIO_LOGIC_INVERSE);
  1037. setSetting("ledMode", 0, LED_MODE_FINDME);
  1038. setSetting("ledMode", 1, LED_MODE_FOLLOW);
  1039. setSetting("ledMode", 2, LED_MODE_FOLLOW);
  1040. setSetting("ledMode", 3, LED_MODE_FOLLOW);
  1041. setSetting("ledRelay", 1, 1);
  1042. setSetting("ledRelay", 2, 2);
  1043. setSetting("ledRelay", 3, 3);
  1044. setSetting("rlyGPIO", 0, 14); // USB power
  1045. setSetting("rlyGPIO", 1, 13); // power plug 1
  1046. setSetting("rlyGPIO", 2, 4); // power plug 2
  1047. setSetting("rlyGPIO", 3, 15); // power plug 3
  1048. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  1049. setSetting("rlyType", 1, RELAY_TYPE_NORMAL);
  1050. setSetting("rlyType", 2, RELAY_TYPE_NORMAL);
  1051. setSetting("rlyType", 3, RELAY_TYPE_NORMAL);
  1052. setSetting("dbgSerial", 0);
  1053. #elif defined(BH_ONOFRE)
  1054. // Bruno Horta's OnOfre
  1055. // https://www.bhonofre.pt/
  1056. // https://github.com/brunohorta82/BH_OnOfre/
  1057. setSetting("board", 78);
  1058. setSetting("btnGPIO", 0, 12);
  1059. setSetting("btnGPIO", 1, 13);
  1060. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP);
  1061. setSetting("btnMode", 1, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP);
  1062. setSetting("btnRelay", 0, 0);
  1063. setSetting("btnRelay", 1, 1);
  1064. setSetting("rlyGPIO", 0, 4);
  1065. setSetting("rlyGPIO", 1, 5);
  1066. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  1067. setSetting("rlyType", 1, RELAY_TYPE_NORMAL);
  1068. #elif defined(BLITZWOLF_BWSHP2)
  1069. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  1070. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  1071. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  1072. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  1073. // * Goosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  1074. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  1075. setSetting("board", 79);
  1076. setSetting("btnGPIO", 0, 13);
  1077. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  1078. setSetting("btnRelay", 0, 0);
  1079. setSetting("ledGPIO", 0, 2);
  1080. setSetting("ledGPIO", 1, 0);
  1081. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  1082. setSetting("ledLogic", 1, GPIO_LOGIC_INVERSE);
  1083. setSetting("ledMode", 0, LED_MODE_WIFI);
  1084. setSetting("ledMode", 1, LED_MODE_FINDME);
  1085. setSetting("ledRelay", 1, 0);
  1086. setSetting("rlyGPIO", 0, 15);
  1087. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  1088. setSetting("hlwSELGPIO", 12);
  1089. setSetting("hlwCF1GPIO", 14);
  1090. setSetting("hlwCFGPIO", 5);
  1091. setSetting("hlwCurLevel", LOW);
  1092. setSetting("hlwInt", FALLING);
  1093. setSetting("curRatio", 25740);
  1094. setSetting("volRatio", 313400);
  1095. setSetting("pwrRatio", 3414290);
  1096. #elif defined(TINKERMAN_ESPURNA_SWITCH)
  1097. setSetting("board", 80);
  1098. setSetting("btnGPIO", 0, 4);
  1099. setSetting("btnMode", 0, BUTTON_PUSHBUTTON);
  1100. setSetting("btnPress", 0, BUTTON_MODE_TOGGLE);
  1101. setSetting("btnClick", 0, BUTTON_MODE_NONE);
  1102. setSetting("btnDblClick", 0, BUTTON_MODE_NONE);
  1103. setSetting("btnLngClick", 0, BUTTON_MODE_NONE);
  1104. setSetting("btnLngLngClick", 0, BUTTON_MODE_NONE);
  1105. setSetting("btnRelay", 0, 0);
  1106. setSetting("ledGPIO", 0, 2);
  1107. setSetting("ledLogic", 0, GPIO_LOGIC_DIRECT);
  1108. setSetting("rlyGPIO", 0, 12);
  1109. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  1110. #elif defined(ITEAD_SONOFF_S31)
  1111. setSetting("board", 81);
  1112. setSetting("cseEnabled", 1);
  1113. setSetting("cseGPIO", 1);
  1114. setSetting("dbgSerial", 0);
  1115. #elif defined(STM_RELAY)
  1116. setSetting("board", 82);
  1117. setSetting("rlyCount", 2);
  1118. setSetting("rlyProvider", RELAY_PROVIDER_STM)
  1119. setSetting("dbgSerial", 0);
  1120. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  1121. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  1122. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  1123. setSetting("board", 83);
  1124. setSetting("btnGPIO", 0, 13);
  1125. setSetting("btnMode", 0, BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH);
  1126. setSetting("btnRelay", 0, 0);
  1127. setSetting("ledGPIO", 0, 2);
  1128. setSetting("ledGPIO", 1, 0);
  1129. setSetting("ledLogic", 0, GPIO_LOGIC_INVERSE);
  1130. setSetting("ledLogic", 1, GPIO_LOGIC_INVERSE);
  1131. setSetting("ledMode", 0, LED_MODE_WIFI);
  1132. setSetting("ledMode", 1, LED_MODE_FINDME);
  1133. setSetting("ledRelay", 1, 0);
  1134. setSetting("rlyGPIO", 0, 15);
  1135. setSetting("rlyType", 0, RELAY_TYPE_NORMAL);
  1136. setSetting("hlwSELGPIO", 3);
  1137. setSetting("hlwCF1GPIO", 14);
  1138. setSetting("hlwCFGPIO", 5);
  1139. setSetting("hlwCurLevel", LOW);
  1140. setSetting("hlwInt", FALLING);
  1141. setSetting("curRatio", 25740);
  1142. setSetting("volRatio", 313400);
  1143. setSetting("pwrRatio", 3414290);
  1144. #elif defined(GENERIC_GEIGER_COUNTER)
  1145. setSetting("board", 83);
  1146. setSetting("geiEnabled", 1);
  1147. #elif defined(TINKERMAN_RFM69GW)
  1148. setSetting("board", 84);
  1149. setSetting("btnGPIO", 0, 0);
  1150. setSetting("rfm69Enabled", 1);
  1151. setSetting("rfm69CSGPIO", 15);
  1152. setSetting("rfm69IRQGPIO", 5);
  1153. setSetting("rfm69ResetGPIO", 7);
  1154. setSetting("rfm69HW", 0)
  1155. #else
  1156. // Allow users to define new settings without migration config
  1157. //#error "UNSUPPORTED HARDWARE!"
  1158. #endif
  1159. }