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.

3346 lines
106 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. // Light RGBW
  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. // ORVIBO
  735. // -----------------------------------------------------------------------------
  736. #elif defined(ORVIBO_B25)
  737. // Info
  738. #define MANUFACTURER "ORVIBO"
  739. #define DEVICE "B25"
  740. // Buttons
  741. #define BUTTON1_PIN 14
  742. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  743. #define BUTTON1_RELAY 1
  744. // Relays
  745. #define RELAY1_PIN 5
  746. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  747. // LEDs
  748. #define LED1_PIN 12 // 4 blue led
  749. #define LED1_PIN_INVERSE 1
  750. #define LED2_PIN 4 // 12 red led
  751. #define LED2_PIN_INVERSE 1
  752. // -----------------------------------------------------------------------------
  753. // YJZK
  754. // -----------------------------------------------------------------------------
  755. #elif defined(YJZK_SWITCH_1CH)
  756. // Info
  757. #define MANUFACTURER "YJZK"
  758. #define DEVICE "SWITCH_1CH"
  759. // Buttons
  760. #define BUTTON1_PIN 0
  761. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  762. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  763. #define BUTTON1_CLICK BUTTON_MODE_NONE
  764. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  765. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  766. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  767. #define BUTTON1_RELAY 1
  768. // Relays
  769. #define RELAY1_PIN 12
  770. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  771. // LEDs
  772. #define LED1_PIN 13
  773. #define LED1_PIN_INVERSE 0
  774. #elif defined(YJZK_SWITCH_2CH)
  775. // Info
  776. #define MANUFACTURER "YJZK"
  777. #define DEVICE "SWITCH_2CH"
  778. // Buttons
  779. #define BUTTON1_PIN 0
  780. #define BUTTON2_PIN 9
  781. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  782. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  783. #define BUTTON1_CLICK BUTTON_MODE_NONE
  784. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  785. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  786. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  787. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  788. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  789. #define BUTTON2_CLICK BUTTON_MODE_NONE
  790. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  791. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  792. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  793. #define BUTTON1_RELAY 1
  794. #define BUTTON2_RELAY 2
  795. // Relays
  796. #define RELAY1_PIN 12
  797. #define RELAY2_PIN 5
  798. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  799. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  800. // LEDs
  801. #define LED1_PIN 13
  802. #define LED1_PIN_INVERSE 0
  803. // YJZK 3CH switch
  804. // Also Lixin Touch Wifi 3M
  805. #elif defined(YJZK_SWITCH_3CH)
  806. // Info
  807. #define MANUFACTURER "YJZK"
  808. #define DEVICE "SWITCH_3CH"
  809. // Buttons
  810. #define BUTTON1_PIN 0
  811. #define BUTTON2_PIN 9
  812. #define BUTTON3_PIN 10
  813. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  814. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  815. #define BUTTON1_CLICK BUTTON_MODE_NONE
  816. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  817. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  818. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  819. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  820. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  821. #define BUTTON2_CLICK BUTTON_MODE_NONE
  822. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  823. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  824. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  825. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  826. #define BUTTON3_PRESS BUTTON_MODE_TOGGLE
  827. #define BUTTON3_CLICK BUTTON_MODE_NONE
  828. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  829. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  830. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_RESET
  831. #define BUTTON1_RELAY 1
  832. #define BUTTON2_RELAY 2
  833. #define BUTTON3_RELAY 3
  834. // Relays
  835. #define RELAY1_PIN 12
  836. #define RELAY2_PIN 5
  837. #define RELAY3_PIN 4
  838. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  839. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  840. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  841. // LEDs
  842. #define LED1_PIN 13
  843. #define LED1_PIN_INVERSE 0
  844. // -----------------------------------------------------------------------------
  845. // Electrodragon boards
  846. // -----------------------------------------------------------------------------
  847. #elif defined(ELECTRODRAGON_WIFI_IOT)
  848. // Info
  849. #define MANUFACTURER "ELECTRODRAGON"
  850. #define DEVICE "WIFI_IOT"
  851. // Buttons
  852. #define BUTTON1_PIN 0
  853. #define BUTTON2_PIN 2
  854. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  855. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  856. #define BUTTON1_RELAY 1
  857. #define BUTTON2_RELAY 2
  858. // Relays
  859. #define RELAY1_PIN 12
  860. #define RELAY2_PIN 13
  861. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  862. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  863. // LEDs
  864. #define LED1_PIN 16
  865. #define LED1_PIN_INVERSE 0
  866. // -----------------------------------------------------------------------------
  867. // WorkChoice ecoPlug
  868. // -----------------------------------------------------------------------------
  869. #elif defined(WORKCHOICE_ECOPLUG)
  870. // Info
  871. #define MANUFACTURER "WORKCHOICE"
  872. #define DEVICE "ECOPLUG"
  873. // Buttons
  874. #define BUTTON1_PIN 13
  875. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  876. #define BUTTON1_RELAY 1
  877. // Relays
  878. #define RELAY1_PIN 15
  879. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  880. // LEDs
  881. #define LED1_PIN 2
  882. #define LED1_PIN_INVERSE 0
  883. // -----------------------------------------------------------------------------
  884. // AI Thinker
  885. // -----------------------------------------------------------------------------
  886. #elif defined(AITHINKER_AI_LIGHT)
  887. // Info
  888. #define MANUFACTURER "AITHINKER"
  889. #define DEVICE "AI_LIGHT"
  890. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  891. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  892. #define DUMMY_RELAY_COUNT 1
  893. // Light
  894. #define LIGHT_CHANNELS 4
  895. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  896. #define MY92XX_CHIPS 1
  897. #define MY92XX_DI_PIN 13
  898. #define MY92XX_DCKI_PIN 15
  899. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  900. #define MY92XX_MAPPING 0, 1, 2, 3
  901. // -----------------------------------------------------------------------------
  902. // LED Controller
  903. // -----------------------------------------------------------------------------
  904. #elif defined(MAGICHOME_LED_CONTROLLER)
  905. // Info
  906. #define MANUFACTURER "MAGICHOME"
  907. #define DEVICE "LED_CONTROLLER"
  908. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  909. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  910. #define DUMMY_RELAY_COUNT 1
  911. // LEDs
  912. #define LED1_PIN 2
  913. #define LED1_PIN_INVERSE 1
  914. // Light
  915. #define LIGHT_CHANNELS 4
  916. #define LIGHT_CH1_PIN 14 // RED
  917. #define LIGHT_CH2_PIN 5 // GREEN
  918. #define LIGHT_CH3_PIN 12 // BLUE
  919. #define LIGHT_CH4_PIN 13 // WHITE
  920. #define LIGHT_CH1_INVERSE 0
  921. #define LIGHT_CH2_INVERSE 0
  922. #define LIGHT_CH3_INVERSE 0
  923. #define LIGHT_CH4_INVERSE 0
  924. // IR
  925. #define IR_SUPPORT 1
  926. #define IR_RX_PIN 4
  927. #define IR_BUTTON_SET 1
  928. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  929. // Info
  930. #define MANUFACTURER "MAGICHOME"
  931. #define DEVICE "LED_CONTROLLER_20"
  932. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  933. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  934. #define DUMMY_RELAY_COUNT 1
  935. // LEDs
  936. #define LED1_PIN 2
  937. #define LED1_PIN_INVERSE 1
  938. // Light
  939. #define LIGHT_CHANNELS 4
  940. #define LIGHT_CH1_PIN 5 // RED
  941. #define LIGHT_CH2_PIN 12 // GREEN
  942. #define LIGHT_CH3_PIN 13 // BLUE
  943. #define LIGHT_CH4_PIN 15 // WHITE
  944. #define LIGHT_CH1_INVERSE 0
  945. #define LIGHT_CH2_INVERSE 0
  946. #define LIGHT_CH3_INVERSE 0
  947. #define LIGHT_CH4_INVERSE 0
  948. // IR
  949. #define IR_SUPPORT 1
  950. #define IR_RX_PIN 4
  951. #define IR_BUTTON_SET 1
  952. #elif defined(MAGICHOME_ZJ_WFMN_A_11)
  953. // Info
  954. #define MANUFACTURER "MAGICHOME"
  955. #define DEVICE "ZJ_WFMN_A_11"
  956. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  957. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  958. #define DUMMY_RELAY_COUNT 1
  959. // LEDs
  960. #define LED1_PIN 2
  961. #define LED1_PIN_INVERSE 1
  962. #define LED2_PIN 15
  963. #define LED2_PIN_INVERSE 1
  964. // Light
  965. #define LIGHT_CHANNELS 4
  966. #define LIGHT_CH1_PIN 12 // RED
  967. #define LIGHT_CH2_PIN 5 // GREEN
  968. #define LIGHT_CH3_PIN 13 // BLUE
  969. #define LIGHT_CH4_PIN 14 // WHITE
  970. #define LIGHT_CH1_INVERSE 0
  971. #define LIGHT_CH2_INVERSE 0
  972. #define LIGHT_CH3_INVERSE 0
  973. #define LIGHT_CH4_INVERSE 0
  974. // IR
  975. #define IR_SUPPORT 1
  976. #define IR_RX_PIN 4
  977. #define IR_BUTTON_SET 1
  978. #elif defined(MAGICHOME_ZJ_WFMN_B_11)
  979. // Info
  980. #define MANUFACTURER "MAGICHOME"
  981. #define DEVICE "ZJ_WFMN_B_11"
  982. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  983. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  984. #define DUMMY_RELAY_COUNT 1
  985. // LEDs
  986. #define LED1_PIN 2
  987. #define LED1_PIN_INVERSE 1
  988. #define LED2_PIN 15
  989. #define LED2_PIN_INVERSE 1
  990. // Light
  991. #define LIGHT_CHANNELS 4
  992. #define LIGHT_CH1_PIN 14 // RED
  993. #define LIGHT_CH2_PIN 5 // GREEN
  994. #define LIGHT_CH3_PIN 12 // BLUE
  995. #define LIGHT_CH4_PIN 13 // WHITE
  996. #define LIGHT_CH1_INVERSE 0
  997. #define LIGHT_CH2_INVERSE 0
  998. #define LIGHT_CH3_INVERSE 0
  999. #define LIGHT_CH4_INVERSE 0
  1000. // RF
  1001. #define RF_SUPPORT 1
  1002. #define RF_PIN 4
  1003. // -----------------------------------------------------------------------------
  1004. // HUACANXING H801 & H802
  1005. // -----------------------------------------------------------------------------
  1006. #elif defined(HUACANXING_H801)
  1007. // Info
  1008. #define MANUFACTURER "HUACANXING"
  1009. #define DEVICE "H801"
  1010. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1011. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1012. #define DUMMY_RELAY_COUNT 1
  1013. #define DEBUG_PORT Serial1
  1014. #define SERIAL_RX_ENABLED 1
  1015. // LEDs
  1016. #define LED1_PIN 5
  1017. #define LED1_PIN_INVERSE 1
  1018. // Light
  1019. #define LIGHT_CHANNELS 5
  1020. #define LIGHT_CH1_PIN 15 // RED
  1021. #define LIGHT_CH2_PIN 13 // GREEN
  1022. #define LIGHT_CH3_PIN 12 // BLUE
  1023. #define LIGHT_CH4_PIN 14 // WHITE1
  1024. #define LIGHT_CH5_PIN 4 // WHITE2
  1025. #define LIGHT_CH1_INVERSE 0
  1026. #define LIGHT_CH2_INVERSE 0
  1027. #define LIGHT_CH3_INVERSE 0
  1028. #define LIGHT_CH4_INVERSE 0
  1029. #define LIGHT_CH5_INVERSE 0
  1030. #elif defined(HUACANXING_H802)
  1031. // Info
  1032. #define MANUFACTURER "HUACANXING"
  1033. #define DEVICE "H802"
  1034. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1035. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1036. #define DUMMY_RELAY_COUNT 1
  1037. #define DEBUG_PORT Serial1
  1038. #define SERIAL_RX_ENABLED 1
  1039. // Light
  1040. #define LIGHT_CHANNELS 4
  1041. #define LIGHT_CH1_PIN 12 // RED
  1042. #define LIGHT_CH2_PIN 14 // GREEN
  1043. #define LIGHT_CH3_PIN 13 // BLUE
  1044. #define LIGHT_CH4_PIN 15 // WHITE
  1045. #define LIGHT_CH1_INVERSE 0
  1046. #define LIGHT_CH2_INVERSE 0
  1047. #define LIGHT_CH3_INVERSE 0
  1048. #define LIGHT_CH4_INVERSE 0
  1049. // -----------------------------------------------------------------------------
  1050. // Jan Goedeke Wifi Relay
  1051. // https://github.com/JanGoe/esp8266-wifi-relay
  1052. // -----------------------------------------------------------------------------
  1053. #elif defined(JANGOE_WIFI_RELAY_NC)
  1054. // Info
  1055. #define MANUFACTURER "JANGOE"
  1056. #define DEVICE "WIFI_RELAY_NC"
  1057. // Buttons
  1058. #define BUTTON1_PIN 12
  1059. #define BUTTON2_PIN 13
  1060. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1061. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1062. #define BUTTON1_RELAY 1
  1063. #define BUTTON2_RELAY 2
  1064. // Relays
  1065. #define RELAY1_PIN 2
  1066. #define RELAY2_PIN 14
  1067. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1068. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1069. #elif defined(JANGOE_WIFI_RELAY_NO)
  1070. // Info
  1071. #define MANUFACTURER "JANGOE"
  1072. #define DEVICE "WIFI_RELAY_NO"
  1073. // Buttons
  1074. #define BUTTON1_PIN 12
  1075. #define BUTTON2_PIN 13
  1076. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1077. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1078. #define BUTTON1_RELAY 1
  1079. #define BUTTON2_RELAY 2
  1080. // Relays
  1081. #define RELAY1_PIN 2
  1082. #define RELAY2_PIN 14
  1083. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1084. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1085. // -----------------------------------------------------------------------------
  1086. // Jorge García Wifi+Relays Board Kit
  1087. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  1088. // https://github.com/jorgegarciadev/wifikit
  1089. // -----------------------------------------------------------------------------
  1090. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  1091. // Info
  1092. #define MANUFACTURER "JORGEGARCIA"
  1093. #define DEVICE "WIFI_RELAYS"
  1094. // Relays
  1095. #define RELAY1_PIN 0
  1096. #define RELAY2_PIN 2
  1097. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1098. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1099. // -----------------------------------------------------------------------------
  1100. // WiFi MQTT Relay / Thermostat
  1101. // -----------------------------------------------------------------------------
  1102. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  1103. // Info
  1104. #define MANUFACTURER "OPENENERGYMONITOR"
  1105. #define DEVICE "MQTT_RELAY"
  1106. // Buttons
  1107. #define BUTTON1_PIN 0
  1108. #define BUTTON1_RELAY 1
  1109. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1110. // Relays
  1111. #define RELAY1_PIN 12
  1112. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1113. // LEDs
  1114. #define LED1_PIN 16
  1115. #define LED1_PIN_INVERSE 0
  1116. // -----------------------------------------------------------------------------
  1117. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  1118. // 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
  1119. // 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
  1120. // -----------------------------------------------------------------------------
  1121. #elif defined(WION_50055)
  1122. // Currently untested, does not support energy monitoring
  1123. // Info
  1124. #define MANUFACTURER "WION"
  1125. #define DEVICE "50055"
  1126. // Buttons
  1127. #define BUTTON1_PIN 13
  1128. #define BUTTON1_RELAY 1
  1129. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1130. // Relays
  1131. #define RELAY1_PIN 15
  1132. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1133. // LEDs
  1134. #define LED1_PIN 2
  1135. #define LED1_PIN_INVERSE 0
  1136. // -----------------------------------------------------------------------------
  1137. // EX-Store Wifi Relay v3.1
  1138. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  1139. // -----------------------------------------------------------------------------
  1140. #elif defined(EXS_WIFI_RELAY_V31)
  1141. // Untested
  1142. // Info
  1143. #define MANUFACTURER "EXS"
  1144. #define DEVICE "WIFI_RELAY_V31"
  1145. // Buttons
  1146. #define BUTTON1_PIN 0
  1147. #define BUTTON1_RELAY 1
  1148. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1149. // Relays
  1150. #define RELAY1_PIN 13
  1151. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1152. #define RELAY1_RESET_PIN 12
  1153. // -----------------------------------------------------------------------------
  1154. // EX-Store Wifi Relay v5.0
  1155. // -----------------------------------------------------------------------------
  1156. #elif defined(EXS_WIFI_RELAY_V50)
  1157. // Info
  1158. #define MANUFACTURER "EXS"
  1159. #define DEVICE "WIFI_RELAY_V50"
  1160. // Buttons
  1161. #define BUTTON1_PIN 5
  1162. #define BUTTON2_PIN 4
  1163. #define BUTTON1_RELAY 1
  1164. #define BUTTON2_RELAY 2
  1165. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1166. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1167. // Relays
  1168. #define RELAY1_PIN 14
  1169. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1170. #define RELAY1_RESET_PIN 16
  1171. #define RELAY2_PIN 13
  1172. #define RELAY2_TYPE RELAY_TYPE_LATCHED
  1173. #define RELAY2_RESET_PIN 12
  1174. // LEDs
  1175. #define LED1_PIN 15
  1176. #define LED1_PIN_INVERSE 0
  1177. // -----------------------------------------------------------------------------
  1178. // V9261F
  1179. // -----------------------------------------------------------------------------
  1180. #elif defined(GENERIC_V9261F)
  1181. // Info
  1182. #define MANUFACTURER "GENERIC"
  1183. #define DEVICE "V9261F"
  1184. #define ALEXA_SUPPORT 0
  1185. // V9261F
  1186. #define V9261F_SUPPORT 1
  1187. #define V9261F_PIN 2
  1188. #define V9261F_PIN_INVERSE 1
  1189. // -----------------------------------------------------------------------------
  1190. // ECH1560
  1191. // -----------------------------------------------------------------------------
  1192. #elif defined(GENERIC_ECH1560)
  1193. // Info
  1194. #define MANUFACTURER "GENERIC"
  1195. #define DEVICE "ECH1560"
  1196. #define ALEXA_SUPPORT 0
  1197. // ECH1560
  1198. #define ECH1560_SUPPORT 1
  1199. #define ECH1560_CLK_PIN 4
  1200. #define ECH1560_MISO_PIN 5
  1201. #define ECH1560_INVERTED 0
  1202. // -----------------------------------------------------------------------------
  1203. // ESPLive
  1204. // https://github.com/ManCaveMade/ESP-Live
  1205. // -----------------------------------------------------------------------------
  1206. #elif defined(MANCAVEMADE_ESPLIVE)
  1207. // Info
  1208. #define MANUFACTURER "MANCAVEMADE"
  1209. #define DEVICE "ESPLIVE"
  1210. // Buttons
  1211. #define BUTTON1_PIN 4
  1212. #define BUTTON2_PIN 5
  1213. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1214. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1215. #define BUTTON1_RELAY 1
  1216. #define BUTTON2_RELAY 2
  1217. // Relays
  1218. #define RELAY1_PIN 12
  1219. #define RELAY2_PIN 13
  1220. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1221. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1222. // DS18B20
  1223. #ifndef DALLAS_SUPPORT
  1224. #define DALLAS_SUPPORT 1
  1225. #endif
  1226. #define DALLAS_PIN 2
  1227. #define DALLAS_UPDATE_INTERVAL 5000
  1228. #define TEMPERATURE_MIN_CHANGE 1.0
  1229. // -----------------------------------------------------------------------------
  1230. // QuinLED
  1231. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  1232. // -----------------------------------------------------------------------------
  1233. #elif defined(INTERMITTECH_QUINLED)
  1234. // Info
  1235. #define MANUFACTURER "INTERMITTECH"
  1236. #define DEVICE "QUINLED"
  1237. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1238. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1239. #define DUMMY_RELAY_COUNT 1
  1240. // LEDs
  1241. #define LED1_PIN 5
  1242. #define LED1_PIN_INVERSE 1
  1243. // Light
  1244. #define LIGHT_CHANNELS 2
  1245. #define LIGHT_CH1_PIN 0
  1246. #define LIGHT_CH2_PIN 2
  1247. #define LIGHT_CH1_INVERSE 0
  1248. #define LIGHT_CH2_INVERSE 0
  1249. // -----------------------------------------------------------------------------
  1250. // Arilux AL-LC06
  1251. // -----------------------------------------------------------------------------
  1252. #elif defined(ARILUX_AL_LC01)
  1253. // Info
  1254. #define MANUFACTURER "ARILUX"
  1255. #define DEVICE "AL_LC01"
  1256. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1257. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1258. #define DUMMY_RELAY_COUNT 1
  1259. // Light
  1260. #define LIGHT_CHANNELS 3
  1261. #define LIGHT_CH1_PIN 5 // RED
  1262. #define LIGHT_CH2_PIN 12 // GREEN
  1263. #define LIGHT_CH3_PIN 13 // BLUE
  1264. #define LIGHT_CH1_INVERSE 0
  1265. #define LIGHT_CH2_INVERSE 0
  1266. #define LIGHT_CH3_INVERSE 0
  1267. #elif defined(ARILUX_AL_LC02)
  1268. // Info
  1269. #define MANUFACTURER "ARILUX"
  1270. #define DEVICE "AL_LC02"
  1271. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1272. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1273. #define DUMMY_RELAY_COUNT 1
  1274. // Light
  1275. #define LIGHT_CHANNELS 4
  1276. #define LIGHT_CH1_PIN 12 // RED
  1277. #define LIGHT_CH2_PIN 5 // GREEN
  1278. #define LIGHT_CH3_PIN 13 // BLUE
  1279. #define LIGHT_CH4_PIN 15 // WHITE1
  1280. #define LIGHT_CH1_INVERSE 0
  1281. #define LIGHT_CH2_INVERSE 0
  1282. #define LIGHT_CH3_INVERSE 0
  1283. #define LIGHT_CH4_INVERSE 0
  1284. #elif defined(ARILUX_AL_LC06)
  1285. // Info
  1286. #define MANUFACTURER "ARILUX"
  1287. #define DEVICE "AL_LC06"
  1288. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1289. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1290. #define DUMMY_RELAY_COUNT 1
  1291. // Light
  1292. #define LIGHT_CHANNELS 5
  1293. #define LIGHT_CH1_PIN 14 // RED
  1294. #define LIGHT_CH2_PIN 12 // GREEN
  1295. #define LIGHT_CH3_PIN 13 // BLUE
  1296. #define LIGHT_CH4_PIN 15 // WHITE1
  1297. #define LIGHT_CH5_PIN 5 // WHITE2
  1298. #define LIGHT_CH1_INVERSE 0
  1299. #define LIGHT_CH2_INVERSE 0
  1300. #define LIGHT_CH3_INVERSE 0
  1301. #define LIGHT_CH4_INVERSE 0
  1302. #define LIGHT_CH5_INVERSE 0
  1303. #elif defined(ARILUX_AL_LC11)
  1304. // Info
  1305. #define MANUFACTURER "ARILUX"
  1306. #define DEVICE "AL_LC11"
  1307. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1308. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1309. #define DUMMY_RELAY_COUNT 1
  1310. // Light
  1311. #define LIGHT_CHANNELS 5
  1312. #define LIGHT_CH1_PIN 5 // RED
  1313. #define LIGHT_CH2_PIN 4 // GREEN
  1314. #define LIGHT_CH3_PIN 14 // BLUE
  1315. #define LIGHT_CH4_PIN 13 // WHITE1
  1316. #define LIGHT_CH5_PIN 12 // WHITE1
  1317. #define LIGHT_CH1_INVERSE 0
  1318. #define LIGHT_CH2_INVERSE 0
  1319. #define LIGHT_CH3_INVERSE 0
  1320. #define LIGHT_CH4_INVERSE 0
  1321. #define LIGHT_CH5_INVERSE 0
  1322. #elif defined(ARILUX_E27)
  1323. // Info
  1324. #define MANUFACTURER "ARILUX"
  1325. #define DEVICE "E27"
  1326. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1327. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1328. #define DUMMY_RELAY_COUNT 1
  1329. // Light
  1330. #define LIGHT_CHANNELS 4
  1331. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  1332. #define MY92XX_CHIPS 1
  1333. #define MY92XX_DI_PIN 13
  1334. #define MY92XX_DCKI_PIN 15
  1335. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1336. #define MY92XX_MAPPING 0, 1, 2, 3
  1337. // -----------------------------------------------------------------------------
  1338. // XENON SM-PW701U
  1339. // -----------------------------------------------------------------------------
  1340. #elif defined(XENON_SM_PW702U)
  1341. // Info
  1342. #define MANUFACTURER "XENON"
  1343. #define DEVICE "SM_PW702U"
  1344. // Buttons
  1345. #define BUTTON1_PIN 13
  1346. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1347. #define BUTTON1_RELAY 1
  1348. // Relays
  1349. #define RELAY1_PIN 12
  1350. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1351. // LEDs
  1352. #define LED1_PIN 4
  1353. #define LED1_PIN_INVERSE 1
  1354. // -----------------------------------------------------------------------------
  1355. // AUTHOMETION LYT8266
  1356. // https://authometion.com/shop/en/home/13-lyt8266.html
  1357. // -----------------------------------------------------------------------------
  1358. #elif defined(AUTHOMETION_LYT8266)
  1359. // Info
  1360. #define MANUFACTURER "AUTHOMETION"
  1361. #define DEVICE "LYT8266"
  1362. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1363. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1364. #define DUMMY_RELAY_COUNT 1
  1365. // Light
  1366. #define LIGHT_CHANNELS 4
  1367. #define LIGHT_CH1_PIN 13 // RED
  1368. #define LIGHT_CH2_PIN 12 // GREEN
  1369. #define LIGHT_CH3_PIN 14 // BLUE
  1370. #define LIGHT_CH4_PIN 2 // WHITE
  1371. #define LIGHT_CH1_INVERSE 0
  1372. #define LIGHT_CH2_INVERSE 0
  1373. #define LIGHT_CH3_INVERSE 0
  1374. #define LIGHT_CH4_INVERSE 0
  1375. #define LIGHT_ENABLE_PIN 15
  1376. #elif defined(GIZWITS_WITTY_CLOUD)
  1377. // Info
  1378. #define MANUFACTURER "GIZWITS"
  1379. #define DEVICE "WITTY_CLOUD"
  1380. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1381. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1382. #define DUMMY_RELAY_COUNT 1
  1383. // Buttons
  1384. #define BUTTON1_PIN 4
  1385. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1386. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  1387. #define BUTTON1_CLICK BUTTON_MODE_NONE
  1388. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1389. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1390. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  1391. #define ANALOG_SUPPORT 1
  1392. // LEDs
  1393. #define LED1_PIN 2 // BLUE build-in
  1394. #define LED1_PIN_INVERSE 1
  1395. // Light
  1396. #define LIGHT_CHANNELS 3
  1397. #define LIGHT_CH1_PIN 15 // RED
  1398. #define LIGHT_CH2_PIN 12 // GREEN
  1399. #define LIGHT_CH3_PIN 13 // BLUE
  1400. #define LIGHT_CH1_INVERSE 0
  1401. #define LIGHT_CH2_INVERSE 0
  1402. #define LIGHT_CH3_INVERSE 0
  1403. // -----------------------------------------------------------------------------
  1404. // KMC 70011
  1405. // https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
  1406. // -----------------------------------------------------------------------------
  1407. #elif defined(KMC_70011)
  1408. // Info
  1409. #define MANUFACTURER "KMC"
  1410. #define DEVICE "70011"
  1411. // Buttons
  1412. #define BUTTON1_PIN 0
  1413. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1414. #define BUTTON1_RELAY 1
  1415. // Relays
  1416. #define RELAY1_PIN 14
  1417. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1418. // LEDs
  1419. #define LED1_PIN 13
  1420. #define LED1_PIN_INVERSE 1
  1421. // HLW8012
  1422. #ifndef HLW8012_SUPPORT
  1423. #define HLW8012_SUPPORT 1
  1424. #endif
  1425. #define HLW8012_SEL_PIN 12
  1426. #define HLW8012_CF1_PIN 5
  1427. #define HLW8012_CF_PIN 4
  1428. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1429. // -----------------------------------------------------------------------------
  1430. // Euromate (?) Wifi Stecker Shuko
  1431. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  1432. // Thanks to @Geitde
  1433. // -----------------------------------------------------------------------------
  1434. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  1435. // Info
  1436. #define MANUFACTURER "EUROMATE"
  1437. #define DEVICE "WIFI_STECKER_SCHUKO"
  1438. // Buttons
  1439. #define BUTTON1_PIN 14
  1440. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1441. #define BUTTON1_RELAY 1
  1442. // The relay in the device is not a bistable (latched) relay.
  1443. // The device is reported to have a flip-flop circuit to drive the relay
  1444. // So @Geitde hack is still the only possible
  1445. // Hack: drive GPIO12 low and use GPIO5 as normal relay pin:
  1446. #define RELAY1_PIN 5
  1447. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1448. #define LED2_PIN 12 /* DUMMY: exploit default off state for GPIO12=low */
  1449. #define LED2_PIN_INVERSE 0
  1450. // LEDs
  1451. #define LED1_PIN 4
  1452. #define LED1_PIN_INVERSE 0
  1453. // -----------------------------------------------------------------------------
  1454. // Generic 8CH
  1455. // -----------------------------------------------------------------------------
  1456. #elif defined(GENERIC_8CH)
  1457. // Info
  1458. #define MANUFACTURER "GENERIC"
  1459. #define DEVICE "8CH"
  1460. // Relays
  1461. #define RELAY1_PIN 0
  1462. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1463. #define RELAY2_PIN 2
  1464. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1465. #define RELAY3_PIN 4
  1466. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1467. #define RELAY4_PIN 5
  1468. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1469. #define RELAY5_PIN 12
  1470. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1471. #define RELAY6_PIN 13
  1472. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  1473. #define RELAY7_PIN 14
  1474. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  1475. #define RELAY8_PIN 15
  1476. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  1477. // -----------------------------------------------------------------------------
  1478. // STM RELAY
  1479. // -----------------------------------------------------------------------------
  1480. #elif defined(STM_RELAY)
  1481. // Info
  1482. #define MANUFACTURER "STM_RELAY"
  1483. #define DEVICE "2CH"
  1484. // Relays
  1485. #define DUMMY_RELAY_COUNT 2
  1486. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  1487. // Remove UART noise on serial line
  1488. #define DEBUG_SERIAL_SUPPORT 0
  1489. // -----------------------------------------------------------------------------
  1490. // Tonbux Powerstrip02
  1491. // -----------------------------------------------------------------------------
  1492. #elif defined(TONBUX_POWERSTRIP02)
  1493. // Info
  1494. #define MANUFACTURER "TONBUX"
  1495. #define DEVICE "POWERSTRIP02"
  1496. // Buttons
  1497. #define BUTTON1_PIN 5
  1498. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1499. #define BUTTON1_RELAY 0
  1500. // Relays
  1501. #define RELAY1_PIN 4
  1502. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1503. #define RELAY2_PIN 13
  1504. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1505. #define RELAY3_PIN 12
  1506. #define RELAY3_TYPE RELAY_TYPE_INVERSE
  1507. #define RELAY4_PIN 14
  1508. #define RELAY4_TYPE RELAY_TYPE_INVERSE
  1509. // Not a relay. USB ports on/off
  1510. #define RELAY5_PIN 16
  1511. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1512. // LEDs
  1513. #define LED1_PIN 0 // 1 blue led
  1514. #define LED1_PIN_INVERSE 1
  1515. #define LED2_PIN 3 // 3 red leds
  1516. #define LED2_PIN_INVERSE 1
  1517. // -----------------------------------------------------------------------------
  1518. // Lingan SWA1
  1519. // -----------------------------------------------------------------------------
  1520. #elif defined(LINGAN_SWA1)
  1521. // Info
  1522. #define MANUFACTURER "LINGAN"
  1523. #define DEVICE "SWA1"
  1524. // Buttons
  1525. #define BUTTON1_PIN 13
  1526. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1527. #define BUTTON1_RELAY 1
  1528. // Relays
  1529. #define RELAY1_PIN 5
  1530. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1531. // LEDs
  1532. #define LED1_PIN 4
  1533. #define LED1_PIN_INVERSE 1
  1534. // -----------------------------------------------------------------------------
  1535. // HEYGO HY02
  1536. // -----------------------------------------------------------------------------
  1537. #elif defined(HEYGO_HY02)
  1538. // Info
  1539. #define MANUFACTURER "HEYGO"
  1540. #define DEVICE "HY02"
  1541. // Buttons
  1542. #define BUTTON1_PIN 13
  1543. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1544. #define BUTTON1_RELAY 1
  1545. // Relays
  1546. #define RELAY1_PIN 12
  1547. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1548. // LEDs
  1549. #define LED1_PIN 4
  1550. #define LED1_PIN_INVERSE 0
  1551. // -----------------------------------------------------------------------------
  1552. // Maxcio W-US002S
  1553. // -----------------------------------------------------------------------------
  1554. #elif defined(MAXCIO_WUS002S)
  1555. // Info
  1556. #define MANUFACTURER "MAXCIO"
  1557. #define DEVICE "WUS002S"
  1558. // Buttons
  1559. #define BUTTON1_PIN 2
  1560. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1561. #define BUTTON1_RELAY 1
  1562. // Relays
  1563. #define RELAY1_PIN 13
  1564. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1565. // LEDs
  1566. #define LED1_PIN 3
  1567. #define LED1_PIN_INVERSE 0
  1568. // HLW8012
  1569. #ifndef HLW8012_SUPPORT
  1570. #define HLW8012_SUPPORT 1
  1571. #endif
  1572. #define HLW8012_SEL_PIN 12
  1573. #define HLW8012_CF1_PIN 5
  1574. #define HLW8012_CF_PIN 4
  1575. #define HLW8012_CURRENT_R 0.002 // Current resistor
  1576. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1577. // -----------------------------------------------------------------------------
  1578. // Maxcio W-DE004
  1579. // -----------------------------------------------------------------------------
  1580. #elif defined(MAXCIO_WDE004)
  1581. // Info
  1582. #define MANUFACTURER "MAXCIO"
  1583. #define DEVICE "WDE004"
  1584. // Buttons
  1585. #define BUTTON1_PIN 1
  1586. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1587. #define BUTTON1_RELAY 1
  1588. // Relays
  1589. #define RELAY1_PIN 14
  1590. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1591. // LEDs
  1592. #define LED1_PIN 13
  1593. #define LED1_PIN_INVERSE 1
  1594. // -----------------------------------------------------------------------------
  1595. // YiDian XS-SSA05
  1596. // -----------------------------------------------------------------------------
  1597. #elif defined(YIDIAN_XSSSA05)
  1598. // Info
  1599. #define MANUFACTURER "YIDIAN"
  1600. #define DEVICE "XSSSA05"
  1601. // Buttons
  1602. #define BUTTON1_PIN 13
  1603. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1604. #define BUTTON1_RELAY 1
  1605. // Relays
  1606. #define RELAY1_PIN 12
  1607. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1608. // LEDs
  1609. #define LED1_PIN 0 // red
  1610. #define LED1_PIN_INVERSE 1
  1611. #define LED1_MODE LED_MODE_WIFI
  1612. #define LED2_PIN 15 // blue
  1613. #define LED2_PIN_INVERSE 1
  1614. #define LED2_MODE LED_MODE_RELAY
  1615. // HLW8012
  1616. #ifndef HLW8012_SUPPORT
  1617. #define HLW8012_SUPPORT 1
  1618. #endif
  1619. #define HLW8012_SEL_PIN 3
  1620. #define HLW8012_CF1_PIN 14
  1621. #define HLW8012_CF_PIN 5
  1622. #define HLW8012_SEL_CURRENT LOW
  1623. #define HLW8012_CURRENT_RATIO 25740
  1624. #define HLW8012_VOLTAGE_RATIO 313400
  1625. #define HLW8012_POWER_RATIO 3414290
  1626. #define HLW8012_INTERRUPT_ON FALLING
  1627. // -----------------------------------------------------------------------------
  1628. // TONBUX XS-SSA01
  1629. // -----------------------------------------------------------------------------
  1630. #elif defined(TONBUX_XSSSA01)
  1631. // Info
  1632. #define MANUFACTURER "TONBUX"
  1633. #define DEVICE "XSSSA01"
  1634. // Buttons
  1635. #define BUTTON1_PIN 4
  1636. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1637. #define BUTTON1_RELAY 1
  1638. // Relays
  1639. #define RELAY1_PIN 14
  1640. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1641. // LEDs
  1642. #define LED1_PIN 13
  1643. #define LED1_PIN_INVERSE 0
  1644. // -----------------------------------------------------------------------------
  1645. // TONBUX XS-SSA06
  1646. // -----------------------------------------------------------------------------
  1647. #elif defined(TONBUX_XSSSA06)
  1648. // Info
  1649. #define MANUFACTURER "TONBUX"
  1650. #define DEVICE "XSSSA06"
  1651. // Buttons
  1652. #define BUTTON1_PIN 13
  1653. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1654. #define BUTTON1_RELAY 1
  1655. // Relays
  1656. #define RELAY1_PIN 15
  1657. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1658. // LEDs
  1659. #define LED1_PIN 0 // R - 8 rgb led ring
  1660. #define LED1_PIN_INVERSE 0
  1661. #define LED2_PIN 5 // G
  1662. #define LED2_PIN_INVERSE 0
  1663. #define LED3_PIN 2 // B
  1664. #define LED3_PIN_INVERSE 0
  1665. // -----------------------------------------------------------------------------
  1666. // GREEN ESP8266 RELAY MODULE
  1667. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1668. // -----------------------------------------------------------------------------
  1669. #elif defined(GREEN_ESP8266RELAY)
  1670. // Info
  1671. #define MANUFACTURER "GREEN"
  1672. #define DEVICE "ESP8266RELAY"
  1673. // Buttons
  1674. // Not a button but input via Optocoupler
  1675. #define BUTTON1_PIN 5
  1676. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1677. #define BUTTON1_RELAY 1
  1678. // Relays
  1679. #define RELAY1_PIN 4
  1680. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1681. // LEDs
  1682. #define LED1_PIN 2
  1683. #define LED1_PIN_INVERSE 1
  1684. // -----------------------------------------------------------------------------
  1685. // Henrique Gravina ESPIKE
  1686. // https://github.com/Henriquegravina/Espike
  1687. // -----------------------------------------------------------------------------
  1688. #elif defined(IKE_ESPIKE)
  1689. #define MANUFACTURER "IKE"
  1690. #define DEVICE "ESPIKE"
  1691. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1692. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1693. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1694. #define BUTTON1_PIN 13
  1695. #define BUTTON1_RELAY 1
  1696. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1697. #define BUTTON2_PIN 12
  1698. #define BUTTON2_RELAY 2
  1699. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1700. #define BUTTON3_PIN 14
  1701. #define BUTTON3_RELAY 3
  1702. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1703. #define RELAY1_PIN 4
  1704. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1705. #define RELAY2_PIN 5
  1706. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1707. #define RELAY3_PIN 16
  1708. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1709. #define LED1_PIN 2
  1710. #define LED1_PIN_INVERSE 1
  1711. // -----------------------------------------------------------------------------
  1712. // SWIFITCH
  1713. // https://github.com/ArnieX/swifitch
  1714. // -----------------------------------------------------------------------------
  1715. #elif defined(ARNIEX_SWIFITCH)
  1716. // Info
  1717. #define MANUFACTURER "ARNIEX"
  1718. #define DEVICE "SWIFITCH"
  1719. // Buttons
  1720. #define BUTTON1_PIN 4 // D2
  1721. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1722. #define BUTTON1_RELAY 1
  1723. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1724. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1725. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1726. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1727. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1728. // Relays
  1729. #define RELAY1_PIN 5 // D1
  1730. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1731. // LEDs
  1732. #define LED1_PIN 12 // D6
  1733. #define LED1_PIN_INVERSE 1
  1734. // -----------------------------------------------------------------------------
  1735. // ESP-01S RELAY v4.0
  1736. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  1737. // -----------------------------------------------------------------------------
  1738. #elif defined(GENERIC_ESP01S_RELAY_V40)
  1739. // Info
  1740. #define MANUFACTURER "GENERIC"
  1741. #define DEVICE "ESP01S_RELAY_40"
  1742. // Relays
  1743. #define RELAY1_PIN 0
  1744. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1745. // LEDs
  1746. #define LED1_PIN 2
  1747. #define LED1_PIN_INVERSE 0
  1748. // -----------------------------------------------------------------------------
  1749. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  1750. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  1751. // -----------------------------------------------------------------------------
  1752. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  1753. // Info
  1754. #define MANUFACTURER "GENERIC"
  1755. #define DEVICE "ESP01S_RGBLED_10"
  1756. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  1757. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  1758. // Buttons
  1759. //#define BUTTON1_PIN 2
  1760. // Relays
  1761. //#define RELAY1_PIN 2
  1762. // LEDs
  1763. #define LED1_PIN 2
  1764. #define LED1_PIN_INVERSE 0
  1765. // -----------------------------------------------------------------------------
  1766. // ESP-01S DHT11 v1.0
  1767. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  1768. // -----------------------------------------------------------------------------
  1769. #elif defined(GENERIC_ESP01S_DHT11_V10)
  1770. // Info
  1771. #define MANUFACTURER "GENERIC"
  1772. #define DEVICE "ESP01S_DHT11_10"
  1773. // DHT11
  1774. #ifndef DHT_SUPPORT
  1775. #define DHT_SUPPORT 1
  1776. #endif
  1777. #define DHT_PIN 2
  1778. #define DHT_TYPE DHT_CHIP_DHT11
  1779. // -----------------------------------------------------------------------------
  1780. // ESP-01S DS18B20 v1.0
  1781. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  1782. // -----------------------------------------------------------------------------
  1783. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  1784. // Info
  1785. #define MANUFACTURER "GENERIC"
  1786. #define DEVICE "ESP01S_DS18B20_10"
  1787. // DB18B20
  1788. #ifndef DALLAS_SUPPORT
  1789. #define DALLAS_SUPPORT 1
  1790. #endif
  1791. #define DALLAS_PIN 2
  1792. // -----------------------------------------------------------------------------
  1793. // ESP-DIN relay board V1
  1794. // https://github.com/pilotak/esp_din
  1795. // -----------------------------------------------------------------------------
  1796. #elif defined(PILOTAK_ESP_DIN_V1)
  1797. // Info
  1798. #define MANUFACTURER "PILOTAK"
  1799. #define DEVICE "ESP_DIN_V1"
  1800. // Buttons
  1801. #define BUTTON1_PIN 0
  1802. #define BUTTON1_RELAY 1
  1803. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1804. // Relays
  1805. #define RELAY1_PIN 4
  1806. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1807. #define RELAY2_PIN 5
  1808. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1809. // LEDs
  1810. #define LED1_PIN 15
  1811. #define LED1_PIN_INVERSE 0
  1812. #define I2C_SDA_PIN 12
  1813. #define I2C_SCL_PIN 13
  1814. #ifndef DALLAS_SUPPORT
  1815. #define DALLAS_SUPPORT 1
  1816. #endif
  1817. #define DALLAS_PIN 2
  1818. #ifndef RF_SUPPORT
  1819. #define RF_SUPPORT 1
  1820. #endif
  1821. #define RF_PIN 14
  1822. #ifndef DIGITAL_SUPPORT
  1823. #define DIGITAL_SUPPORT 1
  1824. #endif
  1825. #define DIGITAL_PIN 16
  1826. #define DIGITAL_PIN_MODE INPUT
  1827. // -----------------------------------------------------------------------------
  1828. // Heltec Touch Relay
  1829. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  1830. // -----------------------------------------------------------------------------
  1831. #elif defined(HELTEC_TOUCHRELAY)
  1832. // Info
  1833. #define MANUFACTURER "HELTEC"
  1834. #define DEVICE "TOUCH_RELAY"
  1835. // Buttons
  1836. #define BUTTON1_PIN 14
  1837. #define BUTTON1_RELAY 1
  1838. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1839. // Relays
  1840. #define RELAY1_PIN 12
  1841. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1842. // -----------------------------------------------------------------------------
  1843. // Zhilde ZLD-EU44-W
  1844. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  1845. // -----------------------------------------------------------------------------
  1846. #elif defined(ZHILDE_EU44_W)
  1847. // Info
  1848. #define MANUFACTURER "ZHILDE"
  1849. #define DEVICE "EU44_W"
  1850. // Based on the reporter, this product uses GPIO1 and 3 for the button
  1851. // and onboard LED, so hardware serial should be disabled...
  1852. #define DEBUG_SERIAL_SUPPORT 0
  1853. // Buttons
  1854. #define BUTTON1_PIN 3
  1855. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1856. // Relays
  1857. #define RELAY1_PIN 5
  1858. #define RELAY2_PIN 4
  1859. #define RELAY3_PIN 12
  1860. #define RELAY4_PIN 13
  1861. #define RELAY5_PIN 14
  1862. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1863. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1864. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1865. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1866. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1867. // LEDs
  1868. #define LED1_PIN 1
  1869. #define LED1_PIN_INVERSE 1
  1870. // -----------------------------------------------------------------------------
  1871. // Allnet 4duino ESP8266-UP-Relais
  1872. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  1873. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  1874. // -----------------------------------------------------------------------------
  1875. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  1876. // Info
  1877. #define MANUFACTURER "ALLNET"
  1878. #define DEVICE "4DUINO_IOT_WLAN_RELAIS"
  1879. // Relays
  1880. #define RELAY1_PIN 14
  1881. #define RELAY1_RESET_PIN 12
  1882. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1883. // LEDs
  1884. #define LED1_PIN 0
  1885. #define LED1_PIN_INVERSE 1
  1886. // Buttons
  1887. //#define BUTTON1_PIN 0
  1888. //#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1889. // Using pins labelled as SDA & SCL as buttons
  1890. #define BUTTON2_PIN 4
  1891. #define BUTTON2_MODE BUTTON_PUSHBUTTON
  1892. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  1893. #define BUTTON2_CLICK BUTTON_MODE_NONE
  1894. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  1895. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  1896. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  1897. #define BUTTON3_PIN 5
  1898. #define BUTTON3_MODE BUTTON_PUSHBUTTON
  1899. // Using pins labelled as SDA & SCL for I2C
  1900. //#define I2C_SDA_PIN 4
  1901. //#define I2C_SCL_PIN 5
  1902. // -----------------------------------------------------------------------------
  1903. // Luani HVIO
  1904. // https://luani.de/projekte/esp8266-hvio/
  1905. // https://luani.de/blog/esp8266-230v-io-modul/
  1906. // -----------------------------------------------------------------------------
  1907. #elif defined(LUANI_HVIO)
  1908. // Info
  1909. #define MANUFACTURER "LUANI"
  1910. #define DEVICE "HVIO"
  1911. // Buttons
  1912. #define BUTTON1_PIN 12
  1913. #define BUTTON1_RELAY 1
  1914. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  1915. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1916. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1917. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1918. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1919. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1920. #define BUTTON2_PIN 13
  1921. #define BUTTON2_RELAY 2
  1922. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  1923. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  1924. // Relays
  1925. #define RELAY1_PIN 4
  1926. #define RELAY2_PIN 5
  1927. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1928. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1929. // LEDs
  1930. #define LED1_PIN 15
  1931. #define LED1_PIN_INVERSE 0
  1932. // -----------------------------------------------------------------------------
  1933. // Tonbux 50-100M Smart Mosquito Killer USB
  1934. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  1935. // -----------------------------------------------------------------------------
  1936. #elif defined(TONBUX_MOSQUITO_KILLER)
  1937. // Info
  1938. #define MANUFACTURER "TONBUX"
  1939. #define DEVICE "MOSQUITO_KILLER"
  1940. // Buttons
  1941. #define BUTTON1_PIN 2
  1942. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1943. #define BUTTON1_RELAY 1
  1944. // Relays
  1945. #define RELAY1_PIN 5 // not a relay, fan
  1946. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1947. // LEDs
  1948. #define LED1_PIN 15 // blue led
  1949. #define LED1_PIN_INVERSE 1
  1950. #define LED1_MODE LED_MODE_WIFI
  1951. #define LED2_PIN 14 // red led
  1952. #define LED2_PIN_INVERSE 1
  1953. #define LED2_MODE LED_MODE_RELAY
  1954. #define LED3_PIN 12 // UV leds (1-2-3-4-5-6-7-8)
  1955. #define LED3_PIN_INVERSE 0
  1956. #define LED3_RELAY 1
  1957. #define LED4_PIN 16 // UV leds (9-10-11)
  1958. #define LED4_PIN_INVERSE 0
  1959. #define LED4_RELAY 1
  1960. // -----------------------------------------------------------------------------
  1961. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  1962. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  1963. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  1964. // -----------------------------------------------------------------------------
  1965. #elif defined(NEO_COOLCAM_NAS_WR01W)
  1966. // Info
  1967. #define MANUFACTURER "NEO_COOLCAM"
  1968. #define DEVICE "NAS_WR01W"
  1969. // Buttons
  1970. #define BUTTON1_PIN 13
  1971. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1972. #define BUTTON1_RELAY 1
  1973. // Relays
  1974. #define RELAY1_PIN 12
  1975. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1976. // LEDs
  1977. #define LED1_PIN 4
  1978. #define LED1_PIN_INVERSE 1
  1979. // ------------------------------------------------------------------------------
  1980. // Estink Wifi Power Strip
  1981. // https://www.amazon.de/Steckdosenleiste-Ladeger%C3%A4t-Sprachsteuerung-SmartphonesTablets-Android/dp/B0796W5FZY
  1982. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  1983. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  1984. // -----------------------------------------------------------------------------
  1985. #elif defined(ESTINK_WIFI_POWER_STRIP)
  1986. // Info
  1987. #define MANUFACTURER "ESTINK"
  1988. #define DEVICE "WIFI_POWER_STRIP"
  1989. // Disable UART noise since this board uses GPIO3
  1990. #define DEBUG_SERIAL_SUPPORT 0
  1991. // Buttons
  1992. #define BUTTON1_PIN 16
  1993. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1994. #define BUTTON1_RELAY 4
  1995. // Relays
  1996. #define RELAY1_PIN 14 // USB power
  1997. #define RELAY2_PIN 13 // power plug 1
  1998. #define RELAY3_PIN 4 // power plug 2
  1999. #define RELAY4_PIN 15 // power plug 3
  2000. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2001. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2002. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2003. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2004. // LEDs
  2005. #define LED1_PIN 0 // power led
  2006. #define LED2_PIN 12 // power plug 1
  2007. #define LED3_PIN 3 // power plug 2
  2008. #define LED4_PIN 5 // power plug 3
  2009. #define LED1_PIN_INVERSE 1
  2010. #define LED2_PIN_INVERSE 1
  2011. #define LED3_PIN_INVERSE 1
  2012. #define LED4_PIN_INVERSE 1
  2013. #define LED1_MODE LED_MODE_FINDME
  2014. #define LED2_MODE LED_MODE_FOLLOW
  2015. #define LED3_MODE LED_MODE_FOLLOW
  2016. #define LED4_MODE LED_MODE_FOLLOW
  2017. #define LED2_RELAY 2
  2018. #define LED3_RELAY 3
  2019. #define LED4_RELAY 4
  2020. // -----------------------------------------------------------------------------
  2021. // Bruno Horta's OnOfre
  2022. // https://www.bhonofre.pt/
  2023. // https://github.com/brunohorta82/BH_OnOfre/
  2024. // -----------------------------------------------------------------------------
  2025. #elif defined(BH_ONOFRE)
  2026. // Info
  2027. #define MANUFACTURER "BH"
  2028. #define DEVICE "ONOFRE"
  2029. // Buttons
  2030. #define BUTTON1_PIN 12
  2031. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2032. #define BUTTON1_RELAY 1
  2033. #define BUTTON2_PIN 13
  2034. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2035. #define BUTTON2_RELAY 2
  2036. // Relays
  2037. #define RELAY1_PIN 4
  2038. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2039. #define RELAY2_PIN 5
  2040. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2041. // -----------------------------------------------------------------------------
  2042. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  2043. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  2044. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  2045. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  2046. // * Goosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  2047. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  2048. // -----------------------------------------------------------------------------
  2049. #elif defined(BLITZWOLF_BWSHP2)
  2050. // Info
  2051. #define MANUFACTURER "BLITZWOLF"
  2052. #define DEVICE "BWSHP2"
  2053. // Buttons
  2054. #define BUTTON1_PIN 13
  2055. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2056. #define BUTTON1_RELAY 1
  2057. // Relays
  2058. #define RELAY1_PIN 15
  2059. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2060. // LEDs
  2061. #define LED1_PIN 2
  2062. #define LED1_PIN_INVERSE 1
  2063. #define LED2_PIN 0
  2064. #define LED2_PIN_INVERSE 1
  2065. #define LED2_MODE LED_MODE_FINDME
  2066. #define LED2_RELAY 1
  2067. // HJL01 / BL0937
  2068. #ifndef HLW8012_SUPPORT
  2069. #define HLW8012_SUPPORT 1
  2070. #endif
  2071. #define HLW8012_SEL_PIN 12
  2072. #define HLW8012_CF1_PIN 14
  2073. #define HLW8012_CF_PIN 5
  2074. #define HLW8012_SEL_CURRENT LOW
  2075. #define HLW8012_CURRENT_RATIO 25740
  2076. #define HLW8012_VOLTAGE_RATIO 313400
  2077. #define HLW8012_POWER_RATIO 3414290
  2078. #define HLW8012_INTERRUPT_ON FALLING
  2079. // -----------------------------------------------------------------------------
  2080. // Same as the above but new board version marked V2.3
  2081. // -----------------------------------------------------------------------------
  2082. #elif defined(BLITZWOLF_BWSHP2_V23)
  2083. // Info
  2084. #define MANUFACTURER "BLITZWOLF"
  2085. #define DEVICE "BWSHP2V2.3"
  2086. // Buttons
  2087. #define BUTTON1_PIN 3
  2088. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2089. #define BUTTON1_RELAY 1
  2090. // Relays
  2091. #define RELAY1_PIN 14
  2092. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2093. // LEDs
  2094. #define LED1_PIN 1
  2095. #define LED1_PIN_INVERSE 1
  2096. #define LED2_PIN 13
  2097. #define LED2_PIN_INVERSE 1
  2098. #define LED2_MODE LED_MODE_FINDME
  2099. #define LED2_RELAY 1
  2100. // HJL01 / BL0937
  2101. #ifndef HLW8012_SUPPORT
  2102. #define HLW8012_SUPPORT 1
  2103. #endif
  2104. #define HLW8012_SEL_PIN 12
  2105. #define HLW8012_CF1_PIN 5
  2106. #define HLW8012_CF_PIN 4
  2107. #define HLW8012_SEL_CURRENT LOW
  2108. #define HLW8012_CURRENT_RATIO 25740
  2109. #define HLW8012_VOLTAGE_RATIO 313400
  2110. #define HLW8012_POWER_RATIO 3414290
  2111. #define HLW8012_INTERRUPT_ON FALLING
  2112. // -----------------------------------------------------------------------------
  2113. // Teckin SP22 v1.4 - v1.6
  2114. // -----------------------------------------------------------------------------
  2115. #elif defined(TECKIN_SP22_V14)
  2116. // Info
  2117. #define MANUFACTURER "TECKIN"
  2118. #define DEVICE "SP22_V14"
  2119. // Buttons
  2120. #define BUTTON1_PIN 1
  2121. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2122. #define BUTTON1_RELAY 1
  2123. // Relays
  2124. #define RELAY1_PIN 14
  2125. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2126. // LEDs
  2127. #define LED1_PIN 3
  2128. #define LED1_PIN_INVERSE 1
  2129. #define LED2_PIN 13
  2130. #define LED2_PIN_INVERSE 1
  2131. #define LED2_MODE LED_MODE_FINDME
  2132. #define LED2_RELAY 1
  2133. // HJL01 / BL0937
  2134. #ifndef HLW8012_SUPPORT
  2135. #define HLW8012_SUPPORT 1
  2136. #endif
  2137. #define HLW8012_SEL_PIN 12
  2138. #define HLW8012_CF1_PIN 5
  2139. #define HLW8012_CF_PIN 4
  2140. #define HLW8012_SEL_CURRENT LOW
  2141. #define HLW8012_CURRENT_RATIO 20730
  2142. #define HLW8012_VOLTAGE_RATIO 264935
  2143. #define HLW8012_POWER_RATIO 2533110
  2144. #define HLW8012_INTERRUPT_ON FALLING
  2145. // ----------------------------------------------------------------------------------------
  2146. // Homecube 16A is similar but some pins differ and it also has RGB LEDs
  2147. // https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
  2148. // ----------------------------------------------------------------------------------------
  2149. #elif defined(HOMECUBE_16A)
  2150. // Info
  2151. #define MANUFACTURER "HOMECUBE"
  2152. #define DEVICE "16A"
  2153. // Buttons
  2154. #define BUTTON1_PIN 13
  2155. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2156. #define BUTTON1_RELAY 1
  2157. // Relays
  2158. #define RELAY1_PIN 15
  2159. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2160. // LEDs
  2161. //LED Pin 4 - ESP8266 onboard LED
  2162. //Red LED: 0
  2163. //Green LED: 12
  2164. //Blue LED: 2
  2165. // Blue
  2166. #define LED1_PIN 2
  2167. #define LED1_PIN_INVERSE 0
  2168. // Green
  2169. #define LED2_PIN 12
  2170. #define LED2_PIN_INVERSE 1
  2171. #define LED2_MODE LED_MODE_RELAY
  2172. // Red
  2173. #define LED3_PIN 0
  2174. #define LED3_PIN_INVERSE 0
  2175. #define LED3_MODE LED_MODE_OFF
  2176. // HJL01 / BL0937
  2177. #ifndef HLW8012_SUPPORT
  2178. #define HLW8012_SUPPORT 1
  2179. #endif
  2180. #define HLW8012_SEL_PIN 16
  2181. #define HLW8012_CF1_PIN 14
  2182. #define HLW8012_CF_PIN 5
  2183. #define HLW8012_SEL_CURRENT LOW
  2184. #define HLW8012_CURRENT_RATIO 25740
  2185. #define HLW8012_VOLTAGE_RATIO 313400
  2186. #define HLW8012_POWER_RATIO 3414290
  2187. #define HLW8012_INTERRUPT_ON FALLING
  2188. // -----------------------------------------------------------------------------
  2189. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  2190. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  2191. // -----------------------------------------------------------------------------
  2192. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  2193. // Info
  2194. #define MANUFACTURER "VANZAVANZU"
  2195. #define DEVICE "SMART_WIFI_PLUG_MINI"
  2196. // Buttons
  2197. #define BUTTON1_PIN 13
  2198. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2199. #define BUTTON1_RELAY 1
  2200. // Relays
  2201. #define RELAY1_PIN 15
  2202. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2203. // LEDs
  2204. #define LED1_PIN 2
  2205. #define LED1_PIN_INVERSE 1
  2206. #define LED2_PIN 0
  2207. #define LED2_PIN_INVERSE 1
  2208. #define LED2_MODE LED_MODE_FINDME
  2209. #define LED2_RELAY 1
  2210. // Disable UART noise
  2211. #define DEBUG_SERIAL_SUPPORT 0
  2212. // HJL01 / BL0937
  2213. #ifndef HLW8012_SUPPORT
  2214. #define HLW8012_SUPPORT 1
  2215. #endif
  2216. #define HLW8012_SEL_PIN 3
  2217. #define HLW8012_CF1_PIN 14
  2218. #define HLW8012_CF_PIN 5
  2219. #define HLW8012_SEL_CURRENT LOW
  2220. #define HLW8012_CURRENT_RATIO 25740
  2221. #define HLW8012_VOLTAGE_RATIO 313400
  2222. #define HLW8012_POWER_RATIO 3414290
  2223. #define HLW8012_INTERRUPT_ON FALLING
  2224. // -----------------------------------------------------------------------------
  2225. #elif defined(GENERIC_AG_L4)
  2226. // Info
  2227. #define MANUFACTURER "GENERIC"
  2228. #define DEVICE "AG_L4"
  2229. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2230. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2231. #define DUMMY_RELAY_COUNT 1
  2232. // button 1: "power" button
  2233. #define BUTTON1_PIN 4
  2234. #define BUTTON1_RELAY 1
  2235. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2236. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  2237. #define BUTTON1_CLICK BUTTON_MODE_NONE
  2238. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2239. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2240. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  2241. // button 2: "wifi" button
  2242. #define BUTTON2_PIN 2
  2243. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2244. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  2245. #define BUTTON2_CLICK BUTTON_MODE_NONE
  2246. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  2247. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  2248. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  2249. // LEDs
  2250. #define LED1_PIN 5 // red status led
  2251. #define LED1_PIN_INVERSE 0
  2252. #define LED2_PIN 16 // master light power
  2253. #define LED2_PIN_INVERSE 1
  2254. #define LED2_MODE LED_MODE_RELAY
  2255. // Light
  2256. #define LIGHT_CHANNELS 3
  2257. #define LIGHT_CH1_PIN 14 // RED
  2258. #define LIGHT_CH2_PIN 13 // GREEN
  2259. #define LIGHT_CH3_PIN 12 // BLUE
  2260. #define LIGHT_CH1_INVERSE 0
  2261. #define LIGHT_CH2_INVERSE 0
  2262. #define LIGHT_CH3_INVERSE 0
  2263. // -----------------------------------------------------------------------------
  2264. #elif defined(ALLTERCO_SHELLY1)
  2265. // Info
  2266. #define MANUFACTURER "ALLTERCO"
  2267. #define DEVICE "SHELLY1"
  2268. // Buttons
  2269. #define BUTTON1_PIN 5
  2270. #define BUTTON1_MODE BUTTON_SWITCH
  2271. #define BUTTON1_RELAY 1
  2272. // Relays
  2273. #define RELAY1_PIN 4
  2274. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2275. #elif defined(ALLTERCO_SHELLY2)
  2276. // Info
  2277. #define MANUFACTURER "ALLTERCO"
  2278. #define DEVICE "SHELLY2"
  2279. // Buttons
  2280. #define BUTTON1_PIN 12
  2281. #define BUTTON2_PIN 14
  2282. #define BUTTON1_MODE BUTTON_SWITCH
  2283. #define BUTTON2_MODE BUTTON_SWITCH
  2284. #define BUTTON1_RELAY 1
  2285. #define BUTTON2_RELAY 2
  2286. // Relays
  2287. #define RELAY1_PIN 4
  2288. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2289. #define RELAY2_PIN 5
  2290. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2291. // -----------------------------------------------------------------------------
  2292. #elif defined(LOHAS_9W)
  2293. // Info
  2294. #define MANUFACTURER "LOHAS"
  2295. #define DEVICE "E27_9W"
  2296. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2297. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2298. #define DUMMY_RELAY_COUNT 1
  2299. // Light
  2300. #define LIGHT_CHANNELS 5
  2301. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2302. #define MY92XX_CHIPS 2
  2303. #define MY92XX_DI_PIN 13
  2304. #define MY92XX_DCKI_PIN 15
  2305. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2306. #define MY92XX_MAPPING 0, 1, 2, 3, 4
  2307. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  2308. // -----------------------------------------------------------------------------
  2309. #elif defined(XIAOMI_SMART_DESK_LAMP)
  2310. // Info
  2311. #define MANUFACTURER "XIAOMI"
  2312. #define DEVICE "SMART_DESK_LAMP"
  2313. // Buttons
  2314. #define BUTTON1_PIN 2
  2315. #define BUTTON2_PIN 14
  2316. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2317. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2318. // This button doubles as switch here and as encoder mode switch below
  2319. // Clicking it (for less than 500ms) will turn the light on and off
  2320. // Double and Long clicks will not work as these are used to modify the encoder action
  2321. #define BUTTON1_RELAY 1
  2322. #define BUTTON_LNGCLICK_DELAY 500
  2323. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2324. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2325. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  2326. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  2327. #define BUTTON2_DBLCLICK BUTTON_MODE_AP
  2328. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  2329. // Light
  2330. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2331. #define DUMMY_RELAY_COUNT 1
  2332. #define LIGHT_STEP 8
  2333. #define LIGHT_CHANNELS 2
  2334. #define LIGHT_CH1_PIN 5 // warm white
  2335. #define LIGHT_CH1_INVERSE 0
  2336. #define LIGHT_CH2_PIN 4 // cold white
  2337. #define LIGHT_CH2_INVERSE 0
  2338. // Encoder
  2339. // If mode is ENCODER_MODE_RATIO, the value ratio between both channels is changed
  2340. // when the button is not pressed, and the overall brightness when pressed
  2341. // If mode is ENCODER_MODE_CHANNEL, the first channel value is changed
  2342. // when the button is not pressed, and the second channel when pressed
  2343. // If no ENCODERX_BUTTON_PIN defined it will only change the value of the first defined channel
  2344. #define ENCODER_SUPPORT 1
  2345. #define ENCODER1_PIN1 12
  2346. #define ENCODER1_PIN2 13
  2347. #define ENCODER1_BUTTON_PIN 2 // active low by default, with software pullup
  2348. #define ENCODER1_CHANNEL1 0 // please note this value is 0-based (LIGHT_CH1 above)
  2349. #define ENCODER1_CHANNEL2 1 // please note this value is 0-based (LIGHT_CH2 above)
  2350. #define ENCODER1_MODE ENCODER_MODE_RATIO
  2351. #elif defined(PHYX_ESP12_RGB)
  2352. // Info
  2353. #define MANUFACTURER "PHYX"
  2354. #define DEVICE "ESP12_RGB"
  2355. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2356. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2357. #define DUMMY_RELAY_COUNT 1
  2358. // Light
  2359. #define LIGHT_CHANNELS 3
  2360. #define LIGHT_CH1_PIN 4 // RED
  2361. #define LIGHT_CH2_PIN 14 // GREEN
  2362. #define LIGHT_CH3_PIN 12 // BLUE
  2363. #define LIGHT_CH1_INVERSE 0
  2364. #define LIGHT_CH2_INVERSE 0
  2365. #define LIGHT_CH3_INVERSE 0
  2366. // -----------------------------------------------------------------------------
  2367. // iWoole LED Table Lamp
  2368. // 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
  2369. // -----------------------------------------------------------------------------
  2370. #elif defined(IWOOLE_LED_TABLE_LAMP)
  2371. // Info
  2372. #define MANUFACTURER "IWOOLE"
  2373. #define DEVICE "LED_TABLE_LAMP"
  2374. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2375. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2376. #define DUMMY_RELAY_COUNT 1
  2377. // Light
  2378. #define LIGHT_CHANNELS 4
  2379. #define LIGHT_CH1_PIN 12 // RED
  2380. #define LIGHT_CH2_PIN 5 // GREEN
  2381. #define LIGHT_CH3_PIN 14 // BLUE
  2382. #define LIGHT_CH4_PIN 4 // WHITE
  2383. #define LIGHT_CH1_INVERSE 0
  2384. #define LIGHT_CH2_INVERSE 0
  2385. #define LIGHT_CH3_INVERSE 0
  2386. #define LIGHT_CH4_INVERSE 0
  2387. // -----------------------------------------------------------------------------
  2388. // Lombex Lux Nova 2 Tunable White
  2389. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2390. // -----------------------------------------------------------------------------
  2391. #elif defined(LOMBEX_LUX_NOVA2_TUNABLE_WHITE)
  2392. // Info
  2393. #define MANUFACTURER "LOMBEX"
  2394. #define DEVICE "LUX_NOVA2_TUNABLE_WHITE"
  2395. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2396. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2397. #define DUMMY_RELAY_COUNT 1
  2398. // Light
  2399. #define LIGHT_CHANNELS 5
  2400. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2401. #define MY92XX_CHIPS 1
  2402. #define MY92XX_DI_PIN 4
  2403. #define MY92XX_DCKI_PIN 5
  2404. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2405. // No RGB on this bulb. Warm white on channel 0, cool white on channel 3
  2406. #define MY92XX_MAPPING 255, 255, 255, 3, 0
  2407. // -----------------------------------------------------------------------------
  2408. // Lombex Lux Nova 2 White and Color
  2409. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2410. // -----------------------------------------------------------------------------
  2411. #elif defined(LOMBEX_LUX_NOVA2_WHITE_COLOR)
  2412. // Info
  2413. #define MANUFACTURER "LOMBEX"
  2414. #define DEVICE "LUX_NOVA2_WHITE_COLOR"
  2415. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2416. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2417. #define DUMMY_RELAY_COUNT 1
  2418. // Light
  2419. #define LIGHT_CHANNELS 4
  2420. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2421. #define MY92XX_CHIPS 1
  2422. #define MY92XX_DI_PIN 4
  2423. #define MY92XX_DCKI_PIN 5
  2424. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2425. // RGB on channels 0/1/2, either cool or warm white on channel 3
  2426. // The bulb *should* have cool leds, but could also have warm leds as a common defect
  2427. #define MY92XX_MAPPING 0, 1, 2, 3
  2428. // -----------------------------------------------------------------------------
  2429. // Bestek Smart Plug with 2 USB ports
  2430. // https://www.bestekcorp.com/bestek-smart-plug-works-with-amazon-alexa-google-assistant-and-ifttt-with-2-usb
  2431. // -----------------------------------------------------------------------------
  2432. #elif defined(BESTEK_MRJ1011)
  2433. // Info
  2434. #define MANUFACTURER "BESTEK"
  2435. #define DEVICE "MRJ1011"
  2436. // Buttons
  2437. #define BUTTON1_PIN 13
  2438. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2439. #define BUTTON1_RELAY 1
  2440. // Relay
  2441. #define RELAY1_PIN 12
  2442. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2443. // LED
  2444. #define LED1_PIN 4
  2445. #define LED1_PIN_INVERSE 1
  2446. // -----------------------------------------------------------------------------
  2447. // GBLIFE RGBW SOCKET
  2448. // -----------------------------------------------------------------------------
  2449. #elif defined(GBLIFE_RGBW_SOCKET)
  2450. // Info
  2451. #define MANUFACTURER "GBLIFE"
  2452. #define DEVICE "RGBW_SOCKET"
  2453. // Buttons
  2454. #define BUTTON1_PIN 13
  2455. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2456. #define BUTTON1_RELAY 1
  2457. // Relays
  2458. #define RELAY1_PIN 15
  2459. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2460. // Light RGBW
  2461. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2462. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2463. #define DUMMY_RELAY_COUNT 1
  2464. #define LIGHT_CHANNELS 4
  2465. #define LIGHT_CH1_PIN 5 // RED
  2466. #define LIGHT_CH2_PIN 14 // GREEN
  2467. #define LIGHT_CH3_PIN 12 // BLUE
  2468. #define LIGHT_CH4_PIN 4 // WHITE
  2469. #define LIGHT_CH1_INVERSE 0
  2470. #define LIGHT_CH2_INVERSE 0
  2471. #define LIGHT_CH3_INVERSE 0
  2472. #define LIGHT_CH4_INVERSE 0
  2473. // -----------------------------------------------------------------------------
  2474. // TEST boards (do not use!!)
  2475. // -----------------------------------------------------------------------------
  2476. #elif defined(TRAVIS01)
  2477. // Info
  2478. #define MANUFACTURER "TravisCI"
  2479. #define DEVICE "Virtual board 01"
  2480. // Some buttons - pin 0
  2481. #define BUTTON1_PIN 0
  2482. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2483. #define BUTTON1_RELAY 1
  2484. // Some relays - pin 1
  2485. #define RELAY1_PIN 1
  2486. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2487. // Some LEDs - pin 2
  2488. #define LED1_PIN 2
  2489. #define LED1_PIN_INVERSE 1
  2490. // A bit of I2C - pins 3,4
  2491. #define I2C_SDA_PIN 3
  2492. #define I2C_SCL_PIN 4
  2493. // And, as they say in "From Dusk till Dawn":
  2494. // This is a sensor blow out!
  2495. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  2496. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  2497. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  2498. // C'mon, you want sensor, come on in sensor lovers!
  2499. // If we don’t got it, you don't want it!
  2500. #define AM2320_SUPPORT 1
  2501. #define BH1750_SUPPORT 1
  2502. #define BMX280_SUPPORT 1
  2503. #define SHT3X_I2C_SUPPORT 1
  2504. #define EMON_ADC121_SUPPORT 1
  2505. #define EMON_ADS1X15_SUPPORT 1
  2506. #define SHT3X_I2C_SUPPORT 1
  2507. #define SI7021_SUPPORT 1
  2508. #define PMSX003_SUPPORT 1
  2509. #define SENSEAIR_SUPPORT 1
  2510. #define VL53L1X_SUPPORT 1
  2511. // A bit of lights - pin 5
  2512. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2513. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2514. #define DUMMY_RELAY_COUNT 1
  2515. #define LIGHT_CHANNELS 1
  2516. #define LIGHT_CH1_PIN 5
  2517. #define LIGHT_CH1_INVERSE 0
  2518. // A bit of HLW8012 - pins 6,7,8
  2519. #ifndef HLW8012_SUPPORT
  2520. #define HLW8012_SUPPORT 1
  2521. #endif
  2522. #define HLW8012_SEL_PIN 6
  2523. #define HLW8012_CF1_PIN 7
  2524. #define HLW8012_CF_PIN 8
  2525. // A bit of Dallas - pin 9
  2526. #ifndef DALLAS_SUPPORT
  2527. #define DALLAS_SUPPORT 1
  2528. #endif
  2529. #define DALLAS_PIN 9
  2530. // A bit of ECH1560 - pins 10,11, 12
  2531. #ifndef ECH1560_SUPPORT
  2532. #define ECH1560_SUPPORT 1
  2533. #endif
  2534. #define ECH1560_CLK_PIN 10
  2535. #define ECH1560_MISO_PIN 11
  2536. #define ECH1560_INVERTED 12
  2537. // MICS-2710 & MICS-5525 test
  2538. #define MICS2710_SUPPORT 1
  2539. #define MICS5525_SUPPORT 1
  2540. #elif defined(TRAVIS02)
  2541. // Relay provider dual
  2542. #define MANUFACTURER "TravisCI"
  2543. #define DEVICE "Virtual board 02"
  2544. // Some buttons - pin 0
  2545. #define BUTTON1_PIN 0
  2546. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2547. #define BUTTON1_RELAY 1
  2548. // A bit of CSE7766 - pin 1
  2549. #ifndef CSE7766_SUPPORT
  2550. #define CSE7766_SUPPORT 1
  2551. #endif
  2552. #define CSE7766_PIN 1
  2553. // Relay type dual - pins 2,3
  2554. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  2555. #define RELAY1_PIN 2
  2556. #define RELAY2_PIN 3
  2557. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2558. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2559. // IR - pin 4
  2560. #define IR_SUPPORT 1
  2561. #define IR_RX_PIN 4
  2562. #define IR_BUTTON_SET 1
  2563. // A bit of DHT - pin 5
  2564. #ifndef DHT_SUPPORT
  2565. #define DHT_SUPPORT 1
  2566. #endif
  2567. #define DHT_PIN 5
  2568. // A bit of TMP3X (analog)
  2569. #define TMP3X_SUPPORT 1
  2570. // A bit of EVENTS - pin 10
  2571. #define EVENTS_SUPPORT 1
  2572. #define EVENTS_PIN 6
  2573. // Sonar
  2574. #define SONAR_SUPPORT 1
  2575. #define SONAR_TRIGGER 7
  2576. #define SONAR_ECHO 8
  2577. // MHZ19
  2578. #define MHZ19_SUPPORT 1
  2579. #define MHZ19_RX_PIN 9
  2580. #define MHZ19_TX_PIN 10
  2581. // PZEM004T
  2582. #define PZEM004T_SUPPORT 1
  2583. #define PZEM004T_RX_PIN 11
  2584. #define PZEM004T_TX_PIN 12
  2585. // V9261F
  2586. #define V9261F_SUPPORT 1
  2587. #define V9261F_PIN 13
  2588. // GUVAS12SD
  2589. #define GUVAS12SD_SUPPORT 1
  2590. #define GUVAS12SD_PIN 14
  2591. // Test non-default modules
  2592. #define MDNS_CLIENT_SUPPORT 1
  2593. #define NOFUSS_SUPPORT 1
  2594. #define UART_MQTT_SUPPORT 1
  2595. #define INFLUXDB_SUPPORT 1
  2596. #define IR_SUPPORT 1
  2597. #elif defined(TRAVIS03)
  2598. // Relay provider light/my92XX
  2599. #define MANUFACTURER "TravisCI"
  2600. #define DEVICE "Virtual board 03"
  2601. // Some buttons - pin 0
  2602. #define BUTTON1_PIN 0
  2603. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2604. #define BUTTON1_RELAY 1
  2605. // MY9231 Light - pins 1,2
  2606. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2607. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2608. #define DUMMY_RELAY_COUNT 1
  2609. #define LIGHT_CHANNELS 5
  2610. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2611. #define MY92XX_CHIPS 2
  2612. #define MY92XX_DI_PIN 1
  2613. #define MY92XX_DCKI_PIN 2
  2614. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2615. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  2616. // A bit of Analog EMON (analog)
  2617. #ifndef EMON_ANALOG_SUPPORT
  2618. #define EMON_ANALOG_SUPPORT 1
  2619. #endif
  2620. #define PULSEMETER_SUPPORT 1
  2621. // Test non-default modules
  2622. #define LLMNR_SUPPORT 1
  2623. #define NETBIOS_SUPPORT 1
  2624. #define SSDP_SUPPORT 1
  2625. #endif
  2626. // -----------------------------------------------------------------------------
  2627. // Check definitions
  2628. // -----------------------------------------------------------------------------
  2629. #if not defined(MANUFACTURER) || not defined(DEVICE)
  2630. #error "UNSUPPORTED HARDWARE!!"
  2631. #endif