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.

1452 lines
44 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. #elif defined(MAGICHOME_LED_CONTROLLER_23)
  716. // Info
  717. #define MANUFACTURER "MAGICHOME"
  718. #define DEVICE "LED_CONTROLLER_23"
  719. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  720. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  721. #define DUMMY_RELAY_COUNT 1
  722. // LEDs
  723. #define LED1_PIN 2
  724. #define LED1_PIN_INVERSE 1
  725. // Light
  726. #define LIGHT_CHANNELS 4
  727. #define LIGHT_CH1_PIN 12 // RED
  728. #define LIGHT_CH2_PIN 5 // GREEN
  729. #define LIGHT_CH3_PIN 13 // BLUE
  730. #define LIGHT_CH4_PIN 15 // WHITE
  731. #define LIGHT_CH1_INVERSE 0
  732. #define LIGHT_CH2_INVERSE 0
  733. #define LIGHT_CH3_INVERSE 0
  734. #define LIGHT_CH4_INVERSE 0
  735. // IR
  736. #define IR_SUPPORT 1
  737. #define IR_PIN 4
  738. #define IR_BUTTON_SET 1
  739. // -----------------------------------------------------------------------------
  740. // HUACANXING H801 & H802
  741. // -----------------------------------------------------------------------------
  742. #elif defined(HUACANXING_H801)
  743. // Info
  744. #define MANUFACTURER "HUACANXING"
  745. #define DEVICE "H801"
  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. // LEDs
  752. #define LED1_PIN 5
  753. #define LED1_PIN_INVERSE 1
  754. // Light
  755. #define LIGHT_CHANNELS 5
  756. #define LIGHT_CH1_PIN 15 // RED
  757. #define LIGHT_CH2_PIN 13 // GREEN
  758. #define LIGHT_CH3_PIN 12 // BLUE
  759. #define LIGHT_CH4_PIN 14 // WHITE1
  760. #define LIGHT_CH5_PIN 4 // WHITE2
  761. #define LIGHT_CH1_INVERSE 0
  762. #define LIGHT_CH2_INVERSE 0
  763. #define LIGHT_CH3_INVERSE 0
  764. #define LIGHT_CH4_INVERSE 0
  765. #define LIGHT_CH5_INVERSE 0
  766. #elif defined(HUACANXING_H802)
  767. // Info
  768. #define MANUFACTURER "HUACANXING"
  769. #define DEVICE "H802"
  770. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  771. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  772. #define DUMMY_RELAY_COUNT 1
  773. #define DEBUG_PORT Serial1
  774. #define SERIAL_RX_PORT Serial
  775. // Light
  776. #define LIGHT_CHANNELS 4
  777. #define LIGHT_CH1_PIN 12 // RED
  778. #define LIGHT_CH2_PIN 14 // GREEN
  779. #define LIGHT_CH3_PIN 13 // BLUE
  780. #define LIGHT_CH4_PIN 15 // WHITE
  781. #define LIGHT_CH1_INVERSE 0
  782. #define LIGHT_CH2_INVERSE 0
  783. #define LIGHT_CH3_INVERSE 0
  784. #define LIGHT_CH4_INVERSE 0
  785. // -----------------------------------------------------------------------------
  786. // Jan Goedeke Wifi Relay
  787. // https://github.com/JanGoe/esp8266-wifi-relay
  788. // -----------------------------------------------------------------------------
  789. #elif defined(JANGOE_WIFI_RELAY_NC)
  790. // Info
  791. #define MANUFACTURER "JANGOE"
  792. #define DEVICE "WIFI_RELAY_NC"
  793. // Buttons
  794. #define BUTTON1_PIN 12
  795. #define BUTTON2_PIN 13
  796. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  797. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  798. #define BUTTON1_RELAY 1
  799. #define BUTTON2_RELAY 2
  800. // Relays
  801. #define RELAY1_PIN 2
  802. #define RELAY2_PIN 14
  803. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  804. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  805. #elif defined(JANGOE_WIFI_RELAY_NO)
  806. // Info
  807. #define MANUFACTURER "JANGOE"
  808. #define DEVICE "WIFI_RELAY_NO"
  809. // Buttons
  810. #define BUTTON1_PIN 12
  811. #define BUTTON2_PIN 13
  812. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  813. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  814. #define BUTTON1_RELAY 1
  815. #define BUTTON2_RELAY 2
  816. // Relays
  817. #define RELAY1_PIN 2
  818. #define RELAY2_PIN 14
  819. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  820. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  821. // -----------------------------------------------------------------------------
  822. // Jorge García Wifi+Relays Board Kit
  823. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  824. // https://github.com/jorgegarciadev/wifikit
  825. // -----------------------------------------------------------------------------
  826. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  827. // Info
  828. #define MANUFACTURER "JORGEGARCIA"
  829. #define DEVICE "WIFI_RELAYS"
  830. // Relays
  831. #define RELAY1_PIN 0
  832. #define RELAY2_PIN 2
  833. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  834. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  835. // -----------------------------------------------------------------------------
  836. // WiFi MQTT Relay / Thermostat
  837. // -----------------------------------------------------------------------------
  838. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  839. // Info
  840. #define MANUFACTURER "OPENENERGYMONITOR"
  841. #define DEVICE "MQTT_RELAY"
  842. // Buttons
  843. #define BUTTON1_PIN 0
  844. #define BUTTON1_RELAY 1
  845. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  846. // Relays
  847. #define RELAY1_PIN 12
  848. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  849. // LEDs
  850. #define LED1_PIN 16
  851. #define LED1_PIN_INVERSE 0
  852. // -----------------------------------------------------------------------------
  853. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  854. // 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
  855. // 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
  856. // -----------------------------------------------------------------------------
  857. #elif defined(WION_50055)
  858. // Currently untested, does not support energy monitoring
  859. // Info
  860. #define MANUFACTURER "WION"
  861. #define DEVICE "50055"
  862. // Buttons
  863. #define BUTTON1_PIN 13
  864. #define BUTTON1_RELAY 1
  865. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  866. // Relays
  867. #define RELAY1_PIN 15
  868. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  869. // LEDs
  870. #define LED1_PIN 2
  871. #define LED1_PIN_INVERSE 0
  872. // -----------------------------------------------------------------------------
  873. // EX-Store Wifi Relay v3.1
  874. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  875. // -----------------------------------------------------------------------------
  876. #elif defined(EXS_WIFI_RELAY_V31)
  877. // Untested
  878. // Info
  879. #define MANUFACTURER "EXS"
  880. #define DEVICE "WIFI_RELAY_V31"
  881. // Buttons
  882. #define BUTTON1_PIN 0
  883. #define BUTTON1_RELAY 1
  884. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  885. // Relays
  886. #define RELAY1_PIN 13
  887. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  888. #define RELAY1_RESET_PIN 12
  889. // -----------------------------------------------------------------------------
  890. // V9261F
  891. // -----------------------------------------------------------------------------
  892. #elif defined(GENERIC_V9261F)
  893. // Info
  894. #define MANUFACTURER "GENERIC"
  895. #define DEVICE "V9261F"
  896. #define ALEXA_SUPPORT 0
  897. // V9261F
  898. #define V9261F_SUPPORT 1
  899. #define V9261F_PIN 2
  900. #define V9261F_PIN_INVERSE 1
  901. // -----------------------------------------------------------------------------
  902. // ECH1560
  903. // -----------------------------------------------------------------------------
  904. #elif defined(GENERIC_ECH1560)
  905. // Info
  906. #define MANUFACTURER "GENERIC"
  907. #define DEVICE "ECH1560"
  908. #define ALEXA_SUPPORT 0
  909. // ECH1560
  910. #define ECH1560_SUPPORT 1
  911. #define ECH1560_CLK_PIN 4
  912. #define ECH1560_MISO_PIN 5
  913. #define ECH1560_INVERTED 0
  914. // -----------------------------------------------------------------------------
  915. // ESPLive
  916. // https://github.com/ManCaveMade/ESP-Live
  917. // -----------------------------------------------------------------------------
  918. #elif defined(MANCAVEMADE_ESPLIVE)
  919. // Info
  920. #define MANUFACTURER "MANCAVEMADE"
  921. #define DEVICE "ESPLIVE"
  922. // Buttons
  923. #define BUTTON1_PIN 4
  924. #define BUTTON2_PIN 5
  925. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  926. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  927. #define BUTTON1_RELAY 1
  928. #define BUTTON2_RELAY 2
  929. // Relays
  930. #define RELAY1_PIN 12
  931. #define RELAY2_PIN 13
  932. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  933. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  934. // DB18B20
  935. #ifndef DALLAS_SUPPORT
  936. #define DALLAS_SUPPORT 1
  937. #endif
  938. #define DALLAS_PIN 2
  939. #define DALLAS_UPDATE_INTERVAL 5000
  940. #define TEMPERATURE_MIN_CHANGE 1.0
  941. // -----------------------------------------------------------------------------
  942. // QuinLED
  943. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  944. // -----------------------------------------------------------------------------
  945. #elif defined(INTERMITTECH_QUINLED)
  946. // Info
  947. #define MANUFACTURER "INTERMITTECH"
  948. #define DEVICE "QUINLED"
  949. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  950. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  951. #define DUMMY_RELAY_COUNT 1
  952. // LEDs
  953. #define LED1_PIN 5
  954. #define LED1_PIN_INVERSE 1
  955. // Light
  956. #define LIGHT_CHANNELS 2
  957. #define LIGHT_CH1_PIN 0
  958. #define LIGHT_CH2_PIN 2
  959. #define LIGHT_CH1_INVERSE 0
  960. #define LIGHT_CH2_INVERSE 0
  961. // -----------------------------------------------------------------------------
  962. // Arilux AL-LC06
  963. // -----------------------------------------------------------------------------
  964. #elif defined(ARILUX_AL_LC01)
  965. // Info
  966. #define MANUFACTURER "ARILUX"
  967. #define DEVICE "AL_LC01"
  968. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  969. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  970. #define DUMMY_RELAY_COUNT 1
  971. // Light
  972. #define LIGHT_CHANNELS 4
  973. #define LIGHT_CH1_PIN 5 // RED
  974. #define LIGHT_CH2_PIN 12 // GREEN
  975. #define LIGHT_CH3_PIN 13 // BLUE
  976. #define LIGHT_CH4_PIN 14 // WHITE1
  977. #define LIGHT_CH1_INVERSE 0
  978. #define LIGHT_CH2_INVERSE 0
  979. #define LIGHT_CH3_INVERSE 0
  980. #define LIGHT_CH4_INVERSE 0
  981. #elif defined(ARILUX_AL_LC02)
  982. // Info
  983. #define MANUFACTURER "ARILUX"
  984. #define DEVICE "AL_LC02"
  985. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  986. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  987. #define DUMMY_RELAY_COUNT 1
  988. // Light
  989. #define LIGHT_CHANNELS 4
  990. #define LIGHT_CH1_PIN 12 // RED
  991. #define LIGHT_CH2_PIN 5 // GREEN
  992. #define LIGHT_CH3_PIN 13 // BLUE
  993. #define LIGHT_CH4_PIN 15 // WHITE1
  994. #define LIGHT_CH1_INVERSE 0
  995. #define LIGHT_CH2_INVERSE 0
  996. #define LIGHT_CH3_INVERSE 0
  997. #define LIGHT_CH4_INVERSE 0
  998. #elif defined(ARILUX_AL_LC06)
  999. // Info
  1000. #define MANUFACTURER "ARILUX"
  1001. #define DEVICE "AL_LC06"
  1002. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1003. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1004. #define DUMMY_RELAY_COUNT 1
  1005. // Light
  1006. #define LIGHT_CHANNELS 5
  1007. #define LIGHT_CH1_PIN 14 // RED
  1008. #define LIGHT_CH2_PIN 12 // GREEN
  1009. #define LIGHT_CH3_PIN 13 // BLUE
  1010. #define LIGHT_CH4_PIN 15 // WHITE1
  1011. #define LIGHT_CH5_PIN 5 // WHITE2
  1012. #define LIGHT_CH1_INVERSE 0
  1013. #define LIGHT_CH2_INVERSE 0
  1014. #define LIGHT_CH3_INVERSE 0
  1015. #define LIGHT_CH4_INVERSE 0
  1016. #define LIGHT_CH5_INVERSE 0
  1017. #elif defined(ARILUX_AL_LC11)
  1018. // Info
  1019. #define MANUFACTURER "ARILUX"
  1020. #define DEVICE "AL_LC11"
  1021. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1022. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1023. #define DUMMY_RELAY_COUNT 1
  1024. // Light
  1025. #define LIGHT_CHANNELS 5
  1026. #define LIGHT_CH1_PIN 5 // RED
  1027. #define LIGHT_CH2_PIN 4 // GREEN
  1028. #define LIGHT_CH3_PIN 14 // BLUE
  1029. #define LIGHT_CH4_PIN 13 // WHITE1
  1030. #define LIGHT_CH5_PIN 12 // WHITE1
  1031. #define LIGHT_CH1_INVERSE 0
  1032. #define LIGHT_CH2_INVERSE 0
  1033. #define LIGHT_CH3_INVERSE 0
  1034. #define LIGHT_CH4_INVERSE 0
  1035. #define LIGHT_CH5_INVERSE 0
  1036. #elif defined(ARILUX_E27)
  1037. // Info
  1038. #define MANUFACTURER "ARILUX"
  1039. #define DEVICE "E27"
  1040. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1041. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1042. #define DUMMY_RELAY_COUNT 1
  1043. // Light
  1044. #define LIGHT_CHANNELS 4
  1045. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  1046. #define MY92XX_CHIPS 1
  1047. #define MY92XX_DI_PIN 13
  1048. #define MY92XX_DCKI_PIN 15
  1049. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1050. #define MY92XX_MAPPING 0, 1, 2, 3
  1051. // -----------------------------------------------------------------------------
  1052. // XENON SM-PW701U
  1053. // -----------------------------------------------------------------------------
  1054. #elif defined(XENON_SM_PW702U)
  1055. // Info
  1056. #define MANUFACTURER "XENON"
  1057. #define DEVICE "SM_PW702U"
  1058. // Buttons
  1059. #define BUTTON1_PIN 13
  1060. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1061. #define BUTTON1_RELAY 1
  1062. // Relays
  1063. #define RELAY1_PIN 12
  1064. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1065. // LEDs
  1066. #define LED1_PIN 4
  1067. #define LED1_PIN_INVERSE 1
  1068. // -----------------------------------------------------------------------------
  1069. // AUTHOMETION LYT8266
  1070. // https://authometion.com/shop/en/home/13-lyt8266.html
  1071. // -----------------------------------------------------------------------------
  1072. #elif defined(AUTHOMETION_LYT8266)
  1073. // Info
  1074. #define MANUFACTURER "AUTHOMETION"
  1075. #define DEVICE "LYT8266"
  1076. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1077. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1078. #define DUMMY_RELAY_COUNT 1
  1079. // Light
  1080. #define LIGHT_CHANNELS 4
  1081. #define LIGHT_CH1_PIN 13 // RED
  1082. #define LIGHT_CH2_PIN 12 // GREEN
  1083. #define LIGHT_CH3_PIN 14 // BLUE
  1084. #define LIGHT_CH4_PIN 2 // WHITE
  1085. #define LIGHT_CH1_INVERSE 0
  1086. #define LIGHT_CH2_INVERSE 0
  1087. #define LIGHT_CH3_INVERSE 0
  1088. #define LIGHT_CH4_INVERSE 0
  1089. #define LIGHT_ENABLE_PIN 15
  1090. // -----------------------------------------------------------------------------
  1091. // Generic 8CH
  1092. // -----------------------------------------------------------------------------
  1093. #elif defined(GENERIC_8CH)
  1094. // Info
  1095. #define MANUFACTURER "GENERIC"
  1096. #define DEVICE "8CH"
  1097. // Relays
  1098. #define RELAY1_PIN 0
  1099. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1100. #define RELAY2_PIN 2
  1101. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1102. #define RELAY3_PIN 4
  1103. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1104. #define RELAY4_PIN 5
  1105. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1106. #define RELAY5_PIN 12
  1107. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1108. #define RELAY6_PIN 13
  1109. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  1110. #define RELAY7_PIN 14
  1111. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  1112. #define RELAY8_PIN 15
  1113. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  1114. // -----------------------------------------------------------------------------
  1115. #elif defined(UARTtoMQTT)
  1116. // Info
  1117. #define MANUFACTURER "Albert"
  1118. #define DEVICE "UARTtoMQTT_experiment"
  1119. #define SERIAL_BAUDRATE 115200
  1120. // Remove UART noise on serial line
  1121. #define TERMINAL_SUPPORT 0
  1122. #define DEBUG_SERIAL_SUPPORT 0
  1123. // Buttons
  1124. #define BUTTON1_PIN 0
  1125. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1126. // LEDs
  1127. #define LED1_PIN 1
  1128. #define LED1_PIN_INVERSE 1
  1129. // -----------------------------------------------------------------------------
  1130. #endif
  1131. // -----------------------------------------------------------------------------
  1132. // Check definitions
  1133. // -----------------------------------------------------------------------------
  1134. #if not defined(MANUFACTURER) || not defined(DEVICE)
  1135. #error "UNSUPPORTED HARDWARE!!"
  1136. #endif