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.

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