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.

3071 lines
97 KiB

7 years ago
7 years ago
6 years ago
6 years ago
7 years ago
7 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
  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-SSA06
  1559. // -----------------------------------------------------------------------------
  1560. #elif defined(TONBUX_XSSSA06)
  1561. // Info
  1562. #define MANUFACTURER "TONBUX"
  1563. #define DEVICE "XSSSA06"
  1564. // Buttons
  1565. #define BUTTON1_PIN 13
  1566. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1567. #define BUTTON1_RELAY 1
  1568. // Relays
  1569. #define RELAY1_PIN 15
  1570. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1571. // LEDs
  1572. #define LED1_PIN 0 // R - 8 rgb led ring
  1573. #define LED1_PIN_INVERSE 0
  1574. #define LED2_PIN 5 // G
  1575. #define LED2_PIN_INVERSE 0
  1576. #define LED3_PIN 2 // B
  1577. #define LED3_PIN_INVERSE 0
  1578. // -----------------------------------------------------------------------------
  1579. // GREEN ESP8266 RELAY MODULE
  1580. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1581. // -----------------------------------------------------------------------------
  1582. #elif defined(GREEN_ESP8266RELAY)
  1583. // Info
  1584. #define MANUFACTURER "GREEN"
  1585. #define DEVICE "ESP8266RELAY"
  1586. // Buttons
  1587. // Not a button but input via Optocoupler
  1588. #define BUTTON1_PIN 5
  1589. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1590. #define BUTTON1_RELAY 1
  1591. // Relays
  1592. #define RELAY1_PIN 4
  1593. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1594. // LEDs
  1595. #define LED1_PIN 2
  1596. #define LED1_PIN_INVERSE 1
  1597. // -----------------------------------------------------------------------------
  1598. // Henrique Gravina ESPIKE
  1599. // https://github.com/Henriquegravina/Espike
  1600. // -----------------------------------------------------------------------------
  1601. #elif defined(IKE_ESPIKE)
  1602. #define MANUFACTURER "IKE"
  1603. #define DEVICE "ESPIKE"
  1604. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1605. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1606. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1607. #define BUTTON1_PIN 13
  1608. #define BUTTON1_RELAY 1
  1609. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1610. #define BUTTON2_PIN 12
  1611. #define BUTTON2_RELAY 2
  1612. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1613. #define BUTTON3_PIN 14
  1614. #define BUTTON3_RELAY 3
  1615. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1616. #define RELAY1_PIN 4
  1617. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1618. #define RELAY2_PIN 5
  1619. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1620. #define RELAY3_PIN 16
  1621. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1622. #define LED1_PIN 2
  1623. #define LED1_PIN_INVERSE 1
  1624. // -----------------------------------------------------------------------------
  1625. // SWIFITCH
  1626. // https://github.com/ArnieX/swifitch
  1627. // -----------------------------------------------------------------------------
  1628. #elif defined(ARNIEX_SWIFITCH)
  1629. // Info
  1630. #define MANUFACTURER "ARNIEX"
  1631. #define DEVICE "SWIFITCH"
  1632. // Buttons
  1633. #define BUTTON1_PIN 4 // D2
  1634. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1635. #define BUTTON1_RELAY 1
  1636. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1637. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1638. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1639. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1640. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1641. // Relays
  1642. #define RELAY1_PIN 5 // D1
  1643. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1644. // LEDs
  1645. #define LED1_PIN 12 // D6
  1646. #define LED1_PIN_INVERSE 1
  1647. // -----------------------------------------------------------------------------
  1648. // ESP-01S RELAY v4.0
  1649. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  1650. // -----------------------------------------------------------------------------
  1651. #elif defined(GENERIC_ESP01S_RELAY_V40)
  1652. // Info
  1653. #define MANUFACTURER "GENERIC"
  1654. #define DEVICE "ESP01S_RELAY_40"
  1655. // Relays
  1656. #define RELAY1_PIN 0
  1657. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1658. // LEDs
  1659. #define LED1_PIN 2
  1660. #define LED1_PIN_INVERSE 0
  1661. // -----------------------------------------------------------------------------
  1662. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  1663. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  1664. // -----------------------------------------------------------------------------
  1665. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  1666. // Info
  1667. #define MANUFACTURER "GENERIC"
  1668. #define DEVICE "ESP01S_RGBLED_10"
  1669. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  1670. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  1671. // Buttons
  1672. //#define BUTTON1_PIN 2
  1673. // Relays
  1674. //#define RELAY1_PIN 2
  1675. // LEDs
  1676. #define LED1_PIN 2
  1677. #define LED1_PIN_INVERSE 0
  1678. // -----------------------------------------------------------------------------
  1679. // ESP-01S DHT11 v1.0
  1680. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  1681. // -----------------------------------------------------------------------------
  1682. #elif defined(GENERIC_ESP01S_DHT11_V10)
  1683. // Info
  1684. #define MANUFACTURER "GENERIC"
  1685. #define DEVICE "ESP01S_DHT11_10"
  1686. // DHT11
  1687. #ifndef DHT_SUPPORT
  1688. #define DHT_SUPPORT 1
  1689. #endif
  1690. #define DHT_PIN 2
  1691. #define DHT_TYPE DHT_CHIP_DHT11
  1692. // -----------------------------------------------------------------------------
  1693. // ESP-01S DS18B20 v1.0
  1694. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  1695. // -----------------------------------------------------------------------------
  1696. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  1697. // Info
  1698. #define MANUFACTURER "GENERIC"
  1699. #define DEVICE "ESP01S_DS18B20_10"
  1700. // DB18B20
  1701. #ifndef DALLAS_SUPPORT
  1702. #define DALLAS_SUPPORT 1
  1703. #endif
  1704. #define DALLAS_PIN 2
  1705. // -----------------------------------------------------------------------------
  1706. // ESP-DIN relay board V1
  1707. // https://github.com/pilotak/esp_din
  1708. // -----------------------------------------------------------------------------
  1709. #elif defined(PILOTAK_ESP_DIN_V1)
  1710. // Info
  1711. #define MANUFACTURER "PILOTAK"
  1712. #define DEVICE "ESP_DIN_V1"
  1713. // Buttons
  1714. #define BUTTON1_PIN 0
  1715. #define BUTTON1_RELAY 1
  1716. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1717. // Relays
  1718. #define RELAY1_PIN 4
  1719. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1720. #define RELAY2_PIN 5
  1721. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1722. // LEDs
  1723. #define LED1_PIN 15
  1724. #define LED1_PIN_INVERSE 0
  1725. #define I2C_SDA_PIN 12
  1726. #define I2C_SCL_PIN 13
  1727. #ifndef DALLAS_SUPPORT
  1728. #define DALLAS_SUPPORT 1
  1729. #endif
  1730. #define DALLAS_PIN 2
  1731. #ifndef RF_SUPPORT
  1732. #define RF_SUPPORT 1
  1733. #endif
  1734. #define RF_PIN 14
  1735. #ifndef DIGITAL_SUPPORT
  1736. #define DIGITAL_SUPPORT 1
  1737. #endif
  1738. #define DIGITAL_PIN 16
  1739. #define DIGITAL_PIN_MODE INPUT
  1740. // -----------------------------------------------------------------------------
  1741. // Heltec Touch Relay
  1742. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  1743. // -----------------------------------------------------------------------------
  1744. #elif defined(HELTEC_TOUCHRELAY)
  1745. // Info
  1746. #define MANUFACTURER "HELTEC"
  1747. #define DEVICE "TOUCH_RELAY"
  1748. // Buttons
  1749. #define BUTTON1_PIN 14
  1750. #define BUTTON1_RELAY 1
  1751. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1752. // Relays
  1753. #define RELAY1_PIN 12
  1754. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1755. // -----------------------------------------------------------------------------
  1756. // Zhilde ZLD-EU44-W
  1757. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  1758. // -----------------------------------------------------------------------------
  1759. #elif defined(ZHILDE_EU44_W)
  1760. // Info
  1761. #define MANUFACTURER "ZHILDE"
  1762. #define DEVICE "EU44_W"
  1763. // Based on the reporter, this product uses GPIO1 and 3 for the button
  1764. // and onboard LED, so hardware serial should be disabled...
  1765. #define DEBUG_SERIAL_SUPPORT 0
  1766. // Buttons
  1767. #define BUTTON1_PIN 3
  1768. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1769. // Relays
  1770. #define RELAY1_PIN 5
  1771. #define RELAY2_PIN 4
  1772. #define RELAY3_PIN 12
  1773. #define RELAY4_PIN 13
  1774. #define RELAY5_PIN 14
  1775. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1776. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1777. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1778. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1779. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1780. // LEDs
  1781. #define LED1_PIN 1
  1782. #define LED1_PIN_INVERSE 1
  1783. // -----------------------------------------------------------------------------
  1784. // Allnet 4duino ESP8266-UP-Relais
  1785. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  1786. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  1787. // -----------------------------------------------------------------------------
  1788. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  1789. // Info
  1790. #define MANUFACTURER "ALLNET"
  1791. #define DEVICE "4DUINO_IOT_WLAN_RELAIS"
  1792. // Relays
  1793. #define RELAY1_PIN 14
  1794. #define RELAY1_RESET_PIN 12
  1795. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1796. // LEDs
  1797. #define LED1_PIN 0
  1798. #define LED1_PIN_INVERSE 1
  1799. // Buttons
  1800. //#define BUTTON1_PIN 0
  1801. //#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1802. // Using pins labelled as SDA & SCL as buttons
  1803. #define BUTTON2_PIN 4
  1804. #define BUTTON2_MODE BUTTON_PUSHBUTTON
  1805. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  1806. #define BUTTON2_CLICK BUTTON_MODE_NONE
  1807. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  1808. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  1809. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  1810. #define BUTTON3_PIN 5
  1811. #define BUTTON3_MODE BUTTON_PUSHBUTTON
  1812. // Using pins labelled as SDA & SCL for I2C
  1813. //#define I2C_SDA_PIN 4
  1814. //#define I2C_SCL_PIN 5
  1815. // -----------------------------------------------------------------------------
  1816. // Luani HVIO
  1817. // https://luani.de/projekte/esp8266-hvio/
  1818. // https://luani.de/blog/esp8266-230v-io-modul/
  1819. // -----------------------------------------------------------------------------
  1820. #elif defined(LUANI_HVIO)
  1821. // Info
  1822. #define MANUFACTURER "LUANI"
  1823. #define DEVICE "HVIO"
  1824. // Buttons
  1825. #define BUTTON1_PIN 12
  1826. #define BUTTON1_RELAY 1
  1827. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  1828. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1829. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1830. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1831. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1832. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1833. #define BUTTON2_PIN 13
  1834. #define BUTTON2_RELAY 2
  1835. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  1836. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  1837. // Relays
  1838. #define RELAY1_PIN 4
  1839. #define RELAY2_PIN 5
  1840. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1841. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1842. // LEDs
  1843. #define LED1_PIN 15
  1844. #define LED1_PIN_INVERSE 0
  1845. // -----------------------------------------------------------------------------
  1846. // Tonbux 50-100M Smart Mosquito Killer USB
  1847. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  1848. // -----------------------------------------------------------------------------
  1849. #elif defined(TONBUX_MOSQUITO_KILLER)
  1850. // Info
  1851. #define MANUFACTURER "TONBUX"
  1852. #define DEVICE "MOSQUITO_KILLER"
  1853. // Buttons
  1854. #define BUTTON1_PIN 2
  1855. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1856. #define BUTTON1_RELAY 1
  1857. // Relays
  1858. #define RELAY1_PIN 5 // not a relay, fan
  1859. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1860. // LEDs
  1861. #define LED1_PIN 15 // blue led
  1862. #define LED1_PIN_INVERSE 1
  1863. #define LED1_MODE LED_MODE_WIFI
  1864. #define LED2_PIN 14 // red led
  1865. #define LED2_PIN_INVERSE 1
  1866. #define LED2_MODE LED_MODE_RELAY
  1867. #define LED3_PIN 12 // UV leds (1-2-3-4-5-6-7-8)
  1868. #define LED3_PIN_INVERSE 0
  1869. #define LED3_RELAY 1
  1870. #define LED4_PIN 16 // UV leds (9-10-11)
  1871. #define LED4_PIN_INVERSE 0
  1872. #define LED4_RELAY 1
  1873. // -----------------------------------------------------------------------------
  1874. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  1875. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  1876. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  1877. // -----------------------------------------------------------------------------
  1878. #elif defined(NEO_COOLCAM_NAS_WR01W)
  1879. // Info
  1880. #define MANUFACTURER "NEO_COOLCAM"
  1881. #define DEVICE "NAS_WR01W"
  1882. // Buttons
  1883. #define BUTTON1_PIN 13
  1884. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1885. #define BUTTON1_RELAY 1
  1886. // Relays
  1887. #define RELAY1_PIN 12
  1888. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1889. // LEDs
  1890. #define LED1_PIN 4
  1891. #define LED1_PIN_INVERSE 1
  1892. // ------------------------------------------------------------------------------
  1893. // Estink Wifi Power Strip
  1894. // https://www.amazon.de/Steckdosenleiste-Ladeger%C3%A4t-Sprachsteuerung-SmartphonesTablets-Android/dp/B0796W5FZY
  1895. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  1896. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  1897. // -----------------------------------------------------------------------------
  1898. #elif defined(ESTINK_WIFI_POWER_STRIP)
  1899. // Info
  1900. #define MANUFACTURER "ESTINK"
  1901. #define DEVICE "WIFI_POWER_STRIP"
  1902. // Disable UART noise since this board uses GPIO3
  1903. #define DEBUG_SERIAL_SUPPORT 0
  1904. // Buttons
  1905. #define BUTTON1_PIN 16
  1906. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1907. #define BUTTON1_RELAY 4
  1908. // Relays
  1909. #define RELAY1_PIN 14 // USB power
  1910. #define RELAY2_PIN 13 // power plug 1
  1911. #define RELAY3_PIN 4 // power plug 2
  1912. #define RELAY4_PIN 15 // power plug 3
  1913. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1914. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1915. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1916. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1917. // LEDs
  1918. #define LED1_PIN 0 // power led
  1919. #define LED2_PIN 12 // power plug 1
  1920. #define LED3_PIN 3 // power plug 2
  1921. #define LED4_PIN 5 // power plug 3
  1922. #define LED1_PIN_INVERSE 1
  1923. #define LED2_PIN_INVERSE 1
  1924. #define LED3_PIN_INVERSE 1
  1925. #define LED4_PIN_INVERSE 1
  1926. #define LED1_MODE LED_MODE_FINDME
  1927. #define LED2_MODE LED_MODE_FOLLOW
  1928. #define LED3_MODE LED_MODE_FOLLOW
  1929. #define LED4_MODE LED_MODE_FOLLOW
  1930. #define LED2_RELAY 2
  1931. #define LED3_RELAY 3
  1932. #define LED4_RELAY 4
  1933. // -----------------------------------------------------------------------------
  1934. // Bruno Horta's OnOfre
  1935. // https://www.bhonofre.pt/
  1936. // https://github.com/brunohorta82/BH_OnOfre/
  1937. // -----------------------------------------------------------------------------
  1938. #elif defined(BH_ONOFRE)
  1939. // Info
  1940. #define MANUFACTURER "BH"
  1941. #define DEVICE "ONOFRE"
  1942. // Buttons
  1943. #define BUTTON1_PIN 12
  1944. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1945. #define BUTTON1_RELAY 1
  1946. #define BUTTON2_PIN 13
  1947. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1948. #define BUTTON2_RELAY 2
  1949. // Relays
  1950. #define RELAY1_PIN 4
  1951. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1952. #define RELAY2_PIN 5
  1953. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1954. // -----------------------------------------------------------------------------
  1955. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  1956. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  1957. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  1958. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  1959. // * Goosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  1960. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  1961. // -----------------------------------------------------------------------------
  1962. #elif defined(BLITZWOLF_BWSHP2)
  1963. // Info
  1964. #define MANUFACTURER "BLITZWOLF"
  1965. #define DEVICE "BWSHP2"
  1966. // Buttons
  1967. #define BUTTON1_PIN 13
  1968. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1969. #define BUTTON1_RELAY 1
  1970. // Relays
  1971. #define RELAY1_PIN 15
  1972. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1973. // LEDs
  1974. #define LED1_PIN 2
  1975. #define LED1_PIN_INVERSE 1
  1976. #define LED2_PIN 0
  1977. #define LED2_PIN_INVERSE 1
  1978. #define LED2_MODE LED_MODE_FINDME
  1979. #define LED2_RELAY 1
  1980. // HJL01 / BL0937
  1981. #ifndef HLW8012_SUPPORT
  1982. #define HLW8012_SUPPORT 1
  1983. #endif
  1984. #define HLW8012_SEL_PIN 12
  1985. #define HLW8012_CF1_PIN 14
  1986. #define HLW8012_CF_PIN 5
  1987. #define HLW8012_SEL_CURRENT LOW
  1988. #define HLW8012_CURRENT_RATIO 25740
  1989. #define HLW8012_VOLTAGE_RATIO 313400
  1990. #define HLW8012_POWER_RATIO 3414290
  1991. #define HLW8012_INTERRUPT_ON FALLING
  1992. // ----------------------------------------------------------------------------------------
  1993. // Homecube 16A is similar but some pins differ and it also has RGB LEDs
  1994. // https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
  1995. // ----------------------------------------------------------------------------------------
  1996. #elif defined(HOMECUBE_16A)
  1997. // Info
  1998. #define MANUFACTURER "HOMECUBE"
  1999. #define DEVICE "16A"
  2000. // Buttons
  2001. #define BUTTON1_PIN 13
  2002. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2003. #define BUTTON1_RELAY 1
  2004. // Relays
  2005. #define RELAY1_PIN 15
  2006. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2007. // LEDs
  2008. //LED Pin 4 - ESP8266 onboard LED
  2009. //Red LED: 0
  2010. //Green LED: 12
  2011. //Blue LED: 2
  2012. // Blue
  2013. #define LED1_PIN 2
  2014. #define LED1_PIN_INVERSE 0
  2015. // Green
  2016. #define LED2_PIN 12
  2017. #define LED2_PIN_INVERSE 1
  2018. #define LED2_MODE LED_MODE_RELAY
  2019. // Red
  2020. #define LED3_PIN 0
  2021. #define LED3_PIN_INVERSE 0
  2022. #define LED3_MODE LED_MODE_OFF
  2023. // HJL01 / BL0937
  2024. #ifndef HLW8012_SUPPORT
  2025. #define HLW8012_SUPPORT 1
  2026. #endif
  2027. #define HLW8012_SEL_PIN 16
  2028. #define HLW8012_CF1_PIN 14
  2029. #define HLW8012_CF_PIN 5
  2030. #define HLW8012_SEL_CURRENT LOW
  2031. #define HLW8012_CURRENT_RATIO 25740
  2032. #define HLW8012_VOLTAGE_RATIO 313400
  2033. #define HLW8012_POWER_RATIO 3414290
  2034. #define HLW8012_INTERRUPT_ON FALLING
  2035. // -----------------------------------------------------------------------------
  2036. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  2037. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  2038. // -----------------------------------------------------------------------------
  2039. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  2040. // Info
  2041. #define MANUFACTURER "VANZAVANZU"
  2042. #define DEVICE "SMART_WIFI_PLUG_MINI"
  2043. // Buttons
  2044. #define BUTTON1_PIN 13
  2045. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2046. #define BUTTON1_RELAY 1
  2047. // Relays
  2048. #define RELAY1_PIN 15
  2049. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2050. // LEDs
  2051. #define LED1_PIN 2
  2052. #define LED1_PIN_INVERSE 1
  2053. #define LED2_PIN 0
  2054. #define LED2_PIN_INVERSE 1
  2055. #define LED2_MODE LED_MODE_FINDME
  2056. #define LED2_RELAY 1
  2057. // Disable UART noise
  2058. #define DEBUG_SERIAL_SUPPORT 0
  2059. // HJL01 / BL0937
  2060. #ifndef HLW8012_SUPPORT
  2061. #define HLW8012_SUPPORT 1
  2062. #endif
  2063. #define HLW8012_SEL_PIN 3
  2064. #define HLW8012_CF1_PIN 14
  2065. #define HLW8012_CF_PIN 5
  2066. #define HLW8012_SEL_CURRENT LOW
  2067. #define HLW8012_CURRENT_RATIO 25740
  2068. #define HLW8012_VOLTAGE_RATIO 313400
  2069. #define HLW8012_POWER_RATIO 3414290
  2070. #define HLW8012_INTERRUPT_ON FALLING
  2071. // -----------------------------------------------------------------------------
  2072. #elif defined(GENERIC_AG_L4)
  2073. // Info
  2074. #define MANUFACTURER "GENERIC"
  2075. #define DEVICE "AG_L4"
  2076. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2077. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2078. #define DUMMY_RELAY_COUNT 1
  2079. // button 1: "power" button
  2080. #define BUTTON1_PIN 4
  2081. #define BUTTON1_RELAY 1
  2082. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2083. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  2084. #define BUTTON1_CLICK BUTTON_MODE_NONE
  2085. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2086. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2087. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  2088. // button 2: "wifi" button
  2089. #define BUTTON2_PIN 2
  2090. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2091. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  2092. #define BUTTON2_CLICK BUTTON_MODE_NONE
  2093. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  2094. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  2095. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  2096. // LEDs
  2097. #define LED1_PIN 5 // red status led
  2098. #define LED1_PIN_INVERSE 0
  2099. #define LED2_PIN 16 // master light power
  2100. #define LED2_PIN_INVERSE 1
  2101. #define LED2_MODE LED_MODE_RELAY
  2102. // Light
  2103. #define LIGHT_CHANNELS 3
  2104. #define LIGHT_CH1_PIN 14 // RED
  2105. #define LIGHT_CH2_PIN 13 // GREEN
  2106. #define LIGHT_CH3_PIN 12 // BLUE
  2107. #define LIGHT_CH1_INVERSE 0
  2108. #define LIGHT_CH2_INVERSE 0
  2109. #define LIGHT_CH3_INVERSE 0
  2110. // -----------------------------------------------------------------------------
  2111. #elif defined(ALLTERCO_SHELLY1)
  2112. // Info
  2113. #define MANUFACTURER "ALLTERCO"
  2114. #define DEVICE "SHELLY1"
  2115. // Buttons
  2116. #define BUTTON1_PIN 5
  2117. #define BUTTON1_MODE BUTTON_SWITCH
  2118. #define BUTTON1_RELAY 1
  2119. // Relays
  2120. #define RELAY1_PIN 4
  2121. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2122. #elif defined(ALLTERCO_SHELLY2)
  2123. // Info
  2124. #define MANUFACTURER "ALLTERCO"
  2125. #define DEVICE "SHELLY2"
  2126. // Buttons
  2127. #define BUTTON1_PIN 12
  2128. #define BUTTON2_PIN 14
  2129. #define BUTTON1_MODE BUTTON_SWITCH
  2130. #define BUTTON2_MODE BUTTON_SWITCH
  2131. #define BUTTON1_RELAY 1
  2132. #define BUTTON2_RELAY 2
  2133. // Relays
  2134. #define RELAY1_PIN 4
  2135. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2136. #define RELAY2_PIN 5
  2137. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2138. // -----------------------------------------------------------------------------
  2139. #elif defined(LOHAS_9W)
  2140. // Info
  2141. #define MANUFACTURER "LOHAS"
  2142. #define DEVICE "E27_9W"
  2143. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2144. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2145. #define DUMMY_RELAY_COUNT 1
  2146. // Light
  2147. #define LIGHT_CHANNELS 5
  2148. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2149. #define MY92XX_CHIPS 2
  2150. #define MY92XX_DI_PIN 13
  2151. #define MY92XX_DCKI_PIN 15
  2152. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2153. #define MY92XX_MAPPING 0, 1, 2, 3, 4
  2154. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  2155. // -----------------------------------------------------------------------------
  2156. #elif defined(XIAOMI_SMART_DESK_LAMP)
  2157. // Info
  2158. #define MANUFACTURER "XIAOMI"
  2159. #define DEVICE "SMART_DESK_LAMP"
  2160. // Buttons
  2161. #define BUTTON1_PIN 2
  2162. #define BUTTON2_PIN 14
  2163. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2164. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2165. // This button doubles as switch here and as encoder mode switch below
  2166. // Clicking it (for less than 500ms) will turn the light on and off
  2167. // Double and Long clicks will not work as these are used to modify the encoder action
  2168. #define BUTTON1_RELAY 1
  2169. #define BUTTON_LNGCLICK_DELAY 500
  2170. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2171. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2172. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  2173. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  2174. #define BUTTON2_DBLCLICK BUTTON_MODE_AP
  2175. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  2176. // Light
  2177. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2178. #define DUMMY_RELAY_COUNT 1
  2179. #define LIGHT_STEP 8
  2180. #define LIGHT_CHANNELS 2
  2181. #define LIGHT_CH1_PIN 5 // warm white
  2182. #define LIGHT_CH1_INVERSE 0
  2183. #define LIGHT_CH2_PIN 4 // cold white
  2184. #define LIGHT_CH2_INVERSE 0
  2185. // Encoder
  2186. // If mode is ENCODER_MODE_RATIO, the value ratio between both channels is changed
  2187. // when the button is not pressed, and the overall brightness when pressed
  2188. // If mode is ENCODER_MODE_CHANNEL, the first channel value is changed
  2189. // when the button is not pressed, and the second channel when pressed
  2190. // If no ENCODERX_BUTTON_PIN defined it will only change the value of the first defined channel
  2191. #define ENCODER_SUPPORT 1
  2192. #define ENCODER1_PIN1 12
  2193. #define ENCODER1_PIN2 13
  2194. #define ENCODER1_BUTTON_PIN 2 // active low by default, with software pullup
  2195. #define ENCODER1_CHANNEL1 0 // please note this value is 0-based (LIGHT_CH1 above)
  2196. #define ENCODER1_CHANNEL2 1 // please note this value is 0-based (LIGHT_CH2 above)
  2197. #define ENCODER1_MODE ENCODER_MODE_RATIO
  2198. #elif defined(PHYX_ESP12_RGB)
  2199. // Info
  2200. #define MANUFACTURER "PHYX"
  2201. #define DEVICE "ESP12_RGB"
  2202. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2203. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2204. #define DUMMY_RELAY_COUNT 1
  2205. // Light
  2206. #define LIGHT_CHANNELS 3
  2207. #define LIGHT_CH1_PIN 4 // RED
  2208. #define LIGHT_CH2_PIN 14 // GREEN
  2209. #define LIGHT_CH3_PIN 12 // BLUE
  2210. #define LIGHT_CH1_INVERSE 0
  2211. #define LIGHT_CH2_INVERSE 0
  2212. #define LIGHT_CH3_INVERSE 0
  2213. // -----------------------------------------------------------------------------
  2214. // iWoole LED Table Lamp
  2215. // 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
  2216. // -----------------------------------------------------------------------------
  2217. #elif defined(IWOOLE_LED_TABLE_LAMP)
  2218. // Info
  2219. #define MANUFACTURER "IWOOLE"
  2220. #define DEVICE "LED_TABLE_LAMP"
  2221. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2222. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2223. #define DUMMY_RELAY_COUNT 1
  2224. // Light
  2225. #define LIGHT_CHANNELS 4
  2226. #define LIGHT_CH1_PIN 12 // RED
  2227. #define LIGHT_CH2_PIN 5 // GREEN
  2228. #define LIGHT_CH3_PIN 14 // BLUE
  2229. #define LIGHT_CH4_PIN 4 // WHITE
  2230. #define LIGHT_CH1_INVERSE 0
  2231. #define LIGHT_CH2_INVERSE 0
  2232. #define LIGHT_CH3_INVERSE 0
  2233. #define LIGHT_CH4_INVERSE 0
  2234. // -----------------------------------------------------------------------------
  2235. // Bestek Smart Plug with 2 USB ports
  2236. // https://www.bestekcorp.com/bestek-smart-plug-works-with-amazon-alexa-google-assistant-and-ifttt-with-2-usb
  2237. // -----------------------------------------------------------------------------
  2238. #elif defined(BESTEK_MRJ1011)
  2239. // Info
  2240. #define MANUFACTURER "BESTEK"
  2241. #define DEVICE "MRJ1011"
  2242. // Buttons
  2243. #define BUTTON1_PIN 13
  2244. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2245. #define BUTTON1_RELAY 1
  2246. // Relay
  2247. #define RELAY1_PIN 12
  2248. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2249. // LED
  2250. #define LED1_PIN 4
  2251. #define LED1_PIN_INVERSE 1
  2252. // -----------------------------------------------------------------------------
  2253. // TEST boards (do not use!!)
  2254. // -----------------------------------------------------------------------------
  2255. #elif defined(TRAVIS01)
  2256. // Info
  2257. #define MANUFACTURER "TravisCI"
  2258. #define DEVICE "Virtual board 01"
  2259. // Some buttons - pin 0
  2260. #define BUTTON1_PIN 0
  2261. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2262. #define BUTTON1_RELAY 1
  2263. // Some relays - pin 1
  2264. #define RELAY1_PIN 1
  2265. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2266. // Some LEDs - pin 2
  2267. #define LED1_PIN 2
  2268. #define LED1_PIN_INVERSE 1
  2269. // A bit of I2C - pins 3,4
  2270. #define I2C_SDA_PIN 3
  2271. #define I2C_SCL_PIN 4
  2272. // And, as they say in "From Dusk till Dawn":
  2273. // This is a sensor blow out!
  2274. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  2275. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  2276. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  2277. // C'mon, you want sensor, come on in sensor lovers!
  2278. // If we don’t got it, you don't want it!
  2279. #define AM2320_SUPPORT 1
  2280. #define BH1750_SUPPORT 1
  2281. #define BMX280_SUPPORT 1
  2282. #define SHT3X_I2C_SUPPORT 1
  2283. #define EMON_ADC121_SUPPORT 1
  2284. #define EMON_ADS1X15_SUPPORT 1
  2285. #define SHT3X_I2C_SUPPORT 1
  2286. #define SI7021_SUPPORT 1
  2287. #define PMSX003_SUPPORT 1
  2288. #define SENSEAIR_SUPPORT1
  2289. // A bit of lights - pin 5
  2290. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2291. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2292. #define DUMMY_RELAY_COUNT 1
  2293. #define LIGHT_CHANNELS 1
  2294. #define LIGHT_CH1_PIN 5
  2295. #define LIGHT_CH1_INVERSE 0
  2296. // A bit of HLW8012 - pins 6,7,8
  2297. #ifndef HLW8012_SUPPORT
  2298. #define HLW8012_SUPPORT 1
  2299. #endif
  2300. #define HLW8012_SEL_PIN 6
  2301. #define HLW8012_CF1_PIN 7
  2302. #define HLW8012_CF_PIN 8
  2303. // A bit of Dallas - pin 9
  2304. #ifndef DALLAS_SUPPORT
  2305. #define DALLAS_SUPPORT 1
  2306. #endif
  2307. #define DALLAS_PIN 9
  2308. // A bit of ECH1560 - pins 10,11, 12
  2309. #ifndef ECH1560_SUPPORT
  2310. #define ECH1560_SUPPORT 1
  2311. #endif
  2312. #define ECH1560_CLK_PIN 10
  2313. #define ECH1560_MISO_PIN 11
  2314. #define ECH1560_INVERTED 12
  2315. // MICS-2710 & MICS-5525 test
  2316. #define MICS2710_SUPPORT 1
  2317. #define MICS5525_SUPPORT 1
  2318. #elif defined(TRAVIS02)
  2319. // Relay provider dual
  2320. #define MANUFACTURER "TravisCI"
  2321. #define DEVICE "Virtual board 02"
  2322. // Some buttons - pin 0
  2323. #define BUTTON1_PIN 0
  2324. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2325. #define BUTTON1_RELAY 1
  2326. // A bit of CSE7766 - pin 1
  2327. #ifndef CSE7766_SUPPORT
  2328. #define CSE7766_SUPPORT 1
  2329. #endif
  2330. #define CSE7766_PIN 1
  2331. // Relay type dual - pins 2,3
  2332. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  2333. #define RELAY1_PIN 2
  2334. #define RELAY2_PIN 3
  2335. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2336. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2337. // IR - pin 4
  2338. #define IR_SUPPORT 1
  2339. #define IR_RX_PIN 4
  2340. #define IR_BUTTON_SET 1
  2341. // A bit of DHT - pin 5
  2342. #ifndef DHT_SUPPORT
  2343. #define DHT_SUPPORT 1
  2344. #endif
  2345. #define DHT_PIN 5
  2346. // A bit of TMP3X (analog)
  2347. #define TMP3X_SUPPORT 1
  2348. // A bit of EVENTS - pin 10
  2349. #define EVENTS_SUPPORT 1
  2350. #define EVENTS_PIN 6
  2351. // Sonar
  2352. #define SONAR_SUPPORT 1
  2353. #define SONAR_TRIGGER 7
  2354. #define SONAR_ECHO 8
  2355. // MHZ19
  2356. #define MHZ19_SUPPORT 1
  2357. #define MHZ19_RX_PIN 9
  2358. #define MHZ19_TX_PIN 10
  2359. // PZEM004T
  2360. #define PZEM004T_SUPPORT 1
  2361. #define PZEM004T_RX_PIN 11
  2362. #define PZEM004T_TX_PIN 12
  2363. // V9261F
  2364. #define V9261F_SUPPORT 1
  2365. #define V9261F_PIN 13
  2366. // GUVAS12SD
  2367. #define GUVAS12SD_SUPPORT 1
  2368. #define GUVAS12SD_PIN 14
  2369. // Test non-default modules
  2370. #define MDNS_CLIENT_SUPPORT 1
  2371. #define NOFUSS_SUPPORT 1
  2372. #define UART_MQTT_SUPPORT 1
  2373. #define INFLUXDB_SUPPORT 1
  2374. #define IR_SUPPORT 1
  2375. #elif defined(TRAVIS03)
  2376. // Relay provider light/my92XX
  2377. #define MANUFACTURER "TravisCI"
  2378. #define DEVICE "Virtual board 03"
  2379. // Some buttons - pin 0
  2380. #define BUTTON1_PIN 0
  2381. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2382. #define BUTTON1_RELAY 1
  2383. // MY9231 Light - pins 1,2
  2384. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2385. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2386. #define DUMMY_RELAY_COUNT 1
  2387. #define LIGHT_CHANNELS 5
  2388. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2389. #define MY92XX_CHIPS 2
  2390. #define MY92XX_DI_PIN 1
  2391. #define MY92XX_DCKI_PIN 2
  2392. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2393. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  2394. // A bit of Analog EMON (analog)
  2395. #ifndef EMON_ANALOG_SUPPORT
  2396. #define EMON_ANALOG_SUPPORT 1
  2397. #endif
  2398. // Test non-default modules
  2399. #define LLMNR_SUPPORT 1
  2400. #define NETBIOS_SUPPORT 1
  2401. #define SSDP_SUPPORT 1
  2402. #endif
  2403. // -----------------------------------------------------------------------------
  2404. // Check definitions
  2405. // -----------------------------------------------------------------------------
  2406. #if not defined(MANUFACTURER) || not defined(DEVICE)
  2407. #error "UNSUPPORTED HARDWARE!!"
  2408. #endif