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.

3094 lines
98 KiB

6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 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 types.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 BUTTON_SUPPORT 0
  36. #define DOMOTICZ_SUPPORT 0
  37. #define HOMEASSISTANT_SUPPORT 0
  38. #define I2C_SUPPORT 0
  39. #define MDNS_SERVER_SUPPORT 0
  40. #define MQTT_SUPPORT 0
  41. #define NTP_SUPPORT 0
  42. #define SCHEDULER_SUPPORT 0
  43. #define SENSOR_SUPPORT 0
  44. #define THINGSPEAK_SUPPORT 0
  45. #define WEB_SUPPORT 0
  46. // Extra light-weight image
  47. //#define DEBUG_SERIAL_SUPPORT 0
  48. //#define DEBUG_TELNET_SUPPORT 0
  49. //#define DEBUG_WEB_SUPPORT 0
  50. //#define LED_SUPPORT 0
  51. //#define TELNET_SUPPORT 0
  52. //#define TERMINAL_SUPPORT 0
  53. // -----------------------------------------------------------------------------
  54. // Development boards
  55. // -----------------------------------------------------------------------------
  56. #elif defined(NODEMCU_LOLIN)
  57. // Info
  58. #define MANUFACTURER "NODEMCU"
  59. #define DEVICE "LOLIN"
  60. // Buttons
  61. #define BUTTON1_PIN 0
  62. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  63. #define BUTTON1_RELAY 1
  64. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  65. #define RELAY1_PIN 12
  66. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  67. // Light
  68. #define LED1_PIN 2
  69. #define LED1_PIN_INVERSE 1
  70. #elif defined(NODEMCU_BASIC)
  71. // Info
  72. // Generic NodeMCU Board without any buttons or relays connected.
  73. #define MANUFACTURER "NODEMCU"
  74. #define DEVICE "BASIC"
  75. #elif defined(WEMOS_D1_MINI)
  76. // Info
  77. #define MANUFACTURER "WEMOS"
  78. #define DEVICE "D1_MINI"
  79. // Buttons
  80. // No buttons on the D1 MINI alone, but defining it without adding a button doen't create problems
  81. #define BUTTON1_PIN 0 // Connect a pushbutton between D3 and GND,
  82. // it's the same as using a Wemos one button shield
  83. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  84. #define BUTTON1_RELAY 1
  85. // LEDs
  86. #define LED1_PIN 2
  87. #define LED1_PIN_INVERSE 1
  88. #define I2C_SDA_PIN 4 // D2
  89. #define I2C_SCL_PIN 5 // D1
  90. #elif defined(WEMOS_D1_MINI_RELAYSHIELD)
  91. // Info
  92. #define MANUFACTURER "WEMOS"
  93. #define DEVICE "D1_MINI_RELAYSHIELD"
  94. // Buttons
  95. // No buttons on the D1 MINI alone, but defining it without adding a button doen't create problems
  96. #define BUTTON1_PIN 0 // Connect a pushbutton between D3 and GND,
  97. // it's the same as using a Wemos one button shield
  98. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  99. #define BUTTON1_RELAY 1
  100. // Relays
  101. #define RELAY1_PIN 5
  102. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  103. // LEDs
  104. #define LED1_PIN 2
  105. #define LED1_PIN_INVERSE 1
  106. // When Wemos relay shield is connected GPIO5 (D1) is used for relay,
  107. // so I2C must be remapped to other pins
  108. #define I2C_SDA_PIN 12 // D6
  109. #define I2C_SCL_PIN 14 // D5
  110. #elif defined(WEMOS_D1_TARPUNA_SHIELD)
  111. // Info
  112. #define MANUFACTURER "WEMOS"
  113. #define DEVICE "D1_TARPUNA_SHIELD"
  114. // -----------------------------------------------------------------------------
  115. // ESPurna
  116. // -----------------------------------------------------------------------------
  117. #elif defined(TINKERMAN_ESPURNA_H06)
  118. // Info
  119. #define MANUFACTURER "TINKERMAN"
  120. #define DEVICE "ESPURNA_H06"
  121. // Buttons
  122. #define BUTTON1_PIN 4
  123. #define BUTTON1_RELAY 1
  124. // Normal pushbutton
  125. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  126. // Relays
  127. #define RELAY1_PIN 12
  128. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  129. // LEDs
  130. #define LED1_PIN 2
  131. #define LED1_PIN_INVERSE 1
  132. // HLW8012
  133. #ifndef HLW8012_SUPPORT
  134. #define HLW8012_SUPPORT 1
  135. #endif
  136. #define HLW8012_SEL_PIN 2
  137. #define HLW8012_CF1_PIN 13
  138. #define HLW8012_CF_PIN 14
  139. #elif defined(TINKERMAN_ESPURNA_H08)
  140. // Info
  141. #define MANUFACTURER "TINKERMAN"
  142. #define DEVICE "ESPURNA_H08"
  143. // Buttons
  144. #define BUTTON1_PIN 4
  145. #define BUTTON1_RELAY 1
  146. // Normal pushbutton
  147. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  148. // Relays
  149. #define RELAY1_PIN 12
  150. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  151. // LEDs
  152. #define LED1_PIN 2
  153. #define LED1_PIN_INVERSE 0
  154. // HLW8012
  155. #ifndef HLW8012_SUPPORT
  156. #define HLW8012_SUPPORT 1
  157. #endif
  158. #define HLW8012_SEL_PIN 5
  159. #define HLW8012_CF1_PIN 13
  160. #define HLW8012_CF_PIN 14
  161. #elif defined(TINKERMAN_ESPURNA_SWITCH)
  162. // Info
  163. #define MANUFACTURER "TINKERMAN"
  164. #define DEVICE "ESPURNA_SWITCH"
  165. // Buttons
  166. #define BUTTON1_PIN 4
  167. #define BUTTON1_RELAY 1
  168. // Touch button
  169. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  170. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  171. #define BUTTON1_CLICK BUTTON_MODE_NONE
  172. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  173. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  174. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  175. // LEDs
  176. #define LED1_PIN 2
  177. #define LED1_PIN_INVERSE 0
  178. // Relays
  179. #define RELAY1_PIN 12
  180. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  181. // Check http://tinkerman.cat/rfm69-wifi-gateway/
  182. #elif defined(TINKERMAN_RFM69GW)
  183. // Info
  184. #define MANUFACTURER "TINKERMAN"
  185. #define DEVICE "RFM69GW"
  186. // Buttons
  187. #define BUTTON1_PIN 0
  188. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  189. // RFM69GW
  190. #define RFM69_SUPPORT 1
  191. // Disable non-core modules
  192. #define ALEXA_SUPPORT 0
  193. #define DOMOTICZ_SUPPORT 0
  194. #define HOMEASSISTANT_SUPPORT 0
  195. #define I2C_SUPPORT 0
  196. #define SCHEDULER_SUPPORT 0
  197. #define SENSOR_SUPPORT 0
  198. #define THINGSPEAK_SUPPORT 0
  199. // -----------------------------------------------------------------------------
  200. // Itead Studio boards
  201. // -----------------------------------------------------------------------------
  202. #elif defined(ITEAD_SONOFF_BASIC)
  203. // Info
  204. #define MANUFACTURER "ITEAD"
  205. #define DEVICE "SONOFF_BASIC"
  206. // Buttons
  207. #define BUTTON1_PIN 0
  208. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  209. #define BUTTON1_RELAY 1
  210. #define BUTTON2_PIN 14
  211. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  212. #define BUTTON2_RELAY 1
  213. // Relays
  214. #define RELAY1_PIN 12
  215. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  216. // LEDs
  217. #define LED1_PIN 13
  218. #define LED1_PIN_INVERSE 1
  219. #elif defined(ITEAD_SONOFF_RF)
  220. // Info
  221. #define MANUFACTURER "ITEAD"
  222. #define DEVICE "SONOFF_RF"
  223. // Buttons
  224. #define BUTTON1_PIN 0
  225. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  226. #define BUTTON1_RELAY 1
  227. #define BUTTON2_PIN 14
  228. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  229. #define BUTTON2_RELAY 1
  230. // Relays
  231. #define RELAY1_PIN 12
  232. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  233. // LEDs
  234. #define LED1_PIN 13
  235. #define LED1_PIN_INVERSE 1
  236. #elif defined(ITEAD_SONOFF_TH)
  237. // Info
  238. #define MANUFACTURER "ITEAD"
  239. #define DEVICE "SONOFF_TH"
  240. // Buttons
  241. #define BUTTON1_PIN 0
  242. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  243. #define BUTTON1_RELAY 1
  244. // Relays
  245. #define RELAY1_PIN 12
  246. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  247. // LEDs
  248. #define LED1_PIN 13
  249. #define LED1_PIN_INVERSE 1
  250. // Jack is connected to GPIO14 (and with a small hack to GPIO4)
  251. #ifndef DALLAS_SUPPORT
  252. #define DALLAS_SUPPORT 1
  253. #endif
  254. #define DALLAS_PIN 14
  255. #ifndef DHT_SUPPORT
  256. #define DHT_SUPPORT 1
  257. #endif
  258. #define DHT_PIN 14
  259. //#define I2C_SDA_PIN 4
  260. //#define I2C_SCL_PIN 14
  261. #elif defined(ITEAD_SONOFF_SV)
  262. // Info
  263. #define MANUFACTURER "ITEAD"
  264. #define DEVICE "SONOFF_SV"
  265. // Buttons
  266. #define BUTTON1_PIN 0
  267. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  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_SLAMPHER)
  276. // Info
  277. #define MANUFACTURER "ITEAD"
  278. #define DEVICE "SLAMPHER"
  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 13
  288. #define LED1_PIN_INVERSE 1
  289. #elif defined(ITEAD_S20)
  290. // Info
  291. #define MANUFACTURER "ITEAD"
  292. #define DEVICE "S20"
  293. // Buttons
  294. #define BUTTON1_PIN 0
  295. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  296. #define BUTTON1_RELAY 1
  297. // Relays
  298. #define RELAY1_PIN 12
  299. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  300. // LEDs
  301. #define LED1_PIN 13
  302. #define LED1_PIN_INVERSE 1
  303. #elif defined(ITEAD_SONOFF_TOUCH)
  304. // Info
  305. #define MANUFACTURER "ITEAD"
  306. #define DEVICE "SONOFF_TOUCH"
  307. // Buttons
  308. #define BUTTON1_PIN 0
  309. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  310. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  311. #define BUTTON1_CLICK BUTTON_MODE_NONE
  312. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  313. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  314. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  315. #define BUTTON1_RELAY 1
  316. // Relays
  317. #define RELAY1_PIN 12
  318. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  319. // LEDs
  320. #define LED1_PIN 13
  321. #define LED1_PIN_INVERSE 1
  322. #elif defined(ITEAD_SONOFF_POW)
  323. // Info
  324. #define MANUFACTURER "ITEAD"
  325. #define DEVICE "SONOFF_POW"
  326. // Buttons
  327. #define BUTTON1_PIN 0
  328. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  329. #define BUTTON1_RELAY 1
  330. // Relays
  331. #define RELAY1_PIN 12
  332. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  333. // LEDs
  334. #define LED1_PIN 15
  335. #define LED1_PIN_INVERSE 0
  336. // HLW8012
  337. #ifndef HLW8012_SUPPORT
  338. #define HLW8012_SUPPORT 1
  339. #endif
  340. #define HLW8012_SEL_PIN 5
  341. #define HLW8012_CF1_PIN 13
  342. #define HLW8012_CF_PIN 14
  343. #elif defined(ITEAD_SONOFF_POW_R2)
  344. // Info
  345. #define MANUFACTURER "ITEAD"
  346. #define DEVICE "SONOFF_POW_R2"
  347. // Buttons
  348. #define BUTTON1_PIN 0
  349. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  350. #define BUTTON1_RELAY 1
  351. // Relays
  352. #define RELAY1_PIN 12
  353. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  354. // LEDs
  355. #define LED1_PIN 13
  356. #define LED1_PIN_INVERSE 1
  357. // Disable UART noise
  358. #define DEBUG_SERIAL_SUPPORT 0
  359. // CSE7766
  360. #ifndef CSE7766_SUPPORT
  361. #define CSE7766_SUPPORT 1
  362. #endif
  363. #define CSE7766_PIN 1
  364. #elif defined(ITEAD_SONOFF_DUAL)
  365. // Info
  366. #define MANUFACTURER "ITEAD"
  367. #define DEVICE "SONOFF_DUAL"
  368. #define SERIAL_BAUDRATE 19230
  369. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  370. #define DUMMY_RELAY_COUNT 2
  371. #define DEBUG_SERIAL_SUPPORT 0
  372. // Buttons
  373. #define BUTTON3_RELAY 1
  374. // LEDs
  375. #define LED1_PIN 13
  376. #define LED1_PIN_INVERSE 1
  377. #elif defined(ITEAD_SONOFF_DUAL_R2)
  378. #define MANUFACTURER "ITEAD"
  379. #define DEVICE "SONOFF_DUAL_R2"
  380. // Buttons
  381. #define BUTTON1_PIN 0 // Button 0 on header
  382. #define BUTTON2_PIN 9 // Button 1 on header
  383. #define BUTTON3_PIN 10 // Physical button
  384. #define BUTTON1_RELAY 1
  385. #define BUTTON2_RELAY 2
  386. #define BUTTON3_RELAY 1
  387. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  388. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  389. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  390. // Relays
  391. #define RELAY1_PIN 12
  392. #define RELAY2_PIN 5
  393. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  394. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  395. // LEDs
  396. #define LED1_PIN 13
  397. #define LED1_PIN_INVERSE 1
  398. #elif defined(ITEAD_SONOFF_4CH)
  399. // Info
  400. #define MANUFACTURER "ITEAD"
  401. #define DEVICE "SONOFF_4CH"
  402. // Buttons
  403. #define BUTTON1_PIN 0
  404. #define BUTTON2_PIN 9
  405. #define BUTTON3_PIN 10
  406. #define BUTTON4_PIN 14
  407. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  408. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  409. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  410. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  411. #define BUTTON1_RELAY 1
  412. #define BUTTON2_RELAY 2
  413. #define BUTTON3_RELAY 3
  414. #define BUTTON4_RELAY 4
  415. // Relays
  416. #define RELAY1_PIN 12
  417. #define RELAY2_PIN 5
  418. #define RELAY3_PIN 4
  419. #define RELAY4_PIN 15
  420. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  421. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  422. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  423. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  424. // LEDs
  425. #define LED1_PIN 13
  426. #define LED1_PIN_INVERSE 1
  427. #elif defined(ITEAD_SONOFF_4CH_PRO)
  428. // Info
  429. #define MANUFACTURER "ITEAD"
  430. #define DEVICE "SONOFF_4CH_PRO"
  431. // Buttons
  432. #define BUTTON1_PIN 0
  433. #define BUTTON2_PIN 9
  434. #define BUTTON3_PIN 10
  435. #define BUTTON4_PIN 14
  436. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  437. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  438. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  439. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  440. #define BUTTON1_RELAY 1
  441. #define BUTTON2_RELAY 2
  442. #define BUTTON3_RELAY 3
  443. #define BUTTON4_RELAY 4
  444. // Sonoff 4CH Pro uses a secondary STM32 microcontroller to handle
  445. // buttons and relays, but it also forwards button presses to the ESP8285.
  446. // This allows ESPurna to handle button presses -almost- the same way
  447. // as with other devices except:
  448. // * Double click seems to break/disable the button on the STM32 side
  449. // * With S6 switch to 1 (self-locking and inching modes) everything's OK
  450. // * With S6 switch to 0 (interlock mode) if there is a relay ON
  451. // and you click on another relay button, the STM32 sends a "press"
  452. // event for the button of the first relay (to turn it OFF) but it
  453. // does not send a "release" event. It's like it's holding the
  454. // button down since you can see it is still LOW.
  455. // Whatever reason the result is that it may actually perform a
  456. // long click or long-long click.
  457. // The configuration below make the button toggle the relay on press events
  458. // and disables any possibly harmful combination with S6 set to 0.
  459. // If you are sure you will only use S6 to 1 you can comment the
  460. // BUTTON1_LNGCLICK and BUTTON1_LNGLNGCLICK options below to recover the
  461. // reset mode and factory reset functionalities, or link other actions like
  462. // AP mode in the commented line below.
  463. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  464. #define BUTTON1_CLICK BUTTON_MODE_NONE
  465. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  466. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  467. //#define BUTTON1_LNGCLICK BUTTON_MODE_AP
  468. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  469. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  470. #define BUTTON2_CLICK BUTTON_MODE_NONE
  471. #define BUTTON3_PRESS BUTTON_MODE_TOGGLE
  472. #define BUTTON3_CLICK BUTTON_MODE_NONE
  473. #define BUTTON4_PRESS BUTTON_MODE_TOGGLE
  474. #define BUTTON4_CLICK BUTTON_MODE_NONE
  475. // Relays
  476. #define RELAY1_PIN 12
  477. #define RELAY2_PIN 5
  478. #define RELAY3_PIN 4
  479. #define RELAY4_PIN 15
  480. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  481. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  482. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  483. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  484. // LEDs
  485. #define LED1_PIN 13
  486. #define LED1_PIN_INVERSE 1
  487. #elif defined(ITEAD_1CH_INCHING)
  488. // The inching functionality is managed by a misterious IC in the board.
  489. // You cannot control the inching button and functionality from the ESP8266
  490. // Besides, enabling the inching functionality using the hardware button
  491. // will result in the relay switching on and off continuously.
  492. // Fortunately the unkown IC keeps memory of the hardware inching status
  493. // so you can just disable it and forget. The inching LED must be lit.
  494. // You can still use the pulse options from the web interface
  495. // without problem.
  496. // Info
  497. #define MANUFACTURER "ITEAD"
  498. #define DEVICE "1CH_INCHING"
  499. // Buttons
  500. #define BUTTON1_PIN 0
  501. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  502. #define BUTTON1_RELAY 1
  503. // Relays
  504. #define RELAY1_PIN 12
  505. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  506. // LEDs
  507. #define LED1_PIN 13
  508. #define LED1_PIN_INVERSE 1
  509. #elif defined(ITEAD_MOTOR)
  510. // Info
  511. #define MANUFACTURER "ITEAD"
  512. #define DEVICE "MOTOR"
  513. // Buttons
  514. #define BUTTON1_PIN 0
  515. #define BUTTON1_RELAY 1
  516. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  517. // Relays
  518. #define RELAY1_PIN 12
  519. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  520. // LEDs
  521. #define LED1_PIN 13
  522. #define LED1_PIN_INVERSE 1
  523. #elif defined(ITEAD_BNSZ01)
  524. // Info
  525. #define MANUFACTURER "ITEAD"
  526. #define DEVICE "BNSZ01"
  527. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  528. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  529. #define DUMMY_RELAY_COUNT 1
  530. // LEDs
  531. #define LED1_PIN 13
  532. #define LED1_PIN_INVERSE 1
  533. // Light
  534. #define LIGHT_CHANNELS 1
  535. #define LIGHT_CH1_PIN 12
  536. #define LIGHT_CH1_INVERSE 0
  537. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  538. // Info
  539. #define MANUFACTURER "ITEAD"
  540. #define DEVICE "SONOFF_RFBRIDGE"
  541. #define RELAY_PROVIDER RELAY_PROVIDER_RFBRIDGE
  542. // Number of virtual switches
  543. #ifndef DUMMY_RELAY_COUNT
  544. #define DUMMY_RELAY_COUNT 8
  545. #endif
  546. // Buttons
  547. #define BUTTON1_PIN 0
  548. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  549. // LEDs
  550. #define LED1_PIN 13
  551. #define LED1_PIN_INVERSE 1
  552. // RFB Direct hack thanks to @wildwiz
  553. // https://github.com/xoseperez/espurna/wiki/Hardware-Itead-Sonoff-RF-Bridge---Direct-Hack
  554. #ifndef RFB_DIRECT
  555. #define RFB_DIRECT 0
  556. #endif
  557. #ifndef RFB_RX_PIN
  558. #define RFB_RX_PIN 4 // GPIO for RX when RFB_DIRECT
  559. #endif
  560. #ifndef RFB_TX_PIN
  561. #define RFB_TX_PIN 5 // GPIO for TX when RFB_DIRECT
  562. #endif
  563. // When using un-modified harware, ESPurna communicates with the secondary
  564. // MCU EFM8BB1 via UART at 19200 bps so we need to change the speed of
  565. // the port and remove UART noise on serial line
  566. #if not RFB_DIRECT
  567. #define SERIAL_BAUDRATE 19200
  568. #define DEBUG_SERIAL_SUPPORT 0
  569. #endif
  570. #elif defined(ITEAD_SONOFF_B1)
  571. // Info
  572. #define MANUFACTURER "ITEAD"
  573. #define DEVICE "SONOFF_B1"
  574. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  575. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  576. #define DUMMY_RELAY_COUNT 1
  577. // Light
  578. #define LIGHT_CHANNELS 5
  579. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  580. #define MY92XX_CHIPS 2
  581. #define MY92XX_DI_PIN 12
  582. #define MY92XX_DCKI_PIN 14
  583. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  584. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  585. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  586. #elif defined(ITEAD_SONOFF_LED)
  587. // Info
  588. #define MANUFACTURER "ITEAD"
  589. #define DEVICE "SONOFF_LED"
  590. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  591. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  592. #define DUMMY_RELAY_COUNT 1
  593. // LEDs
  594. #define LED1_PIN 13
  595. #define LED1_PIN_INVERSE 1
  596. // Light
  597. #define LIGHT_CHANNELS 2
  598. #define LIGHT_CH1_PIN 12 // Cold white
  599. #define LIGHT_CH2_PIN 14 // Warm white
  600. #define LIGHT_CH1_INVERSE 0
  601. #define LIGHT_CH2_INVERSE 0
  602. #elif defined(ITEAD_SONOFF_T1_1CH)
  603. // Info
  604. #define MANUFACTURER "ITEAD"
  605. #define DEVICE "SONOFF_T1_1CH"
  606. // Buttons
  607. #define BUTTON1_PIN 0
  608. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  609. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  610. #define BUTTON1_CLICK BUTTON_MODE_NONE
  611. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  612. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  613. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  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. #elif defined(ITEAD_SONOFF_T1_2CH)
  622. // Info
  623. #define MANUFACTURER "ITEAD"
  624. #define DEVICE "SONOFF_T1_2CH"
  625. // Buttons
  626. #define BUTTON1_PIN 0
  627. #define BUTTON2_PIN 9
  628. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  629. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  630. #define BUTTON1_CLICK BUTTON_MODE_NONE
  631. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  632. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  633. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  634. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  635. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  636. #define BUTTON2_CLICK BUTTON_MODE_NONE
  637. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  638. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  639. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  640. #define BUTTON1_RELAY 1
  641. #define BUTTON2_RELAY 2
  642. // Relays
  643. #define RELAY1_PIN 12
  644. #define RELAY2_PIN 5
  645. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  646. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  647. // LEDs
  648. #define LED1_PIN 13
  649. #define LED1_PIN_INVERSE 1
  650. #elif defined(ITEAD_SONOFF_T1_3CH)
  651. // Info
  652. #define MANUFACTURER "ITEAD"
  653. #define DEVICE "SONOFF_T1_3CH"
  654. // Buttons
  655. #define BUTTON1_PIN 0
  656. #define BUTTON2_PIN 9
  657. #define BUTTON3_PIN 10
  658. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  659. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  660. #define BUTTON1_CLICK BUTTON_MODE_NONE
  661. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  662. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  663. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  664. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  665. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  666. #define BUTTON2_CLICK BUTTON_MODE_NONE
  667. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  668. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  669. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  670. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  671. #define BUTTON3_PRESS BUTTON_MODE_TOGGLE
  672. #define BUTTON3_CLICK BUTTON_MODE_NONE
  673. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  674. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  675. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_RESET
  676. #define BUTTON1_RELAY 1
  677. #define BUTTON2_RELAY 2
  678. #define BUTTON3_RELAY 3
  679. // Relays
  680. #define RELAY1_PIN 12
  681. #define RELAY2_PIN 5
  682. #define RELAY3_PIN 4
  683. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  684. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  685. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  686. // LEDs
  687. #define LED1_PIN 13
  688. #define LED1_PIN_INVERSE 1
  689. #elif defined(ITEAD_SONOFF_S31)
  690. // Info
  691. #define MANUFACTURER "ITEAD"
  692. #define DEVICE "SONOFF_S31"
  693. // Buttons
  694. #define BUTTON1_PIN 0
  695. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  696. #define BUTTON1_RELAY 1
  697. // Relays
  698. #define RELAY1_PIN 12
  699. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  700. // LEDs
  701. #define LED1_PIN 13
  702. #define LED1_PIN_INVERSE 1
  703. // Disable UART noise
  704. #define DEBUG_SERIAL_SUPPORT 0
  705. // CSE7766
  706. #define CSE7766_SUPPORT 1
  707. #define CSE7766_PIN 1
  708. #elif defined(ITEAD_SONOFF_IFAN02)
  709. // Info
  710. #define MANUFACTURER "ITEAD"
  711. #define DEVICE "SONOFF_IFAN02"
  712. // These are virtual buttons triggered by the remote
  713. #define BUTTON1_PIN 0
  714. #define BUTTON2_PIN 9
  715. #define BUTTON3_PIN 10
  716. #define BUTTON4_PIN 14
  717. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  718. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  719. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  720. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  721. // Relays
  722. #define RELAY1_PIN 12
  723. #define RELAY2_PIN 5
  724. #define RELAY3_PIN 4
  725. #define RELAY4_PIN 15
  726. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  727. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  728. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  729. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  730. // LEDs
  731. #define LED1_PIN 13
  732. #define LED1_PIN_INVERSE 1
  733. // -----------------------------------------------------------------------------
  734. // YJZK
  735. // -----------------------------------------------------------------------------
  736. #elif defined(YJZK_SWITCH_1CH)
  737. // Info
  738. #define MANUFACTURER "YJZK"
  739. #define DEVICE "SWITCH_1CH"
  740. // Buttons
  741. #define BUTTON1_PIN 0
  742. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  743. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  744. #define BUTTON1_CLICK BUTTON_MODE_NONE
  745. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  746. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  747. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  748. #define BUTTON1_RELAY 1
  749. // Relays
  750. #define RELAY1_PIN 12
  751. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  752. // LEDs
  753. #define LED1_PIN 13
  754. #define LED1_PIN_INVERSE 0
  755. #elif defined(YJZK_SWITCH_2CH)
  756. // Info
  757. #define MANUFACTURER "YJZK"
  758. #define DEVICE "SWITCH_2CH"
  759. // Buttons
  760. #define BUTTON1_PIN 0
  761. #define BUTTON2_PIN 9
  762. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  763. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  764. #define BUTTON1_CLICK BUTTON_MODE_NONE
  765. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  766. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  767. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  768. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  769. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  770. #define BUTTON2_CLICK BUTTON_MODE_NONE
  771. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  772. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  773. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  774. #define BUTTON1_RELAY 1
  775. #define BUTTON2_RELAY 2
  776. // Relays
  777. #define RELAY1_PIN 12
  778. #define RELAY2_PIN 5
  779. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  780. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  781. // LEDs
  782. #define LED1_PIN 13
  783. #define LED1_PIN_INVERSE 0
  784. // YJZK 3CH switch
  785. // Also Lixin Touch Wifi 3M
  786. #elif defined(YJZK_SWITCH_3CH)
  787. // Info
  788. #define MANUFACTURER "YJZK"
  789. #define DEVICE "SWITCH_3CH"
  790. // Buttons
  791. #define BUTTON1_PIN 0
  792. #define BUTTON2_PIN 9
  793. #define BUTTON3_PIN 10
  794. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  795. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  796. #define BUTTON1_CLICK BUTTON_MODE_NONE
  797. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  798. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  799. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  800. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  801. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  802. #define BUTTON2_CLICK BUTTON_MODE_NONE
  803. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  804. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  805. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  806. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  807. #define BUTTON3_PRESS BUTTON_MODE_TOGGLE
  808. #define BUTTON3_CLICK BUTTON_MODE_NONE
  809. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  810. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  811. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_RESET
  812. #define BUTTON1_RELAY 1
  813. #define BUTTON2_RELAY 2
  814. #define BUTTON3_RELAY 3
  815. // Relays
  816. #define RELAY1_PIN 12
  817. #define RELAY2_PIN 5
  818. #define RELAY3_PIN 4
  819. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  820. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  821. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  822. // LEDs
  823. #define LED1_PIN 13
  824. #define LED1_PIN_INVERSE 0
  825. // -----------------------------------------------------------------------------
  826. // Electrodragon boards
  827. // -----------------------------------------------------------------------------
  828. #elif defined(ELECTRODRAGON_WIFI_IOT)
  829. // Info
  830. #define MANUFACTURER "ELECTRODRAGON"
  831. #define DEVICE "WIFI_IOT"
  832. // Buttons
  833. #define BUTTON1_PIN 0
  834. #define BUTTON2_PIN 2
  835. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  836. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  837. #define BUTTON1_RELAY 1
  838. #define BUTTON2_RELAY 2
  839. // Relays
  840. #define RELAY1_PIN 12
  841. #define RELAY2_PIN 13
  842. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  843. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  844. // LEDs
  845. #define LED1_PIN 16
  846. #define LED1_PIN_INVERSE 0
  847. // -----------------------------------------------------------------------------
  848. // WorkChoice ecoPlug
  849. // -----------------------------------------------------------------------------
  850. #elif defined(WORKCHOICE_ECOPLUG)
  851. // Info
  852. #define MANUFACTURER "WORKCHOICE"
  853. #define DEVICE "ECOPLUG"
  854. // Buttons
  855. #define BUTTON1_PIN 13
  856. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  857. #define BUTTON1_RELAY 1
  858. // Relays
  859. #define RELAY1_PIN 15
  860. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  861. // LEDs
  862. #define LED1_PIN 2
  863. #define LED1_PIN_INVERSE 0
  864. // -----------------------------------------------------------------------------
  865. // AI Thinker
  866. // -----------------------------------------------------------------------------
  867. #elif defined(AITHINKER_AI_LIGHT)
  868. // Info
  869. #define MANUFACTURER "AITHINKER"
  870. #define DEVICE "AI_LIGHT"
  871. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  872. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  873. #define DUMMY_RELAY_COUNT 1
  874. // Light
  875. #define LIGHT_CHANNELS 4
  876. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  877. #define MY92XX_CHIPS 1
  878. #define MY92XX_DI_PIN 13
  879. #define MY92XX_DCKI_PIN 15
  880. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  881. #define MY92XX_MAPPING 0, 1, 2, 3
  882. // -----------------------------------------------------------------------------
  883. // LED Controller
  884. // -----------------------------------------------------------------------------
  885. #elif defined(MAGICHOME_LED_CONTROLLER)
  886. // Info
  887. #define MANUFACTURER "MAGICHOME"
  888. #define DEVICE "LED_CONTROLLER"
  889. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  890. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  891. #define DUMMY_RELAY_COUNT 1
  892. // LEDs
  893. #define LED1_PIN 2
  894. #define LED1_PIN_INVERSE 1
  895. // Light
  896. #define LIGHT_CHANNELS 4
  897. #define LIGHT_CH1_PIN 14 // RED
  898. #define LIGHT_CH2_PIN 5 // GREEN
  899. #define LIGHT_CH3_PIN 12 // BLUE
  900. #define LIGHT_CH4_PIN 13 // WHITE
  901. #define LIGHT_CH1_INVERSE 0
  902. #define LIGHT_CH2_INVERSE 0
  903. #define LIGHT_CH3_INVERSE 0
  904. #define LIGHT_CH4_INVERSE 0
  905. // IR
  906. #define IR_SUPPORT 1
  907. #define IR_RX_PIN 4
  908. #define IR_BUTTON_SET 1
  909. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  910. // Info
  911. #define MANUFACTURER "MAGICHOME"
  912. #define DEVICE "LED_CONTROLLER_20"
  913. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  914. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  915. #define DUMMY_RELAY_COUNT 1
  916. // LEDs
  917. #define LED1_PIN 2
  918. #define LED1_PIN_INVERSE 1
  919. // Light
  920. #define LIGHT_CHANNELS 4
  921. #define LIGHT_CH1_PIN 5 // RED
  922. #define LIGHT_CH2_PIN 12 // GREEN
  923. #define LIGHT_CH3_PIN 13 // BLUE
  924. #define LIGHT_CH4_PIN 15 // WHITE
  925. #define LIGHT_CH1_INVERSE 0
  926. #define LIGHT_CH2_INVERSE 0
  927. #define LIGHT_CH3_INVERSE 0
  928. #define LIGHT_CH4_INVERSE 0
  929. // IR
  930. #define IR_SUPPORT 1
  931. #define IR_RX_PIN 4
  932. #define IR_BUTTON_SET 1
  933. // -----------------------------------------------------------------------------
  934. // HUACANXING H801 & H802
  935. // -----------------------------------------------------------------------------
  936. #elif defined(HUACANXING_H801)
  937. // Info
  938. #define MANUFACTURER "HUACANXING"
  939. #define DEVICE "H801"
  940. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  941. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  942. #define DUMMY_RELAY_COUNT 1
  943. #define DEBUG_PORT Serial1
  944. #define SERIAL_RX_ENABLED 1
  945. // LEDs
  946. #define LED1_PIN 5
  947. #define LED1_PIN_INVERSE 1
  948. // Light
  949. #define LIGHT_CHANNELS 5
  950. #define LIGHT_CH1_PIN 15 // RED
  951. #define LIGHT_CH2_PIN 13 // GREEN
  952. #define LIGHT_CH3_PIN 12 // BLUE
  953. #define LIGHT_CH4_PIN 14 // WHITE1
  954. #define LIGHT_CH5_PIN 4 // WHITE2
  955. #define LIGHT_CH1_INVERSE 0
  956. #define LIGHT_CH2_INVERSE 0
  957. #define LIGHT_CH3_INVERSE 0
  958. #define LIGHT_CH4_INVERSE 0
  959. #define LIGHT_CH5_INVERSE 0
  960. #elif defined(HUACANXING_H802)
  961. // Info
  962. #define MANUFACTURER "HUACANXING"
  963. #define DEVICE "H802"
  964. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  965. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  966. #define DUMMY_RELAY_COUNT 1
  967. #define DEBUG_PORT Serial1
  968. #define SERIAL_RX_ENABLED 1
  969. // Light
  970. #define LIGHT_CHANNELS 4
  971. #define LIGHT_CH1_PIN 12 // RED
  972. #define LIGHT_CH2_PIN 14 // GREEN
  973. #define LIGHT_CH3_PIN 13 // BLUE
  974. #define LIGHT_CH4_PIN 15 // WHITE
  975. #define LIGHT_CH1_INVERSE 0
  976. #define LIGHT_CH2_INVERSE 0
  977. #define LIGHT_CH3_INVERSE 0
  978. #define LIGHT_CH4_INVERSE 0
  979. // -----------------------------------------------------------------------------
  980. // Jan Goedeke Wifi Relay
  981. // https://github.com/JanGoe/esp8266-wifi-relay
  982. // -----------------------------------------------------------------------------
  983. #elif defined(JANGOE_WIFI_RELAY_NC)
  984. // Info
  985. #define MANUFACTURER "JANGOE"
  986. #define DEVICE "WIFI_RELAY_NC"
  987. // Buttons
  988. #define BUTTON1_PIN 12
  989. #define BUTTON2_PIN 13
  990. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  991. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  992. #define BUTTON1_RELAY 1
  993. #define BUTTON2_RELAY 2
  994. // Relays
  995. #define RELAY1_PIN 2
  996. #define RELAY2_PIN 14
  997. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  998. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  999. #elif defined(JANGOE_WIFI_RELAY_NO)
  1000. // Info
  1001. #define MANUFACTURER "JANGOE"
  1002. #define DEVICE "WIFI_RELAY_NO"
  1003. // Buttons
  1004. #define BUTTON1_PIN 12
  1005. #define BUTTON2_PIN 13
  1006. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1007. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1008. #define BUTTON1_RELAY 1
  1009. #define BUTTON2_RELAY 2
  1010. // Relays
  1011. #define RELAY1_PIN 2
  1012. #define RELAY2_PIN 14
  1013. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1014. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1015. // -----------------------------------------------------------------------------
  1016. // Jorge García Wifi+Relays Board Kit
  1017. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  1018. // https://github.com/jorgegarciadev/wifikit
  1019. // -----------------------------------------------------------------------------
  1020. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  1021. // Info
  1022. #define MANUFACTURER "JORGEGARCIA"
  1023. #define DEVICE "WIFI_RELAYS"
  1024. // Relays
  1025. #define RELAY1_PIN 0
  1026. #define RELAY2_PIN 2
  1027. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1028. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1029. // -----------------------------------------------------------------------------
  1030. // WiFi MQTT Relay / Thermostat
  1031. // -----------------------------------------------------------------------------
  1032. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  1033. // Info
  1034. #define MANUFACTURER "OPENENERGYMONITOR"
  1035. #define DEVICE "MQTT_RELAY"
  1036. // Buttons
  1037. #define BUTTON1_PIN 0
  1038. #define BUTTON1_RELAY 1
  1039. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1040. // Relays
  1041. #define RELAY1_PIN 12
  1042. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1043. // LEDs
  1044. #define LED1_PIN 16
  1045. #define LED1_PIN_INVERSE 0
  1046. // -----------------------------------------------------------------------------
  1047. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  1048. // 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
  1049. // 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
  1050. // -----------------------------------------------------------------------------
  1051. #elif defined(WION_50055)
  1052. // Currently untested, does not support energy monitoring
  1053. // Info
  1054. #define MANUFACTURER "WION"
  1055. #define DEVICE "50055"
  1056. // Buttons
  1057. #define BUTTON1_PIN 13
  1058. #define BUTTON1_RELAY 1
  1059. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1060. // Relays
  1061. #define RELAY1_PIN 15
  1062. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1063. // LEDs
  1064. #define LED1_PIN 2
  1065. #define LED1_PIN_INVERSE 0
  1066. // -----------------------------------------------------------------------------
  1067. // EX-Store Wifi Relay v3.1
  1068. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  1069. // -----------------------------------------------------------------------------
  1070. #elif defined(EXS_WIFI_RELAY_V31)
  1071. // Untested
  1072. // Info
  1073. #define MANUFACTURER "EXS"
  1074. #define DEVICE "WIFI_RELAY_V31"
  1075. // Buttons
  1076. #define BUTTON1_PIN 0
  1077. #define BUTTON1_RELAY 1
  1078. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1079. // Relays
  1080. #define RELAY1_PIN 13
  1081. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1082. #define RELAY1_RESET_PIN 12
  1083. // -----------------------------------------------------------------------------
  1084. // EX-Store Wifi Relay v5.0
  1085. // -----------------------------------------------------------------------------
  1086. #elif defined(EXS_WIFI_RELAY_V50)
  1087. // Info
  1088. #define MANUFACTURER "EXS"
  1089. #define DEVICE "WIFI_RELAY_V50"
  1090. // Buttons
  1091. #define BUTTON1_PIN 5
  1092. #define BUTTON2_PIN 4
  1093. #define BUTTON1_RELAY 1
  1094. #define BUTTON2_RELAY 2
  1095. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1096. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1097. // Relays
  1098. #define RELAY1_PIN 14
  1099. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1100. #define RELAY1_RESET_PIN 16
  1101. #define RELAY2_PIN 13
  1102. #define RELAY2_TYPE RELAY_TYPE_LATCHED
  1103. #define RELAY2_RESET_PIN 12
  1104. // LEDs
  1105. #define LED1_PIN 15
  1106. #define LED1_PIN_INVERSE 0
  1107. // -----------------------------------------------------------------------------
  1108. // V9261F
  1109. // -----------------------------------------------------------------------------
  1110. #elif defined(GENERIC_V9261F)
  1111. // Info
  1112. #define MANUFACTURER "GENERIC"
  1113. #define DEVICE "V9261F"
  1114. #define ALEXA_SUPPORT 0
  1115. // V9261F
  1116. #define V9261F_SUPPORT 1
  1117. #define V9261F_PIN 2
  1118. #define V9261F_PIN_INVERSE 1
  1119. // -----------------------------------------------------------------------------
  1120. // ECH1560
  1121. // -----------------------------------------------------------------------------
  1122. #elif defined(GENERIC_ECH1560)
  1123. // Info
  1124. #define MANUFACTURER "GENERIC"
  1125. #define DEVICE "ECH1560"
  1126. #define ALEXA_SUPPORT 0
  1127. // ECH1560
  1128. #define ECH1560_SUPPORT 1
  1129. #define ECH1560_CLK_PIN 4
  1130. #define ECH1560_MISO_PIN 5
  1131. #define ECH1560_INVERTED 0
  1132. // -----------------------------------------------------------------------------
  1133. // ESPLive
  1134. // https://github.com/ManCaveMade/ESP-Live
  1135. // -----------------------------------------------------------------------------
  1136. #elif defined(MANCAVEMADE_ESPLIVE)
  1137. // Info
  1138. #define MANUFACTURER "MANCAVEMADE"
  1139. #define DEVICE "ESPLIVE"
  1140. // Buttons
  1141. #define BUTTON1_PIN 4
  1142. #define BUTTON2_PIN 5
  1143. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1144. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1145. #define BUTTON1_RELAY 1
  1146. #define BUTTON2_RELAY 2
  1147. // Relays
  1148. #define RELAY1_PIN 12
  1149. #define RELAY2_PIN 13
  1150. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1151. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1152. // DS18B20
  1153. #ifndef DALLAS_SUPPORT
  1154. #define DALLAS_SUPPORT 1
  1155. #endif
  1156. #define DALLAS_PIN 2
  1157. #define DALLAS_UPDATE_INTERVAL 5000
  1158. #define TEMPERATURE_MIN_CHANGE 1.0
  1159. // -----------------------------------------------------------------------------
  1160. // QuinLED
  1161. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  1162. // -----------------------------------------------------------------------------
  1163. #elif defined(INTERMITTECH_QUINLED)
  1164. // Info
  1165. #define MANUFACTURER "INTERMITTECH"
  1166. #define DEVICE "QUINLED"
  1167. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1168. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1169. #define DUMMY_RELAY_COUNT 1
  1170. // LEDs
  1171. #define LED1_PIN 5
  1172. #define LED1_PIN_INVERSE 1
  1173. // Light
  1174. #define LIGHT_CHANNELS 2
  1175. #define LIGHT_CH1_PIN 0
  1176. #define LIGHT_CH2_PIN 2
  1177. #define LIGHT_CH1_INVERSE 0
  1178. #define LIGHT_CH2_INVERSE 0
  1179. // -----------------------------------------------------------------------------
  1180. // Arilux AL-LC06
  1181. // -----------------------------------------------------------------------------
  1182. #elif defined(ARILUX_AL_LC01)
  1183. // Info
  1184. #define MANUFACTURER "ARILUX"
  1185. #define DEVICE "AL_LC01"
  1186. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1187. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1188. #define DUMMY_RELAY_COUNT 1
  1189. // Light
  1190. #define LIGHT_CHANNELS 3
  1191. #define LIGHT_CH1_PIN 5 // RED
  1192. #define LIGHT_CH2_PIN 12 // GREEN
  1193. #define LIGHT_CH3_PIN 13 // BLUE
  1194. #define LIGHT_CH1_INVERSE 0
  1195. #define LIGHT_CH2_INVERSE 0
  1196. #define LIGHT_CH3_INVERSE 0
  1197. #elif defined(ARILUX_AL_LC02)
  1198. // Info
  1199. #define MANUFACTURER "ARILUX"
  1200. #define DEVICE "AL_LC02"
  1201. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1202. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1203. #define DUMMY_RELAY_COUNT 1
  1204. // Light
  1205. #define LIGHT_CHANNELS 4
  1206. #define LIGHT_CH1_PIN 12 // RED
  1207. #define LIGHT_CH2_PIN 5 // GREEN
  1208. #define LIGHT_CH3_PIN 13 // BLUE
  1209. #define LIGHT_CH4_PIN 15 // WHITE1
  1210. #define LIGHT_CH1_INVERSE 0
  1211. #define LIGHT_CH2_INVERSE 0
  1212. #define LIGHT_CH3_INVERSE 0
  1213. #define LIGHT_CH4_INVERSE 0
  1214. #elif defined(ARILUX_AL_LC06)
  1215. // Info
  1216. #define MANUFACTURER "ARILUX"
  1217. #define DEVICE "AL_LC06"
  1218. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1219. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1220. #define DUMMY_RELAY_COUNT 1
  1221. // Light
  1222. #define LIGHT_CHANNELS 5
  1223. #define LIGHT_CH1_PIN 14 // RED
  1224. #define LIGHT_CH2_PIN 12 // GREEN
  1225. #define LIGHT_CH3_PIN 13 // BLUE
  1226. #define LIGHT_CH4_PIN 15 // WHITE1
  1227. #define LIGHT_CH5_PIN 5 // WHITE2
  1228. #define LIGHT_CH1_INVERSE 0
  1229. #define LIGHT_CH2_INVERSE 0
  1230. #define LIGHT_CH3_INVERSE 0
  1231. #define LIGHT_CH4_INVERSE 0
  1232. #define LIGHT_CH5_INVERSE 0
  1233. #elif defined(ARILUX_AL_LC11)
  1234. // Info
  1235. #define MANUFACTURER "ARILUX"
  1236. #define DEVICE "AL_LC11"
  1237. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1238. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1239. #define DUMMY_RELAY_COUNT 1
  1240. // Light
  1241. #define LIGHT_CHANNELS 5
  1242. #define LIGHT_CH1_PIN 5 // RED
  1243. #define LIGHT_CH2_PIN 4 // GREEN
  1244. #define LIGHT_CH3_PIN 14 // BLUE
  1245. #define LIGHT_CH4_PIN 13 // WHITE1
  1246. #define LIGHT_CH5_PIN 12 // WHITE1
  1247. #define LIGHT_CH1_INVERSE 0
  1248. #define LIGHT_CH2_INVERSE 0
  1249. #define LIGHT_CH3_INVERSE 0
  1250. #define LIGHT_CH4_INVERSE 0
  1251. #define LIGHT_CH5_INVERSE 0
  1252. #elif defined(ARILUX_E27)
  1253. // Info
  1254. #define MANUFACTURER "ARILUX"
  1255. #define DEVICE "E27"
  1256. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1257. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1258. #define DUMMY_RELAY_COUNT 1
  1259. // Light
  1260. #define LIGHT_CHANNELS 4
  1261. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  1262. #define MY92XX_CHIPS 1
  1263. #define MY92XX_DI_PIN 13
  1264. #define MY92XX_DCKI_PIN 15
  1265. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1266. #define MY92XX_MAPPING 0, 1, 2, 3
  1267. // -----------------------------------------------------------------------------
  1268. // XENON SM-PW701U
  1269. // -----------------------------------------------------------------------------
  1270. #elif defined(XENON_SM_PW702U)
  1271. // Info
  1272. #define MANUFACTURER "XENON"
  1273. #define DEVICE "SM_PW702U"
  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 1
  1284. // -----------------------------------------------------------------------------
  1285. // AUTHOMETION LYT8266
  1286. // https://authometion.com/shop/en/home/13-lyt8266.html
  1287. // -----------------------------------------------------------------------------
  1288. #elif defined(AUTHOMETION_LYT8266)
  1289. // Info
  1290. #define MANUFACTURER "AUTHOMETION"
  1291. #define DEVICE "LYT8266"
  1292. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1293. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1294. #define DUMMY_RELAY_COUNT 1
  1295. // Light
  1296. #define LIGHT_CHANNELS 4
  1297. #define LIGHT_CH1_PIN 13 // RED
  1298. #define LIGHT_CH2_PIN 12 // GREEN
  1299. #define LIGHT_CH3_PIN 14 // BLUE
  1300. #define LIGHT_CH4_PIN 2 // WHITE
  1301. #define LIGHT_CH1_INVERSE 0
  1302. #define LIGHT_CH2_INVERSE 0
  1303. #define LIGHT_CH3_INVERSE 0
  1304. #define LIGHT_CH4_INVERSE 0
  1305. #define LIGHT_ENABLE_PIN 15
  1306. #elif defined(GIZWITS_WITTY_CLOUD)
  1307. // Info
  1308. #define MANUFACTURER "GIZWITS"
  1309. #define DEVICE "WITTY_CLOUD"
  1310. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1311. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1312. #define DUMMY_RELAY_COUNT 1
  1313. // Buttons
  1314. #define BUTTON1_PIN 4
  1315. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1316. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  1317. #define BUTTON1_CLICK BUTTON_MODE_NONE
  1318. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1319. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1320. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  1321. #define ANALOG_SUPPORT 1
  1322. // LEDs
  1323. #define LED1_PIN 2 // BLUE build-in
  1324. #define LED1_PIN_INVERSE 1
  1325. // Light
  1326. #define LIGHT_CHANNELS 3
  1327. #define LIGHT_CH1_PIN 15 // RED
  1328. #define LIGHT_CH2_PIN 12 // GREEN
  1329. #define LIGHT_CH3_PIN 13 // BLUE
  1330. #define LIGHT_CH1_INVERSE 0
  1331. #define LIGHT_CH2_INVERSE 0
  1332. #define LIGHT_CH3_INVERSE 0
  1333. // -----------------------------------------------------------------------------
  1334. // KMC 70011
  1335. // https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
  1336. // -----------------------------------------------------------------------------
  1337. #elif defined(KMC_70011)
  1338. // Info
  1339. #define MANUFACTURER "KMC"
  1340. #define DEVICE "70011"
  1341. // Buttons
  1342. #define BUTTON1_PIN 0
  1343. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1344. #define BUTTON1_RELAY 1
  1345. // Relays
  1346. #define RELAY1_PIN 14
  1347. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1348. // LEDs
  1349. #define LED1_PIN 13
  1350. #define LED1_PIN_INVERSE 1
  1351. // HLW8012
  1352. #ifndef HLW8012_SUPPORT
  1353. #define HLW8012_SUPPORT 1
  1354. #endif
  1355. #define HLW8012_SEL_PIN 12
  1356. #define HLW8012_CF1_PIN 5
  1357. #define HLW8012_CF_PIN 4
  1358. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1359. // -----------------------------------------------------------------------------
  1360. // Euromate (?) Wifi Stecker Shuko
  1361. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  1362. // Thanks to @Geitde
  1363. // -----------------------------------------------------------------------------
  1364. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  1365. // Info
  1366. #define MANUFACTURER "EUROMATE"
  1367. #define DEVICE "WIFI_STECKER_SCHUKO"
  1368. // Buttons
  1369. #define BUTTON1_PIN 14
  1370. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1371. #define BUTTON1_RELAY 1
  1372. // The relay in the device is not a bistable (latched) relay.
  1373. // The device is reported to have a flip-flop circuit to drive the relay
  1374. // So @Geitde hack is still the only possible
  1375. // Hack: drive GPIO12 low and use GPIO5 as normal relay pin:
  1376. #define RELAY1_PIN 5
  1377. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1378. #define LED2_PIN 12 /* DUMMY: exploit default off state for GPIO12=low */
  1379. #define LED2_PIN_INVERSE 0
  1380. // LEDs
  1381. #define LED1_PIN 4
  1382. #define LED1_PIN_INVERSE 0
  1383. // -----------------------------------------------------------------------------
  1384. // Generic 8CH
  1385. // -----------------------------------------------------------------------------
  1386. #elif defined(GENERIC_8CH)
  1387. // Info
  1388. #define MANUFACTURER "GENERIC"
  1389. #define DEVICE "8CH"
  1390. // Relays
  1391. #define RELAY1_PIN 0
  1392. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1393. #define RELAY2_PIN 2
  1394. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1395. #define RELAY3_PIN 4
  1396. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1397. #define RELAY4_PIN 5
  1398. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1399. #define RELAY5_PIN 12
  1400. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1401. #define RELAY6_PIN 13
  1402. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  1403. #define RELAY7_PIN 14
  1404. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  1405. #define RELAY8_PIN 15
  1406. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  1407. // -----------------------------------------------------------------------------
  1408. // STM RELAY
  1409. // -----------------------------------------------------------------------------
  1410. #elif defined(STM_RELAY)
  1411. // Info
  1412. #define MANUFACTURER "STM_RELAY"
  1413. #define DEVICE "2CH"
  1414. // Relays
  1415. #define DUMMY_RELAY_COUNT 2
  1416. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  1417. // Remove UART noise on serial line
  1418. #define DEBUG_SERIAL_SUPPORT 0
  1419. // -----------------------------------------------------------------------------
  1420. // Tonbux Powerstrip02
  1421. // -----------------------------------------------------------------------------
  1422. #elif defined(TONBUX_POWERSTRIP02)
  1423. // Info
  1424. #define MANUFACTURER "TONBUX"
  1425. #define DEVICE "POWERSTRIP02"
  1426. // Buttons
  1427. #define BUTTON1_PIN 5
  1428. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1429. #define BUTTON1_RELAY 0
  1430. // Relays
  1431. #define RELAY1_PIN 4
  1432. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1433. #define RELAY2_PIN 13
  1434. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1435. #define RELAY3_PIN 12
  1436. #define RELAY3_TYPE RELAY_TYPE_INVERSE
  1437. #define RELAY4_PIN 14
  1438. #define RELAY4_TYPE RELAY_TYPE_INVERSE
  1439. // Not a relay. USB ports on/off
  1440. #define RELAY5_PIN 16
  1441. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1442. // LEDs
  1443. #define LED1_PIN 0 // 1 blue led
  1444. #define LED1_PIN_INVERSE 1
  1445. #define LED2_PIN 3 // 3 red leds
  1446. #define LED2_PIN_INVERSE 1
  1447. // -----------------------------------------------------------------------------
  1448. // Lingan SWA1
  1449. // -----------------------------------------------------------------------------
  1450. #elif defined(LINGAN_SWA1)
  1451. // Info
  1452. #define MANUFACTURER "LINGAN"
  1453. #define DEVICE "SWA1"
  1454. // Buttons
  1455. #define BUTTON1_PIN 13
  1456. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1457. #define BUTTON1_RELAY 1
  1458. // Relays
  1459. #define RELAY1_PIN 5
  1460. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1461. // LEDs
  1462. #define LED1_PIN 4
  1463. #define LED1_PIN_INVERSE 1
  1464. // -----------------------------------------------------------------------------
  1465. // HEYGO HY02
  1466. // -----------------------------------------------------------------------------
  1467. #elif defined(HEYGO_HY02)
  1468. // Info
  1469. #define MANUFACTURER "HEYGO"
  1470. #define DEVICE "HY02"
  1471. // Buttons
  1472. #define BUTTON1_PIN 13
  1473. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1474. #define BUTTON1_RELAY 1
  1475. // Relays
  1476. #define RELAY1_PIN 12
  1477. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1478. // LEDs
  1479. #define LED1_PIN 4
  1480. #define LED1_PIN_INVERSE 0
  1481. // -----------------------------------------------------------------------------
  1482. // Maxcio W-US002S
  1483. // -----------------------------------------------------------------------------
  1484. #elif defined(MAXCIO_WUS002S)
  1485. // Info
  1486. #define MANUFACTURER "MAXCIO"
  1487. #define DEVICE "WUS002S"
  1488. // Buttons
  1489. #define BUTTON1_PIN 2
  1490. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1491. #define BUTTON1_RELAY 1
  1492. // Relays
  1493. #define RELAY1_PIN 13
  1494. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1495. // LEDs
  1496. #define LED1_PIN 3
  1497. #define LED1_PIN_INVERSE 0
  1498. // HLW8012
  1499. #ifndef HLW8012_SUPPORT
  1500. #define HLW8012_SUPPORT 1
  1501. #endif
  1502. #define HLW8012_SEL_PIN 12
  1503. #define HLW8012_CF1_PIN 5
  1504. #define HLW8012_CF_PIN 4
  1505. #define HLW8012_CURRENT_R 0.002 // Current resistor
  1506. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1507. // -----------------------------------------------------------------------------
  1508. // Maxcio W-DE004
  1509. // -----------------------------------------------------------------------------
  1510. #elif defined(MAXCIO_WDE004)
  1511. // Info
  1512. #define MANUFACTURER "MAXCIO"
  1513. #define DEVICE "WDE004"
  1514. // Buttons
  1515. #define BUTTON1_PIN 1
  1516. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1517. #define BUTTON1_RELAY 1
  1518. // Relays
  1519. #define RELAY1_PIN 14
  1520. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1521. // LEDs
  1522. #define LED1_PIN 13
  1523. #define LED1_PIN_INVERSE 1
  1524. // -----------------------------------------------------------------------------
  1525. // YiDian XS-SSA05
  1526. // -----------------------------------------------------------------------------
  1527. #elif defined(YIDIAN_XSSSA05)
  1528. // Info
  1529. #define MANUFACTURER "YIDIAN"
  1530. #define DEVICE "XSSSA05"
  1531. // Buttons
  1532. #define BUTTON1_PIN 13
  1533. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1534. #define BUTTON1_RELAY 1
  1535. // Relays
  1536. #define RELAY1_PIN 12
  1537. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1538. // LEDs
  1539. #define LED1_PIN 0 // red
  1540. #define LED1_PIN_INVERSE 1
  1541. #define LED1_MODE LED_MODE_WIFI
  1542. #define LED2_PIN 15 // blue
  1543. #define LED2_PIN_INVERSE 1
  1544. #define LED2_MODE LED_MODE_RELAY
  1545. // HLW8012
  1546. #ifndef HLW8012_SUPPORT
  1547. #define HLW8012_SUPPORT 1
  1548. #endif
  1549. #define HLW8012_SEL_PIN 3
  1550. #define HLW8012_CF1_PIN 14
  1551. #define HLW8012_CF_PIN 5
  1552. #define HLW8012_SEL_CURRENT LOW
  1553. #define HLW8012_CURRENT_RATIO 25740
  1554. #define HLW8012_VOLTAGE_RATIO 313400
  1555. #define HLW8012_POWER_RATIO 3414290
  1556. #define HLW8012_INTERRUPT_ON FALLING
  1557. // -----------------------------------------------------------------------------
  1558. // TONBUX XS-SSA01
  1559. // -----------------------------------------------------------------------------
  1560. #elif defined(TONBUX_XSSSA01)
  1561. // Info
  1562. #define MANUFACTURER "TONBUX"
  1563. #define DEVICE "XSSSA01"
  1564. // Buttons
  1565. #define BUTTON1_PIN 4
  1566. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1567. #define BUTTON1_RELAY 1
  1568. // Relays
  1569. #define RELAY1_PIN 14
  1570. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1571. // LEDs
  1572. #define LED1_PIN 13
  1573. #define LED1_PIN_INVERSE 0
  1574. // -----------------------------------------------------------------------------
  1575. // TONBUX XS-SSA06
  1576. // -----------------------------------------------------------------------------
  1577. #elif defined(TONBUX_XSSSA06)
  1578. // Info
  1579. #define MANUFACTURER "TONBUX"
  1580. #define DEVICE "XSSSA06"
  1581. // Buttons
  1582. #define BUTTON1_PIN 13
  1583. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1584. #define BUTTON1_RELAY 1
  1585. // Relays
  1586. #define RELAY1_PIN 15
  1587. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1588. // LEDs
  1589. #define LED1_PIN 0 // R - 8 rgb led ring
  1590. #define LED1_PIN_INVERSE 0
  1591. #define LED2_PIN 5 // G
  1592. #define LED2_PIN_INVERSE 0
  1593. #define LED3_PIN 2 // B
  1594. #define LED3_PIN_INVERSE 0
  1595. // -----------------------------------------------------------------------------
  1596. // GREEN ESP8266 RELAY MODULE
  1597. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1598. // -----------------------------------------------------------------------------
  1599. #elif defined(GREEN_ESP8266RELAY)
  1600. // Info
  1601. #define MANUFACTURER "GREEN"
  1602. #define DEVICE "ESP8266RELAY"
  1603. // Buttons
  1604. // Not a button but input via Optocoupler
  1605. #define BUTTON1_PIN 5
  1606. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1607. #define BUTTON1_RELAY 1
  1608. // Relays
  1609. #define RELAY1_PIN 4
  1610. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1611. // LEDs
  1612. #define LED1_PIN 2
  1613. #define LED1_PIN_INVERSE 1
  1614. // -----------------------------------------------------------------------------
  1615. // Henrique Gravina ESPIKE
  1616. // https://github.com/Henriquegravina/Espike
  1617. // -----------------------------------------------------------------------------
  1618. #elif defined(IKE_ESPIKE)
  1619. #define MANUFACTURER "IKE"
  1620. #define DEVICE "ESPIKE"
  1621. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1622. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1623. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1624. #define BUTTON1_PIN 13
  1625. #define BUTTON1_RELAY 1
  1626. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1627. #define BUTTON2_PIN 12
  1628. #define BUTTON2_RELAY 2
  1629. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1630. #define BUTTON3_PIN 14
  1631. #define BUTTON3_RELAY 3
  1632. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1633. #define RELAY1_PIN 4
  1634. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1635. #define RELAY2_PIN 5
  1636. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1637. #define RELAY3_PIN 16
  1638. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1639. #define LED1_PIN 2
  1640. #define LED1_PIN_INVERSE 1
  1641. // -----------------------------------------------------------------------------
  1642. // SWIFITCH
  1643. // https://github.com/ArnieX/swifitch
  1644. // -----------------------------------------------------------------------------
  1645. #elif defined(ARNIEX_SWIFITCH)
  1646. // Info
  1647. #define MANUFACTURER "ARNIEX"
  1648. #define DEVICE "SWIFITCH"
  1649. // Buttons
  1650. #define BUTTON1_PIN 4 // D2
  1651. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1652. #define BUTTON1_RELAY 1
  1653. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1654. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1655. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1656. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1657. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1658. // Relays
  1659. #define RELAY1_PIN 5 // D1
  1660. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1661. // LEDs
  1662. #define LED1_PIN 12 // D6
  1663. #define LED1_PIN_INVERSE 1
  1664. // -----------------------------------------------------------------------------
  1665. // ESP-01S RELAY v4.0
  1666. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  1667. // -----------------------------------------------------------------------------
  1668. #elif defined(GENERIC_ESP01S_RELAY_V40)
  1669. // Info
  1670. #define MANUFACTURER "GENERIC"
  1671. #define DEVICE "ESP01S_RELAY_40"
  1672. // Relays
  1673. #define RELAY1_PIN 0
  1674. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1675. // LEDs
  1676. #define LED1_PIN 2
  1677. #define LED1_PIN_INVERSE 0
  1678. // -----------------------------------------------------------------------------
  1679. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  1680. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  1681. // -----------------------------------------------------------------------------
  1682. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  1683. // Info
  1684. #define MANUFACTURER "GENERIC"
  1685. #define DEVICE "ESP01S_RGBLED_10"
  1686. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  1687. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  1688. // Buttons
  1689. //#define BUTTON1_PIN 2
  1690. // Relays
  1691. //#define RELAY1_PIN 2
  1692. // LEDs
  1693. #define LED1_PIN 2
  1694. #define LED1_PIN_INVERSE 0
  1695. // -----------------------------------------------------------------------------
  1696. // ESP-01S DHT11 v1.0
  1697. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  1698. // -----------------------------------------------------------------------------
  1699. #elif defined(GENERIC_ESP01S_DHT11_V10)
  1700. // Info
  1701. #define MANUFACTURER "GENERIC"
  1702. #define DEVICE "ESP01S_DHT11_10"
  1703. // DHT11
  1704. #ifndef DHT_SUPPORT
  1705. #define DHT_SUPPORT 1
  1706. #endif
  1707. #define DHT_PIN 2
  1708. #define DHT_TYPE DHT_CHIP_DHT11
  1709. // -----------------------------------------------------------------------------
  1710. // ESP-01S DS18B20 v1.0
  1711. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  1712. // -----------------------------------------------------------------------------
  1713. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  1714. // Info
  1715. #define MANUFACTURER "GENERIC"
  1716. #define DEVICE "ESP01S_DS18B20_10"
  1717. // DB18B20
  1718. #ifndef DALLAS_SUPPORT
  1719. #define DALLAS_SUPPORT 1
  1720. #endif
  1721. #define DALLAS_PIN 2
  1722. // -----------------------------------------------------------------------------
  1723. // ESP-DIN relay board V1
  1724. // https://github.com/pilotak/esp_din
  1725. // -----------------------------------------------------------------------------
  1726. #elif defined(PILOTAK_ESP_DIN_V1)
  1727. // Info
  1728. #define MANUFACTURER "PILOTAK"
  1729. #define DEVICE "ESP_DIN_V1"
  1730. // Buttons
  1731. #define BUTTON1_PIN 0
  1732. #define BUTTON1_RELAY 1
  1733. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1734. // Relays
  1735. #define RELAY1_PIN 4
  1736. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1737. #define RELAY2_PIN 5
  1738. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1739. // LEDs
  1740. #define LED1_PIN 15
  1741. #define LED1_PIN_INVERSE 0
  1742. #define I2C_SDA_PIN 12
  1743. #define I2C_SCL_PIN 13
  1744. #ifndef DALLAS_SUPPORT
  1745. #define DALLAS_SUPPORT 1
  1746. #endif
  1747. #define DALLAS_PIN 2
  1748. #ifndef RF_SUPPORT
  1749. #define RF_SUPPORT 1
  1750. #endif
  1751. #define RF_PIN 14
  1752. #ifndef DIGITAL_SUPPORT
  1753. #define DIGITAL_SUPPORT 1
  1754. #endif
  1755. #define DIGITAL_PIN 16
  1756. #define DIGITAL_PIN_MODE INPUT
  1757. // -----------------------------------------------------------------------------
  1758. // Heltec Touch Relay
  1759. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  1760. // -----------------------------------------------------------------------------
  1761. #elif defined(HELTEC_TOUCHRELAY)
  1762. // Info
  1763. #define MANUFACTURER "HELTEC"
  1764. #define DEVICE "TOUCH_RELAY"
  1765. // Buttons
  1766. #define BUTTON1_PIN 14
  1767. #define BUTTON1_RELAY 1
  1768. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1769. // Relays
  1770. #define RELAY1_PIN 12
  1771. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1772. // -----------------------------------------------------------------------------
  1773. // Zhilde ZLD-EU44-W
  1774. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  1775. // -----------------------------------------------------------------------------
  1776. #elif defined(ZHILDE_EU44_W)
  1777. // Info
  1778. #define MANUFACTURER "ZHILDE"
  1779. #define DEVICE "EU44_W"
  1780. // Based on the reporter, this product uses GPIO1 and 3 for the button
  1781. // and onboard LED, so hardware serial should be disabled...
  1782. #define DEBUG_SERIAL_SUPPORT 0
  1783. // Buttons
  1784. #define BUTTON1_PIN 3
  1785. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1786. // Relays
  1787. #define RELAY1_PIN 5
  1788. #define RELAY2_PIN 4
  1789. #define RELAY3_PIN 12
  1790. #define RELAY4_PIN 13
  1791. #define RELAY5_PIN 14
  1792. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1793. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1794. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1795. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1796. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1797. // LEDs
  1798. #define LED1_PIN 1
  1799. #define LED1_PIN_INVERSE 1
  1800. // -----------------------------------------------------------------------------
  1801. // Allnet 4duino ESP8266-UP-Relais
  1802. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  1803. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  1804. // -----------------------------------------------------------------------------
  1805. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  1806. // Info
  1807. #define MANUFACTURER "ALLNET"
  1808. #define DEVICE "4DUINO_IOT_WLAN_RELAIS"
  1809. // Relays
  1810. #define RELAY1_PIN 14
  1811. #define RELAY1_RESET_PIN 12
  1812. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1813. // LEDs
  1814. #define LED1_PIN 0
  1815. #define LED1_PIN_INVERSE 1
  1816. // Buttons
  1817. //#define BUTTON1_PIN 0
  1818. //#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1819. // Using pins labelled as SDA & SCL as buttons
  1820. #define BUTTON2_PIN 4
  1821. #define BUTTON2_MODE BUTTON_PUSHBUTTON
  1822. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  1823. #define BUTTON2_CLICK BUTTON_MODE_NONE
  1824. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  1825. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  1826. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  1827. #define BUTTON3_PIN 5
  1828. #define BUTTON3_MODE BUTTON_PUSHBUTTON
  1829. // Using pins labelled as SDA & SCL for I2C
  1830. //#define I2C_SDA_PIN 4
  1831. //#define I2C_SCL_PIN 5
  1832. // -----------------------------------------------------------------------------
  1833. // Luani HVIO
  1834. // https://luani.de/projekte/esp8266-hvio/
  1835. // https://luani.de/blog/esp8266-230v-io-modul/
  1836. // -----------------------------------------------------------------------------
  1837. #elif defined(LUANI_HVIO)
  1838. // Info
  1839. #define MANUFACTURER "LUANI"
  1840. #define DEVICE "HVIO"
  1841. // Buttons
  1842. #define BUTTON1_PIN 12
  1843. #define BUTTON1_RELAY 1
  1844. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  1845. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1846. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1847. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1848. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1849. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1850. #define BUTTON2_PIN 13
  1851. #define BUTTON2_RELAY 2
  1852. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  1853. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  1854. // Relays
  1855. #define RELAY1_PIN 4
  1856. #define RELAY2_PIN 5
  1857. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1858. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1859. // LEDs
  1860. #define LED1_PIN 15
  1861. #define LED1_PIN_INVERSE 0
  1862. // -----------------------------------------------------------------------------
  1863. // Tonbux 50-100M Smart Mosquito Killer USB
  1864. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  1865. // -----------------------------------------------------------------------------
  1866. #elif defined(TONBUX_MOSQUITO_KILLER)
  1867. // Info
  1868. #define MANUFACTURER "TONBUX"
  1869. #define DEVICE "MOSQUITO_KILLER"
  1870. // Buttons
  1871. #define BUTTON1_PIN 2
  1872. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1873. #define BUTTON1_RELAY 1
  1874. // Relays
  1875. #define RELAY1_PIN 5 // not a relay, fan
  1876. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1877. // LEDs
  1878. #define LED1_PIN 15 // blue led
  1879. #define LED1_PIN_INVERSE 1
  1880. #define LED1_MODE LED_MODE_WIFI
  1881. #define LED2_PIN 14 // red led
  1882. #define LED2_PIN_INVERSE 1
  1883. #define LED2_MODE LED_MODE_RELAY
  1884. #define LED3_PIN 12 // UV leds (1-2-3-4-5-6-7-8)
  1885. #define LED3_PIN_INVERSE 0
  1886. #define LED3_RELAY 1
  1887. #define LED4_PIN 16 // UV leds (9-10-11)
  1888. #define LED4_PIN_INVERSE 0
  1889. #define LED4_RELAY 1
  1890. // -----------------------------------------------------------------------------
  1891. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  1892. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  1893. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  1894. // -----------------------------------------------------------------------------
  1895. #elif defined(NEO_COOLCAM_NAS_WR01W)
  1896. // Info
  1897. #define MANUFACTURER "NEO_COOLCAM"
  1898. #define DEVICE "NAS_WR01W"
  1899. // Buttons
  1900. #define BUTTON1_PIN 13
  1901. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1902. #define BUTTON1_RELAY 1
  1903. // Relays
  1904. #define RELAY1_PIN 12
  1905. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1906. // LEDs
  1907. #define LED1_PIN 4
  1908. #define LED1_PIN_INVERSE 1
  1909. // ------------------------------------------------------------------------------
  1910. // Estink Wifi Power Strip
  1911. // https://www.amazon.de/Steckdosenleiste-Ladeger%C3%A4t-Sprachsteuerung-SmartphonesTablets-Android/dp/B0796W5FZY
  1912. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  1913. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  1914. // -----------------------------------------------------------------------------
  1915. #elif defined(ESTINK_WIFI_POWER_STRIP)
  1916. // Info
  1917. #define MANUFACTURER "ESTINK"
  1918. #define DEVICE "WIFI_POWER_STRIP"
  1919. // Disable UART noise since this board uses GPIO3
  1920. #define DEBUG_SERIAL_SUPPORT 0
  1921. // Buttons
  1922. #define BUTTON1_PIN 16
  1923. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1924. #define BUTTON1_RELAY 4
  1925. // Relays
  1926. #define RELAY1_PIN 14 // USB power
  1927. #define RELAY2_PIN 13 // power plug 1
  1928. #define RELAY3_PIN 4 // power plug 2
  1929. #define RELAY4_PIN 15 // power plug 3
  1930. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1931. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1932. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1933. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1934. // LEDs
  1935. #define LED1_PIN 0 // power led
  1936. #define LED2_PIN 12 // power plug 1
  1937. #define LED3_PIN 3 // power plug 2
  1938. #define LED4_PIN 5 // power plug 3
  1939. #define LED1_PIN_INVERSE 1
  1940. #define LED2_PIN_INVERSE 1
  1941. #define LED3_PIN_INVERSE 1
  1942. #define LED4_PIN_INVERSE 1
  1943. #define LED1_MODE LED_MODE_FINDME
  1944. #define LED2_MODE LED_MODE_FOLLOW
  1945. #define LED3_MODE LED_MODE_FOLLOW
  1946. #define LED4_MODE LED_MODE_FOLLOW
  1947. #define LED2_RELAY 2
  1948. #define LED3_RELAY 3
  1949. #define LED4_RELAY 4
  1950. // -----------------------------------------------------------------------------
  1951. // Bruno Horta's OnOfre
  1952. // https://www.bhonofre.pt/
  1953. // https://github.com/brunohorta82/BH_OnOfre/
  1954. // -----------------------------------------------------------------------------
  1955. #elif defined(BH_ONOFRE)
  1956. // Info
  1957. #define MANUFACTURER "BH"
  1958. #define DEVICE "ONOFRE"
  1959. // Buttons
  1960. #define BUTTON1_PIN 12
  1961. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1962. #define BUTTON1_RELAY 1
  1963. #define BUTTON2_PIN 13
  1964. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1965. #define BUTTON2_RELAY 2
  1966. // Relays
  1967. #define RELAY1_PIN 4
  1968. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1969. #define RELAY2_PIN 5
  1970. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1971. // -----------------------------------------------------------------------------
  1972. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  1973. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  1974. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  1975. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  1976. // * Goosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  1977. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  1978. // -----------------------------------------------------------------------------
  1979. #elif defined(BLITZWOLF_BWSHP2)
  1980. // Info
  1981. #define MANUFACTURER "BLITZWOLF"
  1982. #define DEVICE "BWSHP2"
  1983. // Buttons
  1984. #define BUTTON1_PIN 13
  1985. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1986. #define BUTTON1_RELAY 1
  1987. // Relays
  1988. #define RELAY1_PIN 15
  1989. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1990. // LEDs
  1991. #define LED1_PIN 2
  1992. #define LED1_PIN_INVERSE 1
  1993. #define LED2_PIN 0
  1994. #define LED2_PIN_INVERSE 1
  1995. #define LED2_MODE LED_MODE_FINDME
  1996. #define LED2_RELAY 1
  1997. // HJL01 / BL0937
  1998. #ifndef HLW8012_SUPPORT
  1999. #define HLW8012_SUPPORT 1
  2000. #endif
  2001. #define HLW8012_SEL_PIN 12
  2002. #define HLW8012_CF1_PIN 14
  2003. #define HLW8012_CF_PIN 5
  2004. #define HLW8012_SEL_CURRENT LOW
  2005. #define HLW8012_CURRENT_RATIO 25740
  2006. #define HLW8012_VOLTAGE_RATIO 313400
  2007. #define HLW8012_POWER_RATIO 3414290
  2008. #define HLW8012_INTERRUPT_ON FALLING
  2009. // ----------------------------------------------------------------------------------------
  2010. // Homecube 16A is similar but some pins differ and it also has RGB LEDs
  2011. // https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
  2012. // ----------------------------------------------------------------------------------------
  2013. #elif defined(HOMECUBE_16A)
  2014. // Info
  2015. #define MANUFACTURER "HOMECUBE"
  2016. #define DEVICE "16A"
  2017. // Buttons
  2018. #define BUTTON1_PIN 13
  2019. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2020. #define BUTTON1_RELAY 1
  2021. // Relays
  2022. #define RELAY1_PIN 15
  2023. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2024. // LEDs
  2025. //LED Pin 4 - ESP8266 onboard LED
  2026. //Red LED: 0
  2027. //Green LED: 12
  2028. //Blue LED: 2
  2029. // Blue
  2030. #define LED1_PIN 2
  2031. #define LED1_PIN_INVERSE 0
  2032. // Green
  2033. #define LED2_PIN 12
  2034. #define LED2_PIN_INVERSE 1
  2035. #define LED2_MODE LED_MODE_RELAY
  2036. // Red
  2037. #define LED3_PIN 0
  2038. #define LED3_PIN_INVERSE 0
  2039. #define LED3_MODE LED_MODE_OFF
  2040. // HJL01 / BL0937
  2041. #ifndef HLW8012_SUPPORT
  2042. #define HLW8012_SUPPORT 1
  2043. #endif
  2044. #define HLW8012_SEL_PIN 16
  2045. #define HLW8012_CF1_PIN 14
  2046. #define HLW8012_CF_PIN 5
  2047. #define HLW8012_SEL_CURRENT LOW
  2048. #define HLW8012_CURRENT_RATIO 25740
  2049. #define HLW8012_VOLTAGE_RATIO 313400
  2050. #define HLW8012_POWER_RATIO 3414290
  2051. #define HLW8012_INTERRUPT_ON FALLING
  2052. // -----------------------------------------------------------------------------
  2053. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  2054. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  2055. // -----------------------------------------------------------------------------
  2056. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  2057. // Info
  2058. #define MANUFACTURER "VANZAVANZU"
  2059. #define DEVICE "SMART_WIFI_PLUG_MINI"
  2060. // Buttons
  2061. #define BUTTON1_PIN 13
  2062. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2063. #define BUTTON1_RELAY 1
  2064. // Relays
  2065. #define RELAY1_PIN 15
  2066. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2067. // LEDs
  2068. #define LED1_PIN 2
  2069. #define LED1_PIN_INVERSE 1
  2070. #define LED2_PIN 0
  2071. #define LED2_PIN_INVERSE 1
  2072. #define LED2_MODE LED_MODE_FINDME
  2073. #define LED2_RELAY 1
  2074. // Disable UART noise
  2075. #define DEBUG_SERIAL_SUPPORT 0
  2076. // HJL01 / BL0937
  2077. #ifndef HLW8012_SUPPORT
  2078. #define HLW8012_SUPPORT 1
  2079. #endif
  2080. #define HLW8012_SEL_PIN 3
  2081. #define HLW8012_CF1_PIN 14
  2082. #define HLW8012_CF_PIN 5
  2083. #define HLW8012_SEL_CURRENT LOW
  2084. #define HLW8012_CURRENT_RATIO 25740
  2085. #define HLW8012_VOLTAGE_RATIO 313400
  2086. #define HLW8012_POWER_RATIO 3414290
  2087. #define HLW8012_INTERRUPT_ON FALLING
  2088. // -----------------------------------------------------------------------------
  2089. #elif defined(GENERIC_AG_L4)
  2090. // Info
  2091. #define MANUFACTURER "GENERIC"
  2092. #define DEVICE "AG_L4"
  2093. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2094. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2095. #define DUMMY_RELAY_COUNT 1
  2096. // button 1: "power" button
  2097. #define BUTTON1_PIN 4
  2098. #define BUTTON1_RELAY 1
  2099. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2100. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  2101. #define BUTTON1_CLICK BUTTON_MODE_NONE
  2102. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2103. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2104. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  2105. // button 2: "wifi" button
  2106. #define BUTTON2_PIN 2
  2107. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2108. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  2109. #define BUTTON2_CLICK BUTTON_MODE_NONE
  2110. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  2111. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  2112. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  2113. // LEDs
  2114. #define LED1_PIN 5 // red status led
  2115. #define LED1_PIN_INVERSE 0
  2116. #define LED2_PIN 16 // master light power
  2117. #define LED2_PIN_INVERSE 1
  2118. #define LED2_MODE LED_MODE_RELAY
  2119. // Light
  2120. #define LIGHT_CHANNELS 3
  2121. #define LIGHT_CH1_PIN 14 // RED
  2122. #define LIGHT_CH2_PIN 13 // GREEN
  2123. #define LIGHT_CH3_PIN 12 // BLUE
  2124. #define LIGHT_CH1_INVERSE 0
  2125. #define LIGHT_CH2_INVERSE 0
  2126. #define LIGHT_CH3_INVERSE 0
  2127. // -----------------------------------------------------------------------------
  2128. #elif defined(ALLTERCO_SHELLY1)
  2129. // Info
  2130. #define MANUFACTURER "ALLTERCO"
  2131. #define DEVICE "SHELLY1"
  2132. // Buttons
  2133. #define BUTTON1_PIN 5
  2134. #define BUTTON1_MODE BUTTON_SWITCH
  2135. #define BUTTON1_RELAY 1
  2136. // Relays
  2137. #define RELAY1_PIN 4
  2138. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2139. #elif defined(ALLTERCO_SHELLY2)
  2140. // Info
  2141. #define MANUFACTURER "ALLTERCO"
  2142. #define DEVICE "SHELLY2"
  2143. // Buttons
  2144. #define BUTTON1_PIN 12
  2145. #define BUTTON2_PIN 14
  2146. #define BUTTON1_MODE BUTTON_SWITCH
  2147. #define BUTTON2_MODE BUTTON_SWITCH
  2148. #define BUTTON1_RELAY 1
  2149. #define BUTTON2_RELAY 2
  2150. // Relays
  2151. #define RELAY1_PIN 4
  2152. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2153. #define RELAY2_PIN 5
  2154. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2155. // -----------------------------------------------------------------------------
  2156. #elif defined(LOHAS_9W)
  2157. // Info
  2158. #define MANUFACTURER "LOHAS"
  2159. #define DEVICE "E27_9W"
  2160. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2161. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2162. #define DUMMY_RELAY_COUNT 1
  2163. // Light
  2164. #define LIGHT_CHANNELS 5
  2165. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2166. #define MY92XX_CHIPS 2
  2167. #define MY92XX_DI_PIN 13
  2168. #define MY92XX_DCKI_PIN 15
  2169. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2170. #define MY92XX_MAPPING 0, 1, 2, 3, 4
  2171. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  2172. // -----------------------------------------------------------------------------
  2173. #elif defined(XIAOMI_SMART_DESK_LAMP)
  2174. // Info
  2175. #define MANUFACTURER "XIAOMI"
  2176. #define DEVICE "SMART_DESK_LAMP"
  2177. // Buttons
  2178. #define BUTTON1_PIN 2
  2179. #define BUTTON2_PIN 14
  2180. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2181. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2182. // This button doubles as switch here and as encoder mode switch below
  2183. // Clicking it (for less than 500ms) will turn the light on and off
  2184. // Double and Long clicks will not work as these are used to modify the encoder action
  2185. #define BUTTON1_RELAY 1
  2186. #define BUTTON_LNGCLICK_DELAY 500
  2187. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2188. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2189. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  2190. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  2191. #define BUTTON2_DBLCLICK BUTTON_MODE_AP
  2192. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  2193. // Light
  2194. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2195. #define DUMMY_RELAY_COUNT 1
  2196. #define LIGHT_STEP 8
  2197. #define LIGHT_CHANNELS 2
  2198. #define LIGHT_CH1_PIN 5 // warm white
  2199. #define LIGHT_CH1_INVERSE 0
  2200. #define LIGHT_CH2_PIN 4 // cold white
  2201. #define LIGHT_CH2_INVERSE 0
  2202. // Encoder
  2203. // If mode is ENCODER_MODE_RATIO, the value ratio between both channels is changed
  2204. // when the button is not pressed, and the overall brightness when pressed
  2205. // If mode is ENCODER_MODE_CHANNEL, the first channel value is changed
  2206. // when the button is not pressed, and the second channel when pressed
  2207. // If no ENCODERX_BUTTON_PIN defined it will only change the value of the first defined channel
  2208. #define ENCODER_SUPPORT 1
  2209. #define ENCODER1_PIN1 12
  2210. #define ENCODER1_PIN2 13
  2211. #define ENCODER1_BUTTON_PIN 2 // active low by default, with software pullup
  2212. #define ENCODER1_CHANNEL1 0 // please note this value is 0-based (LIGHT_CH1 above)
  2213. #define ENCODER1_CHANNEL2 1 // please note this value is 0-based (LIGHT_CH2 above)
  2214. #define ENCODER1_MODE ENCODER_MODE_RATIO
  2215. #elif defined(PHYX_ESP12_RGB)
  2216. // Info
  2217. #define MANUFACTURER "PHYX"
  2218. #define DEVICE "ESP12_RGB"
  2219. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2220. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2221. #define DUMMY_RELAY_COUNT 1
  2222. // Light
  2223. #define LIGHT_CHANNELS 3
  2224. #define LIGHT_CH1_PIN 4 // RED
  2225. #define LIGHT_CH2_PIN 14 // GREEN
  2226. #define LIGHT_CH3_PIN 12 // BLUE
  2227. #define LIGHT_CH1_INVERSE 0
  2228. #define LIGHT_CH2_INVERSE 0
  2229. #define LIGHT_CH3_INVERSE 0
  2230. // -----------------------------------------------------------------------------
  2231. // iWoole LED Table Lamp
  2232. // http://iwoole.com/newst-led-smart-night-light-7w-smart-table-light-rgbw-wifi-app-remote-control-110v-220v-us-eu-plug-smart-lamp-google-home-decore-p00022p1.html
  2233. // -----------------------------------------------------------------------------
  2234. #elif defined(IWOOLE_LED_TABLE_LAMP)
  2235. // Info
  2236. #define MANUFACTURER "IWOOLE"
  2237. #define DEVICE "LED_TABLE_LAMP"
  2238. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2239. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2240. #define DUMMY_RELAY_COUNT 1
  2241. // Light
  2242. #define LIGHT_CHANNELS 4
  2243. #define LIGHT_CH1_PIN 12 // RED
  2244. #define LIGHT_CH2_PIN 5 // GREEN
  2245. #define LIGHT_CH3_PIN 14 // BLUE
  2246. #define LIGHT_CH4_PIN 4 // WHITE
  2247. #define LIGHT_CH1_INVERSE 0
  2248. #define LIGHT_CH2_INVERSE 0
  2249. #define LIGHT_CH3_INVERSE 0
  2250. #define LIGHT_CH4_INVERSE 0
  2251. // -----------------------------------------------------------------------------
  2252. // Bestek Smart Plug with 2 USB ports
  2253. // https://www.bestekcorp.com/bestek-smart-plug-works-with-amazon-alexa-google-assistant-and-ifttt-with-2-usb
  2254. // -----------------------------------------------------------------------------
  2255. #elif defined(BESTEK_MRJ1011)
  2256. // Info
  2257. #define MANUFACTURER "BESTEK"
  2258. #define DEVICE "MRJ1011"
  2259. // Buttons
  2260. #define BUTTON1_PIN 13
  2261. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2262. #define BUTTON1_RELAY 1
  2263. // Relay
  2264. #define RELAY1_PIN 12
  2265. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2266. // LED
  2267. #define LED1_PIN 4
  2268. #define LED1_PIN_INVERSE 1
  2269. // -----------------------------------------------------------------------------
  2270. // TEST boards (do not use!!)
  2271. // -----------------------------------------------------------------------------
  2272. #elif defined(TRAVIS01)
  2273. // Info
  2274. #define MANUFACTURER "TravisCI"
  2275. #define DEVICE "Virtual board 01"
  2276. // Some buttons - pin 0
  2277. #define BUTTON1_PIN 0
  2278. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2279. #define BUTTON1_RELAY 1
  2280. // Some relays - pin 1
  2281. #define RELAY1_PIN 1
  2282. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2283. // Some LEDs - pin 2
  2284. #define LED1_PIN 2
  2285. #define LED1_PIN_INVERSE 1
  2286. // A bit of I2C - pins 3,4
  2287. #define I2C_SDA_PIN 3
  2288. #define I2C_SCL_PIN 4
  2289. // And, as they say in "From Dusk till Dawn":
  2290. // This is a sensor blow out!
  2291. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  2292. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  2293. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  2294. // C'mon, you want sensor, come on in sensor lovers!
  2295. // If we don’t got it, you don't want it!
  2296. #define AM2320_SUPPORT 1
  2297. #define BH1750_SUPPORT 1
  2298. #define BMX280_SUPPORT 1
  2299. #define SHT3X_I2C_SUPPORT 1
  2300. #define EMON_ADC121_SUPPORT 1
  2301. #define EMON_ADS1X15_SUPPORT 1
  2302. #define SHT3X_I2C_SUPPORT 1
  2303. #define SI7021_SUPPORT 1
  2304. #define PMSX003_SUPPORT 1
  2305. #define SENSEAIR_SUPPORT1
  2306. // A bit of lights - pin 5
  2307. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2308. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2309. #define DUMMY_RELAY_COUNT 1
  2310. #define LIGHT_CHANNELS 1
  2311. #define LIGHT_CH1_PIN 5
  2312. #define LIGHT_CH1_INVERSE 0
  2313. // A bit of HLW8012 - pins 6,7,8
  2314. #ifndef HLW8012_SUPPORT
  2315. #define HLW8012_SUPPORT 1
  2316. #endif
  2317. #define HLW8012_SEL_PIN 6
  2318. #define HLW8012_CF1_PIN 7
  2319. #define HLW8012_CF_PIN 8
  2320. // A bit of Dallas - pin 9
  2321. #ifndef DALLAS_SUPPORT
  2322. #define DALLAS_SUPPORT 1
  2323. #endif
  2324. #define DALLAS_PIN 9
  2325. // A bit of ECH1560 - pins 10,11, 12
  2326. #ifndef ECH1560_SUPPORT
  2327. #define ECH1560_SUPPORT 1
  2328. #endif
  2329. #define ECH1560_CLK_PIN 10
  2330. #define ECH1560_MISO_PIN 11
  2331. #define ECH1560_INVERTED 12
  2332. // MICS-2710 & MICS-5525 test
  2333. #define MICS2710_SUPPORT 1
  2334. #define MICS5525_SUPPORT 1
  2335. #elif defined(TRAVIS02)
  2336. // Relay provider dual
  2337. #define MANUFACTURER "TravisCI"
  2338. #define DEVICE "Virtual board 02"
  2339. // Some buttons - pin 0
  2340. #define BUTTON1_PIN 0
  2341. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2342. #define BUTTON1_RELAY 1
  2343. // A bit of CSE7766 - pin 1
  2344. #ifndef CSE7766_SUPPORT
  2345. #define CSE7766_SUPPORT 1
  2346. #endif
  2347. #define CSE7766_PIN 1
  2348. // Relay type dual - pins 2,3
  2349. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  2350. #define RELAY1_PIN 2
  2351. #define RELAY2_PIN 3
  2352. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2353. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2354. // IR - pin 4
  2355. #define IR_SUPPORT 1
  2356. #define IR_RX_PIN 4
  2357. #define IR_BUTTON_SET 1
  2358. // A bit of DHT - pin 5
  2359. #ifndef DHT_SUPPORT
  2360. #define DHT_SUPPORT 1
  2361. #endif
  2362. #define DHT_PIN 5
  2363. // A bit of TMP3X (analog)
  2364. #define TMP3X_SUPPORT 1
  2365. // A bit of EVENTS - pin 10
  2366. #define EVENTS_SUPPORT 1
  2367. #define EVENTS_PIN 6
  2368. // Sonar
  2369. #define SONAR_SUPPORT 1
  2370. #define SONAR_TRIGGER 7
  2371. #define SONAR_ECHO 8
  2372. // MHZ19
  2373. #define MHZ19_SUPPORT 1
  2374. #define MHZ19_RX_PIN 9
  2375. #define MHZ19_TX_PIN 10
  2376. // PZEM004T
  2377. #define PZEM004T_SUPPORT 1
  2378. #define PZEM004T_RX_PIN 11
  2379. #define PZEM004T_TX_PIN 12
  2380. // V9261F
  2381. #define V9261F_SUPPORT 1
  2382. #define V9261F_PIN 13
  2383. // GUVAS12SD
  2384. #define GUVAS12SD_SUPPORT 1
  2385. #define GUVAS12SD_PIN 14
  2386. // Test non-default modules
  2387. #define MDNS_CLIENT_SUPPORT 1
  2388. #define NOFUSS_SUPPORT 1
  2389. #define UART_MQTT_SUPPORT 1
  2390. #define INFLUXDB_SUPPORT 1
  2391. #define IR_SUPPORT 1
  2392. #elif defined(TRAVIS03)
  2393. // Relay provider light/my92XX
  2394. #define MANUFACTURER "TravisCI"
  2395. #define DEVICE "Virtual board 03"
  2396. // Some buttons - pin 0
  2397. #define BUTTON1_PIN 0
  2398. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2399. #define BUTTON1_RELAY 1
  2400. // MY9231 Light - pins 1,2
  2401. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2402. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2403. #define DUMMY_RELAY_COUNT 1
  2404. #define LIGHT_CHANNELS 5
  2405. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2406. #define MY92XX_CHIPS 2
  2407. #define MY92XX_DI_PIN 1
  2408. #define MY92XX_DCKI_PIN 2
  2409. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2410. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  2411. // A bit of Analog EMON (analog)
  2412. #ifndef EMON_ANALOG_SUPPORT
  2413. #define EMON_ANALOG_SUPPORT 1
  2414. #endif
  2415. // Test non-default modules
  2416. #define LLMNR_SUPPORT 1
  2417. #define NETBIOS_SUPPORT 1
  2418. #define SSDP_SUPPORT 1
  2419. #endif
  2420. // -----------------------------------------------------------------------------
  2421. // Check definitions
  2422. // -----------------------------------------------------------------------------
  2423. #if not defined(MANUFACTURER) || not defined(DEVICE)
  2424. #error "UNSUPPORTED HARDWARE!!"
  2425. #endif