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