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.

1380 lines
39 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. // -----------------------------------------------------------------------------
  2. // Configuration HELP
  3. // -----------------------------------------------------------------------------
  4. //
  5. // MANUFACTURER: Name of the manufacturer of the board ("string")
  6. // DEVICE: Name of the device ("string")
  7. // BUTTON#_PIN: GPIO for the n-th button (1-based, up to 4 buttons)
  8. // BUTTON#_RELAY: Relay number that will be bind to the n-th button (1-based)
  9. // BUTTON#_MODE: A mask of options (BUTTON_PUSHBUTTON and BUTTON_SWITCH cannot be together)
  10. // - BUTTON_PUSHBUTTON: button event is fired when released
  11. // - BUTTON_SWITCH: button event is fired when pressed or released
  12. // - BUTTON_DEFAULT_HIGH: there is a pull up in place
  13. // - BUTTON_SET_PULLUP: set pullup by software
  14. // RELAY#_PIN: GPIO for the n-th relay (1-based, up to 4 relays)
  15. // RELAY#_TYPE: Relay can be RELAY_TYPE_NORMAL, RELAY_TYPE_INVERSE or RELAY_TYPE_LATCHED
  16. // LED#_PIN: GPIO for the n-th LED (1-based, up to 4 LEDs)
  17. // LED#_PIN_INVERSE: LED has inversed logic (lit when pulled down)
  18. // LED#_MODE: Check hardware.h for LED_MODE_%
  19. // LED#_RELAY: Linked relay (1-based)
  20. //
  21. // Besides, other hardware specific information should be stated here
  22. // -----------------------------------------------------------------------------
  23. // Development boards
  24. // -----------------------------------------------------------------------------
  25. #if defined(NODEMCU_LOLIN)
  26. // Info
  27. #define MANUFACTURER "NODEMCU"
  28. #define DEVICE "LOLIN"
  29. // Buttons
  30. #define BUTTON1_PIN 0
  31. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  32. #define BUTTON1_RELAY 1
  33. // Relays
  34. #define RELAY1_PIN 12
  35. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  36. // LEDs
  37. #define LED1_PIN 2
  38. #define LED1_PIN_INVERSE 1
  39. #elif defined(WEMOS_D1_MINI_RELAYSHIELD)
  40. // Info
  41. #define MANUFACTURER "WEMOS"
  42. #define DEVICE "D1_MINI_RELAYSHIELD"
  43. // Buttons
  44. // No buttons on the D1 MINI alone, but defining it without adding a button doen't create problems
  45. #define BUTTON1_PIN 0 // Connect a pushbutton between D3 and GND,
  46. // it's the same as using a Wemos one button shield
  47. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  48. #define BUTTON1_RELAY 1
  49. // Relays
  50. #define RELAY1_PIN 5
  51. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  52. // LEDs
  53. #define LED1_PIN 2
  54. #define LED1_PIN_INVERSE 1
  55. // -----------------------------------------------------------------------------
  56. // ESPurna
  57. // -----------------------------------------------------------------------------
  58. #elif defined(TINKERMAN_ESPURNA_H06)
  59. // Info
  60. #define MANUFACTURER "TINKERMAN"
  61. #define DEVICE "ESPURNA_H06"
  62. // Buttons
  63. #define BUTTON1_PIN 4
  64. #define BUTTON1_RELAY 1
  65. #ifdef USE_TOUCH_BUTTON
  66. // Touch button
  67. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  68. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  69. #define BUTTON1_CLICK BUTTON_MODE_NONE
  70. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  71. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  72. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  73. #else
  74. // Normal pushbutton
  75. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  76. #endif
  77. // Relays
  78. #define RELAY1_PIN 12
  79. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  80. // LEDs
  81. #define LED1_PIN 2
  82. #define LED1_PIN_INVERSE 1
  83. // HLW8012
  84. #ifndef POWER_PROVIDER
  85. #define POWER_PROVIDER POWER_PROVIDER_HLW8012
  86. #endif
  87. #define HLW8012_SEL_PIN 2
  88. #define HLW8012_CF1_PIN 13
  89. #define HLW8012_CF_PIN 14
  90. #elif defined(TINKERMAN_ESPURNA_H08)
  91. // Info
  92. #define MANUFACTURER "TINKERMAN"
  93. #define DEVICE "ESPURNA_H08"
  94. // Buttons
  95. #define BUTTON1_PIN 4
  96. #define BUTTON1_RELAY 1
  97. #ifdef USE_TOUCH_BUTTON
  98. // Touch button
  99. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  100. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  101. #define BUTTON1_CLICK BUTTON_MODE_NONE
  102. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  103. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  104. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  105. #else
  106. // Normal pushbutton
  107. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  108. #endif
  109. // Relays
  110. #define RELAY1_PIN 12
  111. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  112. // LEDs
  113. #define LED1_PIN 2
  114. #define LED1_PIN_INVERSE 0
  115. // HLW8012
  116. #ifndef POWER_PROVIDER
  117. #define POWER_PROVIDER POWER_PROVIDER_HLW8012
  118. #endif
  119. #define HLW8012_SEL_PIN 5
  120. #define HLW8012_CF1_PIN 13
  121. #define HLW8012_CF_PIN 14
  122. // -----------------------------------------------------------------------------
  123. // Itead Studio boards
  124. // -----------------------------------------------------------------------------
  125. #elif defined(ITEAD_SONOFF_BASIC)
  126. // Info
  127. #define MANUFACTURER "ITEAD"
  128. #define DEVICE "SONOFF_BASIC"
  129. // Buttons
  130. #define BUTTON1_PIN 0
  131. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  132. #define BUTTON1_RELAY 1
  133. #define BUTTON2_PIN 14
  134. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP
  135. #define BUTTON2_RELAY 1
  136. // Relays
  137. #define RELAY1_PIN 12
  138. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  139. // LEDs
  140. #define LED1_PIN 13
  141. #define LED1_PIN_INVERSE 1
  142. #elif defined(ITEAD_SONOFF_RF)
  143. // Info
  144. #define MANUFACTURER "ITEAD"
  145. #define DEVICE "SONOFF_RF"
  146. // Buttons
  147. #define BUTTON1_PIN 0
  148. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  149. #define BUTTON1_RELAY 1
  150. #define BUTTON2_PIN 14
  151. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP
  152. #define BUTTON2_RELAY 1
  153. // Relays
  154. #define RELAY1_PIN 12
  155. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  156. // LEDs
  157. #define LED1_PIN 13
  158. #define LED1_PIN_INVERSE 1
  159. #elif defined(ITEAD_SONOFF_TH)
  160. // Info
  161. #define MANUFACTURER "ITEAD"
  162. #define DEVICE "SONOFF_TH"
  163. // Buttons
  164. #define BUTTON1_PIN 0
  165. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  166. #define BUTTON1_RELAY 1
  167. // Relays
  168. #define RELAY1_PIN 12
  169. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  170. // LEDs
  171. #define LED1_PIN 13
  172. #define LED1_PIN_INVERSE 1
  173. // Jack is connected to GPIO14 (and with a small hack to GPIO4)
  174. //#define I2C_SDA_PIN 4
  175. //#define I2C_SCL_PIN 14
  176. #elif defined(ITEAD_SONOFF_SV)
  177. // Info
  178. #define MANUFACTURER "ITEAD"
  179. #define DEVICE "SONOFF_SV"
  180. // Buttons
  181. #define BUTTON1_PIN 0
  182. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  183. #define BUTTON1_RELAY 1
  184. // Relays
  185. #define RELAY1_PIN 12
  186. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  187. // LEDs
  188. #define LED1_PIN 13
  189. #define LED1_PIN_INVERSE 1
  190. #elif defined(ITEAD_SLAMPHER)
  191. // Info
  192. #define MANUFACTURER "ITEAD"
  193. #define DEVICE "SLAMPHER"
  194. // Buttons
  195. #define BUTTON1_PIN 0
  196. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  197. #define BUTTON1_RELAY 1
  198. // Relays
  199. #define RELAY1_PIN 12
  200. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  201. // LEDs
  202. #define LED1_PIN 13
  203. #define LED1_PIN_INVERSE 1
  204. #elif defined(ITEAD_S20)
  205. // Info
  206. #define MANUFACTURER "ITEAD"
  207. #define DEVICE "S20"
  208. // Buttons
  209. #define BUTTON1_PIN 0
  210. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  211. #define BUTTON1_RELAY 1
  212. // Relays
  213. #define RELAY1_PIN 12
  214. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  215. // LEDs
  216. #define LED1_PIN 13
  217. #define LED1_PIN_INVERSE 1
  218. #elif defined(ITEAD_SONOFF_TOUCH)
  219. // Info
  220. #define MANUFACTURER "ITEAD"
  221. #define DEVICE "SONOFF_TOUCH"
  222. // Buttons
  223. #define BUTTON1_PIN 0
  224. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  225. #define BUTTON1_RELAY 1
  226. // Relays
  227. #define RELAY1_PIN 12
  228. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  229. // LEDs
  230. #define LED1_PIN 13
  231. #define LED1_PIN_INVERSE 1
  232. #elif defined(ITEAD_SONOFF_POW)
  233. // Info
  234. #define MANUFACTURER "ITEAD"
  235. #define DEVICE "SONOFF_POW"
  236. // Buttons
  237. #define BUTTON1_PIN 0
  238. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  239. #define BUTTON1_RELAY 1
  240. // Relays
  241. #define RELAY1_PIN 12
  242. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  243. // LEDs
  244. #define LED1_PIN 15
  245. #define LED1_PIN_INVERSE 0
  246. // HLW8012
  247. #define POWER_PROVIDER POWER_PROVIDER_HLW8012
  248. #define HLW8012_SEL_PIN 5
  249. #define HLW8012_CF1_PIN 13
  250. #define HLW8012_CF_PIN 14
  251. #elif defined(ITEAD_SONOFF_DUAL)
  252. // Info
  253. #define MANUFACTURER "ITEAD"
  254. #define DEVICE "SONOFF_DUAL"
  255. #define SERIAL_BAUDRATE 19230
  256. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  257. #define DUMMY_RELAY_COUNT 2
  258. #define DEBUG_SERIAL_SUPPORT 0
  259. #define TERMINAL_SUPPORT 0
  260. // Buttons
  261. #define BUTTON3_RELAY 1
  262. // LEDs
  263. #define LED1_PIN 13
  264. #define LED1_PIN_INVERSE 1
  265. #elif defined(ITEAD_SONOFF_DUAL_R2)
  266. #define MANUFACTURER "ITEAD"
  267. #define DEVICE "SONOFF_DUAL_R2"
  268. // Buttons
  269. #define BUTTON1_PIN 0
  270. #define BUTTON2_PIN 9
  271. #define BUTTON3_PIN 10
  272. #define BUTTON1_RELAY 1
  273. #define BUTTON2_RELAY 2
  274. #define BUTTON3_RELAY 1
  275. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP
  276. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP
  277. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  278. // Relays
  279. #define RELAY1_PIN 12
  280. #define RELAY2_PIN 5
  281. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  282. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  283. // LEDs
  284. #define LED1_PIN 13
  285. #define LED1_PIN_INVERSE 1
  286. #elif defined(ITEAD_SONOFF_4CH)
  287. // Info
  288. #define MANUFACTURER "ITEAD"
  289. #define DEVICE "SONOFF_4CH"
  290. // Buttons
  291. #define BUTTON1_PIN 0
  292. #define BUTTON2_PIN 9
  293. #define BUTTON3_PIN 10
  294. #define BUTTON4_PIN 14
  295. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  296. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  297. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  298. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  299. #define BUTTON1_RELAY 1
  300. #define BUTTON2_RELAY 2
  301. #define BUTTON3_RELAY 3
  302. #define BUTTON4_RELAY 4
  303. // Relays
  304. #define RELAY1_PIN 12
  305. #define RELAY2_PIN 5
  306. #define RELAY3_PIN 4
  307. #define RELAY4_PIN 15
  308. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  309. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  310. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  311. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  312. // LEDs
  313. #define LED1_PIN 13
  314. #define LED1_PIN_INVERSE 1
  315. #elif defined(ITEAD_SONOFF_4CH_PRO)
  316. // Info
  317. #define MANUFACTURER "ITEAD"
  318. #define DEVICE "SONOFF_4CH_PRO"
  319. // Buttons
  320. #define BUTTON1_PIN 0
  321. #define BUTTON2_PIN 9
  322. #define BUTTON3_PIN 10
  323. #define BUTTON4_PIN 14
  324. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  325. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  326. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  327. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  328. #define BUTTON1_RELAY 1
  329. #define BUTTON2_RELAY 2
  330. #define BUTTON3_RELAY 3
  331. #define BUTTON4_RELAY 4
  332. // Relays
  333. #define RELAY1_PIN 12
  334. #define RELAY2_PIN 5
  335. #define RELAY3_PIN 4
  336. #define RELAY4_PIN 15
  337. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  338. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  339. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  340. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  341. // LEDs
  342. #define LED1_PIN 13
  343. #define LED1_PIN_INVERSE 1
  344. #elif defined(ITEAD_1CH_INCHING)
  345. // The inching functionality is managed by a misterious IC in the board.
  346. // You cannot control the inching button and functionality from the ESP8266
  347. // Besides, enabling the inching functionality using the hardware button
  348. // will result in the relay switching on and off continuously.
  349. // Fortunately the unkown IC keeps memory of the hardware inching status
  350. // so you can just disable it and forget. The inching LED must be lit.
  351. // You can still use the pulse options from the web interface
  352. // without problem.
  353. // Info
  354. #define MANUFACTURER "ITEAD"
  355. #define DEVICE "1CH_INCHING"
  356. // Buttons
  357. #define BUTTON1_PIN 0
  358. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  359. #define BUTTON1_RELAY 1
  360. // Relays
  361. #define RELAY1_PIN 12
  362. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  363. // LEDs
  364. #define LED1_PIN 13
  365. #define LED1_PIN_INVERSE 1
  366. #elif defined(ITEAD_MOTOR)
  367. // Info
  368. #define MANUFACTURER "ITEAD"
  369. #define DEVICE "MOTOR"
  370. // Buttons
  371. #define BUTTON1_PIN 0
  372. #define BUTTON1_RELAY 1
  373. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  374. // Relays
  375. #define RELAY1_PIN 12
  376. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  377. // LEDs
  378. #define LED1_PIN 13
  379. #define LED1_PIN_INVERSE 1
  380. #elif defined(ITEAD_BNSZ01)
  381. // Info
  382. #define MANUFACTURER "ITEAD"
  383. #define DEVICE "BNSZ01"
  384. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  385. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  386. #define DUMMY_RELAY_COUNT 1
  387. // LEDs
  388. #define LED1_PIN 13
  389. #define LED1_PIN_INVERSE 1
  390. // Light
  391. #define LIGHT_CHANNELS 1
  392. #define LIGHT_CH1_PIN 12
  393. #define LIGHT_CH1_INVERSE 0
  394. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  395. // Info
  396. #define MANUFACTURER "ITEAD"
  397. #define DEVICE "SONOFF_RFBRIDGE"
  398. #define SERIAL_BAUDRATE 19200
  399. #define RELAY_PROVIDER RELAY_PROVIDER_RFBRIDGE
  400. #ifndef DUMMY_RELAY_COUNT
  401. #define DUMMY_RELAY_COUNT 6
  402. #endif
  403. #define TERMINAL_SUPPORT 0
  404. #define DEBUG_SERIAL_SUPPORT 0
  405. // Buttons
  406. #define BUTTON1_PIN 0
  407. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  408. // LEDs
  409. #define LED1_PIN 13
  410. #define LED1_PIN_INVERSE 1
  411. #elif defined(ITEAD_SONOFF_B1)
  412. // Info
  413. #define MANUFACTURER "ITEAD"
  414. #define DEVICE "SONOFF_B1"
  415. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  416. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  417. #define DUMMY_RELAY_COUNT 1
  418. // Light
  419. #define LIGHT_CHANNELS 5
  420. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  421. #define MY92XX_CHIPS 2
  422. #define MY92XX_DI_PIN 12
  423. #define MY92XX_DCKI_PIN 14
  424. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  425. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  426. #elif defined(ITEAD_SONOFF_LED)
  427. // Info
  428. #define MANUFACTURER "ITEAD"
  429. #define DEVICE "SONOFF_LED"
  430. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  431. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  432. #define DUMMY_RELAY_COUNT 1
  433. // LEDs
  434. #define LED1_PIN 13
  435. #define LED1_PIN_INVERSE 1
  436. // Light
  437. #define LIGHT_CHANNELS 2
  438. #define LIGHT_CH1_PIN 12 // Cold white
  439. #define LIGHT_CH2_PIN 14 // Warm white
  440. #define LIGHT_CH1_INVERSE 0
  441. #define LIGHT_CH2_INVERSE 0
  442. #elif defined(ITEAD_SONOFF_T1_1CH)
  443. // Info
  444. #define MANUFACTURER "ITEAD"
  445. #define DEVICE "SONOFF_T1_1CH"
  446. // Buttons
  447. #define BUTTON1_PIN 0
  448. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  449. #define BUTTON1_RELAY 1
  450. // Relays
  451. #define RELAY1_PIN 12
  452. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  453. // LEDs
  454. #define LED1_PIN 13
  455. #define LED1_PIN_INVERSE 1
  456. #elif defined(ITEAD_SONOFF_T1_2CH)
  457. // Info
  458. #define MANUFACTURER "ITEAD"
  459. #define DEVICE "SONOFF_T1_2CH"
  460. // Buttons
  461. #define BUTTON1_PIN 0
  462. #define BUTTON2_PIN 9
  463. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  464. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  465. #define BUTTON1_RELAY 1
  466. #define BUTTON2_RELAY 2
  467. // Relays
  468. #define RELAY1_PIN 12
  469. #define RELAY2_PIN 5
  470. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  471. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  472. // LEDs
  473. #define LED1_PIN 13
  474. #define LED1_PIN_INVERSE 1
  475. #elif defined(ITEAD_SONOFF_T1_3CH)
  476. // Info
  477. #define MANUFACTURER "ITEAD"
  478. #define DEVICE "SONOFF_T1_3CH"
  479. // Buttons
  480. #define BUTTON1_PIN 0
  481. #define BUTTON2_PIN 9
  482. #define BUTTON3_PIN 10
  483. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  484. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  485. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  486. #define BUTTON1_RELAY 1
  487. #define BUTTON2_RELAY 2
  488. #define BUTTON3_RELAY 3
  489. // Relays
  490. #define RELAY1_PIN 12
  491. #define RELAY2_PIN 5
  492. #define RELAY3_PIN 4
  493. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  494. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  495. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  496. // LEDs
  497. #define LED1_PIN 13
  498. #define LED1_PIN_INVERSE 1
  499. // -----------------------------------------------------------------------------
  500. // YJZK
  501. // -----------------------------------------------------------------------------
  502. #elif defined(YJZK_SWITCH_2CH)
  503. // Info
  504. #define MANUFACTURER "YJZK"
  505. #define DEVICE "SWITCH_2CH"
  506. // Buttons
  507. #define BUTTON1_PIN 0
  508. #define BUTTON2_PIN 9
  509. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  510. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  511. #define BUTTON1_RELAY 1
  512. #define BUTTON2_RELAY 2
  513. // Relays
  514. #define RELAY1_PIN 12
  515. #define RELAY2_PIN 5
  516. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  517. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  518. // LEDs
  519. #define LED1_PIN 13
  520. #define LED1_PIN_INVERSE 0
  521. #define LED_WIFI 0
  522. // -----------------------------------------------------------------------------
  523. // Electrodragon boards
  524. // -----------------------------------------------------------------------------
  525. #elif defined(ELECTRODRAGON_WIFI_IOT)
  526. // Info
  527. #define MANUFACTURER "ELECTRODRAGON"
  528. #define DEVICE "WIFI_IOT"
  529. // Buttons
  530. #define BUTTON1_PIN 0
  531. #define BUTTON2_PIN 2
  532. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  533. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  534. #define BUTTON1_RELAY 1
  535. #define BUTTON2_RELAY 2
  536. // Relays
  537. #define RELAY1_PIN 12
  538. #define RELAY2_PIN 13
  539. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  540. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  541. // LEDs
  542. #define LED1_PIN 16
  543. #define LED1_PIN_INVERSE 0
  544. // -----------------------------------------------------------------------------
  545. // WorkChoice ecoPlug
  546. // -----------------------------------------------------------------------------
  547. #elif defined(WORKCHOICE_ECOPLUG)
  548. // Info
  549. #define MANUFACTURER "WORKCHOICE"
  550. #define DEVICE "ECOPLUG"
  551. // Buttons
  552. #define BUTTON1_PIN 13
  553. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  554. #define BUTTON1_RELAY 1
  555. // Relays
  556. #define RELAY1_PIN 15
  557. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  558. // LEDs
  559. #define LED1_PIN 2
  560. #define LED1_PIN_INVERSE 0
  561. // -----------------------------------------------------------------------------
  562. // AI Thinker
  563. // -----------------------------------------------------------------------------
  564. #elif defined(AITHINKER_AI_LIGHT)
  565. // Info
  566. #define MANUFACTURER "AITHINKER"
  567. #define DEVICE "AI_LIGHT"
  568. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  569. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  570. #define DUMMY_RELAY_COUNT 1
  571. // Light
  572. #define LIGHT_CHANNELS 4
  573. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  574. #define MY92XX_CHIPS 1
  575. #define MY92XX_DI_PIN 13
  576. #define MY92XX_DCKI_PIN 15
  577. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  578. #define MY92XX_MAPPING 0, 1, 2, 3
  579. // -----------------------------------------------------------------------------
  580. // LED Controller
  581. // -----------------------------------------------------------------------------
  582. #elif defined(MAGICHOME_LED_CONTROLLER)
  583. // Info
  584. #define MANUFACTURER "MAGICHOME"
  585. #define DEVICE "LED_CONTROLLER"
  586. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  587. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  588. #define DUMMY_RELAY_COUNT 1
  589. // LEDs
  590. #define LED1_PIN 2
  591. #define LED1_PIN_INVERSE 1
  592. // Light
  593. #define LIGHT_CHANNELS 4
  594. #define LIGHT_CH1_PIN 14 // RED
  595. #define LIGHT_CH2_PIN 5 // GREEN
  596. #define LIGHT_CH3_PIN 12 // BLUE
  597. #define LIGHT_CH4_PIN 13 // WHITE
  598. #define LIGHT_CH1_INVERSE 0
  599. #define LIGHT_CH2_INVERSE 0
  600. #define LIGHT_CH3_INVERSE 0
  601. #define LIGHT_CH4_INVERSE 0
  602. // IR
  603. #define IR_SUPPORT 1
  604. #define IR_PIN 4
  605. #define IR_BUTTON_SET 1
  606. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  607. // Info
  608. #define MANUFACTURER "MAGICHOME"
  609. #define DEVICE "LED_CONTROLLER_20"
  610. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  611. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  612. #define DUMMY_RELAY_COUNT 1
  613. // LEDs
  614. #define LED1_PIN 2
  615. #define LED1_PIN_INVERSE 1
  616. // Light
  617. #define LIGHT_CHANNELS 4
  618. #define LIGHT_CH1_PIN 5 // RED
  619. #define LIGHT_CH2_PIN 12 // GREEN
  620. #define LIGHT_CH3_PIN 13 // BLUE
  621. #define LIGHT_CH4_PIN 15 // WHITE
  622. #define LIGHT_CH1_INVERSE 0
  623. #define LIGHT_CH2_INVERSE 0
  624. #define LIGHT_CH3_INVERSE 0
  625. #define LIGHT_CH4_INVERSE 0
  626. // IR
  627. #define IR_SUPPORT 1
  628. #define IR_PIN 4
  629. #define IR_BUTTON_SET 1
  630. // -----------------------------------------------------------------------------
  631. // HUACANXING H801 & H802
  632. // -----------------------------------------------------------------------------
  633. #elif defined(HUACANXING_H801)
  634. // Info
  635. #define MANUFACTURER "HUACANXING"
  636. #define DEVICE "H801"
  637. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  638. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  639. #define DUMMY_RELAY_COUNT 1
  640. #define DEBUG_PORT Serial1
  641. // LEDs
  642. #define LED1_PIN 5
  643. #define LED1_PIN_INVERSE 1
  644. // Light
  645. #define LIGHT_CHANNELS 5
  646. #define LIGHT_CH1_PIN 15 // RED
  647. #define LIGHT_CH2_PIN 13 // GREEN
  648. #define LIGHT_CH3_PIN 12 // BLUE
  649. #define LIGHT_CH4_PIN 14 // WHITE1
  650. #define LIGHT_CH5_PIN 4 // WHITE2
  651. #define LIGHT_CH1_INVERSE 0
  652. #define LIGHT_CH2_INVERSE 0
  653. #define LIGHT_CH3_INVERSE 0
  654. #define LIGHT_CH4_INVERSE 0
  655. #define LIGHT_CH5_INVERSE 0
  656. #elif defined(HUACANXING_H802)
  657. // Info
  658. #define MANUFACTURER "HUACANXING"
  659. #define DEVICE "H802"
  660. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  661. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  662. #define DUMMY_RELAY_COUNT 1
  663. #define DEBUG_PORT Serial1
  664. // Light
  665. #define LIGHT_CHANNELS 4
  666. #define LIGHT_CH1_PIN 12 // RED
  667. #define LIGHT_CH2_PIN 14 // GREEN
  668. #define LIGHT_CH3_PIN 13 // BLUE
  669. #define LIGHT_CH4_PIN 15 // WHITE
  670. #define LIGHT_CH1_INVERSE 0
  671. #define LIGHT_CH2_INVERSE 0
  672. #define LIGHT_CH3_INVERSE 0
  673. #define LIGHT_CH4_INVERSE 0
  674. // -----------------------------------------------------------------------------
  675. // Jan Goedeke Wifi Relay
  676. // https://github.com/JanGoe/esp8266-wifi-relay
  677. // -----------------------------------------------------------------------------
  678. #elif defined(JANGOE_WIFI_RELAY_NC)
  679. // Info
  680. #define MANUFACTURER "JANGOE"
  681. #define DEVICE "WIFI_RELAY_NC"
  682. // Buttons
  683. #define BUTTON1_PIN 12
  684. #define BUTTON2_PIN 13
  685. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  686. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  687. #define BUTTON1_RELAY 1
  688. #define BUTTON2_RELAY 2
  689. // Relays
  690. #define RELAY1_PIN 2
  691. #define RELAY2_PIN 14
  692. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  693. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  694. #elif defined(JANGOE_WIFI_RELAY_NO)
  695. // Info
  696. #define MANUFACTURER "JANGOE"
  697. #define DEVICE "WIFI_RELAY_NO"
  698. // Buttons
  699. #define BUTTON1_PIN 12
  700. #define BUTTON2_PIN 13
  701. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  702. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  703. #define BUTTON1_RELAY 1
  704. #define BUTTON2_RELAY 2
  705. // Relays
  706. #define RELAY1_PIN 2
  707. #define RELAY2_PIN 14
  708. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  709. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  710. // -----------------------------------------------------------------------------
  711. // Jorge García Wifi+Relays Board Kit
  712. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  713. // https://github.com/jorgegarciadev/wifikit
  714. // -----------------------------------------------------------------------------
  715. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  716. // Info
  717. #define MANUFACTURER "JORGEGARCIA"
  718. #define DEVICE "WIFI_RELAYS"
  719. // Relays
  720. #define RELAY1_PIN 0
  721. #define RELAY2_PIN 2
  722. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  723. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  724. // -----------------------------------------------------------------------------
  725. // WiFi MQTT Relay / Thermostat
  726. // -----------------------------------------------------------------------------
  727. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  728. // Info
  729. #define MANUFACTURER "OPENENERGYMONITOR"
  730. #define DEVICE "MQTT_RELAY"
  731. // Buttons
  732. #define BUTTON1_PIN 0
  733. #define BUTTON1_RELAY 1
  734. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  735. // Relays
  736. #define RELAY1_PIN 12
  737. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  738. // LEDs
  739. #define LED1_PIN 16
  740. #define LED1_PIN_INVERSE 0
  741. // -----------------------------------------------------------------------------
  742. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  743. // 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
  744. // 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
  745. // -----------------------------------------------------------------------------
  746. #elif defined(WION_50055)
  747. // Currently untested, does not support energy monitoring
  748. // Info
  749. #define MANUFACTURER "WION"
  750. #define DEVICE "50055"
  751. // Buttons
  752. #define BUTTON1_PIN 13
  753. #define BUTTON1_RELAY 1
  754. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  755. // Relays
  756. #define RELAY1_PIN 15
  757. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  758. // LEDs
  759. #define LED1_PIN 2
  760. #define LED1_PIN_INVERSE 0
  761. // -----------------------------------------------------------------------------
  762. // EX-Store Wifi Relay v3.1
  763. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  764. // -----------------------------------------------------------------------------
  765. #elif defined(EXS_WIFI_RELAY_V31)
  766. // Untested
  767. // Info
  768. #define MANUFACTURER "EXS"
  769. #define DEVICE "WIFI_RELAY_V31"
  770. // Buttons
  771. #define BUTTON1_PIN 0
  772. #define BUTTON1_RELAY 1
  773. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  774. // Relays
  775. #define RELAY1_PIN 13
  776. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  777. #define RELAY1_RESET_PIN 12
  778. // -----------------------------------------------------------------------------
  779. // V9261F
  780. // -----------------------------------------------------------------------------
  781. #elif defined(GENERIC_V9261F)
  782. // Info
  783. #define MANUFACTURER "GENERIC"
  784. #define DEVICE "V9261F"
  785. #define ALEXA_SUPPORT 0
  786. // V9261F
  787. #define POWER_PROVIDER POWER_PROVIDER_V9261F
  788. #define V9261F_PIN 2
  789. #define V9261F_PIN_INVERSE 1
  790. // -----------------------------------------------------------------------------
  791. // ECH1560
  792. // -----------------------------------------------------------------------------
  793. #elif defined(GENERIC_ECH1560)
  794. // Info
  795. #define MANUFACTURER "GENERIC"
  796. #define DEVICE "ECH1560"
  797. #define ALEXA_SUPPORT 0
  798. // ECH1560
  799. #define POWER_PROVIDER POWER_PROVIDER_ECH1560
  800. #define ECH1560_CLK_PIN 4
  801. #define ECH1560_MISO_PIN 5
  802. #define ECH1560_INVERTED 0
  803. // -----------------------------------------------------------------------------
  804. // ESPLive
  805. // https://github.com/ManCaveMade/ESP-Live
  806. // -----------------------------------------------------------------------------
  807. #elif defined(MANCAVEMADE_ESPLIVE)
  808. // Info
  809. #define MANUFACTURER "MANCAVEMADE"
  810. #define DEVICE "ESPLIVE"
  811. // Buttons
  812. #define BUTTON1_PIN 4
  813. #define BUTTON2_PIN 5
  814. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  815. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  816. #define BUTTON1_RELAY 1
  817. #define BUTTON2_RELAY 2
  818. // Relays
  819. #define RELAY1_PIN 12
  820. #define RELAY2_PIN 13
  821. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  822. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  823. // DB18B20
  824. #define DS18B20_SUPPORT 1
  825. #define DS18B20_PIN 2
  826. #define DS18B20_UPDATE_INTERVAL 5000
  827. #define TEMPERATURE_MIN_CHANGE 1.0
  828. // -----------------------------------------------------------------------------
  829. // QuinLED
  830. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  831. // -----------------------------------------------------------------------------
  832. #elif defined(INTERMITTECH_QUINLED)
  833. // Info
  834. #define MANUFACTURER "INTERMITTECH"
  835. #define DEVICE "QUINLED"
  836. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  837. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  838. #define DUMMY_RELAY_COUNT 1
  839. // LEDs
  840. #define LED1_PIN 5
  841. #define LED1_PIN_INVERSE 1
  842. // Light
  843. #define LIGHT_CHANNELS 2
  844. #define LIGHT_CH1_PIN 0
  845. #define LIGHT_CH2_PIN 2
  846. #define LIGHT_CH1_INVERSE 0
  847. #define LIGHT_CH2_INVERSE 0
  848. // -----------------------------------------------------------------------------
  849. // Arilux AL-LC06
  850. // -----------------------------------------------------------------------------
  851. #elif defined(ARILUX_AL_LC06)
  852. // Info
  853. #define MANUFACTURER "ARILUX"
  854. #define DEVICE "AL_LC06"
  855. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  856. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  857. #define DUMMY_RELAY_COUNT 1
  858. // Light
  859. #define LIGHT_CHANNELS 5
  860. #define LIGHT_CH1_PIN 14 // RED
  861. #define LIGHT_CH2_PIN 12 // GREEN
  862. #define LIGHT_CH3_PIN 13 // BLUE
  863. #define LIGHT_CH4_PIN 15 // WHITE1
  864. #define LIGHT_CH5_PIN 5 // WHITE2
  865. #define LIGHT_CH1_INVERSE 0
  866. #define LIGHT_CH2_INVERSE 0
  867. #define LIGHT_CH3_INVERSE 0
  868. #define LIGHT_CH4_INVERSE 0
  869. #define LIGHT_CH5_INVERSE 0
  870. #elif defined(ARILUX_E27)
  871. // Info
  872. #define MANUFACTURER "ARILUX"
  873. #define DEVICE "E27"
  874. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  875. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  876. #define DUMMY_RELAY_COUNT 1
  877. // Light
  878. #define LIGHT_CHANNELS 4
  879. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  880. #define MY92XX_CHIPS 1
  881. #define MY92XX_DI_PIN 13
  882. #define MY92XX_DCKI_PIN 15
  883. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  884. #define MY92XX_MAPPING 0, 1, 2, 3
  885. // -----------------------------------------------------------------------------
  886. // XENON SM-PW701U
  887. // -----------------------------------------------------------------------------
  888. #elif defined(XENON_SM_PW702U)
  889. // Info
  890. #define MANUFACTURER "XENON"
  891. #define DEVICE "SM_PW702U"
  892. // Buttons
  893. #define BUTTON1_PIN 13
  894. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  895. #define BUTTON1_RELAY 1
  896. // Relays
  897. #define RELAY1_PIN 12
  898. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  899. // LEDs
  900. #define LED1_PIN 4
  901. #define LED1_PIN_INVERSE 1
  902. // -----------------------------------------------------------------------------
  903. // AUTHOMETION LYT8266
  904. // https://authometion.com/shop/en/home/13-lyt8266.html
  905. // -----------------------------------------------------------------------------
  906. #elif defined(AUTHOMETION_LYT8266)
  907. // Info
  908. #define MANUFACTURER "AUTHOMETION"
  909. #define DEVICE "LYT8266"
  910. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  911. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  912. #define DUMMY_RELAY_COUNT 1
  913. // Light
  914. #define LIGHT_CHANNELS 4
  915. #define LIGHT_CH1_PIN 13 // RED
  916. #define LIGHT_CH2_PIN 12 // GREEN
  917. #define LIGHT_CH3_PIN 14 // BLUE
  918. #define LIGHT_CH4_PIN 2 // WHITE
  919. #define LIGHT_CH1_INVERSE 0
  920. #define LIGHT_CH2_INVERSE 0
  921. #define LIGHT_CH3_INVERSE 0
  922. #define LIGHT_CH4_INVERSE 0
  923. #define LIGHT_ENABLE_PIN 15
  924. // -----------------------------------------------------------------------------
  925. // Unknown hardware
  926. // -----------------------------------------------------------------------------
  927. #else
  928. #error "UNSUPPORTED HARDWARE!"
  929. #endif
  930. // -----------------------------------------------------------------------------
  931. // Default values
  932. // -----------------------------------------------------------------------------
  933. #ifndef BUTTON1_PRESS
  934. #define BUTTON1_PRESS BUTTON_MODE_NONE
  935. #endif
  936. #ifndef BUTTON2_PRESS
  937. #define BUTTON2_PRESS BUTTON_MODE_NONE
  938. #endif
  939. #ifndef BUTTON3_PRESS
  940. #define BUTTON3_PRESS BUTTON_MODE_NONE
  941. #endif
  942. #ifndef BUTTON4_PRESS
  943. #define BUTTON4_PRESS BUTTON_MODE_NONE
  944. #endif
  945. #ifndef BUTTON1_CLICK
  946. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  947. #endif
  948. #ifndef BUTTON2_CLICK
  949. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  950. #endif
  951. #ifndef BUTTON3_CLICK
  952. #define BUTTON3_CLICK BUTTON_MODE_TOGGLE
  953. #endif
  954. #ifndef BUTTON4_CLICK
  955. #define BUTTON4_CLICK BUTTON_MODE_TOGGLE
  956. #endif
  957. #ifndef BUTTON1_DBLCLICK
  958. #define BUTTON1_DBLCLICK BUTTON_MODE_AP
  959. #endif
  960. #ifndef BUTTON2_DBLCLICK
  961. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  962. #endif
  963. #ifndef BUTTON3_DBLCLICK
  964. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  965. #endif
  966. #ifndef BUTTON4_DBLCLICK
  967. #define BUTTON4_DBLCLICK BUTTON_MODE_NONE
  968. #endif
  969. #ifndef BUTTON1_LNGCLICK
  970. #define BUTTON1_LNGCLICK BUTTON_MODE_RESET
  971. #endif
  972. #ifndef BUTTON2_LNGCLICK
  973. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  974. #endif
  975. #ifndef BUTTON3_LNGCLICK
  976. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  977. #endif
  978. #ifndef BUTTON4_LNGCLICK
  979. #define BUTTON4_LNGCLICK BUTTON_MODE_NONE
  980. #endif
  981. #ifndef BUTTON1_LNGLNGCLICK
  982. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_FACTORY
  983. #endif
  984. #ifndef BUTTON2_LNGLNGCLICK
  985. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  986. #endif
  987. #ifndef BUTTON3_LNGLNGCLICK
  988. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_NONE
  989. #endif
  990. #ifndef BUTTON4_LNGLNGCLICK
  991. #define BUTTON4_LNGLNGCLICK BUTTON_MODE_NONE
  992. #endif
  993. #ifndef BUTTON1_RELAY
  994. #define BUTTON1_RELAY 0
  995. #endif
  996. #ifndef BUTTON2_RELAY
  997. #define BUTTON2_RELAY 0
  998. #endif
  999. #ifndef BUTTON3_RELAY
  1000. #define BUTTON3_RELAY 0
  1001. #endif
  1002. #ifndef BUTTON4_RELAY
  1003. #define BUTTON4_RELAY 0
  1004. #endif
  1005. #ifndef RELAY1_RESET_PIN
  1006. #define RELAY1_RESET_PIN 0
  1007. #endif
  1008. #ifndef RELAY2_RESET_PIN
  1009. #define RELAY2_RESET_PIN 0
  1010. #endif
  1011. #ifndef RELAY3_RESET_PIN
  1012. #define RELAY3_RESET_PIN 0
  1013. #endif
  1014. #ifndef RELAY4_RESET_PIN
  1015. #define RELAY4_RESET_PIN 0
  1016. #endif
  1017. #ifndef RELAY1_DELAY_ON
  1018. #define RELAY1_DELAY_ON 0
  1019. #endif
  1020. #ifndef RELAY2_DELAY_ON
  1021. #define RELAY2_DELAY_ON 0
  1022. #endif
  1023. #ifndef RELAY3_DELAY_ON
  1024. #define RELAY3_DELAY_ON 0
  1025. #endif
  1026. #ifndef RELAY4_DELAY_ON
  1027. #define RELAY4_DELAY_ON 0
  1028. #endif
  1029. #ifndef RELAY1_DELAY_OFF
  1030. #define RELAY1_DELAY_OFF 0
  1031. #endif
  1032. #ifndef RELAY2_DELAY_OFF
  1033. #define RELAY2_DELAY_OFF 0
  1034. #endif
  1035. #ifndef RELAY3_DELAY_OFF
  1036. #define RELAY3_DELAY_OFF 0
  1037. #endif
  1038. #ifndef RELAY4_DELAY_OFF
  1039. #define RELAY4_DELAY_OFF 0
  1040. #endif
  1041. #ifndef LED1_MODE
  1042. #define LED1_MODE LED_MODE_WIFI
  1043. #endif
  1044. #ifndef LED2_MODE
  1045. #define LED2_MODE LED_MODE_MQTT
  1046. #endif
  1047. #ifndef LED3_MODE
  1048. #define LED3_MODE LED_MODE_MQTT
  1049. #endif
  1050. #ifndef LED4_MODE
  1051. #define LED4_MODE LED_MODE_MQTT
  1052. #endif
  1053. #ifndef LED1_RELAY
  1054. #define LED1_RELAY 1
  1055. #endif
  1056. #ifndef LED2_RELAY
  1057. #define LED2_RELAY 2
  1058. #endif
  1059. #ifndef LED3_RELAY
  1060. #define LED3_RELAY 3
  1061. #endif
  1062. #ifndef LED4_RELAY
  1063. #define LED4_RELAY 4
  1064. #endif
  1065. // Needed for ESP8285 boards under Windows using PlatformIO (?)
  1066. #ifndef BUTTON_PUSHBUTTON
  1067. #define BUTTON_PUSHBUTTON 0
  1068. #define BUTTON_SWITCH 1
  1069. #define BUTTON_DEFAULT_HIGH 2
  1070. #define BUTTON_SET_PULLUP 4
  1071. #endif
  1072. // Serial baudrate
  1073. #ifndef SERIAL_BAUDRATE
  1074. #define SERIAL_BAUDRATE 115200
  1075. #endif
  1076. // Relay providers
  1077. #ifndef RELAY_PROVIDER
  1078. #define RELAY_PROVIDER RELAY_PROVIDER_RELAY
  1079. #endif
  1080. // Light provider
  1081. #ifndef LIGHT_PROVIDER
  1082. #define LIGHT_PROVIDER LIGHT_PROVIDER_NONE
  1083. #endif