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.

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