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.

1150 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 TRACK_RELAY_STATUS 0
  331. // Buttons
  332. #define BUTTON1_PIN 0
  333. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  334. // LEDs
  335. #define LED1_PIN 13
  336. #define LED1_PIN_INVERSE 1
  337. #elif defined(ITEAD_SONOFF_B1)
  338. // Info
  339. #define MANUFACTURER "ITEAD"
  340. #define DEVICE "SONOFF_B1"
  341. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  342. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192
  343. #define DUMMY_RELAY_COUNT 1
  344. #define MY9291_DI_PIN 12
  345. #define MY9291_DCKI_PIN 14
  346. #define MY9291_COMMAND MY9291_COMMAND_DEFAULT
  347. #define MY9291_CHANNELS 5
  348. #elif defined(ITEAD_SONOFF_LED)
  349. // Info
  350. #define MANUFACTURER "ITEAD"
  351. #define DEVICE "SONOFF_LED"
  352. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  353. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  354. #define DUMMY_RELAY_COUNT 1
  355. // LEDs
  356. #define LED1_PIN 13
  357. #define LED1_PIN_INVERSE 1
  358. // Channels
  359. #define LIGHT_CH1_PIN 12 // Cold white
  360. #define LIGHT_CH2_PIN 14 // Warm white
  361. #define LIGHT_CH1_INVERSE 0
  362. #define LIGHT_CH2_INVERSE 0
  363. #elif defined(ITEAD_SONOFF_T1_1CH)
  364. // Info
  365. #define MANUFACTURER "ITEAD"
  366. #define DEVICE "SONOFF_T1_1CH"
  367. // Buttons
  368. #define BUTTON1_PIN 9
  369. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  370. #define BUTTON1_RELAY 1
  371. // Relays
  372. #define RELAY1_PIN 5
  373. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  374. // LEDs
  375. #define LED1_PIN 13
  376. #define LED1_PIN_INVERSE 1
  377. #elif defined(ITEAD_SONOFF_T1_2CH)
  378. // Info
  379. #define MANUFACTURER "ITEAD"
  380. #define DEVICE "SONOFF_T1_2CH"
  381. // Buttons
  382. #define BUTTON1_PIN 0
  383. #define BUTTON2_PIN 10
  384. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  385. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  386. #define BUTTON1_RELAY 1
  387. #define BUTTON2_RELAY 2
  388. // Relays
  389. #define RELAY1_PIN 12
  390. #define RELAY2_PIN 4
  391. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  392. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  393. // LEDs
  394. #define LED1_PIN 13
  395. #define LED1_PIN_INVERSE 1
  396. #elif defined(ITEAD_SONOFF_T1_3CH)
  397. // Info
  398. #define MANUFACTURER "ITEAD"
  399. #define DEVICE "SONOFF_T1_3CH"
  400. // Buttons
  401. #define BUTTON1_PIN 0
  402. #define BUTTON2_PIN 9
  403. #define BUTTON3_PIN 10
  404. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  405. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  406. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  407. #define BUTTON1_RELAY 1
  408. #define BUTTON2_RELAY 2
  409. #define BUTTON3_RELAY 3
  410. // Relays
  411. #define RELAY1_PIN 12
  412. #define RELAY2_PIN 5
  413. #define RELAY3_PIN 4
  414. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  415. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  416. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  417. // LEDs
  418. #define LED1_PIN 13
  419. #define LED1_PIN_INVERSE 1
  420. // -----------------------------------------------------------------------------
  421. // Electrodragon boards
  422. // -----------------------------------------------------------------------------
  423. #elif defined(ELECTRODRAGON_WIFI_IOT)
  424. // Info
  425. #define MANUFACTURER "ELECTRODRAGON"
  426. #define DEVICE "WIFI_IOT"
  427. // Buttons
  428. #define BUTTON1_PIN 0
  429. #define BUTTON2_PIN 2
  430. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  431. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  432. #define BUTTON1_RELAY 1
  433. #define BUTTON2_RELAY 2
  434. // Relays
  435. #define RELAY1_PIN 12
  436. #define RELAY2_PIN 13
  437. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  438. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  439. // LEDs
  440. #define LED1_PIN 16
  441. #define LED1_PIN_INVERSE 0
  442. // -----------------------------------------------------------------------------
  443. // WorkChoice ecoPlug
  444. // -----------------------------------------------------------------------------
  445. #elif defined(WORKCHOICE_ECOPLUG)
  446. // Info
  447. #define MANUFACTURER "WORKCHOICE"
  448. #define DEVICE "ECOPLUG"
  449. // Buttons
  450. #define BUTTON1_PIN 13
  451. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  452. #define BUTTON1_RELAY 1
  453. // Relays
  454. #define RELAY1_PIN 15
  455. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  456. // LEDs
  457. #define LED1_PIN 2
  458. #define LED1_PIN_INVERSE 0
  459. // -----------------------------------------------------------------------------
  460. // AI Thinker
  461. // -----------------------------------------------------------------------------
  462. #elif defined(AITHINKER_AI_LIGHT)
  463. // Info
  464. #define MANUFACTURER "AITHINKER"
  465. #define DEVICE "AI_LIGHT"
  466. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  467. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192
  468. #define DUMMY_RELAY_COUNT 1
  469. #define MY9291_DI_PIN 13
  470. #define MY9291_DCKI_PIN 15
  471. #define MY9291_COMMAND MY9291_COMMAND_DEFAULT
  472. #define MY9291_CHANNELS 4
  473. // -----------------------------------------------------------------------------
  474. // LED Controller
  475. // -----------------------------------------------------------------------------
  476. #elif defined(MAGICHOME_LED_CONTROLLER)
  477. // Info
  478. #define MANUFACTURER "MAGICHOME"
  479. #define DEVICE "LED_CONTROLLER"
  480. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  481. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  482. #define DUMMY_RELAY_COUNT 1
  483. // LEDs
  484. #define LED1_PIN 2
  485. #define LED1_PIN_INVERSE 1
  486. // Channels
  487. #define LIGHT_CH1_PIN 14 // RED
  488. #define LIGHT_CH2_PIN 5 // GREEN
  489. #define LIGHT_CH3_PIN 12 // BLUE
  490. #define LIGHT_CH4_PIN 13 // WHITE
  491. #define LIGHT_CH1_INVERSE 0
  492. #define LIGHT_CH2_INVERSE 0
  493. #define LIGHT_CH3_INVERSE 0
  494. #define LIGHT_CH4_INVERSE 0
  495. // -----------------------------------------------------------------------------
  496. // LED Controller With IR
  497. // -----------------------------------------------------------------------------
  498. #elif defined(MAGICHOME_LED_CONTROLLER_IR)
  499. // Info
  500. #define MANUFACTURER "MAGICHOME"
  501. #define DEVICE "LED_CONTROLLER_IR"
  502. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  503. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  504. #define DUMMY_RELAY_COUNT 1
  505. // LEDs
  506. #define LED1_PIN 2
  507. #define LED1_PIN_INVERSE 1
  508. // Channels
  509. #define LIGHT_CH1_PIN 5 // RED
  510. #define LIGHT_CH2_PIN 12 // GREEN
  511. #define LIGHT_CH3_PIN 13 // BLUE
  512. //#define LIGHT_CH4_PIN 14 // WHITE ?
  513. #define LIGHT_IR_PIN 4 // IR LED
  514. #define LIGHT_CH1_INVERSE 0
  515. #define LIGHT_CH2_INVERSE 0
  516. #define LIGHT_CH3_INVERSE 0
  517. #define LIGHT_CH4_INVERSE 0
  518. #define LIGHT_PROVIDER_EXPERIMENTAL_RGB_ONLY_HSV_IR 1
  519. // 24 Buttons Set of the IR Remote
  520. #ifndef IR_BUTTONS_SET
  521. #define IR_BUTTONS_SET 1
  522. #endif
  523. //Remote Buttons SET 1 (for the original Remote shipped with the controller)
  524. #if IR_BUTTONS_SET == 1
  525. #define IR_BUTTON_0 0xFF906F // Brightness +
  526. #define IR_BUTTON_1 0xFFB847 // Brightness -
  527. #define IR_BUTTON_2 0xFFF807 // OFF
  528. #define IR_BUTTON_3 0xFFB04F // ON
  529. #define IR_BUTTON_4 0xFF9867 // RED
  530. #define IR_BUTTON_5 0xFFD827 // GREEN
  531. #define IR_BUTTON_6 0xFF8877 // BLUE
  532. #define IR_BUTTON_7 0xFFA857 // WHITE
  533. #define IR_BUTTON_8 0xFFE817 // "Red" 1
  534. #define IR_BUTTON_9 0xFF48B7 // "Green" 1
  535. #define IR_BUTTON_10 0xFF6897 // "Blue" 1
  536. #define IR_BUTTON_11 0xFFB24D // FLASH Mode
  537. #define IR_BUTTON_12 0xFF02FD // "Red" 2
  538. #define IR_BUTTON_13 0xFF32CD // "Green" 2
  539. #define IR_BUTTON_14 0xFF20DF // "Blue" 2
  540. #define IR_BUTTON_15 0xFF00FF // STROBE Mode
  541. #define IR_BUTTON_16 0xFF50AF // "Red" 3
  542. #define IR_BUTTON_17 0xFF7887 // "Green" 3
  543. #define IR_BUTTON_18 0xFF708F // "Blue" 3
  544. #define IR_BUTTON_19 0xFF58A7 // FADE Mode
  545. #define IR_BUTTON_20 0xFF38C7 // "Red" 4
  546. #define IR_BUTTON_21 0xFF28D7 // "Green" 4
  547. #define IR_BUTTON_22 0xFFF00F // "Blue" 4
  548. #define IR_BUTTON_23 0xFF30CF // SMOOTH Mode
  549. #endif
  550. //Remote Buttons SET 2 (another identical IR Remote shipped with another controller)
  551. #if IR_BUTTONS_SET == 2
  552. #define IR_BUTTON_0 0xFF00FF // Brightness +
  553. #define IR_BUTTON_1 0xFF807F // Brightness -
  554. #define IR_BUTTON_2 0xFF40BF // OFF
  555. #define IR_BUTTON_3 0xFFC03F // ON
  556. #define IR_BUTTON_4 0xFF20DF // RED
  557. #define IR_BUTTON_5 0xFFA05F // GREEN
  558. #define IR_BUTTON_6 0xFF609F // BLUE
  559. #define IR_BUTTON_7 0xFFE01F // WHITE
  560. #define IR_BUTTON_8 0xFF10EF // "Red" 1
  561. #define IR_BUTTON_9 0xFF906F // "Green" 1
  562. #define IR_BUTTON_10 0xFF50AF // "Blue" 1
  563. #define IR_BUTTON_11 0xFFD02F // FLASH Mode
  564. #define IR_BUTTON_12 0xFF30CF // "Red" 2
  565. #define IR_BUTTON_13 0xFFB04F // "Green" 2
  566. #define IR_BUTTON_14 0xFF708F // "Blue" 2
  567. #define IR_BUTTON_15 0xFFF00F // STROBE Mode
  568. #define IR_BUTTON_16 0xFF08F7 // "Red" 3
  569. #define IR_BUTTON_17 0xFF8877 // "Green" 3
  570. #define IR_BUTTON_18 0xFF48B7 // "Blue" 3
  571. #define IR_BUTTON_19 0xFFC837 // FADE Mode
  572. #define IR_BUTTON_20 0xFF28D7 // "Red" 4
  573. #define IR_BUTTON_21 0xFFA857 // "Green" 4
  574. #define IR_BUTTON_22 0xFF6897 // "Blue" 4
  575. #define IR_BUTTON_23 0xFFE817 // SMOOTH Mode
  576. #endif
  577. // -----------------------------------------------------------------------------
  578. // HUACANXING H801
  579. // -----------------------------------------------------------------------------
  580. #elif defined(HUACANXING_H801)
  581. // Info
  582. #define MANUFACTURER "HUACANXING"
  583. #define DEVICE "H801"
  584. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  585. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  586. #define DUMMY_RELAY_COUNT 1
  587. // LEDs
  588. #define LED1_PIN 5
  589. #define LED1_PIN_INVERSE 1
  590. // Channels
  591. #define LIGHT_CH1_PIN 15 // RED
  592. #define LIGHT_CH2_PIN 13 // GREEN
  593. #define LIGHT_CH3_PIN 12 // BLUE
  594. #define LIGHT_CH4_PIN 14 // WHITE1
  595. #define LIGHT_CH5_PIN 4 // WHITE2
  596. #define LIGHT_CH1_INVERSE 0
  597. #define LIGHT_CH2_INVERSE 0
  598. #define LIGHT_CH3_INVERSE 0
  599. #define LIGHT_CH4_INVERSE 0
  600. #define LIGHT_CH5_INVERSE 0
  601. // -----------------------------------------------------------------------------
  602. // Jan Goedeke Wifi Relay
  603. // https://github.com/JanGoe/esp8266-wifi-relay
  604. // -----------------------------------------------------------------------------
  605. #elif defined(JANGOE_WIFI_RELAY_NC)
  606. // Info
  607. #define MANUFACTURER "JANGOE"
  608. #define DEVICE "WIFI_RELAY_NC"
  609. // Buttons
  610. #define BUTTON1_PIN 12
  611. #define BUTTON2_PIN 13
  612. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  613. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  614. #define BUTTON1_RELAY 1
  615. #define BUTTON2_RELAY 2
  616. // Relays
  617. #define RELAY1_PIN 2
  618. #define RELAY2_PIN 14
  619. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  620. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  621. #elif defined(JANGOE_WIFI_RELAY_NO)
  622. // Info
  623. #define MANUFACTURER "JANGOE"
  624. #define DEVICE "WIFI_RELAY_NO"
  625. // Buttons
  626. #define BUTTON1_PIN 12
  627. #define BUTTON2_PIN 13
  628. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  629. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  630. #define BUTTON1_RELAY 1
  631. #define BUTTON2_RELAY 2
  632. // Relays
  633. #define RELAY1_PIN 2
  634. #define RELAY2_PIN 14
  635. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  636. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  637. // -----------------------------------------------------------------------------
  638. // Jorge García Wifi+Relays Board Kit
  639. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  640. // https://github.com/jorgegarciadev/wifikit
  641. // -----------------------------------------------------------------------------
  642. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  643. // Info
  644. #define MANUFACTURER "JORGEGARCIA"
  645. #define DEVICE "WIFI_RELAYS"
  646. // Relays
  647. #define RELAY1_PIN 0
  648. #define RELAY2_PIN 2
  649. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  650. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  651. // -----------------------------------------------------------------------------
  652. // WiFi MQTT Relay / Thermostat
  653. // -----------------------------------------------------------------------------
  654. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  655. // Info
  656. #define MANUFACTURER "OPENENERGYMONITOR"
  657. #define DEVICE "MQTT_RELAY"
  658. // Buttons
  659. #define BUTTON1_PIN 0
  660. #define BUTTON1_RELAY 1
  661. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  662. // Relays
  663. #define RELAY1_PIN 12
  664. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  665. // LEDs
  666. #define LED1_PIN 16
  667. #define LED1_PIN_INVERSE 0
  668. // -----------------------------------------------------------------------------
  669. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  670. // 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
  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-50055-Indoor-Wi-Fi-Wall-Tap-Monitor-Energy-Usage-Wireless-Smart-Switch-%2F263020837777
  672. // -----------------------------------------------------------------------------
  673. #elif defined(WION_50055)
  674. // Currently untested, does not support energy monitoring
  675. // Info
  676. #define MANUFACTURER "WION"
  677. #define DEVICE "50055"
  678. // Buttons
  679. #define BUTTON1_PIN 13
  680. #define BUTTON1_RELAY 1
  681. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  682. // Relays
  683. #define RELAY1_PIN 15
  684. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  685. // LEDs
  686. #define LED1_PIN 2
  687. #define LED1_PIN_INVERSE 0
  688. // -----------------------------------------------------------------------------
  689. // EX-Store Wifi Relay v3.1
  690. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  691. // -----------------------------------------------------------------------------
  692. #elif defined(EXS_WIFI_RELAY_V31)
  693. // Untested
  694. // Info
  695. #define MANUFACTURER "EXS"
  696. #define DEVICE "WIFI_RELAY_V31"
  697. // Buttons
  698. #define BUTTON1_PIN 0
  699. #define BUTTON1_RELAY 1
  700. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  701. // Relays
  702. #define RELAY1_PIN 13
  703. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  704. #define RELAY1_RESET_PIN 12
  705. // -----------------------------------------------------------------------------
  706. // HUACANXING H802
  707. // -----------------------------------------------------------------------------
  708. #elif defined(HUACANXING_H802)
  709. // Info
  710. #define MANUFACTURER "HUACANXING"
  711. #define DEVICE "H802"
  712. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  713. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  714. #define DUMMY_RELAY_COUNT 1
  715. // Channels
  716. #define LIGHT_CH1_PIN 12 // RED
  717. #define LIGHT_CH2_PIN 14 // GREEN
  718. #define LIGHT_CH3_PIN 13 // BLUE
  719. #define LIGHT_CH4_PIN 15 // WHITE
  720. #define LIGHT_CH1_INVERSE 0
  721. #define LIGHT_CH2_INVERSE 0
  722. #define LIGHT_CH3_INVERSE 0
  723. #define LIGHT_CH4_INVERSE 0
  724. // -----------------------------------------------------------------------------
  725. // V9261F
  726. // -----------------------------------------------------------------------------
  727. #elif defined(GENERIC_V9261F)
  728. // Info
  729. #define MANUFACTURER "GENERIC"
  730. #define DEVICE "V9261F"
  731. // V9261F
  732. #define POWER_PROVIDER POWER_PROVIDER_V9261F
  733. #define V9261F_PIN 2
  734. #define V9261F_PIN_INVERSE 1
  735. // -----------------------------------------------------------------------------
  736. // ECH1560
  737. // -----------------------------------------------------------------------------
  738. #elif defined(GENERIC_ECH1560)
  739. // Info
  740. #define MANUFACTURER "GENERIC"
  741. #define DEVICE "ECH1560"
  742. // ECH1560
  743. #define POWER_PROVIDER POWER_PROVIDER_ECH1560
  744. #define ECH1560_CLK_PIN 4
  745. #define ECH1560_MISO_PIN 5
  746. #define ECH1560_INVERTED 0
  747. // -----------------------------------------------------------------------------
  748. // Unknown hardware
  749. // -----------------------------------------------------------------------------
  750. #else
  751. #error "UNSUPPORTED HARDWARE!"
  752. #endif
  753. // -----------------------------------------------------------------------------
  754. // Default values
  755. // -----------------------------------------------------------------------------
  756. #ifndef BUTTON1_PRESS
  757. #define BUTTON1_PRESS BUTTON_MODE_NONE
  758. #endif
  759. #ifndef BUTTON2_PRESS
  760. #define BUTTON2_PRESS BUTTON_MODE_NONE
  761. #endif
  762. #ifndef BUTTON3_PRESS
  763. #define BUTTON3_PRESS BUTTON_MODE_NONE
  764. #endif
  765. #ifndef BUTTON4_PRESS
  766. #define BUTTON4_PRESS BUTTON_MODE_NONE
  767. #endif
  768. #ifndef BUTTON1_CLICK
  769. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  770. #endif
  771. #ifndef BUTTON2_CLICK
  772. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  773. #endif
  774. #ifndef BUTTON3_CLICK
  775. #define BUTTON3_CLICK BUTTON_MODE_TOGGLE
  776. #endif
  777. #ifndef BUTTON4_CLICK
  778. #define BUTTON4_CLICK BUTTON_MODE_TOGGLE
  779. #endif
  780. #ifndef BUTTON1_DBLCLICK
  781. #define BUTTON1_DBLCLICK BUTTON_MODE_AP
  782. #endif
  783. #ifndef BUTTON2_DBLCLICK
  784. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  785. #endif
  786. #ifndef BUTTON3_DBLCLICK
  787. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  788. #endif
  789. #ifndef BUTTON4_DBLCLICK
  790. #define BUTTON4_DBLCLICK BUTTON_MODE_NONE
  791. #endif
  792. #ifndef BUTTON1_LNGCLICK
  793. #define BUTTON1_LNGCLICK BUTTON_MODE_RESET
  794. #endif
  795. #ifndef BUTTON2_LNGCLICK
  796. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  797. #endif
  798. #ifndef BUTTON3_LNGCLICK
  799. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  800. #endif
  801. #ifndef BUTTON4_LNGCLICK
  802. #define BUTTON4_LNGCLICK BUTTON_MODE_NONE
  803. #endif
  804. #ifndef BUTTON1_LNGLNGCLICK
  805. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_FACTORY
  806. #endif
  807. #ifndef BUTTON2_LNGLNGCLICK
  808. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  809. #endif
  810. #ifndef BUTTON3_LNGLNGCLICK
  811. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_NONE
  812. #endif
  813. #ifndef BUTTON4_LNGLNGCLICK
  814. #define BUTTON4_LNGLNGCLICK BUTTON_MODE_NONE
  815. #endif
  816. #ifndef BUTTON1_RELAY
  817. #define BUTTON1_RELAY 0
  818. #endif
  819. #ifndef BUTTON2_RELAY
  820. #define BUTTON2_RELAY 0
  821. #endif
  822. #ifndef BUTTON3_RELAY
  823. #define BUTTON3_RELAY 0
  824. #endif
  825. #ifndef BUTTON4_RELAY
  826. #define BUTTON4_RELAY 0
  827. #endif
  828. #ifndef RELAY1_RESET_PIN
  829. #define RELAY1_RESET_PIN 0
  830. #endif
  831. #ifndef RELAY2_RESET_PIN
  832. #define RELAY2_RESET_PIN 0
  833. #endif
  834. #ifndef RELAY3_RESET_PIN
  835. #define RELAY3_RESET_PIN 0
  836. #endif
  837. #ifndef RELAY4_RESET_PIN
  838. #define RELAY4_RESET_PIN 0
  839. #endif
  840. #ifndef RELAY1_DELAY_ON
  841. #define RELAY1_DELAY_ON 0
  842. #endif
  843. #ifndef RELAY2_DELAY_ON
  844. #define RELAY2_DELAY_ON 0
  845. #endif
  846. #ifndef RELAY3_DELAY_ON
  847. #define RELAY3_DELAY_ON 0
  848. #endif
  849. #ifndef RELAY4_DELAY_ON
  850. #define RELAY4_DELAY_ON 0
  851. #endif
  852. #ifndef RELAY1_DELAY_OFF
  853. #define RELAY1_DELAY_OFF 0
  854. #endif
  855. #ifndef RELAY2_DELAY_OFF
  856. #define RELAY2_DELAY_OFF 0
  857. #endif
  858. #ifndef RELAY3_DELAY_OFF
  859. #define RELAY3_DELAY_OFF 0
  860. #endif
  861. #ifndef RELAY4_DELAY_OFF
  862. #define RELAY4_DELAY_OFF 0
  863. #endif
  864. #ifndef RELAY1_LED
  865. #define RELAY1_LED 0
  866. #endif
  867. #ifndef RELAY2_LED
  868. #define RELAY2_LED 0
  869. #endif
  870. #ifndef RELAY3_LED
  871. #define RELAY3_LED 0
  872. #endif
  873. #ifndef RELAY4_LED
  874. #define RELAY4_LED 0
  875. #endif
  876. // Needed for ESP8285 boards under Windows using PlatformIO (?)
  877. #ifndef BUTTON_PUSHBUTTON
  878. #define BUTTON_PUSHBUTTON 0
  879. #define BUTTON_SWITCH 1
  880. #define BUTTON_DEFAULT_HIGH 2
  881. #define BUTTON_SET_PULLUP 4
  882. #endif
  883. // Does the board track the relay status?
  884. #ifndef TRACK_RELAY_STATUS
  885. #define TRACK_RELAY_STATUS 1
  886. #endif
  887. // Serial baudrate
  888. #ifndef SERIAL_BAUDRATE
  889. #define SERIAL_BAUDRATE 115200
  890. #endif
  891. // Relay providers
  892. #ifndef RELAY_PROVIDER
  893. #define RELAY_PROVIDER RELAY_PROVIDER_RELAY
  894. #endif
  895. // Light provider
  896. #ifndef LIGHT_PROVIDER
  897. #define LIGHT_PROVIDER LIGHT_PROVIDER_NONE
  898. #endif