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.

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