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.

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