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.

1397 lines
43 KiB

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