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.

1151 lines
33 KiB

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. // RELAY#_LED: LED number that will be bind to the n-th relay (1-based)
  17. // LED#_PIN: GPIO for the n-th LED (1-based, up to 4 LEDs)
  18. // LED#_PIN_INVERSE: LED has inversed logic (lit when pulled down)
  19. //
  20. // Besides, other hardware specific information should be stated here
  21. // -----------------------------------------------------------------------------
  22. // Development boards
  23. // -----------------------------------------------------------------------------
  24. #if defined(NODEMCU_LOLIN)
  25. // Info
  26. #define MANUFACTURER "NODEMCU"
  27. #define DEVICE "LOLIN"
  28. // Buttons
  29. #define BUTTON1_PIN 0
  30. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  31. #define BUTTON1_RELAY 1
  32. // Relays
  33. #define RELAY1_PIN 12
  34. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  35. // LEDs
  36. #define LED1_PIN 2
  37. #define LED1_PIN_INVERSE 1
  38. #elif defined(WEMOS_D1_MINI_RELAYSHIELD)
  39. // Info
  40. #define MANUFACTURER "WEMOS"
  41. #define DEVICE "D1_MINI_RELAYSHIELD"
  42. // Buttons
  43. // No buttons on the D1 MINI
  44. // Relays
  45. #define RELAY1_PIN 5
  46. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  47. // LEDs
  48. #define LED1_PIN 2
  49. #define LED1_PIN_INVERSE 1
  50. // -----------------------------------------------------------------------------
  51. // ESPurna
  52. // -----------------------------------------------------------------------------
  53. #elif defined(TINKERMAN_ESPURNA_H)
  54. // Info
  55. #define MANUFACTURER "TINKERMAN"
  56. #define DEVICE "ESPURNA_H"
  57. // Buttons
  58. #define BUTTON1_PIN 4
  59. #define BUTTON1_RELAY 1
  60. // Normal pushbutton
  61. //#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  62. // Touch button
  63. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  64. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  65. #define BUTTON1_CLICK BUTTON_MODE_NONE
  66. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  67. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  68. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  69. // Relays
  70. #define RELAY1_PIN 12
  71. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  72. // LEDs
  73. #define LED1_PIN 5
  74. #define LED1_PIN_INVERSE 0
  75. // HLW8012
  76. #define POWER_PROVIDER POWER_PROVIDER_HLW8012
  77. #define HLW8012_SEL_PIN 2
  78. #define HLW8012_CF1_PIN 13
  79. #define HLW8012_CF_PIN 14
  80. // -----------------------------------------------------------------------------
  81. // Itead Studio boards
  82. // -----------------------------------------------------------------------------
  83. #elif defined(ITEAD_SONOFF_BASIC)
  84. // Info
  85. #define MANUFACTURER "ITEAD"
  86. #define DEVICE "SONOFF_BASIC"
  87. // Buttons
  88. #define BUTTON1_PIN 0
  89. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  90. #define BUTTON1_RELAY 1
  91. // Relays
  92. #define RELAY1_PIN 12
  93. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  94. // LEDs
  95. #define LED1_PIN 13
  96. #define LED1_PIN_INVERSE 1
  97. #elif defined(ITEAD_SONOFF_RF)
  98. // Info
  99. #define MANUFACTURER "ITEAD"
  100. #define DEVICE "SONOFF_RF"
  101. // Buttons
  102. #define BUTTON1_PIN 0
  103. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  104. #define BUTTON1_RELAY 1
  105. // Relays
  106. #define RELAY1_PIN 12
  107. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  108. // LEDs
  109. #define LED1_PIN 13
  110. #define LED1_PIN_INVERSE 1
  111. #elif defined(ITEAD_SONOFF_TH)
  112. // Info
  113. #define MANUFACTURER "ITEAD"
  114. #define DEVICE "SONOFF_TH"
  115. // Buttons
  116. #define BUTTON1_PIN 0
  117. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  118. #define BUTTON1_RELAY 1
  119. // Relays
  120. #define RELAY1_PIN 12
  121. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  122. // LEDs
  123. #define LED1_PIN 13
  124. #define LED1_PIN_INVERSE 1
  125. #elif defined(ITEAD_SONOFF_SV)
  126. // Info
  127. #define MANUFACTURER "ITEAD"
  128. #define DEVICE "SONOFF_SV"
  129. // Buttons
  130. #define BUTTON1_PIN 0
  131. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  132. #define BUTTON1_RELAY 1
  133. // Relays
  134. #define RELAY1_PIN 12
  135. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  136. // LEDs
  137. #define LED1_PIN 13
  138. #define LED1_PIN_INVERSE 1
  139. #elif defined(ITEAD_SLAMPHER)
  140. // Info
  141. #define MANUFACTURER "ITEAD"
  142. #define DEVICE "SLAMPHER"
  143. // Buttons
  144. #define BUTTON1_PIN 0
  145. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  146. #define BUTTON1_RELAY 1
  147. // Relays
  148. #define RELAY1_PIN 12
  149. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  150. // LEDs
  151. #define LED1_PIN 13
  152. #define LED1_PIN_INVERSE 1
  153. #elif defined(ITEAD_S20)
  154. // Info
  155. #define MANUFACTURER "ITEAD"
  156. #define DEVICE "S20"
  157. // Buttons
  158. #define BUTTON1_PIN 0
  159. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  160. #define BUTTON1_RELAY 1
  161. // Relays
  162. #define RELAY1_PIN 12
  163. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  164. // LEDs
  165. #define LED1_PIN 13
  166. #define LED1_PIN_INVERSE 1
  167. #elif defined(ITEAD_SONOFF_TOUCH)
  168. // Info
  169. #define MANUFACTURER "ITEAD"
  170. #define DEVICE "SONOFF_TOUCH"
  171. // Buttons
  172. #define BUTTON1_PIN 0
  173. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  174. #define BUTTON1_RELAY 1
  175. // Relays
  176. #define RELAY1_PIN 12
  177. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  178. // LEDs
  179. #define LED1_PIN 13
  180. #define LED1_PIN_INVERSE 1
  181. #elif defined(ITEAD_SONOFF_POW)
  182. // Info
  183. #define MANUFACTURER "ITEAD"
  184. #define DEVICE "SONOFF_POW"
  185. // Buttons
  186. #define BUTTON1_PIN 0
  187. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  188. #define BUTTON1_RELAY 1
  189. // Relays
  190. #define RELAY1_PIN 12
  191. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  192. // LEDs
  193. #define LED1_PIN 15
  194. #define LED1_PIN_INVERSE 0
  195. // HLW8012
  196. #define POWER_PROVIDER POWER_PROVIDER_HLW8012
  197. #define HLW8012_SEL_PIN 5
  198. #define HLW8012_CF1_PIN 13
  199. #define HLW8012_CF_PIN 14
  200. #elif defined(ITEAD_SONOFF_DUAL)
  201. // Info
  202. #define MANUFACTURER "ITEAD"
  203. #define DEVICE "SONOFF_DUAL"
  204. #define SERIAL_BAUDRATE 19230
  205. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  206. #define DUMMY_RELAY_COUNT 2
  207. #define DEBUG_SERIAL_SUPPORT 0
  208. #define TERMINAL_SUPPORT 0
  209. // Buttons
  210. #define BUTTON3_RELAY 1
  211. // LEDs
  212. #define LED1_PIN 13
  213. #define LED1_PIN_INVERSE 1
  214. #elif defined(ITEAD_SONOFF_4CH)
  215. // Info
  216. #define MANUFACTURER "ITEAD"
  217. #define DEVICE "SONOFF_4CH"
  218. // Buttons
  219. #define BUTTON1_PIN 0
  220. #define BUTTON2_PIN 9
  221. #define BUTTON3_PIN 10
  222. #define BUTTON4_PIN 14
  223. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  224. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  225. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  226. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  227. #define BUTTON1_RELAY 1
  228. #define BUTTON2_RELAY 2
  229. #define BUTTON3_RELAY 3
  230. #define BUTTON4_RELAY 4
  231. // Relays
  232. #define RELAY1_PIN 12
  233. #define RELAY2_PIN 5
  234. #define RELAY3_PIN 4
  235. #define RELAY4_PIN 15
  236. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  237. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  238. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  239. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  240. // LEDs
  241. #define LED1_PIN 13
  242. #define LED1_PIN_INVERSE 1
  243. #elif defined(ITEAD_SONOFF_4CH_PRO)
  244. // Info
  245. #define MANUFACTURER "ITEAD"
  246. #define DEVICE "SONOFF_4CH_PRO"
  247. // Buttons
  248. #define BUTTON1_PIN 0
  249. #define BUTTON2_PIN 9
  250. #define BUTTON3_PIN 10
  251. #define BUTTON4_PIN 14
  252. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  253. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  254. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  255. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  256. #define BUTTON1_RELAY 1
  257. #define BUTTON2_RELAY 2
  258. #define BUTTON3_RELAY 3
  259. #define BUTTON4_RELAY 4
  260. // Relays
  261. #define RELAY1_PIN 12
  262. #define RELAY2_PIN 5
  263. #define RELAY3_PIN 4
  264. #define RELAY4_PIN 15
  265. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  266. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  267. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  268. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  269. // LEDs
  270. #define LED1_PIN 13
  271. #define LED1_PIN_INVERSE 1
  272. #elif defined(ITEAD_1CH_INCHING)
  273. // The inching functionality is managed by a misterious IC in the board.
  274. // You cannot control the inching button and functionality from the ESP8266
  275. // Besides, enabling the inching functionality using the hardware button
  276. // will result in the relay switching on and off continuously.
  277. // Fortunately the unkown IC keeps memory of the hardware inching status
  278. // so you can just disable it and forget. The inching LED must be lit.
  279. // You can still use the pulse options from the web interface
  280. // without problem.
  281. // Info
  282. #define MANUFACTURER "ITEAD"
  283. #define DEVICE "1CH_INCHING"
  284. // Buttons
  285. #define BUTTON1_PIN 0
  286. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  287. #define BUTTON1_RELAY 1
  288. // Relays
  289. #define RELAY1_PIN 12
  290. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  291. // LEDs
  292. #define LED1_PIN 13
  293. #define LED1_PIN_INVERSE 1
  294. #elif defined(ITEAD_MOTOR)
  295. // Info
  296. #define MANUFACTURER "ITEAD"
  297. #define DEVICE "MOTOR"
  298. // Buttons
  299. #define BUTTON1_PIN 0
  300. #define BUTTON1_RELAY 1
  301. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  302. // Relays
  303. #define RELAY1_PIN 12
  304. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  305. // LEDs
  306. #define LED1_PIN 13
  307. #define LED1_PIN_INVERSE 1
  308. #elif defined(ITEAD_BNSZ01)
  309. // Info
  310. #define MANUFACTURER "ITEAD"
  311. #define DEVICE "BNSZ01"
  312. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  313. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  314. #define DUMMY_RELAY_COUNT 1
  315. // LEDs
  316. #define LED1_PIN 13
  317. #define LED1_PIN_INVERSE 1
  318. // Channels
  319. #define LIGHT_CH1_PIN 12
  320. #define LIGHT_CH1_INVERSE 0
  321. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  322. // Info
  323. #define MANUFACTURER "ITEAD"
  324. #define DEVICE "SONOFF_RFBRIDGE"
  325. #define SERIAL_BAUDRATE 19200
  326. #define RELAY_PROVIDER RELAY_PROVIDER_RFBRIDGE
  327. #ifndef DUMMY_RELAY_COUNT
  328. #define DUMMY_RELAY_COUNT 6
  329. #endif
  330. #define TERMINAL_SUPPORT 0
  331. #define TRACK_RELAY_STATUS 0
  332. // Buttons
  333. #define BUTTON1_PIN 0
  334. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  335. // LEDs
  336. #define LED1_PIN 13
  337. #define LED1_PIN_INVERSE 1
  338. #elif defined(ITEAD_SONOFF_B1)
  339. // Info
  340. #define MANUFACTURER "ITEAD"
  341. #define DEVICE "SONOFF_B1"
  342. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  343. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192
  344. #define DUMMY_RELAY_COUNT 1
  345. #define MY9291_DI_PIN 12
  346. #define MY9291_DCKI_PIN 14
  347. #define MY9291_COMMAND MY9291_COMMAND_DEFAULT
  348. #define MY9291_CHANNELS 5
  349. #elif defined(ITEAD_SONOFF_LED)
  350. // Info
  351. #define MANUFACTURER "ITEAD"
  352. #define DEVICE "SONOFF_LED"
  353. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  354. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  355. #define DUMMY_RELAY_COUNT 1
  356. // LEDs
  357. #define LED1_PIN 13
  358. #define LED1_PIN_INVERSE 1
  359. // Channels
  360. #define LIGHT_CH1_PIN 12 // Cold white
  361. #define LIGHT_CH2_PIN 14 // Warm white
  362. #define LIGHT_CH1_INVERSE 0
  363. #define LIGHT_CH2_INVERSE 0
  364. #elif defined(ITEAD_SONOFF_T1_1CH)
  365. // Info
  366. #define MANUFACTURER "ITEAD"
  367. #define DEVICE "SONOFF_T1_1CH"
  368. // Buttons
  369. #define BUTTON1_PIN 9
  370. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  371. #define BUTTON1_RELAY 1
  372. // Relays
  373. #define RELAY1_PIN 5
  374. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  375. // LEDs
  376. #define LED1_PIN 13
  377. #define LED1_PIN_INVERSE 1
  378. #elif defined(ITEAD_SONOFF_T1_2CH)
  379. // Info
  380. #define MANUFACTURER "ITEAD"
  381. #define DEVICE "SONOFF_T1_2CH"
  382. // Buttons
  383. #define BUTTON1_PIN 0
  384. #define BUTTON2_PIN 10
  385. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  386. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  387. #define BUTTON1_RELAY 1
  388. #define BUTTON2_RELAY 2
  389. // Relays
  390. #define RELAY1_PIN 12
  391. #define RELAY2_PIN 4
  392. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  393. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  394. // LEDs
  395. #define LED1_PIN 13
  396. #define LED1_PIN_INVERSE 1
  397. #elif defined(ITEAD_SONOFF_T1_3CH)
  398. // Info
  399. #define MANUFACTURER "ITEAD"
  400. #define DEVICE "SONOFF_T1_3CH"
  401. // Buttons
  402. #define BUTTON1_PIN 0
  403. #define BUTTON2_PIN 9
  404. #define BUTTON3_PIN 10
  405. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  406. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  407. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  408. #define BUTTON1_RELAY 1
  409. #define BUTTON2_RELAY 2
  410. #define BUTTON3_RELAY 3
  411. // Relays
  412. #define RELAY1_PIN 12
  413. #define RELAY2_PIN 5
  414. #define RELAY3_PIN 4
  415. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  416. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  417. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  418. // LEDs
  419. #define LED1_PIN 13
  420. #define LED1_PIN_INVERSE 1
  421. // -----------------------------------------------------------------------------
  422. // Electrodragon boards
  423. // -----------------------------------------------------------------------------
  424. #elif defined(ELECTRODRAGON_WIFI_IOT)
  425. // Info
  426. #define MANUFACTURER "ELECTRODRAGON"
  427. #define DEVICE "WIFI_IOT"
  428. // Buttons
  429. #define BUTTON1_PIN 0
  430. #define BUTTON2_PIN 2
  431. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  432. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  433. #define BUTTON1_RELAY 1
  434. #define BUTTON2_RELAY 2
  435. // Relays
  436. #define RELAY1_PIN 12
  437. #define RELAY2_PIN 13
  438. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  439. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  440. // LEDs
  441. #define LED1_PIN 16
  442. #define LED1_PIN_INVERSE 0
  443. // -----------------------------------------------------------------------------
  444. // WorkChoice ecoPlug
  445. // -----------------------------------------------------------------------------
  446. #elif defined(WORKCHOICE_ECOPLUG)
  447. // Info
  448. #define MANUFACTURER "WORKCHOICE"
  449. #define DEVICE "ECOPLUG"
  450. // Buttons
  451. #define BUTTON1_PIN 13
  452. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  453. #define BUTTON1_RELAY 1
  454. // Relays
  455. #define RELAY1_PIN 15
  456. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  457. // LEDs
  458. #define LED1_PIN 2
  459. #define LED1_PIN_INVERSE 0
  460. // -----------------------------------------------------------------------------
  461. // AI Thinker
  462. // -----------------------------------------------------------------------------
  463. #elif defined(AITHINKER_AI_LIGHT)
  464. // Info
  465. #define MANUFACTURER "AITHINKER"
  466. #define DEVICE "AI_LIGHT"
  467. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  468. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192
  469. #define DUMMY_RELAY_COUNT 1
  470. #define MY9291_DI_PIN 13
  471. #define MY9291_DCKI_PIN 15
  472. #define MY9291_COMMAND MY9291_COMMAND_DEFAULT
  473. #define MY9291_CHANNELS 4
  474. // -----------------------------------------------------------------------------
  475. // LED Controller
  476. // -----------------------------------------------------------------------------
  477. #elif defined(MAGICHOME_LED_CONTROLLER)
  478. // Info
  479. #define MANUFACTURER "MAGICHOME"
  480. #define DEVICE "LED_CONTROLLER"
  481. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  482. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  483. #define DUMMY_RELAY_COUNT 1
  484. // LEDs
  485. #define LED1_PIN 2
  486. #define LED1_PIN_INVERSE 1
  487. // Channels
  488. #define LIGHT_CH1_PIN 14 // RED
  489. #define LIGHT_CH2_PIN 5 // GREEN
  490. #define LIGHT_CH3_PIN 12 // BLUE
  491. #define LIGHT_CH4_PIN 13 // WHITE
  492. #define LIGHT_CH1_INVERSE 0
  493. #define LIGHT_CH2_INVERSE 0
  494. #define LIGHT_CH3_INVERSE 0
  495. #define LIGHT_CH4_INVERSE 0
  496. // -----------------------------------------------------------------------------
  497. // LED Controller With IR
  498. // -----------------------------------------------------------------------------
  499. #elif defined(MAGICHOME_LED_CONTROLLER_IR)
  500. // Info
  501. #define MANUFACTURER "MAGICHOME"
  502. #define DEVICE "LED_CONTROLLER_IR"
  503. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  504. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  505. #define DUMMY_RELAY_COUNT 1
  506. // LEDs
  507. #define LED1_PIN 2
  508. #define LED1_PIN_INVERSE 1
  509. // Channels (for board version 2.0)
  510. #define LIGHT_CH1_PIN 5 // RED
  511. #define LIGHT_CH2_PIN 12 // GREEN
  512. #define LIGHT_CH3_PIN 13 // BLUE
  513. //#define LIGHT_CH4_PIN 14 // WHITE ?
  514. #define LIGHT_IR_PIN 4 // IR LED
  515. #define LIGHT_CH1_INVERSE 0
  516. #define LIGHT_CH2_INVERSE 0
  517. #define LIGHT_CH3_INVERSE 0
  518. #define LIGHT_CH4_INVERSE 0
  519. #define LIGHT_PROVIDER_EXPERIMENTAL_RGB_ONLY_HSV_IR 1
  520. // 24 Buttons Set of the IR Remote
  521. #ifndef IR_BUTTONS_SET
  522. #define IR_BUTTONS_SET 1
  523. #endif
  524. //Remote Buttons SET 1 (for the original Remote shipped with the controller)
  525. #if IR_BUTTONS_SET == 1
  526. #define IR_BUTTON_0 0xFF906F // Brightness +
  527. #define IR_BUTTON_1 0xFFB847 // Brightness -
  528. #define IR_BUTTON_2 0xFFF807 // OFF
  529. #define IR_BUTTON_3 0xFFB04F // ON
  530. #define IR_BUTTON_4 0xFF9867 // RED
  531. #define IR_BUTTON_5 0xFFD827 // GREEN
  532. #define IR_BUTTON_6 0xFF8877 // BLUE
  533. #define IR_BUTTON_7 0xFFA857 // WHITE
  534. #define IR_BUTTON_8 0xFFE817 // "Red" 1
  535. #define IR_BUTTON_9 0xFF48B7 // "Green" 1
  536. #define IR_BUTTON_10 0xFF6897 // "Blue" 1
  537. #define IR_BUTTON_11 0xFFB24D // FLASH Mode
  538. #define IR_BUTTON_12 0xFF02FD // "Red" 2
  539. #define IR_BUTTON_13 0xFF32CD // "Green" 2
  540. #define IR_BUTTON_14 0xFF20DF // "Blue" 2
  541. #define IR_BUTTON_15 0xFF00FF // STROBE Mode
  542. #define IR_BUTTON_16 0xFF50AF // "Red" 3
  543. #define IR_BUTTON_17 0xFF7887 // "Green" 3
  544. #define IR_BUTTON_18 0xFF708F // "Blue" 3
  545. #define IR_BUTTON_19 0xFF58A7 // FADE Mode
  546. #define IR_BUTTON_20 0xFF38C7 // "Red" 4
  547. #define IR_BUTTON_21 0xFF28D7 // "Green" 4
  548. #define IR_BUTTON_22 0xFFF00F // "Blue" 4
  549. #define IR_BUTTON_23 0xFF30CF // SMOOTH Mode
  550. #endif
  551. //Remote Buttons SET 2 (another identical IR Remote shipped with another controller)
  552. #if IR_BUTTONS_SET == 2
  553. #define IR_BUTTON_0 0xFF00FF // Brightness +
  554. #define IR_BUTTON_1 0xFF807F // Brightness -
  555. #define IR_BUTTON_2 0xFF40BF // OFF
  556. #define IR_BUTTON_3 0xFFC03F // ON
  557. #define IR_BUTTON_4 0xFF20DF // RED
  558. #define IR_BUTTON_5 0xFFA05F // GREEN
  559. #define IR_BUTTON_6 0xFF609F // BLUE
  560. #define IR_BUTTON_7 0xFFE01F // WHITE
  561. #define IR_BUTTON_8 0xFF10EF // "Red" 1
  562. #define IR_BUTTON_9 0xFF906F // "Green" 1
  563. #define IR_BUTTON_10 0xFF50AF // "Blue" 1
  564. #define IR_BUTTON_11 0xFFD02F // FLASH Mode
  565. #define IR_BUTTON_12 0xFF30CF // "Red" 2
  566. #define IR_BUTTON_13 0xFFB04F // "Green" 2
  567. #define IR_BUTTON_14 0xFF708F // "Blue" 2
  568. #define IR_BUTTON_15 0xFFF00F // STROBE Mode
  569. #define IR_BUTTON_16 0xFF08F7 // "Red" 3
  570. #define IR_BUTTON_17 0xFF8877 // "Green" 3
  571. #define IR_BUTTON_18 0xFF48B7 // "Blue" 3
  572. #define IR_BUTTON_19 0xFFC837 // FADE Mode
  573. #define IR_BUTTON_20 0xFF28D7 // "Red" 4
  574. #define IR_BUTTON_21 0xFFA857 // "Green" 4
  575. #define IR_BUTTON_22 0xFF6897 // "Blue" 4
  576. #define IR_BUTTON_23 0xFFE817 // SMOOTH Mode
  577. #endif
  578. // -----------------------------------------------------------------------------
  579. // HUACANXING H801
  580. // -----------------------------------------------------------------------------
  581. #elif defined(HUACANXING_H801)
  582. // Info
  583. #define MANUFACTURER "HUACANXING"
  584. #define DEVICE "H801"
  585. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  586. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  587. #define DUMMY_RELAY_COUNT 1
  588. // LEDs
  589. #define LED1_PIN 5
  590. #define LED1_PIN_INVERSE 1
  591. // Channels
  592. #define LIGHT_CH1_PIN 15 // RED
  593. #define LIGHT_CH2_PIN 13 // GREEN
  594. #define LIGHT_CH3_PIN 12 // BLUE
  595. #define LIGHT_CH4_PIN 14 // WHITE1
  596. #define LIGHT_CH5_PIN 4 // WHITE2
  597. #define LIGHT_CH1_INVERSE 0
  598. #define LIGHT_CH2_INVERSE 0
  599. #define LIGHT_CH3_INVERSE 0
  600. #define LIGHT_CH4_INVERSE 0
  601. #define LIGHT_CH5_INVERSE 0
  602. // -----------------------------------------------------------------------------
  603. // Jan Goedeke Wifi Relay
  604. // https://github.com/JanGoe/esp8266-wifi-relay
  605. // -----------------------------------------------------------------------------
  606. #elif defined(JANGOE_WIFI_RELAY_NC)
  607. // Info
  608. #define MANUFACTURER "JANGOE"
  609. #define DEVICE "WIFI_RELAY_NC"
  610. // Buttons
  611. #define BUTTON1_PIN 12
  612. #define BUTTON2_PIN 13
  613. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  614. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  615. #define BUTTON1_RELAY 1
  616. #define BUTTON2_RELAY 2
  617. // Relays
  618. #define RELAY1_PIN 2
  619. #define RELAY2_PIN 14
  620. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  621. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  622. #elif defined(JANGOE_WIFI_RELAY_NO)
  623. // Info
  624. #define MANUFACTURER "JANGOE"
  625. #define DEVICE "WIFI_RELAY_NO"
  626. // Buttons
  627. #define BUTTON1_PIN 12
  628. #define BUTTON2_PIN 13
  629. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  630. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  631. #define BUTTON1_RELAY 1
  632. #define BUTTON2_RELAY 2
  633. // Relays
  634. #define RELAY1_PIN 2
  635. #define RELAY2_PIN 14
  636. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  637. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  638. // -----------------------------------------------------------------------------
  639. // Jorge García Wifi+Relays Board Kit
  640. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  641. // https://github.com/jorgegarciadev/wifikit
  642. // -----------------------------------------------------------------------------
  643. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  644. // Info
  645. #define MANUFACTURER "JORGEGARCIA"
  646. #define DEVICE "WIFI_RELAYS"
  647. // Relays
  648. #define RELAY1_PIN 0
  649. #define RELAY2_PIN 2
  650. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  651. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  652. // -----------------------------------------------------------------------------
  653. // WiFi MQTT Relay / Thermostat
  654. // -----------------------------------------------------------------------------
  655. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  656. // Info
  657. #define MANUFACTURER "OPENENERGYMONITOR"
  658. #define DEVICE "MQTT_RELAY"
  659. // Buttons
  660. #define BUTTON1_PIN 0
  661. #define BUTTON1_RELAY 1
  662. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  663. // Relays
  664. #define RELAY1_PIN 12
  665. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  666. // LEDs
  667. #define LED1_PIN 16
  668. #define LED1_PIN_INVERSE 0
  669. // -----------------------------------------------------------------------------
  670. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  671. // 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
  672. // 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
  673. // -----------------------------------------------------------------------------
  674. #elif defined(WION_50055)
  675. // Currently untested, does not support energy monitoring
  676. // Info
  677. #define MANUFACTURER "WION"
  678. #define DEVICE "50055"
  679. // Buttons
  680. #define BUTTON1_PIN 13
  681. #define BUTTON1_RELAY 1
  682. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  683. // Relays
  684. #define RELAY1_PIN 15
  685. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  686. // LEDs
  687. #define LED1_PIN 2
  688. #define LED1_PIN_INVERSE 0
  689. // -----------------------------------------------------------------------------
  690. // EX-Store Wifi Relay v3.1
  691. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  692. // -----------------------------------------------------------------------------
  693. #elif defined(EXS_WIFI_RELAY_V31)
  694. // Untested
  695. // Info
  696. #define MANUFACTURER "EXS"
  697. #define DEVICE "WIFI_RELAY_V31"
  698. // Buttons
  699. #define BUTTON1_PIN 0
  700. #define BUTTON1_RELAY 1
  701. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  702. // Relays
  703. #define RELAY1_PIN 13
  704. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  705. #define RELAY1_RESET_PIN 12
  706. // -----------------------------------------------------------------------------
  707. // HUACANXING H802
  708. // -----------------------------------------------------------------------------
  709. #elif defined(HUACANXING_H802)
  710. // Info
  711. #define MANUFACTURER "HUACANXING"
  712. #define DEVICE "H802"
  713. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  714. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  715. #define DUMMY_RELAY_COUNT 1
  716. // Channels
  717. #define LIGHT_CH1_PIN 12 // RED
  718. #define LIGHT_CH2_PIN 14 // GREEN
  719. #define LIGHT_CH3_PIN 13 // BLUE
  720. #define LIGHT_CH4_PIN 15 // WHITE
  721. #define LIGHT_CH1_INVERSE 0
  722. #define LIGHT_CH2_INVERSE 0
  723. #define LIGHT_CH3_INVERSE 0
  724. #define LIGHT_CH4_INVERSE 0
  725. // -----------------------------------------------------------------------------
  726. // V9261F
  727. // -----------------------------------------------------------------------------
  728. #elif defined(GENERIC_V9261F)
  729. // Info
  730. #define MANUFACTURER "GENERIC"
  731. #define DEVICE "V9261F"
  732. // V9261F
  733. #define POWER_PROVIDER POWER_PROVIDER_V9261F
  734. #define V9261F_PIN 2
  735. #define V9261F_PIN_INVERSE 1
  736. // -----------------------------------------------------------------------------
  737. // ECH1560
  738. // -----------------------------------------------------------------------------
  739. #elif defined(GENERIC_ECH1560)
  740. // Info
  741. #define MANUFACTURER "GENERIC"
  742. #define DEVICE "ECH1560"
  743. // ECH1560
  744. #define POWER_PROVIDER POWER_PROVIDER_ECH1560
  745. #define ECH1560_CLK_PIN 4
  746. #define ECH1560_MISO_PIN 5
  747. #define ECH1560_INVERTED 0
  748. // -----------------------------------------------------------------------------
  749. // Unknown hardware
  750. // -----------------------------------------------------------------------------
  751. #else
  752. #error "UNSUPPORTED HARDWARE!"
  753. #endif
  754. // -----------------------------------------------------------------------------
  755. // Default values
  756. // -----------------------------------------------------------------------------
  757. #ifndef BUTTON1_PRESS
  758. #define BUTTON1_PRESS BUTTON_MODE_NONE
  759. #endif
  760. #ifndef BUTTON2_PRESS
  761. #define BUTTON2_PRESS BUTTON_MODE_NONE
  762. #endif
  763. #ifndef BUTTON3_PRESS
  764. #define BUTTON3_PRESS BUTTON_MODE_NONE
  765. #endif
  766. #ifndef BUTTON4_PRESS
  767. #define BUTTON4_PRESS BUTTON_MODE_NONE
  768. #endif
  769. #ifndef BUTTON1_CLICK
  770. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  771. #endif
  772. #ifndef BUTTON2_CLICK
  773. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  774. #endif
  775. #ifndef BUTTON3_CLICK
  776. #define BUTTON3_CLICK BUTTON_MODE_TOGGLE
  777. #endif
  778. #ifndef BUTTON4_CLICK
  779. #define BUTTON4_CLICK BUTTON_MODE_TOGGLE
  780. #endif
  781. #ifndef BUTTON1_DBLCLICK
  782. #define BUTTON1_DBLCLICK BUTTON_MODE_AP
  783. #endif
  784. #ifndef BUTTON2_DBLCLICK
  785. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  786. #endif
  787. #ifndef BUTTON3_DBLCLICK
  788. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  789. #endif
  790. #ifndef BUTTON4_DBLCLICK
  791. #define BUTTON4_DBLCLICK BUTTON_MODE_NONE
  792. #endif
  793. #ifndef BUTTON1_LNGCLICK
  794. #define BUTTON1_LNGCLICK BUTTON_MODE_RESET
  795. #endif
  796. #ifndef BUTTON2_LNGCLICK
  797. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  798. #endif
  799. #ifndef BUTTON3_LNGCLICK
  800. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  801. #endif
  802. #ifndef BUTTON4_LNGCLICK
  803. #define BUTTON4_LNGCLICK BUTTON_MODE_NONE
  804. #endif
  805. #ifndef BUTTON1_LNGLNGCLICK
  806. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_FACTORY
  807. #endif
  808. #ifndef BUTTON2_LNGLNGCLICK
  809. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  810. #endif
  811. #ifndef BUTTON3_LNGLNGCLICK
  812. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_NONE
  813. #endif
  814. #ifndef BUTTON4_LNGLNGCLICK
  815. #define BUTTON4_LNGLNGCLICK BUTTON_MODE_NONE
  816. #endif
  817. #ifndef BUTTON1_RELAY
  818. #define BUTTON1_RELAY 0
  819. #endif
  820. #ifndef BUTTON2_RELAY
  821. #define BUTTON2_RELAY 0
  822. #endif
  823. #ifndef BUTTON3_RELAY
  824. #define BUTTON3_RELAY 0
  825. #endif
  826. #ifndef BUTTON4_RELAY
  827. #define BUTTON4_RELAY 0
  828. #endif
  829. #ifndef RELAY1_RESET_PIN
  830. #define RELAY1_RESET_PIN 0
  831. #endif
  832. #ifndef RELAY2_RESET_PIN
  833. #define RELAY2_RESET_PIN 0
  834. #endif
  835. #ifndef RELAY3_RESET_PIN
  836. #define RELAY3_RESET_PIN 0
  837. #endif
  838. #ifndef RELAY4_RESET_PIN
  839. #define RELAY4_RESET_PIN 0
  840. #endif
  841. #ifndef RELAY1_DELAY_ON
  842. #define RELAY1_DELAY_ON 0
  843. #endif
  844. #ifndef RELAY2_DELAY_ON
  845. #define RELAY2_DELAY_ON 0
  846. #endif
  847. #ifndef RELAY3_DELAY_ON
  848. #define RELAY3_DELAY_ON 0
  849. #endif
  850. #ifndef RELAY4_DELAY_ON
  851. #define RELAY4_DELAY_ON 0
  852. #endif
  853. #ifndef RELAY1_DELAY_OFF
  854. #define RELAY1_DELAY_OFF 0
  855. #endif
  856. #ifndef RELAY2_DELAY_OFF
  857. #define RELAY2_DELAY_OFF 0
  858. #endif
  859. #ifndef RELAY3_DELAY_OFF
  860. #define RELAY3_DELAY_OFF 0
  861. #endif
  862. #ifndef RELAY4_DELAY_OFF
  863. #define RELAY4_DELAY_OFF 0
  864. #endif
  865. #ifndef RELAY1_LED
  866. #define RELAY1_LED 0
  867. #endif
  868. #ifndef RELAY2_LED
  869. #define RELAY2_LED 0
  870. #endif
  871. #ifndef RELAY3_LED
  872. #define RELAY3_LED 0
  873. #endif
  874. #ifndef RELAY4_LED
  875. #define RELAY4_LED 0
  876. #endif
  877. // Needed for ESP8285 boards under Windows using PlatformIO (?)
  878. #ifndef BUTTON_PUSHBUTTON
  879. #define BUTTON_PUSHBUTTON 0
  880. #define BUTTON_SWITCH 1
  881. #define BUTTON_DEFAULT_HIGH 2
  882. #define BUTTON_SET_PULLUP 4
  883. #endif
  884. // Does the board track the relay status?
  885. #ifndef TRACK_RELAY_STATUS
  886. #define TRACK_RELAY_STATUS 1
  887. #endif
  888. // Serial baudrate
  889. #ifndef SERIAL_BAUDRATE
  890. #define SERIAL_BAUDRATE 115200
  891. #endif
  892. // Relay providers
  893. #ifndef RELAY_PROVIDER
  894. #define RELAY_PROVIDER RELAY_PROVIDER_RELAY
  895. #endif
  896. // Light provider
  897. #ifndef LIGHT_PROVIDER
  898. #define LIGHT_PROVIDER LIGHT_PROVIDER_NONE
  899. #endif