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.

2013 lines
62 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. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  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. #elif defined(ITEAD_SONOFF_S31)
  608. // Info
  609. #define MANUFACTURER "ITEAD"
  610. #define DEVICE "SONOFF_S31"
  611. // Buttons
  612. #define BUTTON1_PIN 0
  613. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  614. #define BUTTON1_RELAY 1
  615. // Relays
  616. #define RELAY1_PIN 12
  617. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  618. // LEDs
  619. #define LED1_PIN 13
  620. #define LED1_PIN_INVERSE 1
  621. // Disable UART noise
  622. #define TERMINAL_SUPPORT 0
  623. #define DEBUG_SERIAL_SUPPORT 0
  624. // CSE7766
  625. #define CSE7766_SUPPORT 1
  626. #define CSE7766_PIN 1
  627. // -----------------------------------------------------------------------------
  628. // YJZK
  629. // -----------------------------------------------------------------------------
  630. #elif defined(YJZK_SWITCH_2CH)
  631. // Info
  632. #define MANUFACTURER "YJZK"
  633. #define DEVICE "SWITCH_2CH"
  634. // Buttons
  635. #define BUTTON1_PIN 0
  636. #define BUTTON2_PIN 9
  637. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  638. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  639. #define BUTTON1_RELAY 1
  640. #define BUTTON2_RELAY 2
  641. // Relays
  642. #define RELAY1_PIN 12
  643. #define RELAY2_PIN 5
  644. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  645. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  646. // LEDs
  647. #define LED1_PIN 13
  648. #define LED1_PIN_INVERSE 0
  649. // -----------------------------------------------------------------------------
  650. // Electrodragon boards
  651. // -----------------------------------------------------------------------------
  652. #elif defined(ELECTRODRAGON_WIFI_IOT)
  653. // Info
  654. #define MANUFACTURER "ELECTRODRAGON"
  655. #define DEVICE "WIFI_IOT"
  656. // Buttons
  657. #define BUTTON1_PIN 0
  658. #define BUTTON2_PIN 2
  659. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  660. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  661. #define BUTTON1_RELAY 1
  662. #define BUTTON2_RELAY 2
  663. // Relays
  664. #define RELAY1_PIN 12
  665. #define RELAY2_PIN 13
  666. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  667. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  668. // LEDs
  669. #define LED1_PIN 16
  670. #define LED1_PIN_INVERSE 0
  671. // -----------------------------------------------------------------------------
  672. // WorkChoice ecoPlug
  673. // -----------------------------------------------------------------------------
  674. #elif defined(WORKCHOICE_ECOPLUG)
  675. // Info
  676. #define MANUFACTURER "WORKCHOICE"
  677. #define DEVICE "ECOPLUG"
  678. // Buttons
  679. #define BUTTON1_PIN 13
  680. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  681. #define BUTTON1_RELAY 1
  682. // Relays
  683. #define RELAY1_PIN 15
  684. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  685. // LEDs
  686. #define LED1_PIN 2
  687. #define LED1_PIN_INVERSE 0
  688. // -----------------------------------------------------------------------------
  689. // AI Thinker
  690. // -----------------------------------------------------------------------------
  691. #elif defined(AITHINKER_AI_LIGHT)
  692. // Info
  693. #define MANUFACTURER "AITHINKER"
  694. #define DEVICE "AI_LIGHT"
  695. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  696. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  697. #define DUMMY_RELAY_COUNT 1
  698. // Light
  699. #define LIGHT_CHANNELS 4
  700. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  701. #define MY92XX_CHIPS 1
  702. #define MY92XX_DI_PIN 13
  703. #define MY92XX_DCKI_PIN 15
  704. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  705. #define MY92XX_MAPPING 0, 1, 2, 3
  706. // -----------------------------------------------------------------------------
  707. // LED Controller
  708. // -----------------------------------------------------------------------------
  709. #elif defined(MAGICHOME_LED_CONTROLLER)
  710. // Info
  711. #define MANUFACTURER "MAGICHOME"
  712. #define DEVICE "LED_CONTROLLER"
  713. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  714. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  715. #define DUMMY_RELAY_COUNT 1
  716. // LEDs
  717. #define LED1_PIN 2
  718. #define LED1_PIN_INVERSE 1
  719. // Light
  720. #define LIGHT_CHANNELS 4
  721. #define LIGHT_CH1_PIN 14 // RED
  722. #define LIGHT_CH2_PIN 5 // GREEN
  723. #define LIGHT_CH3_PIN 12 // BLUE
  724. #define LIGHT_CH4_PIN 13 // WHITE
  725. #define LIGHT_CH1_INVERSE 0
  726. #define LIGHT_CH2_INVERSE 0
  727. #define LIGHT_CH3_INVERSE 0
  728. #define LIGHT_CH4_INVERSE 0
  729. // IR
  730. #define IR_SUPPORT 1
  731. #define IR_PIN 4
  732. #define IR_BUTTON_SET 1
  733. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  734. // Info
  735. #define MANUFACTURER "MAGICHOME"
  736. #define DEVICE "LED_CONTROLLER_20"
  737. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  738. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  739. #define DUMMY_RELAY_COUNT 1
  740. // LEDs
  741. #define LED1_PIN 2
  742. #define LED1_PIN_INVERSE 1
  743. // Light
  744. #define LIGHT_CHANNELS 4
  745. #define LIGHT_CH1_PIN 5 // RED
  746. #define LIGHT_CH2_PIN 12 // GREEN
  747. #define LIGHT_CH3_PIN 13 // BLUE
  748. #define LIGHT_CH4_PIN 15 // WHITE
  749. #define LIGHT_CH1_INVERSE 0
  750. #define LIGHT_CH2_INVERSE 0
  751. #define LIGHT_CH3_INVERSE 0
  752. #define LIGHT_CH4_INVERSE 0
  753. // IR
  754. #define IR_SUPPORT 1
  755. #define IR_PIN 4
  756. #define IR_BUTTON_SET 1
  757. // -----------------------------------------------------------------------------
  758. // HUACANXING H801 & H802
  759. // -----------------------------------------------------------------------------
  760. #elif defined(HUACANXING_H801)
  761. // Info
  762. #define MANUFACTURER "HUACANXING"
  763. #define DEVICE "H801"
  764. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  765. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  766. #define DUMMY_RELAY_COUNT 1
  767. #define DEBUG_PORT Serial1
  768. #define SERIAL_RX_ENABLED 1
  769. // LEDs
  770. #define LED1_PIN 5
  771. #define LED1_PIN_INVERSE 1
  772. // Light
  773. #define LIGHT_CHANNELS 5
  774. #define LIGHT_CH1_PIN 15 // RED
  775. #define LIGHT_CH2_PIN 13 // GREEN
  776. #define LIGHT_CH3_PIN 12 // BLUE
  777. #define LIGHT_CH4_PIN 14 // WHITE1
  778. #define LIGHT_CH5_PIN 4 // WHITE2
  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. #define LIGHT_CH5_INVERSE 0
  784. #elif defined(HUACANXING_H802)
  785. // Info
  786. #define MANUFACTURER "HUACANXING"
  787. #define DEVICE "H802"
  788. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  789. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  790. #define DUMMY_RELAY_COUNT 1
  791. #define DEBUG_PORT Serial1
  792. #define SERIAL_RX_ENABLED 1
  793. // Light
  794. #define LIGHT_CHANNELS 4
  795. #define LIGHT_CH1_PIN 12 // RED
  796. #define LIGHT_CH2_PIN 14 // GREEN
  797. #define LIGHT_CH3_PIN 13 // BLUE
  798. #define LIGHT_CH4_PIN 15 // WHITE
  799. #define LIGHT_CH1_INVERSE 0
  800. #define LIGHT_CH2_INVERSE 0
  801. #define LIGHT_CH3_INVERSE 0
  802. #define LIGHT_CH4_INVERSE 0
  803. // -----------------------------------------------------------------------------
  804. // Jan Goedeke Wifi Relay
  805. // https://github.com/JanGoe/esp8266-wifi-relay
  806. // -----------------------------------------------------------------------------
  807. #elif defined(JANGOE_WIFI_RELAY_NC)
  808. // Info
  809. #define MANUFACTURER "JANGOE"
  810. #define DEVICE "WIFI_RELAY_NC"
  811. // Buttons
  812. #define BUTTON1_PIN 12
  813. #define BUTTON2_PIN 13
  814. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  815. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  816. #define BUTTON1_RELAY 1
  817. #define BUTTON2_RELAY 2
  818. // Relays
  819. #define RELAY1_PIN 2
  820. #define RELAY2_PIN 14
  821. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  822. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  823. #elif defined(JANGOE_WIFI_RELAY_NO)
  824. // Info
  825. #define MANUFACTURER "JANGOE"
  826. #define DEVICE "WIFI_RELAY_NO"
  827. // Buttons
  828. #define BUTTON1_PIN 12
  829. #define BUTTON2_PIN 13
  830. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  831. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  832. #define BUTTON1_RELAY 1
  833. #define BUTTON2_RELAY 2
  834. // Relays
  835. #define RELAY1_PIN 2
  836. #define RELAY2_PIN 14
  837. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  838. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  839. // -----------------------------------------------------------------------------
  840. // Jorge García Wifi+Relays Board Kit
  841. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  842. // https://github.com/jorgegarciadev/wifikit
  843. // -----------------------------------------------------------------------------
  844. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  845. // Info
  846. #define MANUFACTURER "JORGEGARCIA"
  847. #define DEVICE "WIFI_RELAYS"
  848. // Relays
  849. #define RELAY1_PIN 0
  850. #define RELAY2_PIN 2
  851. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  852. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  853. // -----------------------------------------------------------------------------
  854. // WiFi MQTT Relay / Thermostat
  855. // -----------------------------------------------------------------------------
  856. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  857. // Info
  858. #define MANUFACTURER "OPENENERGYMONITOR"
  859. #define DEVICE "MQTT_RELAY"
  860. // Buttons
  861. #define BUTTON1_PIN 0
  862. #define BUTTON1_RELAY 1
  863. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  864. // Relays
  865. #define RELAY1_PIN 12
  866. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  867. // LEDs
  868. #define LED1_PIN 16
  869. #define LED1_PIN_INVERSE 0
  870. // -----------------------------------------------------------------------------
  871. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  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-50050-Indoor-Wi-Fi-Outlet-Wireless-Switch-Programmable-Timer-%2F263112281551
  873. // 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
  874. // -----------------------------------------------------------------------------
  875. #elif defined(WION_50055)
  876. // Currently untested, does not support energy monitoring
  877. // Info
  878. #define MANUFACTURER "WION"
  879. #define DEVICE "50055"
  880. // Buttons
  881. #define BUTTON1_PIN 13
  882. #define BUTTON1_RELAY 1
  883. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  884. // Relays
  885. #define RELAY1_PIN 15
  886. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  887. // LEDs
  888. #define LED1_PIN 2
  889. #define LED1_PIN_INVERSE 0
  890. // -----------------------------------------------------------------------------
  891. // EX-Store Wifi Relay v3.1
  892. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  893. // -----------------------------------------------------------------------------
  894. #elif defined(EXS_WIFI_RELAY_V31)
  895. // Untested
  896. // Info
  897. #define MANUFACTURER "EXS"
  898. #define DEVICE "WIFI_RELAY_V31"
  899. // Buttons
  900. #define BUTTON1_PIN 0
  901. #define BUTTON1_RELAY 1
  902. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  903. // Relays
  904. #define RELAY1_PIN 13
  905. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  906. #define RELAY1_RESET_PIN 12
  907. // -----------------------------------------------------------------------------
  908. // V9261F
  909. // -----------------------------------------------------------------------------
  910. #elif defined(GENERIC_V9261F)
  911. // Info
  912. #define MANUFACTURER "GENERIC"
  913. #define DEVICE "V9261F"
  914. #define ALEXA_SUPPORT 0
  915. // V9261F
  916. #define V9261F_SUPPORT 1
  917. #define V9261F_PIN 2
  918. #define V9261F_PIN_INVERSE 1
  919. // -----------------------------------------------------------------------------
  920. // ECH1560
  921. // -----------------------------------------------------------------------------
  922. #elif defined(GENERIC_ECH1560)
  923. // Info
  924. #define MANUFACTURER "GENERIC"
  925. #define DEVICE "ECH1560"
  926. #define ALEXA_SUPPORT 0
  927. // ECH1560
  928. #define ECH1560_SUPPORT 1
  929. #define ECH1560_CLK_PIN 4
  930. #define ECH1560_MISO_PIN 5
  931. #define ECH1560_INVERTED 0
  932. // -----------------------------------------------------------------------------
  933. // ESPLive
  934. // https://github.com/ManCaveMade/ESP-Live
  935. // -----------------------------------------------------------------------------
  936. #elif defined(MANCAVEMADE_ESPLIVE)
  937. // Info
  938. #define MANUFACTURER "MANCAVEMADE"
  939. #define DEVICE "ESPLIVE"
  940. // Buttons
  941. #define BUTTON1_PIN 4
  942. #define BUTTON2_PIN 5
  943. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  944. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  945. #define BUTTON1_RELAY 1
  946. #define BUTTON2_RELAY 2
  947. // Relays
  948. #define RELAY1_PIN 12
  949. #define RELAY2_PIN 13
  950. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  951. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  952. // DB18B20
  953. #ifndef DALLAS_SUPPORT
  954. #define DALLAS_SUPPORT 1
  955. #endif
  956. #define DALLAS_PIN 2
  957. #define DALLAS_UPDATE_INTERVAL 5000
  958. #define TEMPERATURE_MIN_CHANGE 1.0
  959. // -----------------------------------------------------------------------------
  960. // QuinLED
  961. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  962. // -----------------------------------------------------------------------------
  963. #elif defined(INTERMITTECH_QUINLED)
  964. // Info
  965. #define MANUFACTURER "INTERMITTECH"
  966. #define DEVICE "QUINLED"
  967. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  968. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  969. #define DUMMY_RELAY_COUNT 1
  970. // LEDs
  971. #define LED1_PIN 5
  972. #define LED1_PIN_INVERSE 1
  973. // Light
  974. #define LIGHT_CHANNELS 2
  975. #define LIGHT_CH1_PIN 0
  976. #define LIGHT_CH2_PIN 2
  977. #define LIGHT_CH1_INVERSE 0
  978. #define LIGHT_CH2_INVERSE 0
  979. // -----------------------------------------------------------------------------
  980. // Arilux AL-LC06
  981. // -----------------------------------------------------------------------------
  982. #elif defined(ARILUX_AL_LC01)
  983. // Info
  984. #define MANUFACTURER "ARILUX"
  985. #define DEVICE "AL_LC01"
  986. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  987. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  988. #define DUMMY_RELAY_COUNT 1
  989. // Light
  990. #define LIGHT_CHANNELS 4
  991. #define LIGHT_CH1_PIN 5 // RED
  992. #define LIGHT_CH2_PIN 12 // GREEN
  993. #define LIGHT_CH3_PIN 13 // BLUE
  994. #define LIGHT_CH4_PIN 14 // WHITE1
  995. #define LIGHT_CH1_INVERSE 0
  996. #define LIGHT_CH2_INVERSE 0
  997. #define LIGHT_CH3_INVERSE 0
  998. #define LIGHT_CH4_INVERSE 0
  999. #elif defined(ARILUX_AL_LC02)
  1000. // Info
  1001. #define MANUFACTURER "ARILUX"
  1002. #define DEVICE "AL_LC02"
  1003. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1004. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1005. #define DUMMY_RELAY_COUNT 1
  1006. // Light
  1007. #define LIGHT_CHANNELS 4
  1008. #define LIGHT_CH1_PIN 12 // RED
  1009. #define LIGHT_CH2_PIN 5 // GREEN
  1010. #define LIGHT_CH3_PIN 13 // BLUE
  1011. #define LIGHT_CH4_PIN 15 // WHITE1
  1012. #define LIGHT_CH1_INVERSE 0
  1013. #define LIGHT_CH2_INVERSE 0
  1014. #define LIGHT_CH3_INVERSE 0
  1015. #define LIGHT_CH4_INVERSE 0
  1016. #elif defined(ARILUX_AL_LC06)
  1017. // Info
  1018. #define MANUFACTURER "ARILUX"
  1019. #define DEVICE "AL_LC06"
  1020. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1021. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1022. #define DUMMY_RELAY_COUNT 1
  1023. // Light
  1024. #define LIGHT_CHANNELS 5
  1025. #define LIGHT_CH1_PIN 14 // RED
  1026. #define LIGHT_CH2_PIN 12 // GREEN
  1027. #define LIGHT_CH3_PIN 13 // BLUE
  1028. #define LIGHT_CH4_PIN 15 // WHITE1
  1029. #define LIGHT_CH5_PIN 5 // WHITE2
  1030. #define LIGHT_CH1_INVERSE 0
  1031. #define LIGHT_CH2_INVERSE 0
  1032. #define LIGHT_CH3_INVERSE 0
  1033. #define LIGHT_CH4_INVERSE 0
  1034. #define LIGHT_CH5_INVERSE 0
  1035. #elif defined(ARILUX_AL_LC11)
  1036. // Info
  1037. #define MANUFACTURER "ARILUX"
  1038. #define DEVICE "AL_LC11"
  1039. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1040. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1041. #define DUMMY_RELAY_COUNT 1
  1042. // Light
  1043. #define LIGHT_CHANNELS 5
  1044. #define LIGHT_CH1_PIN 5 // RED
  1045. #define LIGHT_CH2_PIN 4 // GREEN
  1046. #define LIGHT_CH3_PIN 14 // BLUE
  1047. #define LIGHT_CH4_PIN 13 // WHITE1
  1048. #define LIGHT_CH5_PIN 12 // WHITE1
  1049. #define LIGHT_CH1_INVERSE 0
  1050. #define LIGHT_CH2_INVERSE 0
  1051. #define LIGHT_CH3_INVERSE 0
  1052. #define LIGHT_CH4_INVERSE 0
  1053. #define LIGHT_CH5_INVERSE 0
  1054. #elif defined(ARILUX_E27)
  1055. // Info
  1056. #define MANUFACTURER "ARILUX"
  1057. #define DEVICE "E27"
  1058. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1059. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1060. #define DUMMY_RELAY_COUNT 1
  1061. // Light
  1062. #define LIGHT_CHANNELS 4
  1063. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  1064. #define MY92XX_CHIPS 1
  1065. #define MY92XX_DI_PIN 13
  1066. #define MY92XX_DCKI_PIN 15
  1067. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1068. #define MY92XX_MAPPING 0, 1, 2, 3
  1069. // -----------------------------------------------------------------------------
  1070. // XENON SM-PW701U
  1071. // -----------------------------------------------------------------------------
  1072. #elif defined(XENON_SM_PW702U)
  1073. // Info
  1074. #define MANUFACTURER "XENON"
  1075. #define DEVICE "SM_PW702U"
  1076. // Buttons
  1077. #define BUTTON1_PIN 13
  1078. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1079. #define BUTTON1_RELAY 1
  1080. // Relays
  1081. #define RELAY1_PIN 12
  1082. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1083. // LEDs
  1084. #define LED1_PIN 4
  1085. #define LED1_PIN_INVERSE 1
  1086. // -----------------------------------------------------------------------------
  1087. // AUTHOMETION LYT8266
  1088. // https://authometion.com/shop/en/home/13-lyt8266.html
  1089. // -----------------------------------------------------------------------------
  1090. #elif defined(AUTHOMETION_LYT8266)
  1091. // Info
  1092. #define MANUFACTURER "AUTHOMETION"
  1093. #define DEVICE "LYT8266"
  1094. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1095. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1096. #define DUMMY_RELAY_COUNT 1
  1097. // Light
  1098. #define LIGHT_CHANNELS 4
  1099. #define LIGHT_CH1_PIN 13 // RED
  1100. #define LIGHT_CH2_PIN 12 // GREEN
  1101. #define LIGHT_CH3_PIN 14 // BLUE
  1102. #define LIGHT_CH4_PIN 2 // WHITE
  1103. #define LIGHT_CH1_INVERSE 0
  1104. #define LIGHT_CH2_INVERSE 0
  1105. #define LIGHT_CH3_INVERSE 0
  1106. #define LIGHT_CH4_INVERSE 0
  1107. #define LIGHT_ENABLE_PIN 15
  1108. #elif defined(GIZWITS_WITTY_CLOUD)
  1109. // Info
  1110. #define MANUFACTURER "GIZWITS"
  1111. #define DEVICE "WITTY_CLOUD"
  1112. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1113. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1114. #define DUMMY_RELAY_COUNT 1
  1115. // Buttons
  1116. #define BUTTON1_PIN 4
  1117. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1118. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  1119. #define BUTTON1_CLICK BUTTON_MODE_NONE
  1120. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1121. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1122. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  1123. #define ANALOG_SUPPORT 1
  1124. // LEDs
  1125. #define LED1_PIN 2 // BLUE build-in
  1126. #define LED1_PIN_INVERSE 1
  1127. // Light
  1128. #define LIGHT_CHANNELS 3
  1129. #define LIGHT_CH1_PIN 15 // RED
  1130. #define LIGHT_CH2_PIN 12 // GREEN
  1131. #define LIGHT_CH3_PIN 13 // BLUE
  1132. #define LIGHT_CH1_INVERSE 0
  1133. #define LIGHT_CH2_INVERSE 0
  1134. #define LIGHT_CH3_INVERSE 0
  1135. // -----------------------------------------------------------------------------
  1136. // KMC 70011
  1137. // https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
  1138. // -----------------------------------------------------------------------------
  1139. #elif defined(KMC_70011)
  1140. // Info
  1141. #define MANUFACTURER "KMC"
  1142. #define DEVICE "70011"
  1143. // Buttons
  1144. #define BUTTON1_PIN 0
  1145. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1146. #define BUTTON1_RELAY 1
  1147. // Relays
  1148. #define RELAY1_PIN 14
  1149. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1150. // LEDs
  1151. #define LED1_PIN 13
  1152. #define LED1_PIN_INVERSE 0
  1153. // HLW8012
  1154. #ifndef HLW8012_SUPPORT
  1155. #define HLW8012_SUPPORT 1
  1156. #endif
  1157. #define HLW8012_SEL_PIN 12
  1158. #define HLW8012_CF1_PIN 5
  1159. #define HLW8012_CF_PIN 4
  1160. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1161. // -----------------------------------------------------------------------------
  1162. // Euromate (?) Wifi Stecker Shuko
  1163. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  1164. // Thanks to @Geitde
  1165. // -----------------------------------------------------------------------------
  1166. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  1167. // Info
  1168. #define MANUFACTURER "EUROMATE"
  1169. #define DEVICE "WIFI_STECKER_SCHUKO"
  1170. // Buttons
  1171. #define BUTTON1_PIN 14
  1172. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1173. #define BUTTON1_RELAY 1
  1174. // The relay in the device is not a bistable (latched) relay.
  1175. // The device is reported to have a flip-flop circuit to drive the relay
  1176. // So @Geitde hack is still the only possible
  1177. // Hack: drive GPIO12 low and use GPIO5 as normal relay pin:
  1178. #define RELAY1_PIN 5
  1179. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1180. #define LED2_PIN 12 /* DUMMY: exploit default off state for GPIO12=low */
  1181. #define LED2_PIN_INVERSE 0
  1182. // LEDs
  1183. #define LED1_PIN 4
  1184. #define LED1_PIN_INVERSE 0
  1185. // -----------------------------------------------------------------------------
  1186. // Generic 8CH
  1187. // -----------------------------------------------------------------------------
  1188. #elif defined(GENERIC_8CH)
  1189. // Info
  1190. #define MANUFACTURER "GENERIC"
  1191. #define DEVICE "8CH"
  1192. // Relays
  1193. #define RELAY1_PIN 0
  1194. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1195. #define RELAY2_PIN 2
  1196. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1197. #define RELAY3_PIN 4
  1198. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1199. #define RELAY4_PIN 5
  1200. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1201. #define RELAY5_PIN 12
  1202. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1203. #define RELAY6_PIN 13
  1204. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  1205. #define RELAY7_PIN 14
  1206. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  1207. #define RELAY8_PIN 15
  1208. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  1209. // -----------------------------------------------------------------------------
  1210. // STM RELAY
  1211. // -----------------------------------------------------------------------------
  1212. #elif defined(STM_RELAY)
  1213. // Info
  1214. #define MANUFACTURER "STM_RELAY"
  1215. #define DEVICE "2CH"
  1216. // Relays
  1217. #define DUMMY_RELAY_COUNT 2
  1218. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  1219. // Remove UART noise on serial line
  1220. #define TERMINAL_SUPPORT 0
  1221. #define DEBUG_SERIAL_SUPPORT 0
  1222. // -----------------------------------------------------------------------------
  1223. // Tonbux Powerstrip02
  1224. // -----------------------------------------------------------------------------
  1225. #elif defined(TONBUX_POWERSTRIP02)
  1226. // Info
  1227. #define MANUFACTURER "TONBUX"
  1228. #define DEVICE "POWERSTRIP02"
  1229. // Buttons
  1230. #define BUTTON1_PIN 5
  1231. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1232. #define BUTTON1_RELAY 0
  1233. // Relays
  1234. #define RELAY1_PIN 4
  1235. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1236. #define RELAY2_PIN 13
  1237. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1238. #define RELAY3_PIN 12
  1239. #define RELAY3_TYPE RELAY_TYPE_INVERSE
  1240. #define RELAY4_PIN 14
  1241. #define RELAY4_TYPE RELAY_TYPE_INVERSE
  1242. // Not a relay. USB ports on/off
  1243. #define RELAY5_PIN 16
  1244. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1245. // LEDs
  1246. #define LED1_PIN 0 // 1 blue led
  1247. #define LED1_PIN_INVERSE 1
  1248. #define LED2_PIN 3 // 3 red leds
  1249. #define LED2_PIN_INVERSE 1
  1250. // -----------------------------------------------------------------------------
  1251. // Lingan SWA1
  1252. // -----------------------------------------------------------------------------
  1253. #elif defined(LINGAN_SWA1)
  1254. // Info
  1255. #define MANUFACTURER "LINGAN"
  1256. #define DEVICE "SWA1"
  1257. // Buttons
  1258. #define BUTTON1_PIN 13
  1259. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1260. #define BUTTON1_RELAY 1
  1261. // Relays
  1262. #define RELAY1_PIN 5
  1263. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1264. // LEDs
  1265. #define LED1_PIN 4
  1266. #define LED1_PIN_INVERSE 1
  1267. // -----------------------------------------------------------------------------
  1268. // HEYGO HY02
  1269. // -----------------------------------------------------------------------------
  1270. #elif defined(HEYGO_HY02)
  1271. // Info
  1272. #define MANUFACTURER "HEYGO"
  1273. #define DEVICE "HY02"
  1274. // Buttons
  1275. #define BUTTON1_PIN 13
  1276. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1277. #define BUTTON1_RELAY 1
  1278. // Relays
  1279. #define RELAY1_PIN 12
  1280. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1281. // LEDs
  1282. #define LED1_PIN 4
  1283. #define LED1_PIN_INVERSE 0
  1284. // -----------------------------------------------------------------------------
  1285. // Maxcio W-US002S
  1286. // -----------------------------------------------------------------------------
  1287. #elif defined(MAXCIO_WUS002S)
  1288. // Info
  1289. #define MANUFACTURER "MAXCIO"
  1290. #define DEVICE "WUS002S"
  1291. // Buttons
  1292. #define BUTTON1_PIN 2
  1293. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1294. #define BUTTON1_RELAY 1
  1295. // Relays
  1296. #define RELAY1_PIN 13
  1297. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1298. // LEDs
  1299. #define LED1_PIN 3
  1300. #define LED1_PIN_INVERSE 0
  1301. // HLW8012
  1302. #ifndef HLW8012_SUPPORT
  1303. #define HLW8012_SUPPORT 1
  1304. #endif
  1305. #define HLW8012_SEL_PIN 12
  1306. #define HLW8012_CF1_PIN 5
  1307. #define HLW8012_CF_PIN 4
  1308. #define HLW8012_CURRENT_R 0.002 // Current resistor
  1309. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1310. // -----------------------------------------------------------------------------
  1311. // YiDian XS-SSA05
  1312. // -----------------------------------------------------------------------------
  1313. #elif defined(YIDIAN_XSSSA05)
  1314. // Info
  1315. #define MANUFACTURER "YIDIAN"
  1316. #define DEVICE "XSSSA05"
  1317. // Buttons
  1318. #define BUTTON1_PIN 13
  1319. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1320. #define BUTTON1_RELAY 1
  1321. // Relays
  1322. #define RELAY1_PIN 12
  1323. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1324. // LEDs
  1325. #define LED1_PIN 4
  1326. #define LED1_PIN_INVERSE 0
  1327. // HLW8012
  1328. #ifndef HLW8012_SUPPORT
  1329. #define HLW8012_SUPPORT 1
  1330. #endif
  1331. #define HLW8012_SEL_PIN 3
  1332. #define HLW8012_CF1_PIN 14
  1333. #define HLW8012_CF_PIN 5
  1334. #define HLW8012_CURRENT_R 0.001 // Current resistor
  1335. #define HLW8012_VOLTAGE_R_UP ( 2 * 1200000 ) // Upstream voltage resistor
  1336. // -----------------------------------------------------------------------------
  1337. // TONBUX XS-SSA06
  1338. // -----------------------------------------------------------------------------
  1339. #elif defined(TONBUX_XSSSA06)
  1340. // Info
  1341. #define MANUFACTURER "TONBUX"
  1342. #define DEVICE "XSSSA06"
  1343. // Buttons
  1344. #define BUTTON1_PIN 13
  1345. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1346. #define BUTTON1_RELAY 1
  1347. // Relays
  1348. #define RELAY1_PIN 15
  1349. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1350. // LEDs
  1351. #define LED1_PIN 0 // R - 8 rgb led ring
  1352. #define LED1_PIN_INVERSE 0
  1353. #define LED2_PIN 5 // G
  1354. #define LED2_PIN_INVERSE 0
  1355. #define LED3_PIN 2 // B
  1356. #define LED3_PIN_INVERSE 0
  1357. // -----------------------------------------------------------------------------
  1358. // GREEN ESP8266 RELAY MODULE
  1359. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1360. // -----------------------------------------------------------------------------
  1361. #elif defined(GREEN_ESP8266RELAY)
  1362. // Info
  1363. #define MANUFACTURER "GREEN"
  1364. #define DEVICE "ESP8266RELAY"
  1365. // Buttons
  1366. // Not a button but input via Optocoupler
  1367. #define BUTTON1_PIN 5
  1368. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1369. #define BUTTON1_RELAY 1
  1370. // Relays
  1371. #define RELAY1_PIN 4
  1372. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1373. // LEDs
  1374. #define LED1_PIN 2
  1375. #define LED1_PIN_INVERSE 1
  1376. // -----------------------------------------------------------------------------
  1377. // Henrique Gravina ESPIKE
  1378. // https://github.com/Henriquegravina/Espike
  1379. // -----------------------------------------------------------------------------
  1380. #elif defined(IKE_ESPIKE)
  1381. #define MANUFACTURER "IKE"
  1382. #define DEVICE "ESPIKE"
  1383. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1384. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1385. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1386. #define BUTTON1_PIN 13
  1387. #define BUTTON1_RELAY 1
  1388. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1389. #define BUTTON2_PIN 12
  1390. #define BUTTON2_RELAY 2
  1391. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1392. #define BUTTON3_PIN 14
  1393. #define BUTTON3_RELAY 2
  1394. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1395. #define RELAY1_PIN 4
  1396. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1397. #define RELAY2_PIN 5
  1398. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1399. #define RELAY3_PIN 16
  1400. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1401. #define LED1_PIN 2
  1402. #define LED1_PIN_INVERSE 1
  1403. // -----------------------------------------------------------------------------
  1404. // SWIFITCH
  1405. // https://github.com/ArnieX/swifitch
  1406. // -----------------------------------------------------------------------------
  1407. #elif defined(ARNIEX_SWIFITCH)
  1408. // Info
  1409. #define MANUFACTURER "ARNIEX"
  1410. #define DEVICE "SWIFITCH"
  1411. // Buttons
  1412. #define BUTTON1_PIN 4 // D2
  1413. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1414. #define BUTTON1_RELAY 1
  1415. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1416. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1417. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1418. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1419. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1420. // Relays
  1421. #define RELAY1_PIN 5 // D1
  1422. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1423. // LEDs
  1424. #define LED1_PIN 12 // D6
  1425. #define LED1_PIN_INVERSE 1
  1426. // -----------------------------------------------------------------------------
  1427. // ESP-01S RELAY v4.0
  1428. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  1429. // -----------------------------------------------------------------------------
  1430. #elif defined(GENERIC_ESP01SRELAY40)
  1431. // Info
  1432. #define MANUFACTURER "GENERIC"
  1433. #define DEVICE "ESP01S_RELAY_40"
  1434. // Relays
  1435. #define RELAY1_PIN 0
  1436. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1437. // LEDs
  1438. #define LED1_PIN 2
  1439. #define LED1_PIN_INVERSE 0
  1440. // -----------------------------------------------------------------------------
  1441. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  1442. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  1443. // -----------------------------------------------------------------------------
  1444. #elif defined(GENERIC_ESP01SRGBLED10)
  1445. // Info
  1446. #define MANUFACTURER "GENERIC"
  1447. #define DEVICE "ESP01S_RGBLED_10"
  1448. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  1449. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  1450. // Buttons
  1451. //#define BUTTON1_PIN 2
  1452. // Relays
  1453. //#define RELAY1_PIN 2
  1454. // LEDs
  1455. #define LED1_PIN 2
  1456. // -----------------------------------------------------------------------------
  1457. // Heltec Touch Relay
  1458. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  1459. // -----------------------------------------------------------------------------
  1460. #elif defined(HELTEC_TOUCHRELAY)
  1461. // Info
  1462. #define MANUFACTURER "HELTEC"
  1463. #define DEVICE "TOUCH_RELAY"
  1464. // Buttons
  1465. #define BUTTON1_PIN 14
  1466. #define BUTTON1_RELAY 1
  1467. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1468. // Relays
  1469. #define RELAY1_PIN 12
  1470. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1471. // -----------------------------------------------------------------------------
  1472. // TEST boards (do not use!!)
  1473. // -----------------------------------------------------------------------------
  1474. #elif defined(TRAVIS01)
  1475. // Info
  1476. #define MANUFACTURER "TravisCI"
  1477. #define DEVICE "Virtual board 01"
  1478. // Some buttons - pin 0
  1479. #define BUTTON1_PIN 0
  1480. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1481. #define BUTTON1_RELAY 1
  1482. // Some relays - pin 1
  1483. #define RELAY1_PIN 1
  1484. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1485. // Some LEDs - pin 2
  1486. #define LED1_PIN 2
  1487. #define LED1_PIN_INVERSE 1
  1488. // A bit of I2C - pins 3,4
  1489. #define I2C_SDA_PIN 3
  1490. #define I2C_SCL_PIN 4
  1491. // And, as they say in "From Dusk till Dawn":
  1492. // This is a sensor blow out!
  1493. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  1494. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  1495. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  1496. // C'mon, you want sensor, come on in sensor lovers!
  1497. // If we don’t got it, you don't want it!
  1498. #define BH1750_SUPPORT 1
  1499. #define BMX280_SUPPORT 1
  1500. #define SHT3X_I2C_SUPPORT 1
  1501. #define EMON_ADC121_SUPPORT 1
  1502. #define EMON_ADS1X15_SUPPORT 1
  1503. #define SHT3X_I2C_SUPPORT 1
  1504. #define SI7021_SUPPORT 1
  1505. // A bit of lights - pin 5
  1506. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1507. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1508. #define DUMMY_RELAY_COUNT 1
  1509. #define LIGHT_CHANNELS 1
  1510. #define LIGHT_CH1_PIN 5
  1511. #define LIGHT_CH1_INVERSE 0
  1512. // A bit of HLW8012 - pins 6,7,8
  1513. #ifndef HLW8012_SUPPORT
  1514. #define HLW8012_SUPPORT 1
  1515. #endif
  1516. #define HLW8012_SEL_PIN 6
  1517. #define HLW8012_CF1_PIN 7
  1518. #define HLW8012_CF_PIN 8
  1519. // A bit of Dallas - pin 9
  1520. #ifndef DALLAS_SUPPORT
  1521. #define DALLAS_SUPPORT 1
  1522. #endif
  1523. #define DALLAS_PIN 9
  1524. // A bit of ECH1560 - pins 10,11, 12
  1525. #ifndef ECH1560_SUPPORT
  1526. #define ECH1560_SUPPORT 1
  1527. #endif
  1528. #define ECH1560_CLK_PIN 10
  1529. #define ECH1560_MISO_PIN 11
  1530. #define ECH1560_INVERTED 12
  1531. #elif defined(TRAVIS02)
  1532. // Relay provider dual
  1533. #define MANUFACTURER "TravisCI"
  1534. #define DEVICE "Virtual board 02"
  1535. // A bit of DHT - pin 1
  1536. #ifndef DHT_SUPPORT
  1537. #define DHT_SUPPORT 1
  1538. #endif
  1539. #define DHT_PIN 1
  1540. // Relay type dual - pins 2,3
  1541. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  1542. #define RELAY1_PIN 2
  1543. #define RELAY2_PIN 3
  1544. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1545. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1546. // IR - pin 4
  1547. #define IR_SUPPORT 1
  1548. #define IR_PIN 4
  1549. #define IR_BUTTON_SET 1
  1550. #elif defined(TRAVIS03)
  1551. // Relay provider light/my92XX
  1552. #define MANUFACTURER "TravisCI"
  1553. #define DEVICE "Virtual board 03"
  1554. // MY9231 Light - pins 1,2
  1555. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1556. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1557. #define DUMMY_RELAY_COUNT 1
  1558. #define LIGHT_CHANNELS 5
  1559. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  1560. #define MY92XX_CHIPS 2
  1561. #define MY92XX_DI_PIN 1
  1562. #define MY92XX_DCKI_PIN 2
  1563. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1564. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  1565. #endif
  1566. // -----------------------------------------------------------------------------
  1567. // Check definitions
  1568. // -----------------------------------------------------------------------------
  1569. #if not defined(MANUFACTURER) || not defined(DEVICE)
  1570. #error "UNSUPPORTED HARDWARE!!"
  1571. #endif