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.

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