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.

1404 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 12
  35. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  36. // LEDs
  37. #define LED1_PIN 2
  38. #define LED1_PIN_INVERSE 1
  39. #elif defined(WEMOS_D1_MINI_RELAYSHIELD)
  40. // Info
  41. #define MANUFACTURER "WEMOS"
  42. #define DEVICE "D1_MINI_RELAYSHIELD"
  43. // Buttons
  44. // No buttons on the D1 MINI alone, but defining it without adding a button doen't create problems
  45. #define BUTTON1_PIN 0 // Connect a pushbutton between D3 and GND,
  46. // it's the same as using a Wemos one button shield
  47. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  48. #define BUTTON1_RELAY 1
  49. // Relays
  50. #define RELAY1_PIN 5
  51. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  52. // LEDs
  53. #define LED1_PIN 2
  54. #define LED1_PIN_INVERSE 1
  55. // When Wemos relay shield is connected GPIO5 (D1) is used for relay,
  56. // so I2C must be remapped to other pins
  57. #define I2C_SDA_PIN 12 // D6
  58. #define I2C_SCL_PIN 14 // D5
  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 | BUTTON_DEFAULT_HIGH
  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 | BUTTON_DEFAULT_HIGH
  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 // Button 0 on header
  296. #define BUTTON2_PIN 9 // Button 1 on header
  297. #define BUTTON3_PIN 10 // Physical button
  298. #define BUTTON1_RELAY 1
  299. #define BUTTON2_RELAY 2
  300. #define BUTTON3_RELAY 1
  301. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  302. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  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. #define SERIAL_RX_PORT Serial
  727. // LEDs
  728. #define LED1_PIN 5
  729. #define LED1_PIN_INVERSE 1
  730. // Light
  731. #define LIGHT_CHANNELS 5
  732. #define LIGHT_CH1_PIN 15 // RED
  733. #define LIGHT_CH2_PIN 13 // GREEN
  734. #define LIGHT_CH3_PIN 12 // BLUE
  735. #define LIGHT_CH4_PIN 14 // WHITE1
  736. #define LIGHT_CH5_PIN 4 // WHITE2
  737. #define LIGHT_CH1_INVERSE 0
  738. #define LIGHT_CH2_INVERSE 0
  739. #define LIGHT_CH3_INVERSE 0
  740. #define LIGHT_CH4_INVERSE 0
  741. #define LIGHT_CH5_INVERSE 0
  742. #elif defined(HUACANXING_H802)
  743. // Info
  744. #define MANUFACTURER "HUACANXING"
  745. #define DEVICE "H802"
  746. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  747. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  748. #define DUMMY_RELAY_COUNT 1
  749. #define DEBUG_PORT Serial1
  750. #define SERIAL_RX_PORT Serial
  751. // Light
  752. #define LIGHT_CHANNELS 4
  753. #define LIGHT_CH1_PIN 12 // RED
  754. #define LIGHT_CH2_PIN 14 // GREEN
  755. #define LIGHT_CH3_PIN 13 // BLUE
  756. #define LIGHT_CH4_PIN 15 // WHITE
  757. #define LIGHT_CH1_INVERSE 0
  758. #define LIGHT_CH2_INVERSE 0
  759. #define LIGHT_CH3_INVERSE 0
  760. #define LIGHT_CH4_INVERSE 0
  761. // -----------------------------------------------------------------------------
  762. // Jan Goedeke Wifi Relay
  763. // https://github.com/JanGoe/esp8266-wifi-relay
  764. // -----------------------------------------------------------------------------
  765. #elif defined(JANGOE_WIFI_RELAY_NC)
  766. // Info
  767. #define MANUFACTURER "JANGOE"
  768. #define DEVICE "WIFI_RELAY_NC"
  769. // Buttons
  770. #define BUTTON1_PIN 12
  771. #define BUTTON2_PIN 13
  772. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  773. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  774. #define BUTTON1_RELAY 1
  775. #define BUTTON2_RELAY 2
  776. // Relays
  777. #define RELAY1_PIN 2
  778. #define RELAY2_PIN 14
  779. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  780. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  781. #elif defined(JANGOE_WIFI_RELAY_NO)
  782. // Info
  783. #define MANUFACTURER "JANGOE"
  784. #define DEVICE "WIFI_RELAY_NO"
  785. // Buttons
  786. #define BUTTON1_PIN 12
  787. #define BUTTON2_PIN 13
  788. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  789. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  790. #define BUTTON1_RELAY 1
  791. #define BUTTON2_RELAY 2
  792. // Relays
  793. #define RELAY1_PIN 2
  794. #define RELAY2_PIN 14
  795. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  796. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  797. // -----------------------------------------------------------------------------
  798. // Jorge García Wifi+Relays Board Kit
  799. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  800. // https://github.com/jorgegarciadev/wifikit
  801. // -----------------------------------------------------------------------------
  802. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  803. // Info
  804. #define MANUFACTURER "JORGEGARCIA"
  805. #define DEVICE "WIFI_RELAYS"
  806. // Relays
  807. #define RELAY1_PIN 0
  808. #define RELAY2_PIN 2
  809. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  810. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  811. // -----------------------------------------------------------------------------
  812. // WiFi MQTT Relay / Thermostat
  813. // -----------------------------------------------------------------------------
  814. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  815. // Info
  816. #define MANUFACTURER "OPENENERGYMONITOR"
  817. #define DEVICE "MQTT_RELAY"
  818. // Buttons
  819. #define BUTTON1_PIN 0
  820. #define BUTTON1_RELAY 1
  821. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  822. // Relays
  823. #define RELAY1_PIN 12
  824. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  825. // LEDs
  826. #define LED1_PIN 16
  827. #define LED1_PIN_INVERSE 0
  828. // -----------------------------------------------------------------------------
  829. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  830. // 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
  831. // 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
  832. // -----------------------------------------------------------------------------
  833. #elif defined(WION_50055)
  834. // Currently untested, does not support energy monitoring
  835. // Info
  836. #define MANUFACTURER "WION"
  837. #define DEVICE "50055"
  838. // Buttons
  839. #define BUTTON1_PIN 13
  840. #define BUTTON1_RELAY 1
  841. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  842. // Relays
  843. #define RELAY1_PIN 15
  844. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  845. // LEDs
  846. #define LED1_PIN 2
  847. #define LED1_PIN_INVERSE 0
  848. // -----------------------------------------------------------------------------
  849. // EX-Store Wifi Relay v3.1
  850. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  851. // -----------------------------------------------------------------------------
  852. #elif defined(EXS_WIFI_RELAY_V31)
  853. // Untested
  854. // Info
  855. #define MANUFACTURER "EXS"
  856. #define DEVICE "WIFI_RELAY_V31"
  857. // Buttons
  858. #define BUTTON1_PIN 0
  859. #define BUTTON1_RELAY 1
  860. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  861. // Relays
  862. #define RELAY1_PIN 13
  863. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  864. #define RELAY1_RESET_PIN 12
  865. // -----------------------------------------------------------------------------
  866. // V9261F
  867. // -----------------------------------------------------------------------------
  868. #elif defined(GENERIC_V9261F)
  869. // Info
  870. #define MANUFACTURER "GENERIC"
  871. #define DEVICE "V9261F"
  872. #define ALEXA_SUPPORT 0
  873. // V9261F
  874. #define V9261F_SUPPORT 1
  875. #define V9261F_PIN 2
  876. #define V9261F_PIN_INVERSE 1
  877. // -----------------------------------------------------------------------------
  878. // ECH1560
  879. // -----------------------------------------------------------------------------
  880. #elif defined(GENERIC_ECH1560)
  881. // Info
  882. #define MANUFACTURER "GENERIC"
  883. #define DEVICE "ECH1560"
  884. #define ALEXA_SUPPORT 0
  885. // ECH1560
  886. #define ECH1560_SUPPORT 1
  887. #define ECH1560_CLK_PIN 4
  888. #define ECH1560_MISO_PIN 5
  889. #define ECH1560_INVERTED 0
  890. // -----------------------------------------------------------------------------
  891. // ESPLive
  892. // https://github.com/ManCaveMade/ESP-Live
  893. // -----------------------------------------------------------------------------
  894. #elif defined(MANCAVEMADE_ESPLIVE)
  895. // Info
  896. #define MANUFACTURER "MANCAVEMADE"
  897. #define DEVICE "ESPLIVE"
  898. // Buttons
  899. #define BUTTON1_PIN 4
  900. #define BUTTON2_PIN 5
  901. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  902. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  903. #define BUTTON1_RELAY 1
  904. #define BUTTON2_RELAY 2
  905. // Relays
  906. #define RELAY1_PIN 12
  907. #define RELAY2_PIN 13
  908. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  909. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  910. // DB18B20
  911. #ifndef DALLAS_SUPPORT
  912. #define DALLAS_SUPPORT 1
  913. #endif
  914. #define DALLAS_PIN 2
  915. #define DALLAS_UPDATE_INTERVAL 5000
  916. #define TEMPERATURE_MIN_CHANGE 1.0
  917. // -----------------------------------------------------------------------------
  918. // QuinLED
  919. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  920. // -----------------------------------------------------------------------------
  921. #elif defined(INTERMITTECH_QUINLED)
  922. // Info
  923. #define MANUFACTURER "INTERMITTECH"
  924. #define DEVICE "QUINLED"
  925. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  926. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  927. #define DUMMY_RELAY_COUNT 1
  928. // LEDs
  929. #define LED1_PIN 5
  930. #define LED1_PIN_INVERSE 1
  931. // Light
  932. #define LIGHT_CHANNELS 2
  933. #define LIGHT_CH1_PIN 0
  934. #define LIGHT_CH2_PIN 2
  935. #define LIGHT_CH1_INVERSE 0
  936. #define LIGHT_CH2_INVERSE 0
  937. // -----------------------------------------------------------------------------
  938. // Arilux AL-LC06
  939. // -----------------------------------------------------------------------------
  940. #elif defined(ARILUX_AL_LC01)
  941. // Info
  942. #define MANUFACTURER "ARILUX"
  943. #define DEVICE "AL_LC01"
  944. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  945. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  946. #define DUMMY_RELAY_COUNT 1
  947. // Light
  948. #define LIGHT_CHANNELS 4
  949. #define LIGHT_CH1_PIN 5 // RED
  950. #define LIGHT_CH2_PIN 12 // GREEN
  951. #define LIGHT_CH3_PIN 13 // BLUE
  952. #define LIGHT_CH4_PIN 14 // WHITE1
  953. #define LIGHT_CH1_INVERSE 0
  954. #define LIGHT_CH2_INVERSE 0
  955. #define LIGHT_CH3_INVERSE 0
  956. #define LIGHT_CH4_INVERSE 0
  957. #elif defined(ARILUX_AL_LC02)
  958. // Info
  959. #define MANUFACTURER "ARILUX"
  960. #define DEVICE "AL_LC02"
  961. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  962. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  963. #define DUMMY_RELAY_COUNT 1
  964. // Light
  965. #define LIGHT_CHANNELS 4
  966. #define LIGHT_CH1_PIN 12 // RED
  967. #define LIGHT_CH2_PIN 5 // GREEN
  968. #define LIGHT_CH3_PIN 13 // BLUE
  969. #define LIGHT_CH4_PIN 15 // WHITE1
  970. #define LIGHT_CH1_INVERSE 0
  971. #define LIGHT_CH2_INVERSE 0
  972. #define LIGHT_CH3_INVERSE 0
  973. #define LIGHT_CH4_INVERSE 0
  974. #elif defined(ARILUX_AL_LC06)
  975. // Info
  976. #define MANUFACTURER "ARILUX"
  977. #define DEVICE "AL_LC06"
  978. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  979. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  980. #define DUMMY_RELAY_COUNT 1
  981. // Light
  982. #define LIGHT_CHANNELS 5
  983. #define LIGHT_CH1_PIN 14 // RED
  984. #define LIGHT_CH2_PIN 12 // GREEN
  985. #define LIGHT_CH3_PIN 13 // BLUE
  986. #define LIGHT_CH4_PIN 15 // WHITE1
  987. #define LIGHT_CH5_PIN 5 // WHITE2
  988. #define LIGHT_CH1_INVERSE 0
  989. #define LIGHT_CH2_INVERSE 0
  990. #define LIGHT_CH3_INVERSE 0
  991. #define LIGHT_CH4_INVERSE 0
  992. #define LIGHT_CH5_INVERSE 0
  993. #elif defined(ARILUX_AL_LC11)
  994. // Info
  995. #define MANUFACTURER "ARILUX"
  996. #define DEVICE "AL_LC11"
  997. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  998. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  999. #define DUMMY_RELAY_COUNT 1
  1000. // Light
  1001. #define LIGHT_CHANNELS 5
  1002. #define LIGHT_CH1_PIN 5 // RED
  1003. #define LIGHT_CH2_PIN 4 // GREEN
  1004. #define LIGHT_CH3_PIN 14 // BLUE
  1005. #define LIGHT_CH4_PIN 13 // WHITE1
  1006. #define LIGHT_CH5_PIN 12 // WHITE1
  1007. #define LIGHT_CH1_INVERSE 0
  1008. #define LIGHT_CH2_INVERSE 0
  1009. #define LIGHT_CH3_INVERSE 0
  1010. #define LIGHT_CH4_INVERSE 0
  1011. #define LIGHT_CH5_INVERSE 0
  1012. #elif defined(ARILUX_E27)
  1013. // Info
  1014. #define MANUFACTURER "ARILUX"
  1015. #define DEVICE "E27"
  1016. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1017. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1018. #define DUMMY_RELAY_COUNT 1
  1019. // Light
  1020. #define LIGHT_CHANNELS 4
  1021. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  1022. #define MY92XX_CHIPS 1
  1023. #define MY92XX_DI_PIN 13
  1024. #define MY92XX_DCKI_PIN 15
  1025. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1026. #define MY92XX_MAPPING 0, 1, 2, 3
  1027. // -----------------------------------------------------------------------------
  1028. // XENON SM-PW701U
  1029. // -----------------------------------------------------------------------------
  1030. #elif defined(XENON_SM_PW702U)
  1031. // Info
  1032. #define MANUFACTURER "XENON"
  1033. #define DEVICE "SM_PW702U"
  1034. // Buttons
  1035. #define BUTTON1_PIN 13
  1036. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1037. #define BUTTON1_RELAY 1
  1038. // Relays
  1039. #define RELAY1_PIN 12
  1040. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1041. // LEDs
  1042. #define LED1_PIN 4
  1043. #define LED1_PIN_INVERSE 1
  1044. // -----------------------------------------------------------------------------
  1045. // AUTHOMETION LYT8266
  1046. // https://authometion.com/shop/en/home/13-lyt8266.html
  1047. // -----------------------------------------------------------------------------
  1048. #elif defined(AUTHOMETION_LYT8266)
  1049. // Info
  1050. #define MANUFACTURER "AUTHOMETION"
  1051. #define DEVICE "LYT8266"
  1052. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1053. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1054. #define DUMMY_RELAY_COUNT 1
  1055. // Light
  1056. #define LIGHT_CHANNELS 4
  1057. #define LIGHT_CH1_PIN 13 // RED
  1058. #define LIGHT_CH2_PIN 12 // GREEN
  1059. #define LIGHT_CH3_PIN 14 // BLUE
  1060. #define LIGHT_CH4_PIN 2 // WHITE
  1061. #define LIGHT_CH1_INVERSE 0
  1062. #define LIGHT_CH2_INVERSE 0
  1063. #define LIGHT_CH3_INVERSE 0
  1064. #define LIGHT_CH4_INVERSE 0
  1065. #define LIGHT_ENABLE_PIN 15
  1066. // -----------------------------------------------------------------------------
  1067. // Generic 8CH
  1068. // -----------------------------------------------------------------------------
  1069. #elif defined(GENERIC_8CH)
  1070. // Info
  1071. #define MANUFACTURER "GENERIC"
  1072. #define DEVICE "8CH"
  1073. // Relays
  1074. #define RELAY1_PIN 0
  1075. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1076. #define RELAY2_PIN 2
  1077. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1078. #define RELAY3_PIN 4
  1079. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1080. #define RELAY4_PIN 5
  1081. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1082. #define RELAY5_PIN 12
  1083. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1084. #define RELAY6_PIN 13
  1085. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  1086. #define RELAY7_PIN 14
  1087. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  1088. #define RELAY8_PIN 15
  1089. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  1090. // -----------------------------------------------------------------------------
  1091. #endif
  1092. // -----------------------------------------------------------------------------
  1093. // Check definitions
  1094. // -----------------------------------------------------------------------------
  1095. #if not defined(MANUFACTURER) || not defined(DEVICE)
  1096. #error "UNSUPPORTED HARDWARE!!"
  1097. #endif