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.

2047 lines
63 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
6 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 8 relays)
  15. // RELAY#_TYPE: Relay can be RELAY_TYPE_NORMAL, RELAY_TYPE_INVERSE, RELAY_TYPE_LATCHED or RELAY_TYPE_LATCHED_INVERSE
  16. // LED#_PIN: GPIO for the n-th LED (1-based, up to 8 LEDs)
  17. // LED#_PIN_INVERSE: LED has inversed logic (lit when pulled down)
  18. // LED#_MODE: Check general.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. // -----------------------------------------------------------------------------
  86. // ESPurna
  87. // -----------------------------------------------------------------------------
  88. #elif defined(TINKERMAN_ESPURNA_H06)
  89. // Info
  90. #define MANUFACTURER "TINKERMAN"
  91. #define DEVICE "ESPURNA_H06"
  92. // Buttons
  93. #define BUTTON1_PIN 4
  94. #define BUTTON1_RELAY 1
  95. // Normal pushbutton
  96. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  97. // Relays
  98. #define RELAY1_PIN 12
  99. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  100. // LEDs
  101. #define LED1_PIN 2
  102. #define LED1_PIN_INVERSE 1
  103. // HLW8012
  104. #ifndef HLW8012_SUPPORT
  105. #define HLW8012_SUPPORT 1
  106. #endif
  107. #define HLW8012_SEL_PIN 2
  108. #define HLW8012_CF1_PIN 13
  109. #define HLW8012_CF_PIN 14
  110. #elif defined(TINKERMAN_ESPURNA_H08)
  111. // Info
  112. #define MANUFACTURER "TINKERMAN"
  113. #define DEVICE "ESPURNA_H08"
  114. // Buttons
  115. #define BUTTON1_PIN 4
  116. #define BUTTON1_RELAY 1
  117. // Normal pushbutton
  118. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  119. // Relays
  120. #define RELAY1_PIN 12
  121. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  122. // LEDs
  123. #define LED1_PIN 2
  124. #define LED1_PIN_INVERSE 0
  125. // HLW8012
  126. #ifndef HLW8012_SUPPORT
  127. #define HLW8012_SUPPORT 1
  128. #endif
  129. #define HLW8012_SEL_PIN 5
  130. #define HLW8012_CF1_PIN 13
  131. #define HLW8012_CF_PIN 14
  132. #elif defined(TINKERMAN_ESPURNA_SWITCH)
  133. // Info
  134. #define MANUFACTURER "TINKERMAN"
  135. #define DEVICE "ESPURNA_SWITCH"
  136. // Buttons
  137. #define BUTTON1_PIN 4
  138. #define BUTTON1_RELAY 1
  139. // Touch button
  140. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  141. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  142. #define BUTTON1_CLICK BUTTON_MODE_NONE
  143. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  144. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  145. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  146. // LEDs
  147. #define LED1_PIN 2
  148. #define LED1_PIN_INVERSE 0
  149. // Relays
  150. #define RELAY1_PIN 12
  151. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  152. // -----------------------------------------------------------------------------
  153. // Itead Studio boards
  154. // -----------------------------------------------------------------------------
  155. #elif defined(ITEAD_SONOFF_BASIC)
  156. // Info
  157. #define MANUFACTURER "ITEAD"
  158. #define DEVICE "SONOFF_BASIC"
  159. // Buttons
  160. #define BUTTON1_PIN 0
  161. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  162. #define BUTTON1_RELAY 1
  163. #define BUTTON2_PIN 14
  164. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  165. #define BUTTON2_RELAY 1
  166. // Relays
  167. #define RELAY1_PIN 12
  168. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  169. // LEDs
  170. #define LED1_PIN 13
  171. #define LED1_PIN_INVERSE 1
  172. #elif defined(ITEAD_SONOFF_RF)
  173. // Info
  174. #define MANUFACTURER "ITEAD"
  175. #define DEVICE "SONOFF_RF"
  176. // Buttons
  177. #define BUTTON1_PIN 0
  178. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  179. #define BUTTON1_RELAY 1
  180. #define BUTTON2_PIN 14
  181. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  182. #define BUTTON2_RELAY 1
  183. // Relays
  184. #define RELAY1_PIN 12
  185. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  186. // LEDs
  187. #define LED1_PIN 13
  188. #define LED1_PIN_INVERSE 1
  189. #elif defined(ITEAD_SONOFF_TH)
  190. // Info
  191. #define MANUFACTURER "ITEAD"
  192. #define DEVICE "SONOFF_TH"
  193. // Buttons
  194. #define BUTTON1_PIN 0
  195. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  196. #define BUTTON1_RELAY 1
  197. // Relays
  198. #define RELAY1_PIN 12
  199. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  200. // LEDs
  201. #define LED1_PIN 13
  202. #define LED1_PIN_INVERSE 1
  203. // Jack is connected to GPIO14 (and with a small hack to GPIO4)
  204. #ifndef DALLAS_SUPPORT
  205. #define DALLAS_SUPPORT 1
  206. #endif
  207. #define DALLAS_PIN 14
  208. #ifndef DHT_SUPPORT
  209. #define DHT_SUPPORT 1
  210. #endif
  211. #define DHT_PIN 14
  212. //#define I2C_SDA_PIN 4
  213. //#define I2C_SCL_PIN 14
  214. #elif defined(ITEAD_SONOFF_SV)
  215. // Info
  216. #define MANUFACTURER "ITEAD"
  217. #define DEVICE "SONOFF_SV"
  218. // Buttons
  219. #define BUTTON1_PIN 0
  220. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  221. #define BUTTON1_RELAY 1
  222. // Relays
  223. #define RELAY1_PIN 12
  224. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  225. // LEDs
  226. #define LED1_PIN 13
  227. #define LED1_PIN_INVERSE 1
  228. #elif defined(ITEAD_SLAMPHER)
  229. // Info
  230. #define MANUFACTURER "ITEAD"
  231. #define DEVICE "SLAMPHER"
  232. // Buttons
  233. #define BUTTON1_PIN 0
  234. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  235. #define BUTTON1_RELAY 1
  236. // Relays
  237. #define RELAY1_PIN 12
  238. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  239. // LEDs
  240. #define LED1_PIN 13
  241. #define LED1_PIN_INVERSE 1
  242. #elif defined(ITEAD_S20)
  243. // Info
  244. #define MANUFACTURER "ITEAD"
  245. #define DEVICE "S20"
  246. // Buttons
  247. #define BUTTON1_PIN 0
  248. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  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_TOUCH)
  257. // Info
  258. #define MANUFACTURER "ITEAD"
  259. #define DEVICE "SONOFF_TOUCH"
  260. // Buttons
  261. #define BUTTON1_PIN 0
  262. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  263. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  264. #define BUTTON1_CLICK BUTTON_MODE_NONE
  265. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  266. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  267. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  268. #define BUTTON1_RELAY 1
  269. // Relays
  270. #define RELAY1_PIN 12
  271. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  272. // LEDs
  273. #define LED1_PIN 13
  274. #define LED1_PIN_INVERSE 1
  275. #elif defined(ITEAD_SONOFF_POW)
  276. // Info
  277. #define MANUFACTURER "ITEAD"
  278. #define DEVICE "SONOFF_POW"
  279. // Buttons
  280. #define BUTTON1_PIN 0
  281. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  282. #define BUTTON1_RELAY 1
  283. // Relays
  284. #define RELAY1_PIN 12
  285. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  286. // LEDs
  287. #define LED1_PIN 15
  288. #define LED1_PIN_INVERSE 0
  289. // HLW8012
  290. #ifndef HLW8012_SUPPORT
  291. #define HLW8012_SUPPORT 1
  292. #endif
  293. #define HLW8012_SEL_PIN 5
  294. #define HLW8012_CF1_PIN 13
  295. #define HLW8012_CF_PIN 14
  296. #elif defined(ITEAD_SONOFF_DUAL)
  297. // Info
  298. #define MANUFACTURER "ITEAD"
  299. #define DEVICE "SONOFF_DUAL"
  300. #define SERIAL_BAUDRATE 19230
  301. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  302. #define DUMMY_RELAY_COUNT 2
  303. #define DEBUG_SERIAL_SUPPORT 0
  304. #define TERMINAL_SUPPORT 0
  305. // Buttons
  306. #define BUTTON3_RELAY 1
  307. // LEDs
  308. #define LED1_PIN 13
  309. #define LED1_PIN_INVERSE 1
  310. #elif defined(ITEAD_SONOFF_DUAL_R2)
  311. #define MANUFACTURER "ITEAD"
  312. #define DEVICE "SONOFF_DUAL_R2"
  313. // Buttons
  314. #define BUTTON1_PIN 0 // Button 0 on header
  315. #define BUTTON2_PIN 9 // Button 1 on header
  316. #define BUTTON3_PIN 10 // Physical button
  317. #define BUTTON1_RELAY 1
  318. #define BUTTON2_RELAY 2
  319. #define BUTTON3_RELAY 1
  320. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  321. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  322. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  323. // Relays
  324. #define RELAY1_PIN 12
  325. #define RELAY2_PIN 5
  326. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  327. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  328. // LEDs
  329. #define LED1_PIN 13
  330. #define LED1_PIN_INVERSE 1
  331. #elif defined(ITEAD_SONOFF_4CH)
  332. // Info
  333. #define MANUFACTURER "ITEAD"
  334. #define DEVICE "SONOFF_4CH"
  335. // Buttons
  336. #define BUTTON1_PIN 0
  337. #define BUTTON2_PIN 9
  338. #define BUTTON3_PIN 10
  339. #define BUTTON4_PIN 14
  340. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  341. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  342. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  343. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  344. #define BUTTON1_RELAY 1
  345. #define BUTTON2_RELAY 2
  346. #define BUTTON3_RELAY 3
  347. #define BUTTON4_RELAY 4
  348. // Relays
  349. #define RELAY1_PIN 12
  350. #define RELAY2_PIN 5
  351. #define RELAY3_PIN 4
  352. #define RELAY4_PIN 15
  353. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  354. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  355. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  356. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  357. // LEDs
  358. #define LED1_PIN 13
  359. #define LED1_PIN_INVERSE 1
  360. #elif defined(ITEAD_SONOFF_4CH_PRO)
  361. // Info
  362. #define MANUFACTURER "ITEAD"
  363. #define DEVICE "SONOFF_4CH_PRO"
  364. // Buttons
  365. #define BUTTON1_PIN 0
  366. #define BUTTON2_PIN 9
  367. #define BUTTON3_PIN 10
  368. #define BUTTON4_PIN 14
  369. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  370. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  371. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  372. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  373. #define BUTTON1_RELAY 1
  374. #define BUTTON2_RELAY 2
  375. #define BUTTON3_RELAY 3
  376. #define BUTTON4_RELAY 4
  377. // Sonoff 4CH Pro uses a secondary STM32 microcontroller to handle
  378. // buttons and relays, but it also forwards button presses to the ESP8285.
  379. // This allows ESPurna to handle button presses -almost- the same way
  380. // as with other devices except:
  381. // * Double click seems to break/disable the button on the STM32 side
  382. // * With S6 switch to 1 (self-locking and inching modes) everything's OK
  383. // * With S6 switch to 0 (interlock mode) if there is a relay ON
  384. // and you click on another relay button, the STM32 sends a "press"
  385. // event for the button of the first relay (to turn it OFF) but it
  386. // does not send a "release" event. It's like it's holding the
  387. // button down since you can see it is still LOW.
  388. // Whatever reason the result is that it may actually perform a
  389. // long click or long-long click.
  390. // The configuration below make the button toggle the relay on press events
  391. // and disables any possibly harmful combination with S6 set to 0.
  392. // If you are sure you will only use S6 to 1 you can comment the
  393. // BUTTON1_LNGCLICK and BUTTON1_LNGLNGCLICK options below to recover the
  394. // reset mode and factory reset functionalities, or link other actions like
  395. // AP mode in the commented line below.
  396. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  397. #define BUTTON1_CLICK BUTTON_MODE_NONE
  398. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  399. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  400. //#define BUTTON1_LNGCLICK BUTTON_MODE_AP
  401. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  402. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  403. #define BUTTON2_CLICK BUTTON_MODE_NONE
  404. #define BUTTON3_PRESS BUTTON_MODE_TOGGLE
  405. #define BUTTON3_CLICK BUTTON_MODE_NONE
  406. #define BUTTON4_PRESS BUTTON_MODE_TOGGLE
  407. #define BUTTON4_CLICK BUTTON_MODE_NONE
  408. // Relays
  409. #define RELAY1_PIN 12
  410. #define RELAY2_PIN 5
  411. #define RELAY3_PIN 4
  412. #define RELAY4_PIN 15
  413. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  414. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  415. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  416. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  417. // LEDs
  418. #define LED1_PIN 13
  419. #define LED1_PIN_INVERSE 1
  420. #elif defined(ITEAD_1CH_INCHING)
  421. // The inching functionality is managed by a misterious IC in the board.
  422. // You cannot control the inching button and functionality from the ESP8266
  423. // Besides, enabling the inching functionality using the hardware button
  424. // will result in the relay switching on and off continuously.
  425. // Fortunately the unkown IC keeps memory of the hardware inching status
  426. // so you can just disable it and forget. The inching LED must be lit.
  427. // You can still use the pulse options from the web interface
  428. // without problem.
  429. // Info
  430. #define MANUFACTURER "ITEAD"
  431. #define DEVICE "1CH_INCHING"
  432. // Buttons
  433. #define BUTTON1_PIN 0
  434. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  435. #define BUTTON1_RELAY 1
  436. // Relays
  437. #define RELAY1_PIN 12
  438. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  439. // LEDs
  440. #define LED1_PIN 13
  441. #define LED1_PIN_INVERSE 1
  442. #elif defined(ITEAD_MOTOR)
  443. // Info
  444. #define MANUFACTURER "ITEAD"
  445. #define DEVICE "MOTOR"
  446. // Buttons
  447. #define BUTTON1_PIN 0
  448. #define BUTTON1_RELAY 1
  449. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  450. // Relays
  451. #define RELAY1_PIN 12
  452. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  453. // LEDs
  454. #define LED1_PIN 13
  455. #define LED1_PIN_INVERSE 1
  456. #elif defined(ITEAD_BNSZ01)
  457. // Info
  458. #define MANUFACTURER "ITEAD"
  459. #define DEVICE "BNSZ01"
  460. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  461. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  462. #define DUMMY_RELAY_COUNT 1
  463. // LEDs
  464. #define LED1_PIN 13
  465. #define LED1_PIN_INVERSE 1
  466. // Light
  467. #define LIGHT_CHANNELS 1
  468. #define LIGHT_CH1_PIN 12
  469. #define LIGHT_CH1_INVERSE 0
  470. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  471. // Info
  472. #define MANUFACTURER "ITEAD"
  473. #define DEVICE "SONOFF_RFBRIDGE"
  474. #define SERIAL_BAUDRATE 19200
  475. #define RELAY_PROVIDER RELAY_PROVIDER_RFBRIDGE
  476. #ifndef DUMMY_RELAY_COUNT
  477. #define DUMMY_RELAY_COUNT 8
  478. #endif
  479. // Remove UART noise on serial line
  480. #define TERMINAL_SUPPORT 0
  481. #define DEBUG_SERIAL_SUPPORT 0
  482. // Buttons
  483. #define BUTTON1_PIN 0
  484. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  485. // LEDs
  486. #define LED1_PIN 13
  487. #define LED1_PIN_INVERSE 1
  488. #elif defined(ITEAD_SONOFF_B1)
  489. // Info
  490. #define MANUFACTURER "ITEAD"
  491. #define DEVICE "SONOFF_B1"
  492. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  493. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  494. #define DUMMY_RELAY_COUNT 1
  495. // Light
  496. #define LIGHT_CHANNELS 5
  497. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  498. #define MY92XX_CHIPS 2
  499. #define MY92XX_DI_PIN 12
  500. #define MY92XX_DCKI_PIN 14
  501. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  502. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  503. #elif defined(ITEAD_SONOFF_LED)
  504. // Info
  505. #define MANUFACTURER "ITEAD"
  506. #define DEVICE "SONOFF_LED"
  507. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  508. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  509. #define DUMMY_RELAY_COUNT 1
  510. // LEDs
  511. #define LED1_PIN 13
  512. #define LED1_PIN_INVERSE 1
  513. // Light
  514. #define LIGHT_CHANNELS 2
  515. #define LIGHT_CH1_PIN 12 // Cold white
  516. #define LIGHT_CH2_PIN 14 // Warm white
  517. #define LIGHT_CH1_INVERSE 0
  518. #define LIGHT_CH2_INVERSE 0
  519. #elif defined(ITEAD_SONOFF_T1_1CH)
  520. // Info
  521. #define MANUFACTURER "ITEAD"
  522. #define DEVICE "SONOFF_T1_1CH"
  523. // Buttons
  524. #define BUTTON1_PIN 0
  525. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  526. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  527. #define BUTTON1_CLICK BUTTON_MODE_NONE
  528. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  529. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  530. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  531. #define BUTTON1_RELAY 1
  532. // Relays
  533. #define RELAY1_PIN 12
  534. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  535. // LEDs
  536. #define LED1_PIN 13
  537. #define LED1_PIN_INVERSE 1
  538. #elif defined(ITEAD_SONOFF_T1_2CH)
  539. // Info
  540. #define MANUFACTURER "ITEAD"
  541. #define DEVICE "SONOFF_T1_2CH"
  542. // Buttons
  543. #define BUTTON1_PIN 0
  544. #define BUTTON2_PIN 9
  545. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  546. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  547. #define BUTTON1_CLICK BUTTON_MODE_NONE
  548. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  549. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  550. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  551. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  552. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  553. #define BUTTON2_CLICK BUTTON_MODE_NONE
  554. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  555. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  556. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  557. #define BUTTON1_RELAY 1
  558. #define BUTTON2_RELAY 2
  559. // Relays
  560. #define RELAY1_PIN 12
  561. #define RELAY2_PIN 5
  562. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  563. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  564. // LEDs
  565. #define LED1_PIN 13
  566. #define LED1_PIN_INVERSE 1
  567. #elif defined(ITEAD_SONOFF_T1_3CH)
  568. // Info
  569. #define MANUFACTURER "ITEAD"
  570. #define DEVICE "SONOFF_T1_3CH"
  571. // Buttons
  572. #define BUTTON1_PIN 0
  573. #define BUTTON2_PIN 9
  574. #define BUTTON3_PIN 10
  575. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  576. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  577. #define BUTTON1_CLICK BUTTON_MODE_NONE
  578. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  579. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  580. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  581. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  582. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  583. #define BUTTON2_CLICK BUTTON_MODE_NONE
  584. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  585. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  586. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  587. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  588. #define BUTTON3_PRESS BUTTON_MODE_TOGGLE
  589. #define BUTTON3_CLICK BUTTON_MODE_NONE
  590. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  591. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  592. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_RESET
  593. #define BUTTON1_RELAY 1
  594. #define BUTTON2_RELAY 2
  595. #define BUTTON3_RELAY 3
  596. // Relays
  597. #define RELAY1_PIN 12
  598. #define RELAY2_PIN 5
  599. #define RELAY3_PIN 4
  600. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  601. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  602. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  603. // LEDs
  604. #define LED1_PIN 13
  605. #define LED1_PIN_INVERSE 1
  606. #elif defined(ITEAD_SONOFF_S31)
  607. // Info
  608. #define MANUFACTURER "ITEAD"
  609. #define DEVICE "SONOFF_S31"
  610. // Buttons
  611. #define BUTTON1_PIN 0
  612. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  613. #define BUTTON1_RELAY 1
  614. // Relays
  615. #define RELAY1_PIN 12
  616. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  617. // LEDs
  618. #define LED1_PIN 13
  619. #define LED1_PIN_INVERSE 1
  620. // Disable UART noise
  621. #define TERMINAL_SUPPORT 0
  622. #define DEBUG_SERIAL_SUPPORT 0
  623. // CSE7766
  624. #define CSE7766_SUPPORT 1
  625. #define CSE7766_PIN 1
  626. // -----------------------------------------------------------------------------
  627. // YJZK
  628. // -----------------------------------------------------------------------------
  629. #elif defined(YJZK_SWITCH_2CH)
  630. // Info
  631. #define MANUFACTURER "YJZK"
  632. #define DEVICE "SWITCH_2CH"
  633. // Buttons
  634. #define BUTTON1_PIN 0
  635. #define BUTTON2_PIN 9
  636. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  637. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  638. #define BUTTON1_RELAY 1
  639. #define BUTTON2_RELAY 2
  640. // Relays
  641. #define RELAY1_PIN 12
  642. #define RELAY2_PIN 5
  643. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  644. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  645. // LEDs
  646. #define LED1_PIN 13
  647. #define LED1_PIN_INVERSE 0
  648. // -----------------------------------------------------------------------------
  649. // Electrodragon boards
  650. // -----------------------------------------------------------------------------
  651. #elif defined(ELECTRODRAGON_WIFI_IOT)
  652. // Info
  653. #define MANUFACTURER "ELECTRODRAGON"
  654. #define DEVICE "WIFI_IOT"
  655. // Buttons
  656. #define BUTTON1_PIN 0
  657. #define BUTTON2_PIN 2
  658. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  659. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  660. #define BUTTON1_RELAY 1
  661. #define BUTTON2_RELAY 2
  662. // Relays
  663. #define RELAY1_PIN 12
  664. #define RELAY2_PIN 13
  665. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  666. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  667. // LEDs
  668. #define LED1_PIN 16
  669. #define LED1_PIN_INVERSE 0
  670. // -----------------------------------------------------------------------------
  671. // WorkChoice ecoPlug
  672. // -----------------------------------------------------------------------------
  673. #elif defined(WORKCHOICE_ECOPLUG)
  674. // Info
  675. #define MANUFACTURER "WORKCHOICE"
  676. #define DEVICE "ECOPLUG"
  677. // Buttons
  678. #define BUTTON1_PIN 13
  679. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  680. #define BUTTON1_RELAY 1
  681. // Relays
  682. #define RELAY1_PIN 15
  683. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  684. // LEDs
  685. #define LED1_PIN 2
  686. #define LED1_PIN_INVERSE 0
  687. // -----------------------------------------------------------------------------
  688. // AI Thinker
  689. // -----------------------------------------------------------------------------
  690. #elif defined(AITHINKER_AI_LIGHT)
  691. // Info
  692. #define MANUFACTURER "AITHINKER"
  693. #define DEVICE "AI_LIGHT"
  694. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  695. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  696. #define DUMMY_RELAY_COUNT 1
  697. // Light
  698. #define LIGHT_CHANNELS 4
  699. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  700. #define MY92XX_CHIPS 1
  701. #define MY92XX_DI_PIN 13
  702. #define MY92XX_DCKI_PIN 15
  703. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  704. #define MY92XX_MAPPING 0, 1, 2, 3
  705. // -----------------------------------------------------------------------------
  706. // LED Controller
  707. // -----------------------------------------------------------------------------
  708. #elif defined(MAGICHOME_LED_CONTROLLER)
  709. // Info
  710. #define MANUFACTURER "MAGICHOME"
  711. #define DEVICE "LED_CONTROLLER"
  712. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  713. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  714. #define DUMMY_RELAY_COUNT 1
  715. // LEDs
  716. #define LED1_PIN 2
  717. #define LED1_PIN_INVERSE 1
  718. // Light
  719. #define LIGHT_CHANNELS 4
  720. #define LIGHT_CH1_PIN 14 // RED
  721. #define LIGHT_CH2_PIN 5 // GREEN
  722. #define LIGHT_CH3_PIN 12 // BLUE
  723. #define LIGHT_CH4_PIN 13 // WHITE
  724. #define LIGHT_CH1_INVERSE 0
  725. #define LIGHT_CH2_INVERSE 0
  726. #define LIGHT_CH3_INVERSE 0
  727. #define LIGHT_CH4_INVERSE 0
  728. // IR
  729. #define IR_SUPPORT 1
  730. #define IR_PIN 4
  731. #define IR_BUTTON_SET 1
  732. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  733. // Info
  734. #define MANUFACTURER "MAGICHOME"
  735. #define DEVICE "LED_CONTROLLER_20"
  736. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  737. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  738. #define DUMMY_RELAY_COUNT 1
  739. // LEDs
  740. #define LED1_PIN 2
  741. #define LED1_PIN_INVERSE 1
  742. // Light
  743. #define LIGHT_CHANNELS 4
  744. #define LIGHT_CH1_PIN 5 // RED
  745. #define LIGHT_CH2_PIN 12 // GREEN
  746. #define LIGHT_CH3_PIN 13 // BLUE
  747. #define LIGHT_CH4_PIN 15 // WHITE
  748. #define LIGHT_CH1_INVERSE 0
  749. #define LIGHT_CH2_INVERSE 0
  750. #define LIGHT_CH3_INVERSE 0
  751. #define LIGHT_CH4_INVERSE 0
  752. // IR
  753. #define IR_SUPPORT 1
  754. #define IR_PIN 4
  755. #define IR_BUTTON_SET 1
  756. // -----------------------------------------------------------------------------
  757. // HUACANXING H801 & H802
  758. // -----------------------------------------------------------------------------
  759. #elif defined(HUACANXING_H801)
  760. // Info
  761. #define MANUFACTURER "HUACANXING"
  762. #define DEVICE "H801"
  763. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  764. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  765. #define DUMMY_RELAY_COUNT 1
  766. #define DEBUG_PORT Serial1
  767. #define SERIAL_RX_ENABLED 1
  768. // LEDs
  769. #define LED1_PIN 5
  770. #define LED1_PIN_INVERSE 1
  771. // Light
  772. #define LIGHT_CHANNELS 5
  773. #define LIGHT_CH1_PIN 15 // RED
  774. #define LIGHT_CH2_PIN 13 // GREEN
  775. #define LIGHT_CH3_PIN 12 // BLUE
  776. #define LIGHT_CH4_PIN 14 // WHITE1
  777. #define LIGHT_CH5_PIN 4 // WHITE2
  778. #define LIGHT_CH1_INVERSE 0
  779. #define LIGHT_CH2_INVERSE 0
  780. #define LIGHT_CH3_INVERSE 0
  781. #define LIGHT_CH4_INVERSE 0
  782. #define LIGHT_CH5_INVERSE 0
  783. #elif defined(HUACANXING_H802)
  784. // Info
  785. #define MANUFACTURER "HUACANXING"
  786. #define DEVICE "H802"
  787. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  788. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  789. #define DUMMY_RELAY_COUNT 1
  790. #define DEBUG_PORT Serial1
  791. #define SERIAL_RX_ENABLED 1
  792. // Light
  793. #define LIGHT_CHANNELS 4
  794. #define LIGHT_CH1_PIN 12 // RED
  795. #define LIGHT_CH2_PIN 14 // GREEN
  796. #define LIGHT_CH3_PIN 13 // BLUE
  797. #define LIGHT_CH4_PIN 15 // WHITE
  798. #define LIGHT_CH1_INVERSE 0
  799. #define LIGHT_CH2_INVERSE 0
  800. #define LIGHT_CH3_INVERSE 0
  801. #define LIGHT_CH4_INVERSE 0
  802. // -----------------------------------------------------------------------------
  803. // Jan Goedeke Wifi Relay
  804. // https://github.com/JanGoe/esp8266-wifi-relay
  805. // -----------------------------------------------------------------------------
  806. #elif defined(JANGOE_WIFI_RELAY_NC)
  807. // Info
  808. #define MANUFACTURER "JANGOE"
  809. #define DEVICE "WIFI_RELAY_NC"
  810. // Buttons
  811. #define BUTTON1_PIN 12
  812. #define BUTTON2_PIN 13
  813. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  814. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  815. #define BUTTON1_RELAY 1
  816. #define BUTTON2_RELAY 2
  817. // Relays
  818. #define RELAY1_PIN 2
  819. #define RELAY2_PIN 14
  820. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  821. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  822. #elif defined(JANGOE_WIFI_RELAY_NO)
  823. // Info
  824. #define MANUFACTURER "JANGOE"
  825. #define DEVICE "WIFI_RELAY_NO"
  826. // Buttons
  827. #define BUTTON1_PIN 12
  828. #define BUTTON2_PIN 13
  829. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  830. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  831. #define BUTTON1_RELAY 1
  832. #define BUTTON2_RELAY 2
  833. // Relays
  834. #define RELAY1_PIN 2
  835. #define RELAY2_PIN 14
  836. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  837. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  838. // -----------------------------------------------------------------------------
  839. // Jorge García Wifi+Relays Board Kit
  840. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  841. // https://github.com/jorgegarciadev/wifikit
  842. // -----------------------------------------------------------------------------
  843. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  844. // Info
  845. #define MANUFACTURER "JORGEGARCIA"
  846. #define DEVICE "WIFI_RELAYS"
  847. // Relays
  848. #define RELAY1_PIN 0
  849. #define RELAY2_PIN 2
  850. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  851. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  852. // -----------------------------------------------------------------------------
  853. // WiFi MQTT Relay / Thermostat
  854. // -----------------------------------------------------------------------------
  855. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  856. // Info
  857. #define MANUFACTURER "OPENENERGYMONITOR"
  858. #define DEVICE "MQTT_RELAY"
  859. // Buttons
  860. #define BUTTON1_PIN 0
  861. #define BUTTON1_RELAY 1
  862. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  863. // Relays
  864. #define RELAY1_PIN 12
  865. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  866. // LEDs
  867. #define LED1_PIN 16
  868. #define LED1_PIN_INVERSE 0
  869. // -----------------------------------------------------------------------------
  870. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  871. // 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
  872. // 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
  873. // -----------------------------------------------------------------------------
  874. #elif defined(WION_50055)
  875. // Currently untested, does not support energy monitoring
  876. // Info
  877. #define MANUFACTURER "WION"
  878. #define DEVICE "50055"
  879. // Buttons
  880. #define BUTTON1_PIN 13
  881. #define BUTTON1_RELAY 1
  882. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  883. // Relays
  884. #define RELAY1_PIN 15
  885. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  886. // LEDs
  887. #define LED1_PIN 2
  888. #define LED1_PIN_INVERSE 0
  889. // -----------------------------------------------------------------------------
  890. // EX-Store Wifi Relay v3.1
  891. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  892. // -----------------------------------------------------------------------------
  893. #elif defined(EXS_WIFI_RELAY_V31)
  894. // Untested
  895. // Info
  896. #define MANUFACTURER "EXS"
  897. #define DEVICE "WIFI_RELAY_V31"
  898. // Buttons
  899. #define BUTTON1_PIN 0
  900. #define BUTTON1_RELAY 1
  901. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  902. // Relays
  903. #define RELAY1_PIN 13
  904. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  905. #define RELAY1_RESET_PIN 12
  906. // -----------------------------------------------------------------------------
  907. // V9261F
  908. // -----------------------------------------------------------------------------
  909. #elif defined(GENERIC_V9261F)
  910. // Info
  911. #define MANUFACTURER "GENERIC"
  912. #define DEVICE "V9261F"
  913. #define ALEXA_SUPPORT 0
  914. // V9261F
  915. #define V9261F_SUPPORT 1
  916. #define V9261F_PIN 2
  917. #define V9261F_PIN_INVERSE 1
  918. // -----------------------------------------------------------------------------
  919. // ECH1560
  920. // -----------------------------------------------------------------------------
  921. #elif defined(GENERIC_ECH1560)
  922. // Info
  923. #define MANUFACTURER "GENERIC"
  924. #define DEVICE "ECH1560"
  925. #define ALEXA_SUPPORT 0
  926. // ECH1560
  927. #define ECH1560_SUPPORT 1
  928. #define ECH1560_CLK_PIN 4
  929. #define ECH1560_MISO_PIN 5
  930. #define ECH1560_INVERTED 0
  931. // -----------------------------------------------------------------------------
  932. // ESPLive
  933. // https://github.com/ManCaveMade/ESP-Live
  934. // -----------------------------------------------------------------------------
  935. #elif defined(MANCAVEMADE_ESPLIVE)
  936. // Info
  937. #define MANUFACTURER "MANCAVEMADE"
  938. #define DEVICE "ESPLIVE"
  939. // Buttons
  940. #define BUTTON1_PIN 4
  941. #define BUTTON2_PIN 5
  942. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  943. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  944. #define BUTTON1_RELAY 1
  945. #define BUTTON2_RELAY 2
  946. // Relays
  947. #define RELAY1_PIN 12
  948. #define RELAY2_PIN 13
  949. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  950. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  951. // DS18B20
  952. #ifndef DALLAS_SUPPORT
  953. #define DALLAS_SUPPORT 1
  954. #endif
  955. #define DALLAS_PIN 2
  956. #define DALLAS_UPDATE_INTERVAL 5000
  957. #define TEMPERATURE_MIN_CHANGE 1.0
  958. // -----------------------------------------------------------------------------
  959. // QuinLED
  960. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  961. // -----------------------------------------------------------------------------
  962. #elif defined(INTERMITTECH_QUINLED)
  963. // Info
  964. #define MANUFACTURER "INTERMITTECH"
  965. #define DEVICE "QUINLED"
  966. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  967. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  968. #define DUMMY_RELAY_COUNT 1
  969. // LEDs
  970. #define LED1_PIN 5
  971. #define LED1_PIN_INVERSE 1
  972. // Light
  973. #define LIGHT_CHANNELS 2
  974. #define LIGHT_CH1_PIN 0
  975. #define LIGHT_CH2_PIN 2
  976. #define LIGHT_CH1_INVERSE 0
  977. #define LIGHT_CH2_INVERSE 0
  978. // -----------------------------------------------------------------------------
  979. // Arilux AL-LC06
  980. // -----------------------------------------------------------------------------
  981. #elif defined(ARILUX_AL_LC01)
  982. // Info
  983. #define MANUFACTURER "ARILUX"
  984. #define DEVICE "AL_LC01"
  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 5 // RED
  991. #define LIGHT_CH2_PIN 12 // GREEN
  992. #define LIGHT_CH3_PIN 13 // BLUE
  993. #define LIGHT_CH4_PIN 14 // 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_LC02)
  999. // Info
  1000. #define MANUFACTURER "ARILUX"
  1001. #define DEVICE "AL_LC02"
  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 4
  1007. #define LIGHT_CH1_PIN 12 // RED
  1008. #define LIGHT_CH2_PIN 5 // GREEN
  1009. #define LIGHT_CH3_PIN 13 // BLUE
  1010. #define LIGHT_CH4_PIN 15 // WHITE1
  1011. #define LIGHT_CH1_INVERSE 0
  1012. #define LIGHT_CH2_INVERSE 0
  1013. #define LIGHT_CH3_INVERSE 0
  1014. #define LIGHT_CH4_INVERSE 0
  1015. #elif defined(ARILUX_AL_LC06)
  1016. // Info
  1017. #define MANUFACTURER "ARILUX"
  1018. #define DEVICE "AL_LC06"
  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 14 // RED
  1025. #define LIGHT_CH2_PIN 12 // GREEN
  1026. #define LIGHT_CH3_PIN 13 // BLUE
  1027. #define LIGHT_CH4_PIN 15 // WHITE1
  1028. #define LIGHT_CH5_PIN 5 // WHITE2
  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_AL_LC11)
  1035. // Info
  1036. #define MANUFACTURER "ARILUX"
  1037. #define DEVICE "AL_LC11"
  1038. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1039. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1040. #define DUMMY_RELAY_COUNT 1
  1041. // Light
  1042. #define LIGHT_CHANNELS 5
  1043. #define LIGHT_CH1_PIN 5 // RED
  1044. #define LIGHT_CH2_PIN 4 // GREEN
  1045. #define LIGHT_CH3_PIN 14 // BLUE
  1046. #define LIGHT_CH4_PIN 13 // WHITE1
  1047. #define LIGHT_CH5_PIN 12 // WHITE1
  1048. #define LIGHT_CH1_INVERSE 0
  1049. #define LIGHT_CH2_INVERSE 0
  1050. #define LIGHT_CH3_INVERSE 0
  1051. #define LIGHT_CH4_INVERSE 0
  1052. #define LIGHT_CH5_INVERSE 0
  1053. #elif defined(ARILUX_E27)
  1054. // Info
  1055. #define MANUFACTURER "ARILUX"
  1056. #define DEVICE "E27"
  1057. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1058. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1059. #define DUMMY_RELAY_COUNT 1
  1060. // Light
  1061. #define LIGHT_CHANNELS 4
  1062. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  1063. #define MY92XX_CHIPS 1
  1064. #define MY92XX_DI_PIN 13
  1065. #define MY92XX_DCKI_PIN 15
  1066. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1067. #define MY92XX_MAPPING 0, 1, 2, 3
  1068. // -----------------------------------------------------------------------------
  1069. // XENON SM-PW701U
  1070. // -----------------------------------------------------------------------------
  1071. #elif defined(XENON_SM_PW702U)
  1072. // Info
  1073. #define MANUFACTURER "XENON"
  1074. #define DEVICE "SM_PW702U"
  1075. // Buttons
  1076. #define BUTTON1_PIN 13
  1077. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1078. #define BUTTON1_RELAY 1
  1079. // Relays
  1080. #define RELAY1_PIN 12
  1081. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1082. // LEDs
  1083. #define LED1_PIN 4
  1084. #define LED1_PIN_INVERSE 1
  1085. // -----------------------------------------------------------------------------
  1086. // AUTHOMETION LYT8266
  1087. // https://authometion.com/shop/en/home/13-lyt8266.html
  1088. // -----------------------------------------------------------------------------
  1089. #elif defined(AUTHOMETION_LYT8266)
  1090. // Info
  1091. #define MANUFACTURER "AUTHOMETION"
  1092. #define DEVICE "LYT8266"
  1093. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1094. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1095. #define DUMMY_RELAY_COUNT 1
  1096. // Light
  1097. #define LIGHT_CHANNELS 4
  1098. #define LIGHT_CH1_PIN 13 // RED
  1099. #define LIGHT_CH2_PIN 12 // GREEN
  1100. #define LIGHT_CH3_PIN 14 // BLUE
  1101. #define LIGHT_CH4_PIN 2 // WHITE
  1102. #define LIGHT_CH1_INVERSE 0
  1103. #define LIGHT_CH2_INVERSE 0
  1104. #define LIGHT_CH3_INVERSE 0
  1105. #define LIGHT_CH4_INVERSE 0
  1106. #define LIGHT_ENABLE_PIN 15
  1107. #elif defined(GIZWITS_WITTY_CLOUD)
  1108. // Info
  1109. #define MANUFACTURER "GIZWITS"
  1110. #define DEVICE "WITTY_CLOUD"
  1111. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1112. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1113. #define DUMMY_RELAY_COUNT 1
  1114. // Buttons
  1115. #define BUTTON1_PIN 4
  1116. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1117. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  1118. #define BUTTON1_CLICK BUTTON_MODE_NONE
  1119. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1120. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1121. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  1122. #define ANALOG_SUPPORT 1
  1123. // LEDs
  1124. #define LED1_PIN 2 // BLUE build-in
  1125. #define LED1_PIN_INVERSE 1
  1126. // Light
  1127. #define LIGHT_CHANNELS 3
  1128. #define LIGHT_CH1_PIN 15 // RED
  1129. #define LIGHT_CH2_PIN 12 // GREEN
  1130. #define LIGHT_CH3_PIN 13 // BLUE
  1131. #define LIGHT_CH1_INVERSE 0
  1132. #define LIGHT_CH2_INVERSE 0
  1133. #define LIGHT_CH3_INVERSE 0
  1134. // -----------------------------------------------------------------------------
  1135. // KMC 70011
  1136. // https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
  1137. // -----------------------------------------------------------------------------
  1138. #elif defined(KMC_70011)
  1139. // Info
  1140. #define MANUFACTURER "KMC"
  1141. #define DEVICE "70011"
  1142. // Buttons
  1143. #define BUTTON1_PIN 0
  1144. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1145. #define BUTTON1_RELAY 1
  1146. // Relays
  1147. #define RELAY1_PIN 14
  1148. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1149. // LEDs
  1150. #define LED1_PIN 13
  1151. #define LED1_PIN_INVERSE 0
  1152. // HLW8012
  1153. #ifndef HLW8012_SUPPORT
  1154. #define HLW8012_SUPPORT 1
  1155. #endif
  1156. #define HLW8012_SEL_PIN 12
  1157. #define HLW8012_CF1_PIN 5
  1158. #define HLW8012_CF_PIN 4
  1159. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1160. // -----------------------------------------------------------------------------
  1161. // Euromate (?) Wifi Stecker Shuko
  1162. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  1163. // Thanks to @Geitde
  1164. // -----------------------------------------------------------------------------
  1165. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  1166. // Info
  1167. #define MANUFACTURER "EUROMATE"
  1168. #define DEVICE "WIFI_STECKER_SCHUKO"
  1169. // Buttons
  1170. #define BUTTON1_PIN 14
  1171. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1172. #define BUTTON1_RELAY 1
  1173. // The relay in the device is not a bistable (latched) relay.
  1174. // The device is reported to have a flip-flop circuit to drive the relay
  1175. // So @Geitde hack is still the only possible
  1176. // Hack: drive GPIO12 low and use GPIO5 as normal relay pin:
  1177. #define RELAY1_PIN 5
  1178. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1179. #define LED2_PIN 12 /* DUMMY: exploit default off state for GPIO12=low */
  1180. #define LED2_PIN_INVERSE 0
  1181. // LEDs
  1182. #define LED1_PIN 4
  1183. #define LED1_PIN_INVERSE 0
  1184. // -----------------------------------------------------------------------------
  1185. // Generic 8CH
  1186. // -----------------------------------------------------------------------------
  1187. #elif defined(GENERIC_8CH)
  1188. // Info
  1189. #define MANUFACTURER "GENERIC"
  1190. #define DEVICE "8CH"
  1191. // Relays
  1192. #define RELAY1_PIN 0
  1193. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1194. #define RELAY2_PIN 2
  1195. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1196. #define RELAY3_PIN 4
  1197. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1198. #define RELAY4_PIN 5
  1199. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1200. #define RELAY5_PIN 12
  1201. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1202. #define RELAY6_PIN 13
  1203. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  1204. #define RELAY7_PIN 14
  1205. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  1206. #define RELAY8_PIN 15
  1207. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  1208. // -----------------------------------------------------------------------------
  1209. // STM RELAY
  1210. // -----------------------------------------------------------------------------
  1211. #elif defined(STM_RELAY)
  1212. // Info
  1213. #define MANUFACTURER "STM_RELAY"
  1214. #define DEVICE "2CH"
  1215. // Relays
  1216. #define DUMMY_RELAY_COUNT 2
  1217. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  1218. // Remove UART noise on serial line
  1219. #define TERMINAL_SUPPORT 0
  1220. #define DEBUG_SERIAL_SUPPORT 0
  1221. // -----------------------------------------------------------------------------
  1222. // Tonbux Powerstrip02
  1223. // -----------------------------------------------------------------------------
  1224. #elif defined(TONBUX_POWERSTRIP02)
  1225. // Info
  1226. #define MANUFACTURER "TONBUX"
  1227. #define DEVICE "POWERSTRIP02"
  1228. // Buttons
  1229. #define BUTTON1_PIN 5
  1230. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1231. #define BUTTON1_RELAY 0
  1232. // Relays
  1233. #define RELAY1_PIN 4
  1234. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1235. #define RELAY2_PIN 13
  1236. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1237. #define RELAY3_PIN 12
  1238. #define RELAY3_TYPE RELAY_TYPE_INVERSE
  1239. #define RELAY4_PIN 14
  1240. #define RELAY4_TYPE RELAY_TYPE_INVERSE
  1241. // Not a relay. USB ports on/off
  1242. #define RELAY5_PIN 16
  1243. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1244. // LEDs
  1245. #define LED1_PIN 0 // 1 blue led
  1246. #define LED1_PIN_INVERSE 1
  1247. #define LED2_PIN 3 // 3 red leds
  1248. #define LED2_PIN_INVERSE 1
  1249. // -----------------------------------------------------------------------------
  1250. // Lingan SWA1
  1251. // -----------------------------------------------------------------------------
  1252. #elif defined(LINGAN_SWA1)
  1253. // Info
  1254. #define MANUFACTURER "LINGAN"
  1255. #define DEVICE "SWA1"
  1256. // Buttons
  1257. #define BUTTON1_PIN 13
  1258. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1259. #define BUTTON1_RELAY 1
  1260. // Relays
  1261. #define RELAY1_PIN 5
  1262. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1263. // LEDs
  1264. #define LED1_PIN 4
  1265. #define LED1_PIN_INVERSE 1
  1266. // -----------------------------------------------------------------------------
  1267. // HEYGO HY02
  1268. // -----------------------------------------------------------------------------
  1269. #elif defined(HEYGO_HY02)
  1270. // Info
  1271. #define MANUFACTURER "HEYGO"
  1272. #define DEVICE "HY02"
  1273. // Buttons
  1274. #define BUTTON1_PIN 13
  1275. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1276. #define BUTTON1_RELAY 1
  1277. // Relays
  1278. #define RELAY1_PIN 12
  1279. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1280. // LEDs
  1281. #define LED1_PIN 4
  1282. #define LED1_PIN_INVERSE 0
  1283. // -----------------------------------------------------------------------------
  1284. // Maxcio W-US002S
  1285. // -----------------------------------------------------------------------------
  1286. #elif defined(MAXCIO_WUS002S)
  1287. // Info
  1288. #define MANUFACTURER "MAXCIO"
  1289. #define DEVICE "WUS002S"
  1290. // Buttons
  1291. #define BUTTON1_PIN 2
  1292. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1293. #define BUTTON1_RELAY 1
  1294. // Relays
  1295. #define RELAY1_PIN 13
  1296. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1297. // LEDs
  1298. #define LED1_PIN 3
  1299. #define LED1_PIN_INVERSE 0
  1300. // HLW8012
  1301. #ifndef HLW8012_SUPPORT
  1302. #define HLW8012_SUPPORT 1
  1303. #endif
  1304. #define HLW8012_SEL_PIN 12
  1305. #define HLW8012_CF1_PIN 5
  1306. #define HLW8012_CF_PIN 4
  1307. #define HLW8012_CURRENT_R 0.002 // Current resistor
  1308. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1309. // -----------------------------------------------------------------------------
  1310. // YiDian XS-SSA05
  1311. // -----------------------------------------------------------------------------
  1312. #elif defined(YIDIAN_XSSSA05)
  1313. // Info
  1314. #define MANUFACTURER "YIDIAN"
  1315. #define DEVICE "XSSSA05"
  1316. // Buttons
  1317. #define BUTTON1_PIN 13
  1318. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1319. #define BUTTON1_RELAY 1
  1320. // Relays
  1321. #define RELAY1_PIN 12
  1322. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1323. // LEDs
  1324. #define LED1_PIN 4
  1325. #define LED1_PIN_INVERSE 0
  1326. // HLW8012
  1327. #ifndef HLW8012_SUPPORT
  1328. #define HLW8012_SUPPORT 1
  1329. #endif
  1330. #define HLW8012_SEL_PIN 3
  1331. #define HLW8012_CF1_PIN 14
  1332. #define HLW8012_CF_PIN 5
  1333. #define HLW8012_CURRENT_R 0.001 // Current resistor
  1334. #define HLW8012_VOLTAGE_R_UP ( 2 * 1200000 ) // Upstream voltage resistor
  1335. // -----------------------------------------------------------------------------
  1336. // TONBUX XS-SSA06
  1337. // -----------------------------------------------------------------------------
  1338. #elif defined(TONBUX_XSSSA06)
  1339. // Info
  1340. #define MANUFACTURER "TONBUX"
  1341. #define DEVICE "XSSSA06"
  1342. // Buttons
  1343. #define BUTTON1_PIN 13
  1344. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1345. #define BUTTON1_RELAY 1
  1346. // Relays
  1347. #define RELAY1_PIN 15
  1348. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1349. // LEDs
  1350. #define LED1_PIN 0 // R - 8 rgb led ring
  1351. #define LED1_PIN_INVERSE 0
  1352. #define LED2_PIN 5 // G
  1353. #define LED2_PIN_INVERSE 0
  1354. #define LED3_PIN 2 // B
  1355. #define LED3_PIN_INVERSE 0
  1356. // -----------------------------------------------------------------------------
  1357. // GREEN ESP8266 RELAY MODULE
  1358. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1359. // -----------------------------------------------------------------------------
  1360. #elif defined(GREEN_ESP8266RELAY)
  1361. // Info
  1362. #define MANUFACTURER "GREEN"
  1363. #define DEVICE "ESP8266RELAY"
  1364. // Buttons
  1365. // Not a button but input via Optocoupler
  1366. #define BUTTON1_PIN 5
  1367. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1368. #define BUTTON1_RELAY 1
  1369. // Relays
  1370. #define RELAY1_PIN 4
  1371. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1372. // LEDs
  1373. #define LED1_PIN 2
  1374. #define LED1_PIN_INVERSE 1
  1375. // -----------------------------------------------------------------------------
  1376. // Henrique Gravina ESPIKE
  1377. // https://github.com/Henriquegravina/Espike
  1378. // -----------------------------------------------------------------------------
  1379. #elif defined(IKE_ESPIKE)
  1380. #define MANUFACTURER "IKE"
  1381. #define DEVICE "ESPIKE"
  1382. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1383. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1384. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1385. #define BUTTON1_PIN 13
  1386. #define BUTTON1_RELAY 1
  1387. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1388. #define BUTTON2_PIN 12
  1389. #define BUTTON2_RELAY 2
  1390. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1391. #define BUTTON3_PIN 14
  1392. #define BUTTON3_RELAY 2
  1393. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1394. #define RELAY1_PIN 4
  1395. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1396. #define RELAY2_PIN 5
  1397. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1398. #define RELAY3_PIN 16
  1399. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1400. #define LED1_PIN 2
  1401. #define LED1_PIN_INVERSE 1
  1402. // -----------------------------------------------------------------------------
  1403. // SWIFITCH
  1404. // https://github.com/ArnieX/swifitch
  1405. // -----------------------------------------------------------------------------
  1406. #elif defined(ARNIEX_SWIFITCH)
  1407. // Info
  1408. #define MANUFACTURER "ARNIEX"
  1409. #define DEVICE "SWIFITCH"
  1410. // Buttons
  1411. #define BUTTON1_PIN 4 // D2
  1412. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1413. #define BUTTON1_RELAY 1
  1414. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1415. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1416. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1417. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1418. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1419. // Relays
  1420. #define RELAY1_PIN 5 // D1
  1421. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1422. // LEDs
  1423. #define LED1_PIN 12 // D6
  1424. #define LED1_PIN_INVERSE 1
  1425. // -----------------------------------------------------------------------------
  1426. // ESP-01S RELAY v4.0
  1427. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  1428. // -----------------------------------------------------------------------------
  1429. #elif defined(GENERIC_ESP01S_RELAY_V40)
  1430. // Info
  1431. #define MANUFACTURER "GENERIC"
  1432. #define DEVICE "ESP01S_RELAY_40"
  1433. // Relays
  1434. #define RELAY1_PIN 0
  1435. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1436. // LEDs
  1437. #define LED1_PIN 2
  1438. #define LED1_PIN_INVERSE 0
  1439. // -----------------------------------------------------------------------------
  1440. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  1441. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  1442. // -----------------------------------------------------------------------------
  1443. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  1444. // Info
  1445. #define MANUFACTURER "GENERIC"
  1446. #define DEVICE "ESP01S_RGBLED_10"
  1447. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  1448. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  1449. // Buttons
  1450. //#define BUTTON1_PIN 2
  1451. // Relays
  1452. //#define RELAY1_PIN 2
  1453. // LEDs
  1454. #define LED1_PIN 2
  1455. // -----------------------------------------------------------------------------
  1456. // ESP-01S DHT11 v1.0
  1457. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  1458. // -----------------------------------------------------------------------------
  1459. #elif defined(GENERIC_ESP01S_DHT11_V10)
  1460. // Info
  1461. #define MANUFACTURER "GENERIC"
  1462. #define DEVICE "ESP01S_DHT11_10"
  1463. // DHT11
  1464. #ifndef DHT_SUPPORT
  1465. #define DHT_SUPPORT 1
  1466. #endif
  1467. #define DHT_PIN 2
  1468. // -----------------------------------------------------------------------------
  1469. // ESP-01S DS18B20 v1.0
  1470. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  1471. // -----------------------------------------------------------------------------
  1472. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  1473. // Info
  1474. #define MANUFACTURER "GENERIC"
  1475. #define DEVICE "ESP01S_DS18B20_10"
  1476. // DB18B20
  1477. #ifndef DALLAS_SUPPORT
  1478. #define DALLAS_SUPPORT 1
  1479. #endif
  1480. #define DALLAS_PIN 2
  1481. // -----------------------------------------------------------------------------
  1482. // Heltec Touch Relay
  1483. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  1484. // -----------------------------------------------------------------------------
  1485. #elif defined(HELTEC_TOUCHRELAY)
  1486. // Info
  1487. #define MANUFACTURER "HELTEC"
  1488. #define DEVICE "TOUCH_RELAY"
  1489. // Buttons
  1490. #define BUTTON1_PIN 14
  1491. #define BUTTON1_RELAY 1
  1492. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1493. // Relays
  1494. #define RELAY1_PIN 12
  1495. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1496. // -----------------------------------------------------------------------------
  1497. // TEST boards (do not use!!)
  1498. // -----------------------------------------------------------------------------
  1499. #elif defined(TRAVIS01)
  1500. // Info
  1501. #define MANUFACTURER "TravisCI"
  1502. #define DEVICE "Virtual board 01"
  1503. // Some buttons - pin 0
  1504. #define BUTTON1_PIN 0
  1505. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1506. #define BUTTON1_RELAY 1
  1507. // Some relays - pin 1
  1508. #define RELAY1_PIN 1
  1509. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1510. // Some LEDs - pin 2
  1511. #define LED1_PIN 2
  1512. #define LED1_PIN_INVERSE 1
  1513. // A bit of I2C - pins 3,4
  1514. #define I2C_SDA_PIN 3
  1515. #define I2C_SCL_PIN 4
  1516. // And, as they say in "From Dusk till Dawn":
  1517. // This is a sensor blow out!
  1518. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  1519. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  1520. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  1521. // C'mon, you want sensor, come on in sensor lovers!
  1522. // If we don’t got it, you don't want it!
  1523. #define BH1750_SUPPORT 1
  1524. #define BMX280_SUPPORT 1
  1525. #define SHT3X_I2C_SUPPORT 1
  1526. #define EMON_ADC121_SUPPORT 1
  1527. #define EMON_ADS1X15_SUPPORT 1
  1528. #define SHT3X_I2C_SUPPORT 1
  1529. #define SI7021_SUPPORT 1
  1530. // A bit of lights - pin 5
  1531. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1532. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1533. #define DUMMY_RELAY_COUNT 1
  1534. #define LIGHT_CHANNELS 1
  1535. #define LIGHT_CH1_PIN 5
  1536. #define LIGHT_CH1_INVERSE 0
  1537. // A bit of HLW8012 - pins 6,7,8
  1538. #ifndef HLW8012_SUPPORT
  1539. #define HLW8012_SUPPORT 1
  1540. #endif
  1541. #define HLW8012_SEL_PIN 6
  1542. #define HLW8012_CF1_PIN 7
  1543. #define HLW8012_CF_PIN 8
  1544. // A bit of Dallas - pin 9
  1545. #ifndef DALLAS_SUPPORT
  1546. #define DALLAS_SUPPORT 1
  1547. #endif
  1548. #define DALLAS_PIN 9
  1549. // A bit of ECH1560 - pins 10,11, 12
  1550. #ifndef ECH1560_SUPPORT
  1551. #define ECH1560_SUPPORT 1
  1552. #endif
  1553. #define ECH1560_CLK_PIN 10
  1554. #define ECH1560_MISO_PIN 11
  1555. #define ECH1560_INVERTED 12
  1556. #elif defined(TRAVIS02)
  1557. // Relay provider dual
  1558. #define MANUFACTURER "TravisCI"
  1559. #define DEVICE "Virtual board 02"
  1560. // A bit of DHT - pin 1
  1561. #ifndef DHT_SUPPORT
  1562. #define DHT_SUPPORT 1
  1563. #endif
  1564. #define DHT_PIN 1
  1565. // Relay type dual - pins 2,3
  1566. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  1567. #define RELAY1_PIN 2
  1568. #define RELAY2_PIN 3
  1569. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1570. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1571. // IR - pin 4
  1572. #define IR_SUPPORT 1
  1573. #define IR_PIN 4
  1574. #define IR_BUTTON_SET 1
  1575. #elif defined(TRAVIS03)
  1576. // Relay provider light/my92XX
  1577. #define MANUFACTURER "TravisCI"
  1578. #define DEVICE "Virtual board 03"
  1579. // MY9231 Light - pins 1,2
  1580. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1581. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1582. #define DUMMY_RELAY_COUNT 1
  1583. #define LIGHT_CHANNELS 5
  1584. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  1585. #define MY92XX_CHIPS 2
  1586. #define MY92XX_DI_PIN 1
  1587. #define MY92XX_DCKI_PIN 2
  1588. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1589. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  1590. #endif
  1591. // -----------------------------------------------------------------------------
  1592. // Check definitions
  1593. // -----------------------------------------------------------------------------
  1594. #if not defined(MANUFACTURER) || not defined(DEVICE)
  1595. #error "UNSUPPORTED HARDWARE!!"
  1596. #endif