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.

3859 lines
123 KiB

6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. // -----------------------------------------------------------------------------
  2. // Configuration HELP
  3. // -----------------------------------------------------------------------------
  4. //
  5. // MANUFACTURER: Name of the manufacturer of the board ("string")
  6. // DEVICE: Name of the device ("string")
  7. // BUTTON#_PIN: GPIO for the n-th button (1-based, up to 4 buttons)
  8. // BUTTON#_RELAY: Relay number that will be bind to the n-th button (1-based)
  9. // BUTTON#_MODE: A mask of options (BUTTON_PUSHBUTTON and BUTTON_SWITCH cannot be together)
  10. // - BUTTON_PUSHBUTTON: button event is fired when released
  11. // - BUTTON_SWITCH: button event is fired when pressed or released
  12. // - BUTTON_DEFAULT_HIGH: there is a pull up in place
  13. // - BUTTON_SET_PULLUP: set pullup by software
  14. // RELAY#_PIN: GPIO for the n-th relay (1-based, up to 8 relays)
  15. // RELAY#_TYPE: Relay can be RELAY_TYPE_NORMAL, RELAY_TYPE_INVERSE, RELAY_TYPE_LATCHED or RELAY_TYPE_LATCHED_INVERSE
  16. // LED#_PIN: GPIO for the n-th LED (1-based, up to 8 LEDs)
  17. // LED#_PIN_INVERSE: LED has inversed logic (lit when pulled down)
  18. // LED#_MODE: Check types.h for LED_MODE_%
  19. // LED#_RELAY: Linked relay (1-based)
  20. //
  21. // Besides, other hardware specific information should be stated here
  22. // -----------------------------------------------------------------------------
  23. // ESPurna Core
  24. // -----------------------------------------------------------------------------
  25. #if defined(ESPURNA_CORE)
  26. // This is a special device targeted to generate a light-weight binary image
  27. // meant to be able to do two-step-updates:
  28. // https://github.com/xoseperez/espurna/wiki/TwoStepUpdates
  29. // Info
  30. #define MANUFACTURER "ESPRESSIF"
  31. #define DEVICE "ESPURNA_CORE"
  32. // Disable non-core modules
  33. #define ALEXA_SUPPORT 0
  34. #define API_SUPPORT 0
  35. #define BROKER_SUPPORT 0
  36. #define DOMOTICZ_SUPPORT 0
  37. #define DEBUG_SERIAL_SUPPORT 0
  38. #define DEBUG_TELNET_SUPPORT 0
  39. #define DEBUG_WEB_SUPPORT 0
  40. #define HOMEASSISTANT_SUPPORT 0
  41. #define I2C_SUPPORT 0
  42. #define MQTT_SUPPORT 0
  43. #define NTP_SUPPORT 0
  44. #define SCHEDULER_SUPPORT 0
  45. #define SENSOR_SUPPORT 0
  46. #define THINGSPEAK_SUPPORT 0
  47. #define WEB_SUPPORT 0
  48. // Extra light-weight image
  49. //#define BUTTON_SUPPORT 0
  50. //#define LED_SUPPORT 0
  51. //#define MDNS_SERVER_SUPPORT 0
  52. //#define TELNET_SUPPORT 0
  53. //#define TERMINAL_SUPPORT 0
  54. // -----------------------------------------------------------------------------
  55. // Development boards
  56. // -----------------------------------------------------------------------------
  57. #elif defined(NODEMCU_LOLIN)
  58. // Info
  59. #define MANUFACTURER "NODEMCU"
  60. #define DEVICE "LOLIN"
  61. // Buttons
  62. #define BUTTON1_PIN 0
  63. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  64. #define BUTTON1_RELAY 1
  65. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  66. #define RELAY1_PIN 12
  67. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  68. // Light
  69. #define LED1_PIN 2
  70. #define LED1_PIN_INVERSE 1
  71. #elif defined(NODEMCU_BASIC)
  72. // Info
  73. // Generic NodeMCU Board without any buttons or relays connected.
  74. #define MANUFACTURER "NODEMCU"
  75. #define DEVICE "BASIC"
  76. #elif defined(WEMOS_D1_MINI)
  77. // Info
  78. #define MANUFACTURER "WEMOS"
  79. #define DEVICE "D1_MINI"
  80. // Buttons
  81. // No buttons on the D1 MINI alone, but defining it without adding a button doen't create problems
  82. #define BUTTON1_PIN 0 // Connect a pushbutton between D3 and GND,
  83. // it's the same as using a Wemos one button shield
  84. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  85. #define BUTTON1_RELAY 1
  86. // LEDs
  87. #define LED1_PIN 2
  88. #define LED1_PIN_INVERSE 1
  89. #define I2C_SDA_PIN 4 // D2
  90. #define I2C_SCL_PIN 5 // D1
  91. #elif defined(WEMOS_D1_MINI_RELAYSHIELD)
  92. // Info
  93. #define MANUFACTURER "WEMOS"
  94. #define DEVICE "D1_MINI_RELAYSHIELD"
  95. // Buttons
  96. // No buttons on the D1 MINI alone, but defining it without adding a button doen't create problems
  97. #define BUTTON1_PIN 0 // Connect a pushbutton between D3 and GND,
  98. // it's the same as using a Wemos one button shield
  99. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  100. #define BUTTON1_RELAY 1
  101. // Relays
  102. #define RELAY1_PIN 5
  103. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  104. // LED
  105. #define LED1_PIN 2
  106. #define LED1_PIN_INVERSE 1
  107. // When Wemos relay shield is connected GPIO5 (D1) is used for relay,
  108. // so I2C must be remapped to other pins
  109. #define I2C_SDA_PIN 12 // D6
  110. #define I2C_SCL_PIN 14 // D5
  111. #elif defined(WEMOS_D1_TARPUNA_SHIELD)
  112. // Info
  113. #define MANUFACTURER "WEMOS"
  114. #define DEVICE "D1_TARPUNA_SHIELD"
  115. // -----------------------------------------------------------------------------
  116. // ESPurna
  117. // -----------------------------------------------------------------------------
  118. #elif defined(TINKERMAN_ESPURNA_H06)
  119. // Info
  120. #define MANUFACTURER "TINKERMAN"
  121. #define DEVICE "ESPURNA_H06"
  122. // Buttons
  123. #define BUTTON1_PIN 4
  124. #define BUTTON1_RELAY 1
  125. // Normal pushbutton
  126. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  127. // Relays
  128. #define RELAY1_PIN 12
  129. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  130. // LEDs
  131. #define LED1_PIN 2
  132. #define LED1_PIN_INVERSE 1
  133. // HLW8012
  134. #ifndef HLW8012_SUPPORT
  135. #define HLW8012_SUPPORT 1
  136. #endif
  137. #define HLW8012_SEL_PIN 2
  138. #define HLW8012_CF1_PIN 13
  139. #define HLW8012_CF_PIN 14
  140. #elif defined(TINKERMAN_ESPURNA_H08)
  141. // Info
  142. #define MANUFACTURER "TINKERMAN"
  143. #define DEVICE "ESPURNA_H08"
  144. // Buttons
  145. #define BUTTON1_PIN 4
  146. #define BUTTON1_RELAY 1
  147. // Normal pushbutton
  148. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  149. // Relays
  150. #define RELAY1_PIN 12
  151. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  152. // LEDs
  153. #define LED1_PIN 2
  154. #define LED1_PIN_INVERSE 0
  155. // HLW8012
  156. #ifndef HLW8012_SUPPORT
  157. #define HLW8012_SUPPORT 1
  158. #endif
  159. #define HLW8012_SEL_PIN 5
  160. #define HLW8012_CF1_PIN 13
  161. #define HLW8012_CF_PIN 14
  162. #elif defined(TINKERMAN_ESPURNA_SWITCH)
  163. // Info
  164. #define MANUFACTURER "TINKERMAN"
  165. #define DEVICE "ESPURNA_SWITCH"
  166. // Buttons
  167. #define BUTTON1_PIN 4
  168. #define BUTTON1_RELAY 1
  169. // Touch button
  170. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  171. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  172. #define BUTTON1_CLICK BUTTON_MODE_NONE
  173. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  174. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  175. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  176. // LEDs
  177. #define LED1_PIN 2
  178. #define LED1_PIN_INVERSE 0
  179. // Relays
  180. #define RELAY1_PIN 12
  181. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  182. // Check http://tinkerman.cat/rfm69-wifi-gateway/
  183. #elif defined(TINKERMAN_RFM69GW)
  184. // Info
  185. #define MANUFACTURER "TINKERMAN"
  186. #define DEVICE "RFM69GW"
  187. // Buttons
  188. #define BUTTON1_PIN 0
  189. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  190. // RFM69GW
  191. #define RFM69_SUPPORT 1
  192. // Disable non-core modules
  193. #define ALEXA_SUPPORT 0
  194. #define DOMOTICZ_SUPPORT 0
  195. #define HOMEASSISTANT_SUPPORT 0
  196. #define I2C_SUPPORT 0
  197. #define SCHEDULER_SUPPORT 0
  198. #define SENSOR_SUPPORT 0
  199. #define THINGSPEAK_SUPPORT 0
  200. // -----------------------------------------------------------------------------
  201. // Itead Studio boards
  202. // -----------------------------------------------------------------------------
  203. #elif defined(ITEAD_SONOFF_BASIC)
  204. // Info
  205. #define MANUFACTURER "ITEAD"
  206. #define DEVICE "SONOFF_BASIC"
  207. // Buttons
  208. #define BUTTON1_PIN 0
  209. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  210. #define BUTTON1_RELAY 1
  211. #define BUTTON2_PIN 14
  212. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  213. #define BUTTON2_RELAY 1
  214. // Relays
  215. #define RELAY1_PIN 12
  216. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  217. // LEDs
  218. #define LED1_PIN 13
  219. #define LED1_PIN_INVERSE 1
  220. #elif defined(ITEAD_SONOFF_RF)
  221. // Info
  222. #define MANUFACTURER "ITEAD"
  223. #define DEVICE "SONOFF_RF"
  224. // Buttons
  225. #define BUTTON1_PIN 0
  226. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  227. #define BUTTON1_RELAY 1
  228. #define BUTTON2_PIN 14
  229. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  230. #define BUTTON2_RELAY 1
  231. // Relays
  232. #define RELAY1_PIN 12
  233. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  234. // LEDs
  235. #define LED1_PIN 13
  236. #define LED1_PIN_INVERSE 1
  237. #elif defined(ITEAD_SONOFF_TH)
  238. // Info
  239. #define MANUFACTURER "ITEAD"
  240. #define DEVICE "SONOFF_TH"
  241. // Buttons
  242. #define BUTTON1_PIN 0
  243. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  244. #define BUTTON1_RELAY 1
  245. // Relays
  246. #define RELAY1_PIN 12
  247. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  248. // LEDs
  249. #define LED1_PIN 13
  250. #define LED1_PIN_INVERSE 1
  251. // Jack is connected to GPIO14 (and with a small hack to GPIO4)
  252. #ifndef DALLAS_SUPPORT
  253. #define DALLAS_SUPPORT 1
  254. #endif
  255. #define DALLAS_PIN 14
  256. #ifndef DHT_SUPPORT
  257. #define DHT_SUPPORT 1
  258. #endif
  259. #define DHT_PIN 14
  260. //#define I2C_SDA_PIN 4
  261. //#define I2C_SCL_PIN 14
  262. #elif defined(ITEAD_SONOFF_SV)
  263. // Info
  264. #define MANUFACTURER "ITEAD"
  265. #define DEVICE "SONOFF_SV"
  266. // Buttons
  267. #define BUTTON1_PIN 0
  268. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  269. #define BUTTON1_RELAY 1
  270. // Relays
  271. #define RELAY1_PIN 12
  272. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  273. // LEDs
  274. #define LED1_PIN 13
  275. #define LED1_PIN_INVERSE 1
  276. #elif defined(ITEAD_SLAMPHER)
  277. // Info
  278. #define MANUFACTURER "ITEAD"
  279. #define DEVICE "SLAMPHER"
  280. // Buttons
  281. #define BUTTON1_PIN 0
  282. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  283. #define BUTTON1_RELAY 1
  284. // Relays
  285. #define RELAY1_PIN 12
  286. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  287. // LEDs
  288. #define LED1_PIN 13
  289. #define LED1_PIN_INVERSE 1
  290. #elif defined(ITEAD_S20)
  291. // Info
  292. #define MANUFACTURER "ITEAD"
  293. #define DEVICE "S20"
  294. // Buttons
  295. #define BUTTON1_PIN 0
  296. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  297. #define BUTTON1_RELAY 1
  298. // Relays
  299. #define RELAY1_PIN 12
  300. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  301. // LEDs
  302. #define LED1_PIN 13
  303. #define LED1_PIN_INVERSE 1
  304. #elif defined(ITEAD_SONOFF_TOUCH)
  305. // Info
  306. #define MANUFACTURER "ITEAD"
  307. #define DEVICE "SONOFF_TOUCH"
  308. // Buttons
  309. #define BUTTON1_PIN 0
  310. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  311. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  312. #define BUTTON1_CLICK BUTTON_MODE_NONE
  313. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  314. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  315. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  316. #define BUTTON1_RELAY 1
  317. // Relays
  318. #define RELAY1_PIN 12
  319. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  320. // LEDs
  321. #define LED1_PIN 13
  322. #define LED1_PIN_INVERSE 1
  323. #elif defined(ITEAD_SONOFF_POW)
  324. // Info
  325. #define MANUFACTURER "ITEAD"
  326. #define DEVICE "SONOFF_POW"
  327. // Buttons
  328. #define BUTTON1_PIN 0
  329. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  330. #define BUTTON1_RELAY 1
  331. // Relays
  332. #define RELAY1_PIN 12
  333. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  334. // LEDs
  335. #define LED1_PIN 15
  336. #define LED1_PIN_INVERSE 0
  337. // HLW8012
  338. #ifndef HLW8012_SUPPORT
  339. #define HLW8012_SUPPORT 1
  340. #endif
  341. #define HLW8012_SEL_PIN 5
  342. #define HLW8012_CF1_PIN 13
  343. #define HLW8012_CF_PIN 14
  344. #elif defined(ITEAD_SONOFF_POW_R2)
  345. // Info
  346. #define MANUFACTURER "ITEAD"
  347. #define DEVICE "SONOFF_POW_R2"
  348. // Buttons
  349. #define BUTTON1_PIN 0
  350. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  351. #define BUTTON1_RELAY 1
  352. // Relays
  353. #define RELAY1_PIN 12
  354. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  355. // LEDs
  356. #define LED1_PIN 13
  357. #define LED1_PIN_INVERSE 1
  358. // Disable UART noise
  359. #define DEBUG_SERIAL_SUPPORT 0
  360. // CSE7766
  361. #ifndef CSE7766_SUPPORT
  362. #define CSE7766_SUPPORT 1
  363. #endif
  364. #define CSE7766_PIN 1
  365. #elif defined(ITEAD_SONOFF_DUAL)
  366. // Info
  367. #define MANUFACTURER "ITEAD"
  368. #define DEVICE "SONOFF_DUAL"
  369. #define SERIAL_BAUDRATE 19230
  370. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  371. #define DUMMY_RELAY_COUNT 2
  372. #define DEBUG_SERIAL_SUPPORT 0
  373. // Buttons
  374. #define BUTTON3_RELAY 1
  375. // LEDs
  376. #define LED1_PIN 13
  377. #define LED1_PIN_INVERSE 1
  378. #elif defined(ITEAD_SONOFF_DUAL_R2)
  379. #define MANUFACTURER "ITEAD"
  380. #define DEVICE "SONOFF_DUAL_R2"
  381. // Buttons
  382. #define BUTTON1_PIN 0 // Button 0 on header
  383. #define BUTTON2_PIN 9 // Button 1 on header
  384. #define BUTTON3_PIN 10 // Physical button
  385. #define BUTTON1_RELAY 1
  386. #define BUTTON2_RELAY 2
  387. #define BUTTON3_RELAY 1
  388. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  389. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  390. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  391. // Relays
  392. #define RELAY1_PIN 12
  393. #define RELAY2_PIN 5
  394. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  395. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  396. // LEDs
  397. #define LED1_PIN 13
  398. #define LED1_PIN_INVERSE 1
  399. #elif defined(ITEAD_SONOFF_4CH)
  400. // Info
  401. #define MANUFACTURER "ITEAD"
  402. #define DEVICE "SONOFF_4CH"
  403. // Buttons
  404. #define BUTTON1_PIN 0
  405. #define BUTTON2_PIN 9
  406. #define BUTTON3_PIN 10
  407. #define BUTTON4_PIN 14
  408. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  409. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  410. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  411. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  412. #define BUTTON1_RELAY 1
  413. #define BUTTON2_RELAY 2
  414. #define BUTTON3_RELAY 3
  415. #define BUTTON4_RELAY 4
  416. // Relays
  417. #define RELAY1_PIN 12
  418. #define RELAY2_PIN 5
  419. #define RELAY3_PIN 4
  420. #define RELAY4_PIN 15
  421. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  422. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  423. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  424. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  425. // LEDs
  426. #define LED1_PIN 13
  427. #define LED1_PIN_INVERSE 1
  428. #elif defined(ITEAD_SONOFF_4CH_PRO)
  429. // Info
  430. #define MANUFACTURER "ITEAD"
  431. #define DEVICE "SONOFF_4CH_PRO"
  432. // Buttons
  433. #define BUTTON1_PIN 0
  434. #define BUTTON2_PIN 9
  435. #define BUTTON3_PIN 10
  436. #define BUTTON4_PIN 14
  437. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  438. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  439. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  440. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  441. #define BUTTON1_RELAY 1
  442. #define BUTTON2_RELAY 2
  443. #define BUTTON3_RELAY 3
  444. #define BUTTON4_RELAY 4
  445. // Sonoff 4CH Pro uses a secondary STM32 microcontroller to handle
  446. // buttons and relays, but it also forwards button presses to the ESP8285.
  447. // This allows ESPurna to handle button presses -almost- the same way
  448. // as with other devices except:
  449. // * Double click seems to break/disable the button on the STM32 side
  450. // * With S6 switch to 1 (self-locking and inching modes) everything's OK
  451. // * With S6 switch to 0 (interlock mode) if there is a relay ON
  452. // and you click on another relay button, the STM32 sends a "press"
  453. // event for the button of the first relay (to turn it OFF) but it
  454. // does not send a "release" event. It's like it's holding the
  455. // button down since you can see it is still LOW.
  456. // Whatever reason the result is that it may actually perform a
  457. // long click or long-long click.
  458. // The configuration below make the button toggle the relay on press events
  459. // and disables any possibly harmful combination with S6 set to 0.
  460. // If you are sure you will only use S6 to 1 you can comment the
  461. // BUTTON1_LNGCLICK and BUTTON1_LNGLNGCLICK options below to recover the
  462. // reset mode and factory reset functionalities, or link other actions like
  463. // AP mode in the commented line below.
  464. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  465. #define BUTTON1_CLICK BUTTON_MODE_NONE
  466. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  467. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  468. //#define BUTTON1_LNGCLICK BUTTON_MODE_AP
  469. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  470. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  471. #define BUTTON2_CLICK BUTTON_MODE_NONE
  472. #define BUTTON3_PRESS BUTTON_MODE_TOGGLE
  473. #define BUTTON3_CLICK BUTTON_MODE_NONE
  474. #define BUTTON4_PRESS BUTTON_MODE_TOGGLE
  475. #define BUTTON4_CLICK BUTTON_MODE_NONE
  476. // Relays
  477. #define RELAY1_PIN 12
  478. #define RELAY2_PIN 5
  479. #define RELAY3_PIN 4
  480. #define RELAY4_PIN 15
  481. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  482. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  483. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  484. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  485. // LEDs
  486. #define LED1_PIN 13
  487. #define LED1_PIN_INVERSE 1
  488. #elif defined(ITEAD_1CH_INCHING)
  489. // The inching functionality is managed by a misterious IC in the board.
  490. // You cannot control the inching button and functionality from the ESP8266
  491. // Besides, enabling the inching functionality using the hardware button
  492. // will result in the relay switching on and off continuously.
  493. // Fortunately the unkown IC keeps memory of the hardware inching status
  494. // so you can just disable it and forget. The inching LED must be lit.
  495. // You can still use the pulse options from the web interface
  496. // without problem.
  497. // Info
  498. #define MANUFACTURER "ITEAD"
  499. #define DEVICE "1CH_INCHING"
  500. // Buttons
  501. #define BUTTON1_PIN 0
  502. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  503. #define BUTTON1_RELAY 1
  504. // Relays
  505. #define RELAY1_PIN 12
  506. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  507. // LEDs
  508. #define LED1_PIN 13
  509. #define LED1_PIN_INVERSE 1
  510. #elif defined(ITEAD_MOTOR)
  511. // Info
  512. #define MANUFACTURER "ITEAD"
  513. #define DEVICE "MOTOR"
  514. // Buttons
  515. #define BUTTON1_PIN 0
  516. #define BUTTON1_RELAY 1
  517. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  518. // Relays
  519. #define RELAY1_PIN 12
  520. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  521. // LEDs
  522. #define LED1_PIN 13
  523. #define LED1_PIN_INVERSE 1
  524. #elif defined(ITEAD_BNSZ01)
  525. // Info
  526. #define MANUFACTURER "ITEAD"
  527. #define DEVICE "BNSZ01"
  528. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  529. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  530. #define DUMMY_RELAY_COUNT 1
  531. // LEDs
  532. #define LED1_PIN 13
  533. #define LED1_PIN_INVERSE 1
  534. // Light
  535. #define LIGHT_CHANNELS 1
  536. #define LIGHT_CH1_PIN 12
  537. #define LIGHT_CH1_INVERSE 0
  538. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  539. // Info
  540. #define MANUFACTURER "ITEAD"
  541. #define DEVICE "SONOFF_RFBRIDGE"
  542. #define RELAY_PROVIDER RELAY_PROVIDER_RFBRIDGE
  543. // Number of virtual switches
  544. #ifndef DUMMY_RELAY_COUNT
  545. #define DUMMY_RELAY_COUNT 8
  546. #endif
  547. // Buttons
  548. #define BUTTON1_PIN 0
  549. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  550. // LEDs
  551. #define LED1_PIN 13
  552. #define LED1_PIN_INVERSE 1
  553. #define RF_SUPPORT 1
  554. // Only used when RFB_DIRECT=1
  555. #define RFB_RX_PIN 4
  556. #define RFB_TX_PIN 5
  557. // When using un-modified harware, ESPurna communicates with the secondary
  558. // MCU EFM8BB1 via UART at 19200 bps so we need to change the speed of
  559. // the port and remove UART noise on serial line
  560. #if not RFB_DIRECT
  561. #define SERIAL_BAUDRATE 19200
  562. #define DEBUG_SERIAL_SUPPORT 0
  563. #endif
  564. #elif defined(ITEAD_SONOFF_B1)
  565. // Info
  566. #define MANUFACTURER "ITEAD"
  567. #define DEVICE "SONOFF_B1"
  568. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  569. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  570. #define DUMMY_RELAY_COUNT 1
  571. // Light
  572. #define LIGHT_CHANNELS 5
  573. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  574. #define MY92XX_CHIPS 2
  575. #define MY92XX_DI_PIN 12
  576. #define MY92XX_DCKI_PIN 14
  577. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  578. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  579. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  580. #elif defined(ITEAD_SONOFF_LED)
  581. // Info
  582. #define MANUFACTURER "ITEAD"
  583. #define DEVICE "SONOFF_LED"
  584. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  585. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  586. #define DUMMY_RELAY_COUNT 1
  587. // LEDs
  588. #define LED1_PIN 13
  589. #define LED1_PIN_INVERSE 1
  590. // Light
  591. #define LIGHT_CHANNELS 2
  592. #define LIGHT_CH1_PIN 12 // Cold white
  593. #define LIGHT_CH2_PIN 14 // Warm white
  594. #define LIGHT_CH1_INVERSE 0
  595. #define LIGHT_CH2_INVERSE 0
  596. #elif defined(ITEAD_SONOFF_T1_1CH)
  597. // Info
  598. #define MANUFACTURER "ITEAD"
  599. #define DEVICE "SONOFF_T1_1CH"
  600. // Buttons
  601. #define BUTTON1_PIN 0
  602. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  603. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  604. #define BUTTON1_CLICK BUTTON_MODE_NONE
  605. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  606. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  607. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  608. #define BUTTON1_RELAY 1
  609. // Relays
  610. #define RELAY1_PIN 12
  611. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  612. // LEDs
  613. #define LED1_PIN 13
  614. #define LED1_PIN_INVERSE 1
  615. #elif defined(ITEAD_SONOFF_T1_2CH)
  616. // Info
  617. #define MANUFACTURER "ITEAD"
  618. #define DEVICE "SONOFF_T1_2CH"
  619. // Buttons
  620. #define BUTTON1_PIN 0
  621. #define BUTTON2_PIN 9
  622. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  623. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  624. #define BUTTON1_CLICK BUTTON_MODE_NONE
  625. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  626. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  627. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  628. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  629. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  630. #define BUTTON2_CLICK BUTTON_MODE_NONE
  631. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  632. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  633. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  634. #define BUTTON1_RELAY 1
  635. #define BUTTON2_RELAY 2
  636. // Relays
  637. #define RELAY1_PIN 12
  638. #define RELAY2_PIN 5
  639. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  640. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  641. // LEDs
  642. #define LED1_PIN 13
  643. #define LED1_PIN_INVERSE 1
  644. #elif defined(ITEAD_SONOFF_T1_3CH)
  645. // Info
  646. #define MANUFACTURER "ITEAD"
  647. #define DEVICE "SONOFF_T1_3CH"
  648. // Buttons
  649. #define BUTTON1_PIN 0
  650. #define BUTTON2_PIN 9
  651. #define BUTTON3_PIN 10
  652. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  653. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  654. #define BUTTON1_CLICK BUTTON_MODE_NONE
  655. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  656. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  657. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  658. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  659. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  660. #define BUTTON2_CLICK BUTTON_MODE_NONE
  661. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  662. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  663. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  664. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  665. #define BUTTON3_PRESS BUTTON_MODE_TOGGLE
  666. #define BUTTON3_CLICK BUTTON_MODE_NONE
  667. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  668. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  669. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_RESET
  670. #define BUTTON1_RELAY 1
  671. #define BUTTON2_RELAY 2
  672. #define BUTTON3_RELAY 3
  673. // Relays
  674. #define RELAY1_PIN 12
  675. #define RELAY2_PIN 5
  676. #define RELAY3_PIN 4
  677. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  678. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  679. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  680. // LEDs
  681. #define LED1_PIN 13
  682. #define LED1_PIN_INVERSE 1
  683. #elif defined(ITEAD_SONOFF_S31)
  684. // Info
  685. #define MANUFACTURER "ITEAD"
  686. #define DEVICE "SONOFF_S31"
  687. // Buttons
  688. #define BUTTON1_PIN 0
  689. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  690. #define BUTTON1_RELAY 1
  691. // Relays
  692. #define RELAY1_PIN 12
  693. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  694. // LEDs
  695. #define LED1_PIN 13
  696. #define LED1_PIN_INVERSE 1
  697. // Disable UART noise
  698. #define DEBUG_SERIAL_SUPPORT 0
  699. // CSE7766
  700. #define CSE7766_SUPPORT 1
  701. #define CSE7766_PIN 1
  702. #elif defined(ITEAD_SONOFF_IFAN02)
  703. // Info
  704. #define MANUFACTURER "ITEAD"
  705. #define DEVICE "SONOFF_IFAN02"
  706. // These are virtual buttons triggered by the remote
  707. #define BUTTON1_PIN 0
  708. #define BUTTON2_PIN 9
  709. #define BUTTON3_PIN 10
  710. #define BUTTON4_PIN 14
  711. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  712. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  713. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  714. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  715. // Relays
  716. #define RELAY1_PIN 12
  717. #define RELAY2_PIN 5
  718. #define RELAY3_PIN 4
  719. #define RELAY4_PIN 15
  720. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  721. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  722. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  723. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  724. // LEDs
  725. #define LED1_PIN 13
  726. #define LED1_PIN_INVERSE 1
  727. // -----------------------------------------------------------------------------
  728. // ORVIBO
  729. // -----------------------------------------------------------------------------
  730. #elif defined(ORVIBO_B25)
  731. // Info
  732. #define MANUFACTURER "ORVIBO"
  733. #define DEVICE "B25"
  734. // Buttons
  735. #define BUTTON1_PIN 14
  736. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  737. #define BUTTON1_RELAY 1
  738. // Relays
  739. #define RELAY1_PIN 5
  740. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  741. // LEDs
  742. #define LED1_PIN 12 // 4 blue led
  743. #define LED1_PIN_INVERSE 1
  744. #define LED2_PIN 4 // 12 red led
  745. #define LED2_PIN_INVERSE 1
  746. // -----------------------------------------------------------------------------
  747. // YJZK
  748. // -----------------------------------------------------------------------------
  749. #elif defined(YJZK_SWITCH_1CH)
  750. // Info
  751. #define MANUFACTURER "YJZK"
  752. #define DEVICE "SWITCH_1CH"
  753. // Buttons
  754. #define BUTTON1_PIN 0
  755. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  756. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  757. #define BUTTON1_CLICK BUTTON_MODE_NONE
  758. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  759. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  760. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  761. #define BUTTON1_RELAY 1
  762. // Relays
  763. #define RELAY1_PIN 12
  764. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  765. // LEDs
  766. #define LED1_PIN 13
  767. #define LED1_PIN_INVERSE 0
  768. #elif defined(YJZK_SWITCH_2CH)
  769. // Info
  770. #define MANUFACTURER "YJZK"
  771. #define DEVICE "SWITCH_2CH"
  772. // Buttons
  773. #define BUTTON1_PIN 0
  774. #define BUTTON2_PIN 9
  775. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  776. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  777. #define BUTTON1_CLICK BUTTON_MODE_NONE
  778. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  779. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  780. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  781. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  782. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  783. #define BUTTON2_CLICK BUTTON_MODE_NONE
  784. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  785. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  786. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  787. #define BUTTON1_RELAY 1
  788. #define BUTTON2_RELAY 2
  789. // Relays
  790. #define RELAY1_PIN 12
  791. #define RELAY2_PIN 5
  792. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  793. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  794. // LEDs
  795. #define LED1_PIN 13
  796. #define LED1_PIN_INVERSE 0
  797. // YJZK 3CH switch
  798. // Also Lixin Touch Wifi 3M
  799. #elif defined(YJZK_SWITCH_3CH)
  800. // Info
  801. #define MANUFACTURER "YJZK"
  802. #define DEVICE "SWITCH_3CH"
  803. // Buttons
  804. #define BUTTON1_PIN 0
  805. #define BUTTON2_PIN 9
  806. #define BUTTON3_PIN 10
  807. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  808. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  809. #define BUTTON1_CLICK BUTTON_MODE_NONE
  810. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  811. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  812. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  813. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  814. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  815. #define BUTTON2_CLICK BUTTON_MODE_NONE
  816. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  817. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  818. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  819. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  820. #define BUTTON3_PRESS BUTTON_MODE_TOGGLE
  821. #define BUTTON3_CLICK BUTTON_MODE_NONE
  822. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  823. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  824. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_RESET
  825. #define BUTTON1_RELAY 1
  826. #define BUTTON2_RELAY 2
  827. #define BUTTON3_RELAY 3
  828. // Relays
  829. #define RELAY1_PIN 12
  830. #define RELAY2_PIN 5
  831. #define RELAY3_PIN 4
  832. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  833. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  834. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  835. // LEDs
  836. #define LED1_PIN 13
  837. #define LED1_PIN_INVERSE 0
  838. // -----------------------------------------------------------------------------
  839. // Electrodragon boards
  840. // -----------------------------------------------------------------------------
  841. #elif defined(ELECTRODRAGON_WIFI_IOT)
  842. // Info
  843. #define MANUFACTURER "ELECTRODRAGON"
  844. #define DEVICE "WIFI_IOT"
  845. // Buttons
  846. #define BUTTON1_PIN 0
  847. #define BUTTON2_PIN 2
  848. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  849. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  850. #define BUTTON1_RELAY 1
  851. #define BUTTON2_RELAY 2
  852. // Relays
  853. #define RELAY1_PIN 12
  854. #define RELAY2_PIN 13
  855. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  856. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  857. // LEDs
  858. #define LED1_PIN 16
  859. #define LED1_PIN_INVERSE 0
  860. // -----------------------------------------------------------------------------
  861. // WorkChoice ecoPlug
  862. // -----------------------------------------------------------------------------
  863. #elif defined(WORKCHOICE_ECOPLUG)
  864. // Info
  865. #define MANUFACTURER "WORKCHOICE"
  866. #define DEVICE "ECOPLUG"
  867. // Buttons
  868. #define BUTTON1_PIN 13
  869. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  870. #define BUTTON1_RELAY 1
  871. // Relays
  872. #define RELAY1_PIN 15
  873. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  874. // LEDs
  875. #define LED1_PIN 2
  876. #define LED1_PIN_INVERSE 0
  877. // -----------------------------------------------------------------------------
  878. // AI Thinker
  879. // -----------------------------------------------------------------------------
  880. #elif defined(AITHINKER_AI_LIGHT)
  881. // Info
  882. #define MANUFACTURER "AITHINKER"
  883. #define DEVICE "AI_LIGHT"
  884. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  885. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  886. #define DUMMY_RELAY_COUNT 1
  887. // Light
  888. #define LIGHT_CHANNELS 4
  889. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  890. #define MY92XX_CHIPS 1
  891. #define MY92XX_DI_PIN 13
  892. #define MY92XX_DCKI_PIN 15
  893. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  894. #define MY92XX_MAPPING 0, 1, 2, 3
  895. // -----------------------------------------------------------------------------
  896. // Lyasi LED
  897. // -----------------------------------------------------------------------------
  898. #elif defined(LYASI_LIGHT)
  899. // Info
  900. #define MANUFACTURER "LYASI"
  901. #define DEVICE "RGB-LED"
  902. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  903. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  904. #define DUMMY_RELAY_COUNT 1
  905. // Light
  906. #define LIGHT_CHANNELS 4
  907. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  908. #define MY92XX_CHIPS 1
  909. #define MY92XX_DI_PIN 4
  910. #define MY92XX_DCKI_PIN 5
  911. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  912. #define MY92XX_MAPPING 0, 1, 2, 3
  913. // -----------------------------------------------------------------------------
  914. // LED Controller
  915. // -----------------------------------------------------------------------------
  916. #elif defined(MAGICHOME_LED_CONTROLLER)
  917. // Info
  918. #define MANUFACTURER "MAGICHOME"
  919. #define DEVICE "LED_CONTROLLER"
  920. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  921. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  922. #define DUMMY_RELAY_COUNT 1
  923. // LEDs
  924. #define LED1_PIN 2
  925. #define LED1_PIN_INVERSE 1
  926. // Light
  927. #define LIGHT_CHANNELS 4
  928. #define LIGHT_CH1_PIN 14 // RED
  929. #define LIGHT_CH2_PIN 5 // GREEN
  930. #define LIGHT_CH3_PIN 12 // BLUE
  931. #define LIGHT_CH4_PIN 13 // WHITE
  932. #define LIGHT_CH1_INVERSE 0
  933. #define LIGHT_CH2_INVERSE 0
  934. #define LIGHT_CH3_INVERSE 0
  935. #define LIGHT_CH4_INVERSE 0
  936. // IR
  937. #define IR_SUPPORT 1
  938. #define IR_RX_PIN 4
  939. #define IR_BUTTON_SET 1
  940. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  941. // Info
  942. #define MANUFACTURER "MAGICHOME"
  943. #define DEVICE "LED_CONTROLLER_20"
  944. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  945. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  946. #define DUMMY_RELAY_COUNT 1
  947. // LEDs
  948. #define LED1_PIN 2
  949. #define LED1_PIN_INVERSE 1
  950. // Light
  951. #define LIGHT_CHANNELS 4
  952. #define LIGHT_CH1_PIN 5 // RED
  953. #define LIGHT_CH2_PIN 12 // GREEN
  954. #define LIGHT_CH3_PIN 13 // BLUE
  955. #define LIGHT_CH4_PIN 15 // WHITE
  956. #define LIGHT_CH1_INVERSE 0
  957. #define LIGHT_CH2_INVERSE 0
  958. #define LIGHT_CH3_INVERSE 0
  959. #define LIGHT_CH4_INVERSE 0
  960. // IR
  961. #define IR_SUPPORT 1
  962. #define IR_RX_PIN 4
  963. #define IR_BUTTON_SET 1
  964. #elif defined(MAGICHOME_ZJ_WFMN_A_11)
  965. // Info
  966. #define MANUFACTURER "MAGICHOME"
  967. #define DEVICE "ZJ_WFMN_A_11"
  968. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  969. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  970. #define DUMMY_RELAY_COUNT 1
  971. // LEDs
  972. #define LED1_PIN 2
  973. #define LED1_PIN_INVERSE 1
  974. #define LED2_PIN 15
  975. #define LED2_PIN_INVERSE 1
  976. // Light
  977. #define LIGHT_CHANNELS 4
  978. #define LIGHT_CH1_PIN 12 // RED
  979. #define LIGHT_CH2_PIN 5 // GREEN
  980. #define LIGHT_CH3_PIN 13 // BLUE
  981. #define LIGHT_CH4_PIN 14 // WHITE
  982. #define LIGHT_CH1_INVERSE 0
  983. #define LIGHT_CH2_INVERSE 0
  984. #define LIGHT_CH3_INVERSE 0
  985. #define LIGHT_CH4_INVERSE 0
  986. // IR
  987. #define IR_SUPPORT 1
  988. #define IR_RX_PIN 4
  989. #define IR_BUTTON_SET 1
  990. #elif defined(MAGICHOME_ZJ_WFMN_B_11)
  991. // Info
  992. #define MANUFACTURER "MAGICHOME"
  993. #define DEVICE "ZJ_WFMN_B_11"
  994. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  995. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  996. #define DUMMY_RELAY_COUNT 1
  997. // LEDs
  998. #define LED1_PIN 2
  999. #define LED1_PIN_INVERSE 1
  1000. #define LED2_PIN 15
  1001. #define LED2_PIN_INVERSE 1
  1002. // Light
  1003. #define LIGHT_CHANNELS 4
  1004. #define LIGHT_CH1_PIN 14 // RED
  1005. #define LIGHT_CH2_PIN 5 // GREEN
  1006. #define LIGHT_CH3_PIN 12 // BLUE
  1007. #define LIGHT_CH4_PIN 13 // WHITE
  1008. #define LIGHT_CH1_INVERSE 0
  1009. #define LIGHT_CH2_INVERSE 0
  1010. #define LIGHT_CH3_INVERSE 0
  1011. #define LIGHT_CH4_INVERSE 0
  1012. // RF
  1013. #define RF_SUPPORT 1
  1014. #define RFB_DIRECT 1
  1015. #define RFB_RX_PIN 4
  1016. #elif defined(MAGICHOME_ZJ_ESPM_5CH_B_13)
  1017. // Info
  1018. #define MANUFACTURER "MAGICHOME"
  1019. #define DEVICE "ZJ_ESPM_5CH_B_13"
  1020. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1021. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1022. #define DUMMY_RELAY_COUNT 1
  1023. // Buttons
  1024. #define BUTTON1_PIN 0
  1025. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1026. #define BUTTON1_RELAY 1
  1027. // LEDs
  1028. #define LED1_PIN 2
  1029. #define LED1_PIN_INVERSE 1
  1030. // Light
  1031. #define LIGHT_CHANNELS 5
  1032. #define LIGHT_CH1_PIN 14 // RED
  1033. #define LIGHT_CH2_PIN 12 // GREEN
  1034. #define LIGHT_CH3_PIN 13 // BLUE
  1035. #define LIGHT_CH4_PIN 5 // COLD WHITE
  1036. #define LIGHT_CH5_PIN 15 // WARM WHITE
  1037. #define LIGHT_CH1_INVERSE 0
  1038. #define LIGHT_CH2_INVERSE 0
  1039. #define LIGHT_CH3_INVERSE 0
  1040. #define LIGHT_CH4_INVERSE 0
  1041. #define LIGHT_CH5_INVERSE 0
  1042. // -----------------------------------------------------------------------------
  1043. // HUACANXING H801 & H802
  1044. // -----------------------------------------------------------------------------
  1045. #elif defined(HUACANXING_H801)
  1046. // Info
  1047. #define MANUFACTURER "HUACANXING"
  1048. #define DEVICE "H801"
  1049. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1050. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1051. #define DUMMY_RELAY_COUNT 1
  1052. #define DEBUG_PORT Serial1
  1053. #define SERIAL_RX_ENABLED 1
  1054. // LEDs
  1055. #define LED1_PIN 5
  1056. #define LED1_PIN_INVERSE 1
  1057. // Light
  1058. #define LIGHT_CHANNELS 5
  1059. #define LIGHT_CH1_PIN 15 // RED
  1060. #define LIGHT_CH2_PIN 13 // GREEN
  1061. #define LIGHT_CH3_PIN 12 // BLUE
  1062. #define LIGHT_CH4_PIN 14 // WHITE1
  1063. #define LIGHT_CH5_PIN 4 // WHITE2
  1064. #define LIGHT_CH1_INVERSE 0
  1065. #define LIGHT_CH2_INVERSE 0
  1066. #define LIGHT_CH3_INVERSE 0
  1067. #define LIGHT_CH4_INVERSE 0
  1068. #define LIGHT_CH5_INVERSE 0
  1069. #elif defined(HUACANXING_H802)
  1070. // Info
  1071. #define MANUFACTURER "HUACANXING"
  1072. #define DEVICE "H802"
  1073. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1074. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1075. #define DUMMY_RELAY_COUNT 1
  1076. #define DEBUG_PORT Serial1
  1077. #define SERIAL_RX_ENABLED 1
  1078. // Light
  1079. #define LIGHT_CHANNELS 4
  1080. #define LIGHT_CH1_PIN 12 // RED
  1081. #define LIGHT_CH2_PIN 14 // GREEN
  1082. #define LIGHT_CH3_PIN 13 // BLUE
  1083. #define LIGHT_CH4_PIN 15 // WHITE
  1084. #define LIGHT_CH1_INVERSE 0
  1085. #define LIGHT_CH2_INVERSE 0
  1086. #define LIGHT_CH3_INVERSE 0
  1087. #define LIGHT_CH4_INVERSE 0
  1088. // -----------------------------------------------------------------------------
  1089. // Jan Goedeke Wifi Relay
  1090. // https://github.com/JanGoe/esp8266-wifi-relay
  1091. // -----------------------------------------------------------------------------
  1092. #elif defined(JANGOE_WIFI_RELAY_NC)
  1093. // Info
  1094. #define MANUFACTURER "JANGOE"
  1095. #define DEVICE "WIFI_RELAY_NC"
  1096. // Buttons
  1097. #define BUTTON1_PIN 12
  1098. #define BUTTON2_PIN 13
  1099. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1100. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1101. #define BUTTON1_RELAY 1
  1102. #define BUTTON2_RELAY 2
  1103. // Relays
  1104. #define RELAY1_PIN 2
  1105. #define RELAY2_PIN 14
  1106. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1107. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1108. #elif defined(JANGOE_WIFI_RELAY_NO)
  1109. // Info
  1110. #define MANUFACTURER "JANGOE"
  1111. #define DEVICE "WIFI_RELAY_NO"
  1112. // Buttons
  1113. #define BUTTON1_PIN 12
  1114. #define BUTTON2_PIN 13
  1115. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1116. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1117. #define BUTTON1_RELAY 1
  1118. #define BUTTON2_RELAY 2
  1119. // Relays
  1120. #define RELAY1_PIN 2
  1121. #define RELAY2_PIN 14
  1122. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1123. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1124. // -----------------------------------------------------------------------------
  1125. // Jorge García Wifi+Relays Board Kit
  1126. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  1127. // https://github.com/jorgegarciadev/wifikit
  1128. // -----------------------------------------------------------------------------
  1129. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  1130. // Info
  1131. #define MANUFACTURER "JORGEGARCIA"
  1132. #define DEVICE "WIFI_RELAYS"
  1133. // Relays
  1134. #define RELAY1_PIN 0
  1135. #define RELAY2_PIN 2
  1136. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1137. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1138. // -----------------------------------------------------------------------------
  1139. // WiFi MQTT Relay / Thermostat
  1140. // -----------------------------------------------------------------------------
  1141. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  1142. // Info
  1143. #define MANUFACTURER "OPENENERGYMONITOR"
  1144. #define DEVICE "MQTT_RELAY"
  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 12
  1151. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1152. // LEDs
  1153. #define LED1_PIN 16
  1154. #define LED1_PIN_INVERSE 0
  1155. // -----------------------------------------------------------------------------
  1156. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  1157. // 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
  1158. // 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
  1159. // -----------------------------------------------------------------------------
  1160. #elif defined(WION_50055)
  1161. // Currently untested, does not support energy monitoring
  1162. // Info
  1163. #define MANUFACTURER "WION"
  1164. #define DEVICE "50055"
  1165. // Buttons
  1166. #define BUTTON1_PIN 13
  1167. #define BUTTON1_RELAY 1
  1168. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1169. // Relays
  1170. #define RELAY1_PIN 15
  1171. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1172. // LEDs
  1173. #define LED1_PIN 2
  1174. #define LED1_PIN_INVERSE 0
  1175. // -----------------------------------------------------------------------------
  1176. // EX-Store Wifi Relay v3.1
  1177. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  1178. // -----------------------------------------------------------------------------
  1179. #elif defined(EXS_WIFI_RELAY_V31)
  1180. // Untested
  1181. // Info
  1182. #define MANUFACTURER "EXS"
  1183. #define DEVICE "WIFI_RELAY_V31"
  1184. // Buttons
  1185. #define BUTTON1_PIN 0
  1186. #define BUTTON1_RELAY 1
  1187. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1188. // Relays
  1189. #define RELAY1_PIN 13
  1190. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1191. #define RELAY1_RESET_PIN 12
  1192. // -----------------------------------------------------------------------------
  1193. // EX-Store Wifi Relay v5.0
  1194. // -----------------------------------------------------------------------------
  1195. #elif defined(EXS_WIFI_RELAY_V50)
  1196. // Info
  1197. #define MANUFACTURER "EXS"
  1198. #define DEVICE "WIFI_RELAY_V50"
  1199. // Buttons
  1200. #define BUTTON1_PIN 5
  1201. #define BUTTON2_PIN 4
  1202. #define BUTTON1_RELAY 1
  1203. #define BUTTON2_RELAY 2
  1204. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1205. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1206. // Relays
  1207. #define RELAY1_PIN 14
  1208. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1209. #define RELAY1_RESET_PIN 16
  1210. #define RELAY2_PIN 13
  1211. #define RELAY2_TYPE RELAY_TYPE_LATCHED
  1212. #define RELAY2_RESET_PIN 12
  1213. // LEDs
  1214. #define LED1_PIN 15
  1215. #define LED1_PIN_INVERSE 0
  1216. // -----------------------------------------------------------------------------
  1217. // V9261F
  1218. // -----------------------------------------------------------------------------
  1219. #elif defined(GENERIC_V9261F)
  1220. // Info
  1221. #define MANUFACTURER "GENERIC"
  1222. #define DEVICE "V9261F"
  1223. #define ALEXA_SUPPORT 0
  1224. // V9261F
  1225. #define V9261F_SUPPORT 1
  1226. #define V9261F_PIN 2
  1227. #define V9261F_PIN_INVERSE 1
  1228. // -----------------------------------------------------------------------------
  1229. // ECH1560
  1230. // -----------------------------------------------------------------------------
  1231. #elif defined(GENERIC_ECH1560)
  1232. // Info
  1233. #define MANUFACTURER "GENERIC"
  1234. #define DEVICE "ECH1560"
  1235. #define ALEXA_SUPPORT 0
  1236. // ECH1560
  1237. #define ECH1560_SUPPORT 1
  1238. #define ECH1560_CLK_PIN 4
  1239. #define ECH1560_MISO_PIN 5
  1240. #define ECH1560_INVERTED 0
  1241. // -----------------------------------------------------------------------------
  1242. // ESPLive
  1243. // https://github.com/ManCaveMade/ESP-Live
  1244. // -----------------------------------------------------------------------------
  1245. #elif defined(MANCAVEMADE_ESPLIVE)
  1246. // Info
  1247. #define MANUFACTURER "MANCAVEMADE"
  1248. #define DEVICE "ESPLIVE"
  1249. // Buttons
  1250. #define BUTTON1_PIN 4
  1251. #define BUTTON2_PIN 5
  1252. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1253. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1254. #define BUTTON1_RELAY 1
  1255. #define BUTTON2_RELAY 2
  1256. // Relays
  1257. #define RELAY1_PIN 12
  1258. #define RELAY2_PIN 13
  1259. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1260. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1261. // DS18B20
  1262. #ifndef DALLAS_SUPPORT
  1263. #define DALLAS_SUPPORT 1
  1264. #endif
  1265. #define DALLAS_PIN 2
  1266. #define DALLAS_UPDATE_INTERVAL 5000
  1267. #define TEMPERATURE_MIN_CHANGE 1.0
  1268. // -----------------------------------------------------------------------------
  1269. // QuinLED
  1270. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  1271. // -----------------------------------------------------------------------------
  1272. #elif defined(INTERMITTECH_QUINLED)
  1273. // Info
  1274. #define MANUFACTURER "INTERMITTECH"
  1275. #define DEVICE "QUINLED"
  1276. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1277. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1278. #define DUMMY_RELAY_COUNT 1
  1279. // LEDs
  1280. #define LED1_PIN 5
  1281. #define LED1_PIN_INVERSE 1
  1282. // Light
  1283. #define LIGHT_CHANNELS 2
  1284. #define LIGHT_CH1_PIN 0
  1285. #define LIGHT_CH2_PIN 2
  1286. #define LIGHT_CH1_INVERSE 0
  1287. #define LIGHT_CH2_INVERSE 0
  1288. // -----------------------------------------------------------------------------
  1289. // Arilux AL-LC06
  1290. // -----------------------------------------------------------------------------
  1291. #elif defined(ARILUX_AL_LC01)
  1292. // Info
  1293. #define MANUFACTURER "ARILUX"
  1294. #define DEVICE "AL_LC01"
  1295. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1296. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1297. #define DUMMY_RELAY_COUNT 1
  1298. // Light
  1299. #define LIGHT_CHANNELS 3
  1300. #define LIGHT_CH1_PIN 5 // RED
  1301. #define LIGHT_CH2_PIN 12 // GREEN
  1302. #define LIGHT_CH3_PIN 13 // BLUE
  1303. #define LIGHT_CH1_INVERSE 0
  1304. #define LIGHT_CH2_INVERSE 0
  1305. #define LIGHT_CH3_INVERSE 0
  1306. #elif defined(ARILUX_AL_LC02)
  1307. // Info
  1308. #define MANUFACTURER "ARILUX"
  1309. #define DEVICE "AL_LC02"
  1310. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1311. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1312. #define DUMMY_RELAY_COUNT 1
  1313. // Light
  1314. #define LIGHT_CHANNELS 4
  1315. #define LIGHT_CH1_PIN 12 // RED
  1316. #define LIGHT_CH2_PIN 5 // GREEN
  1317. #define LIGHT_CH3_PIN 13 // BLUE
  1318. #define LIGHT_CH4_PIN 15 // WHITE1
  1319. #define LIGHT_CH1_INVERSE 0
  1320. #define LIGHT_CH2_INVERSE 0
  1321. #define LIGHT_CH3_INVERSE 0
  1322. #define LIGHT_CH4_INVERSE 0
  1323. #elif defined(ARILUX_AL_LC02_V14)
  1324. // Info
  1325. #define MANUFACTURER "ARILUX"
  1326. #define DEVICE "AL_LC02_V14"
  1327. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1328. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1329. #define DUMMY_RELAY_COUNT 1
  1330. // Light
  1331. #define LIGHT_CHANNELS 4
  1332. #define LIGHT_CH1_PIN 14 // RED
  1333. #define LIGHT_CH2_PIN 5 // GREEN
  1334. #define LIGHT_CH3_PIN 12 // BLUE
  1335. #define LIGHT_CH4_PIN 13 // WHITE1
  1336. #define LIGHT_CH1_INVERSE 0
  1337. #define LIGHT_CH2_INVERSE 0
  1338. #define LIGHT_CH3_INVERSE 0
  1339. #define LIGHT_CH4_INVERSE 0
  1340. #elif defined(ARILUX_AL_LC06)
  1341. // Info
  1342. #define MANUFACTURER "ARILUX"
  1343. #define DEVICE "AL_LC06"
  1344. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1345. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1346. #define DUMMY_RELAY_COUNT 1
  1347. // Buttons
  1348. #define BUTTON1_PIN 0
  1349. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1350. #define BUTTON1_RELAY 1
  1351. // Light
  1352. #define LIGHT_CHANNELS 5
  1353. #define LIGHT_CH1_PIN 14 // RED
  1354. #define LIGHT_CH2_PIN 12 // GREEN
  1355. #define LIGHT_CH3_PIN 13 // BLUE
  1356. #define LIGHT_CH4_PIN 15 // WHITE1
  1357. #define LIGHT_CH5_PIN 5 // WHITE2
  1358. #define LIGHT_CH1_INVERSE 0
  1359. #define LIGHT_CH2_INVERSE 0
  1360. #define LIGHT_CH3_INVERSE 0
  1361. #define LIGHT_CH4_INVERSE 0
  1362. #define LIGHT_CH5_INVERSE 0
  1363. #elif defined(ARILUX_AL_LC11)
  1364. // Info
  1365. #define MANUFACTURER "ARILUX"
  1366. #define DEVICE "AL_LC11"
  1367. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1368. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1369. #define DUMMY_RELAY_COUNT 1
  1370. // Light
  1371. #define LIGHT_CHANNELS 5
  1372. #define LIGHT_CH1_PIN 5 // RED
  1373. #define LIGHT_CH2_PIN 4 // GREEN
  1374. #define LIGHT_CH3_PIN 14 // BLUE
  1375. #define LIGHT_CH4_PIN 13 // WHITE1
  1376. #define LIGHT_CH5_PIN 12 // WHITE1
  1377. #define LIGHT_CH1_INVERSE 0
  1378. #define LIGHT_CH2_INVERSE 0
  1379. #define LIGHT_CH3_INVERSE 0
  1380. #define LIGHT_CH4_INVERSE 0
  1381. #define LIGHT_CH5_INVERSE 0
  1382. #elif defined(ARILUX_E27)
  1383. // Info
  1384. #define MANUFACTURER "ARILUX"
  1385. #define DEVICE "E27"
  1386. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1387. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1388. #define DUMMY_RELAY_COUNT 1
  1389. // Light
  1390. #define LIGHT_CHANNELS 4
  1391. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  1392. #define MY92XX_CHIPS 1
  1393. #define MY92XX_DI_PIN 13
  1394. #define MY92XX_DCKI_PIN 15
  1395. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1396. #define MY92XX_MAPPING 0, 1, 2, 3
  1397. // -----------------------------------------------------------------------------
  1398. // XENON SM-PW701U
  1399. // -----------------------------------------------------------------------------
  1400. #elif defined(XENON_SM_PW702U)
  1401. // Info
  1402. #define MANUFACTURER "XENON"
  1403. #define DEVICE "SM_PW702U"
  1404. // Buttons
  1405. #define BUTTON1_PIN 13
  1406. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1407. #define BUTTON1_RELAY 1
  1408. // Relays
  1409. #define RELAY1_PIN 12
  1410. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1411. // LEDs
  1412. #define LED1_PIN 4
  1413. #define LED1_PIN_INVERSE 1
  1414. // -----------------------------------------------------------------------------
  1415. // AUTHOMETION LYT8266
  1416. // https://authometion.com/shop/en/home/13-lyt8266.html
  1417. // -----------------------------------------------------------------------------
  1418. #elif defined(AUTHOMETION_LYT8266)
  1419. // Info
  1420. #define MANUFACTURER "AUTHOMETION"
  1421. #define DEVICE "LYT8266"
  1422. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1423. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1424. #define DUMMY_RELAY_COUNT 1
  1425. // Light
  1426. #define LIGHT_CHANNELS 4
  1427. #define LIGHT_CH1_PIN 13 // RED
  1428. #define LIGHT_CH2_PIN 12 // GREEN
  1429. #define LIGHT_CH3_PIN 14 // BLUE
  1430. #define LIGHT_CH4_PIN 2 // WHITE
  1431. #define LIGHT_CH1_INVERSE 0
  1432. #define LIGHT_CH2_INVERSE 0
  1433. #define LIGHT_CH3_INVERSE 0
  1434. #define LIGHT_CH4_INVERSE 0
  1435. #define LIGHT_ENABLE_PIN 15
  1436. #elif defined(GIZWITS_WITTY_CLOUD)
  1437. // Info
  1438. #define MANUFACTURER "GIZWITS"
  1439. #define DEVICE "WITTY_CLOUD"
  1440. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1441. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1442. #define DUMMY_RELAY_COUNT 1
  1443. // Buttons
  1444. #define BUTTON1_PIN 4
  1445. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1446. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  1447. #define BUTTON1_CLICK BUTTON_MODE_NONE
  1448. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1449. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1450. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  1451. #define ANALOG_SUPPORT 1
  1452. // LEDs
  1453. #define LED1_PIN 2 // BLUE build-in
  1454. #define LED1_PIN_INVERSE 1
  1455. // Light
  1456. #define LIGHT_CHANNELS 3
  1457. #define LIGHT_CH1_PIN 15 // RED
  1458. #define LIGHT_CH2_PIN 12 // GREEN
  1459. #define LIGHT_CH3_PIN 13 // BLUE
  1460. #define LIGHT_CH1_INVERSE 0
  1461. #define LIGHT_CH2_INVERSE 0
  1462. #define LIGHT_CH3_INVERSE 0
  1463. // -----------------------------------------------------------------------------
  1464. // KMC 70011
  1465. // https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
  1466. // -----------------------------------------------------------------------------
  1467. #elif defined(KMC_70011)
  1468. // Info
  1469. #define MANUFACTURER "KMC"
  1470. #define DEVICE "70011"
  1471. // Buttons
  1472. #define BUTTON1_PIN 0
  1473. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1474. #define BUTTON1_RELAY 1
  1475. // Relays
  1476. #define RELAY1_PIN 14
  1477. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1478. // LEDs
  1479. #define LED1_PIN 13
  1480. #define LED1_PIN_INVERSE 1
  1481. // HLW8012
  1482. #ifndef HLW8012_SUPPORT
  1483. #define HLW8012_SUPPORT 1
  1484. #endif
  1485. #define HLW8012_SEL_PIN 12
  1486. #define HLW8012_CF1_PIN 5
  1487. #define HLW8012_CF_PIN 4
  1488. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1489. // -----------------------------------------------------------------------------
  1490. // Euromate (?) Wifi Stecker Schuko
  1491. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  1492. // Thanks to @Geitde
  1493. // -----------------------------------------------------------------------------
  1494. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  1495. // Info
  1496. #define MANUFACTURER "EUROMATE"
  1497. #define DEVICE "WIFI_STECKER_SCHUKO"
  1498. // Buttons
  1499. #define BUTTON1_PIN 14
  1500. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1501. #define BUTTON1_RELAY 1
  1502. // The relay in the device is not a bistable (latched) relay.
  1503. // The device is reported to have a flip-flop circuit to drive the relay
  1504. // So @Geitde hack is still the only possible
  1505. // Hack: drive GPIO12 low and use GPIO5 as normal relay pin:
  1506. #define RELAY1_PIN 5
  1507. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1508. #define LED2_PIN 12 /* DUMMY: exploit default off state for GPIO12=low */
  1509. #define LED2_PIN_INVERSE 0
  1510. // LEDs
  1511. #define LED1_PIN 4
  1512. #define LED1_PIN_INVERSE 0
  1513. // -----------------------------------------------------------------------------
  1514. // Euromate (?) Wifi Stecker Schuko Version 2
  1515. // This configuration is for the second generation of devices sold by OBI.
  1516. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko-weiss/p/4077806
  1517. // -----------------------------------------------------------------------------
  1518. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO_V2)
  1519. // Info
  1520. #define MANUFACTURER "EUROMATE"
  1521. #define DEVICE "WIFI_STECKER_SCHUKO_V2"
  1522. // Buttons
  1523. #define BUTTON1_PIN 5
  1524. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1525. #define BUTTON1_RELAY 1
  1526. // Relays
  1527. #define RELAY1_PIN 4
  1528. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1529. // Green
  1530. #define LED1_PIN 12
  1531. #define LED1_MODE LED_MODE_WIFI
  1532. #define LED1_PIN_INVERSE 0
  1533. // Red
  1534. #define LED2_PIN 13
  1535. #define LED2_MODE LED_MODE_RELAY
  1536. #define LED2_PIN_INVERSE 0
  1537. // -----------------------------------------------------------------------------
  1538. // Generic 8CH
  1539. // -----------------------------------------------------------------------------
  1540. #elif defined(GENERIC_8CH)
  1541. // Info
  1542. #define MANUFACTURER "GENERIC"
  1543. #define DEVICE "8CH"
  1544. // Relays
  1545. #define RELAY1_PIN 0
  1546. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1547. #define RELAY2_PIN 2
  1548. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1549. #define RELAY3_PIN 4
  1550. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1551. #define RELAY4_PIN 5
  1552. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1553. #define RELAY5_PIN 12
  1554. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1555. #define RELAY6_PIN 13
  1556. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  1557. #define RELAY7_PIN 14
  1558. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  1559. #define RELAY8_PIN 15
  1560. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  1561. // -----------------------------------------------------------------------------
  1562. // STM RELAY
  1563. // -----------------------------------------------------------------------------
  1564. #elif defined(STM_RELAY)
  1565. // Info
  1566. #define MANUFACTURER "STM_RELAY"
  1567. #define DEVICE "2CH"
  1568. // Relays
  1569. #define DUMMY_RELAY_COUNT 2
  1570. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  1571. // Remove UART noise on serial line
  1572. #define DEBUG_SERIAL_SUPPORT 0
  1573. // -----------------------------------------------------------------------------
  1574. // Tonbux Powerstrip02
  1575. // -----------------------------------------------------------------------------
  1576. #elif defined(TONBUX_POWERSTRIP02)
  1577. // Info
  1578. #define MANUFACTURER "TONBUX"
  1579. #define DEVICE "POWERSTRIP02"
  1580. // Buttons
  1581. #define BUTTON1_PIN 5
  1582. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1583. #define BUTTON1_RELAY 0
  1584. // Relays
  1585. #define RELAY1_PIN 4
  1586. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1587. #define RELAY2_PIN 13
  1588. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1589. #define RELAY3_PIN 12
  1590. #define RELAY3_TYPE RELAY_TYPE_INVERSE
  1591. #define RELAY4_PIN 14
  1592. #define RELAY4_TYPE RELAY_TYPE_INVERSE
  1593. // Not a relay. USB ports on/off
  1594. #define RELAY5_PIN 16
  1595. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1596. // LEDs
  1597. #define LED1_PIN 0 // 1 blue led
  1598. #define LED1_PIN_INVERSE 1
  1599. #define LED2_PIN 3 // 3 red leds
  1600. #define LED2_PIN_INVERSE 1
  1601. // -----------------------------------------------------------------------------
  1602. // Lingan SWA1
  1603. // -----------------------------------------------------------------------------
  1604. #elif defined(LINGAN_SWA1)
  1605. // Info
  1606. #define MANUFACTURER "LINGAN"
  1607. #define DEVICE "SWA1"
  1608. // Buttons
  1609. #define BUTTON1_PIN 13
  1610. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1611. #define BUTTON1_RELAY 1
  1612. // Relays
  1613. #define RELAY1_PIN 5
  1614. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1615. // LEDs
  1616. #define LED1_PIN 4
  1617. #define LED1_PIN_INVERSE 1
  1618. // -----------------------------------------------------------------------------
  1619. // HEYGO HY02
  1620. // -----------------------------------------------------------------------------
  1621. #elif defined(HEYGO_HY02)
  1622. // Info
  1623. #define MANUFACTURER "HEYGO"
  1624. #define DEVICE "HY02"
  1625. // Buttons
  1626. #define BUTTON1_PIN 13
  1627. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1628. #define BUTTON1_RELAY 1
  1629. // Relays
  1630. #define RELAY1_PIN 12
  1631. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1632. // LEDs
  1633. #define LED1_PIN 4
  1634. #define LED1_PIN_INVERSE 0
  1635. // -----------------------------------------------------------------------------
  1636. // Maxcio W-US002S
  1637. // -----------------------------------------------------------------------------
  1638. #elif defined(MAXCIO_WUS002S)
  1639. // Info
  1640. #define MANUFACTURER "MAXCIO"
  1641. #define DEVICE "WUS002S"
  1642. // Buttons
  1643. #define BUTTON1_PIN 2
  1644. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1645. #define BUTTON1_RELAY 1
  1646. // Relays
  1647. #define RELAY1_PIN 13
  1648. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1649. // LEDs
  1650. #define LED1_PIN 3
  1651. #define LED1_PIN_INVERSE 0
  1652. // HLW8012
  1653. #ifndef HLW8012_SUPPORT
  1654. #define HLW8012_SUPPORT 1
  1655. #endif
  1656. #define HLW8012_SEL_PIN 12
  1657. #define HLW8012_CF1_PIN 5
  1658. #define HLW8012_CF_PIN 4
  1659. #define HLW8012_CURRENT_R 0.002 // Current resistor
  1660. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1661. // LED1 on RX pin
  1662. #define DEBUG_SERIAL_SUPPORT 1
  1663. // -----------------------------------------------------------------------------
  1664. // Maxcio W-DE004
  1665. // -----------------------------------------------------------------------------
  1666. #elif defined(MAXCIO_WDE004)
  1667. // Info
  1668. #define MANUFACTURER "MAXCIO"
  1669. #define DEVICE "WDE004"
  1670. // Buttons
  1671. #define BUTTON1_PIN 1
  1672. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1673. #define BUTTON1_RELAY 1
  1674. // Relays
  1675. #define RELAY1_PIN 14
  1676. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1677. // LEDs
  1678. #define LED1_PIN 13
  1679. #define LED1_PIN_INVERSE 1
  1680. // -----------------------------------------------------------------------------
  1681. // Oukitel P1 Smart Plug
  1682. // https://www.amazon.com/Docooler-OUKITEL-Control-Wireless-Adaptor/dp/B07J3BYFJX/ref=sr_1_fkmrnull_2?keywords=oukitel+p1+smart+switch&qid=1550424399&s=gateway&sr=8-2-fkmrnull
  1683. // -----------------------------------------------------------------------------
  1684. #elif defined(OUKITEL_P1)
  1685. // Info
  1686. #define MANUFACTURER "Oukitel"
  1687. #define DEVICE "P1"
  1688. // Buttons
  1689. #define BUTTON1_PIN 13
  1690. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1691. #define BUTTON1_RELAY 1
  1692. // Relays
  1693. // Right
  1694. #define RELAY1_PIN 12
  1695. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1696. // Left
  1697. #define RELAY2_PIN 15
  1698. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1699. // LEDs
  1700. #define LED1_PIN 0 // blue
  1701. #define LED1_PIN_INVERSE 1
  1702. #define LED1_MODE LED_MODE_WIFI
  1703. // -----------------------------------------------------------------------------
  1704. // YiDian XS-SSA05
  1705. // -----------------------------------------------------------------------------
  1706. #elif defined(YIDIAN_XSSSA05)
  1707. // Info
  1708. #define MANUFACTURER "YIDIAN"
  1709. #define DEVICE "XSSSA05"
  1710. // Buttons
  1711. #define BUTTON1_PIN 13
  1712. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1713. #define BUTTON1_RELAY 1
  1714. // Relays
  1715. #define RELAY1_PIN 12
  1716. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1717. // LEDs
  1718. #define LED1_PIN 0 // red
  1719. #define LED1_PIN_INVERSE 1
  1720. #define LED1_MODE LED_MODE_WIFI
  1721. #define LED2_PIN 15 // blue
  1722. #define LED2_PIN_INVERSE 1
  1723. #define LED2_MODE LED_MODE_RELAY
  1724. // HLW8012
  1725. #ifndef HLW8012_SUPPORT
  1726. #define HLW8012_SUPPORT 1
  1727. #endif
  1728. #define HLW8012_SEL_PIN 3
  1729. #define HLW8012_CF1_PIN 14
  1730. #define HLW8012_CF_PIN 5
  1731. #define HLW8012_SEL_CURRENT LOW
  1732. #define HLW8012_CURRENT_RATIO 25740
  1733. #define HLW8012_VOLTAGE_RATIO 313400
  1734. #define HLW8012_POWER_RATIO 3414290
  1735. #define HLW8012_INTERRUPT_ON FALLING
  1736. // -----------------------------------------------------------------------------
  1737. // TONBUX XS-SSA01
  1738. // -----------------------------------------------------------------------------
  1739. #elif defined(TONBUX_XSSSA01)
  1740. // Info
  1741. #define MANUFACTURER "TONBUX"
  1742. #define DEVICE "XSSSA01"
  1743. // Buttons
  1744. #define BUTTON1_PIN 4
  1745. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1746. #define BUTTON1_RELAY 1
  1747. // Relays
  1748. #define RELAY1_PIN 14
  1749. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1750. // LEDs
  1751. #define LED1_PIN 13
  1752. #define LED1_PIN_INVERSE 0
  1753. // -----------------------------------------------------------------------------
  1754. // TONBUX XS-SSA06
  1755. // -----------------------------------------------------------------------------
  1756. #elif defined(TONBUX_XSSSA06)
  1757. // Info
  1758. #define MANUFACTURER "TONBUX"
  1759. #define DEVICE "XSSSA06"
  1760. // Buttons
  1761. #define BUTTON1_PIN 13
  1762. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1763. #define BUTTON1_RELAY 1
  1764. // Relays
  1765. #define RELAY1_PIN 15
  1766. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1767. // LEDs
  1768. #define LED1_PIN 0 // R - 8 rgb led ring
  1769. #define LED1_PIN_INVERSE 0
  1770. #define LED2_PIN 5 // G
  1771. #define LED2_PIN_INVERSE 0
  1772. #define LED3_PIN 2 // B
  1773. #define LED3_PIN_INVERSE 0
  1774. // -----------------------------------------------------------------------------
  1775. // GREEN ESP8266 RELAY MODULE
  1776. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1777. // -----------------------------------------------------------------------------
  1778. #elif defined(GREEN_ESP8266RELAY)
  1779. // Info
  1780. #define MANUFACTURER "GREEN"
  1781. #define DEVICE "ESP8266RELAY"
  1782. // Buttons
  1783. // Not a button but input via Optocoupler
  1784. #define BUTTON1_PIN 5
  1785. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1786. #define BUTTON1_RELAY 1
  1787. // Relays
  1788. #define RELAY1_PIN 4
  1789. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1790. // LEDs
  1791. #define LED1_PIN 2
  1792. #define LED1_PIN_INVERSE 1
  1793. // -----------------------------------------------------------------------------
  1794. // Henrique Gravina ESPIKE
  1795. // https://github.com/Henriquegravina/Espike
  1796. // -----------------------------------------------------------------------------
  1797. #elif defined(IKE_ESPIKE)
  1798. #define MANUFACTURER "IKE"
  1799. #define DEVICE "ESPIKE"
  1800. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1801. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1802. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1803. #define BUTTON1_PIN 13
  1804. #define BUTTON1_RELAY 1
  1805. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1806. #define BUTTON2_PIN 12
  1807. #define BUTTON2_RELAY 2
  1808. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1809. #define BUTTON3_PIN 14
  1810. #define BUTTON3_RELAY 3
  1811. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1812. #define RELAY1_PIN 4
  1813. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1814. #define RELAY2_PIN 5
  1815. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1816. #define RELAY3_PIN 16
  1817. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1818. #define LED1_PIN 2
  1819. #define LED1_PIN_INVERSE 1
  1820. // -----------------------------------------------------------------------------
  1821. // SWIFITCH
  1822. // https://github.com/ArnieX/swifitch
  1823. // -----------------------------------------------------------------------------
  1824. #elif defined(ARNIEX_SWIFITCH)
  1825. // Info
  1826. #define MANUFACTURER "ARNIEX"
  1827. #define DEVICE "SWIFITCH"
  1828. // Buttons
  1829. #define BUTTON1_PIN 4 // D2
  1830. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1831. #define BUTTON1_RELAY 1
  1832. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1833. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1834. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1835. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1836. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1837. // Relays
  1838. #define RELAY1_PIN 5 // D1
  1839. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1840. // LEDs
  1841. #define LED1_PIN 12 // D6
  1842. #define LED1_PIN_INVERSE 1
  1843. // -----------------------------------------------------------------------------
  1844. // ESP-01S RELAY v4.0
  1845. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  1846. // -----------------------------------------------------------------------------
  1847. #elif defined(GENERIC_ESP01S_RELAY_V40)
  1848. // Info
  1849. #define MANUFACTURER "GENERIC"
  1850. #define DEVICE "ESP01S_RELAY_40"
  1851. // Relays
  1852. #define RELAY1_PIN 0
  1853. #ifndef RELAY1_TYPE
  1854. #define RELAY1_TYPE RELAY_TYPE_NORMAL // See #1504 and #1554
  1855. #endif
  1856. // LEDs
  1857. #define LED1_PIN 2
  1858. #define LED1_PIN_INVERSE 0
  1859. // -----------------------------------------------------------------------------
  1860. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  1861. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  1862. // -----------------------------------------------------------------------------
  1863. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  1864. // Info
  1865. #define MANUFACTURER "GENERIC"
  1866. #define DEVICE "ESP01S_RGBLED_10"
  1867. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  1868. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  1869. // Buttons
  1870. //#define BUTTON1_PIN 2
  1871. // Relays
  1872. //#define RELAY1_PIN 2
  1873. // LEDs
  1874. #define LED1_PIN 2
  1875. #define LED1_PIN_INVERSE 0
  1876. // -----------------------------------------------------------------------------
  1877. // ESP-01S DHT11 v1.0
  1878. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  1879. // -----------------------------------------------------------------------------
  1880. #elif defined(GENERIC_ESP01S_DHT11_V10)
  1881. // Info
  1882. #define MANUFACTURER "GENERIC"
  1883. #define DEVICE "ESP01S_DHT11_10"
  1884. // DHT11
  1885. #ifndef DHT_SUPPORT
  1886. #define DHT_SUPPORT 1
  1887. #endif
  1888. #define DHT_PIN 2
  1889. #define DHT_TYPE DHT_CHIP_DHT11
  1890. // -----------------------------------------------------------------------------
  1891. // ESP-01S DS18B20 v1.0
  1892. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  1893. // -----------------------------------------------------------------------------
  1894. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  1895. // Info
  1896. #define MANUFACTURER "GENERIC"
  1897. #define DEVICE "ESP01S_DS18B20_10"
  1898. // DB18B20
  1899. #ifndef DALLAS_SUPPORT
  1900. #define DALLAS_SUPPORT 1
  1901. #endif
  1902. #define DALLAS_PIN 2
  1903. // -----------------------------------------------------------------------------
  1904. // ESP-DIN relay board V1
  1905. // https://github.com/pilotak/esp_din
  1906. // -----------------------------------------------------------------------------
  1907. #elif defined(PILOTAK_ESP_DIN_V1)
  1908. // Info
  1909. #define MANUFACTURER "PILOTAK"
  1910. #define DEVICE "ESP_DIN_V1"
  1911. // Buttons
  1912. #define BUTTON1_PIN 0
  1913. #define BUTTON1_RELAY 1
  1914. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1915. // Relays
  1916. #define RELAY1_PIN 4
  1917. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1918. #define RELAY2_PIN 5
  1919. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1920. // LEDs
  1921. #define LED1_PIN 15
  1922. #define LED1_PIN_INVERSE 0
  1923. #define I2C_SDA_PIN 12
  1924. #define I2C_SCL_PIN 13
  1925. #ifndef DALLAS_SUPPORT
  1926. #define DALLAS_SUPPORT 1
  1927. #endif
  1928. #define DALLAS_PIN 2
  1929. #define RF_SUPPORT 1
  1930. #define RFB_DIRECT 1
  1931. #define RFB_RX_PIN 14
  1932. #ifndef DIGITAL_SUPPORT
  1933. #define DIGITAL_SUPPORT 1
  1934. #endif
  1935. #define DIGITAL_PIN 16
  1936. #define DIGITAL_PIN_MODE INPUT
  1937. // -----------------------------------------------------------------------------
  1938. // Heltec Touch Relay
  1939. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  1940. // -----------------------------------------------------------------------------
  1941. #elif defined(HELTEC_TOUCHRELAY)
  1942. // Info
  1943. #define MANUFACTURER "HELTEC"
  1944. #define DEVICE "TOUCH_RELAY"
  1945. // Buttons
  1946. #define BUTTON1_PIN 14
  1947. #define BUTTON1_RELAY 1
  1948. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1949. // Relays
  1950. #define RELAY1_PIN 12
  1951. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1952. // -----------------------------------------------------------------------------
  1953. // Zhilde ZLD-EU44-W
  1954. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  1955. // -----------------------------------------------------------------------------
  1956. #elif defined(ZHILDE_EU44_W)
  1957. // Info
  1958. #define MANUFACTURER "ZHILDE"
  1959. #define DEVICE "EU44_W"
  1960. // Based on the reporter, this product uses GPIO1 and 3 for the button
  1961. // and onboard LED, so hardware serial should be disabled...
  1962. #define DEBUG_SERIAL_SUPPORT 0
  1963. // Buttons
  1964. #define BUTTON1_PIN 3
  1965. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1966. // Relays
  1967. #define RELAY1_PIN 5
  1968. #define RELAY2_PIN 4
  1969. #define RELAY3_PIN 12
  1970. #define RELAY4_PIN 13
  1971. #define RELAY5_PIN 14
  1972. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1973. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1974. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1975. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1976. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1977. // LEDs
  1978. #define LED1_PIN 1
  1979. #define LED1_PIN_INVERSE 1
  1980. // -----------------------------------------------------------------------------
  1981. // Allnet 4duino ESP8266-UP-Relais
  1982. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  1983. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  1984. // -----------------------------------------------------------------------------
  1985. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  1986. // Info
  1987. #define MANUFACTURER "ALLNET"
  1988. #define DEVICE "4DUINO_IOT_WLAN_RELAIS"
  1989. // Relays
  1990. #define RELAY1_PIN 14
  1991. #define RELAY1_RESET_PIN 12
  1992. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1993. // LEDs
  1994. #define LED1_PIN 0
  1995. #define LED1_PIN_INVERSE 1
  1996. // Buttons
  1997. //#define BUTTON1_PIN 0
  1998. //#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1999. // Using pins labelled as SDA & SCL as buttons
  2000. #define BUTTON2_PIN 4
  2001. #define BUTTON2_MODE BUTTON_PUSHBUTTON
  2002. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  2003. #define BUTTON2_CLICK BUTTON_MODE_NONE
  2004. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  2005. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  2006. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  2007. #define BUTTON3_PIN 5
  2008. #define BUTTON3_MODE BUTTON_PUSHBUTTON
  2009. // Using pins labelled as SDA & SCL for I2C
  2010. //#define I2C_SDA_PIN 4
  2011. //#define I2C_SCL_PIN 5
  2012. // -----------------------------------------------------------------------------
  2013. // Luani HVIO
  2014. // https://luani.de/projekte/esp8266-hvio/
  2015. // https://luani.de/blog/esp8266-230v-io-modul/
  2016. // -----------------------------------------------------------------------------
  2017. #elif defined(LUANI_HVIO)
  2018. // Info
  2019. #define MANUFACTURER "LUANI"
  2020. #define DEVICE "HVIO"
  2021. // Buttons
  2022. #define BUTTON1_PIN 12
  2023. #define BUTTON1_RELAY 1
  2024. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  2025. #define BUTTON1_PRESS BUTTON_MODE_NONE
  2026. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  2027. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2028. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2029. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  2030. #define BUTTON2_PIN 13
  2031. #define BUTTON2_RELAY 2
  2032. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  2033. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  2034. // Relays
  2035. #define RELAY1_PIN 4
  2036. #define RELAY2_PIN 5
  2037. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2038. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2039. // LEDs
  2040. #define LED1_PIN 15
  2041. #define LED1_PIN_INVERSE 0
  2042. // -----------------------------------------------------------------------------
  2043. // Tonbux 50-100M Smart Mosquito Killer USB
  2044. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  2045. // -----------------------------------------------------------------------------
  2046. #elif defined(TONBUX_MOSQUITO_KILLER)
  2047. // Info
  2048. #define MANUFACTURER "TONBUX"
  2049. #define DEVICE "MOSQUITO_KILLER"
  2050. // Buttons
  2051. #define BUTTON1_PIN 2
  2052. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2053. #define BUTTON1_RELAY 1
  2054. // Relays
  2055. #define RELAY1_PIN 5 // not a relay, fan
  2056. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2057. // LEDs
  2058. #define LED1_PIN 15 // blue led
  2059. #define LED1_PIN_INVERSE 1
  2060. #define LED1_MODE LED_MODE_WIFI
  2061. #define LED2_PIN 14 // red led
  2062. #define LED2_PIN_INVERSE 1
  2063. #define LED2_MODE LED_MODE_RELAY
  2064. #define LED3_PIN 12 // UV leds (1-2-3-4-5-6-7-8)
  2065. #define LED3_PIN_INVERSE 0
  2066. #define LED3_RELAY 1
  2067. #define LED4_PIN 16 // UV leds (9-10-11)
  2068. #define LED4_PIN_INVERSE 0
  2069. #define LED4_RELAY 1
  2070. // -----------------------------------------------------------------------------
  2071. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  2072. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  2073. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  2074. // -----------------------------------------------------------------------------
  2075. #elif defined(NEO_COOLCAM_NAS_WR01W)
  2076. // Info
  2077. #define MANUFACTURER "NEO_COOLCAM"
  2078. #define DEVICE "NAS_WR01W"
  2079. // Buttons
  2080. #define BUTTON1_PIN 13
  2081. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2082. #define BUTTON1_RELAY 1
  2083. // Relays
  2084. #define RELAY1_PIN 12
  2085. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2086. // LEDs
  2087. #define LED1_PIN 4
  2088. #define LED1_PIN_INVERSE 1
  2089. // ------------------------------------------------------------------------------
  2090. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  2091. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  2092. // Also: Estink Wifi Power Strip
  2093. // -----------------------------------------------------------------------------
  2094. #elif defined(FORNORM_ZLD_34EU)
  2095. // Info
  2096. #define MANUFACTURER "FORNORM"
  2097. #define DEVICE "ZLD_34EU"
  2098. // Disable UART noise since this board uses GPIO3
  2099. #define DEBUG_SERIAL_SUPPORT 0
  2100. // Buttons
  2101. #define BUTTON1_PIN 16
  2102. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2103. #define BUTTON1_RELAY 4
  2104. // Relays
  2105. #define RELAY1_PIN 14 // USB power
  2106. #define RELAY2_PIN 13 // power plug 1
  2107. #define RELAY3_PIN 4 // power plug 2
  2108. #define RELAY4_PIN 15 // power plug 3
  2109. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2110. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2111. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2112. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2113. // LEDs
  2114. #define LED1_PIN 0 // power led
  2115. #define LED2_PIN 12 // power plug 1
  2116. #define LED3_PIN 3 // power plug 2
  2117. #define LED4_PIN 5 // power plug 3
  2118. #define LED1_PIN_INVERSE 1
  2119. #define LED2_PIN_INVERSE 1
  2120. #define LED3_PIN_INVERSE 1
  2121. #define LED4_PIN_INVERSE 1
  2122. #define LED1_MODE LED_MODE_FINDME
  2123. #define LED2_MODE LED_MODE_FOLLOW
  2124. #define LED3_MODE LED_MODE_FOLLOW
  2125. #define LED4_MODE LED_MODE_FOLLOW
  2126. #define LED2_RELAY 2
  2127. #define LED3_RELAY 3
  2128. #define LED4_RELAY 4
  2129. // -----------------------------------------------------------------------------
  2130. // Bruno Horta's OnOfre
  2131. // https://www.bhonofre.pt/
  2132. // https://github.com/brunohorta82/BH_OnOfre/
  2133. // -----------------------------------------------------------------------------
  2134. #elif defined(BH_ONOFRE)
  2135. // Info
  2136. #define MANUFACTURER "BH"
  2137. #define DEVICE "ONOFRE"
  2138. // Buttons
  2139. #define BUTTON1_PIN 12
  2140. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2141. #define BUTTON1_RELAY 1
  2142. #define BUTTON2_PIN 13
  2143. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2144. #define BUTTON2_RELAY 2
  2145. // Relays
  2146. #define RELAY1_PIN 4
  2147. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2148. #define RELAY2_PIN 5
  2149. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2150. // -----------------------------------------------------------------------------
  2151. // BlitzWolf SHP2 and SHP6
  2152. // Also several boards under different names uing a power chip labelled BL0937 or HJL-01
  2153. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  2154. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  2155. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  2156. // * Gosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  2157. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  2158. // -----------------------------------------------------------------------------
  2159. #elif defined(BLITZWOLF_BWSHPX)
  2160. // Info
  2161. #define MANUFACTURER "BLITZWOLF"
  2162. #define DEVICE "BWSHPX"
  2163. // Buttons
  2164. #define BUTTON1_PIN 13
  2165. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2166. #define BUTTON1_RELAY 1
  2167. // Relays
  2168. #define RELAY1_PIN 15
  2169. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2170. // LEDs
  2171. #define LED1_PIN 2
  2172. #define LED1_PIN_INVERSE 1
  2173. #define LED2_PIN 0
  2174. #define LED2_PIN_INVERSE 1
  2175. #define LED2_MODE LED_MODE_FINDME
  2176. #define LED2_RELAY 1
  2177. // HJL01 / BL0937
  2178. #ifndef HLW8012_SUPPORT
  2179. #define HLW8012_SUPPORT 1
  2180. #endif
  2181. #define HLW8012_SEL_PIN 12
  2182. #define HLW8012_CF1_PIN 14
  2183. #define HLW8012_CF_PIN 5
  2184. #define HLW8012_SEL_CURRENT LOW
  2185. #define HLW8012_CURRENT_RATIO 25740
  2186. #define HLW8012_VOLTAGE_RATIO 313400
  2187. #define HLW8012_POWER_RATIO 3414290
  2188. #define HLW8012_INTERRUPT_ON FALLING
  2189. // -----------------------------------------------------------------------------
  2190. // Same as the above but new board version marked V2.3
  2191. // BlitzWolf SHP2 V2.3
  2192. // Gosund SP1 V2.3
  2193. // -----------------------------------------------------------------------------
  2194. #elif defined(BLITZWOLF_BWSHPX_V23)
  2195. // Info
  2196. #define MANUFACTURER "BLITZWOLF"
  2197. #define DEVICE "BWSHPX_V23"
  2198. // Buttons
  2199. #define BUTTON1_PIN 3
  2200. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2201. #define BUTTON1_RELAY 1
  2202. // Relays
  2203. #define RELAY1_PIN 14
  2204. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2205. // LEDs
  2206. #define LED1_PIN 1
  2207. #define LED1_PIN_INVERSE 1
  2208. #define LED2_PIN 13
  2209. #define LED2_PIN_INVERSE 1
  2210. #define LED2_MODE LED_MODE_FINDME
  2211. #define LED2_RELAY 1
  2212. // HJL01 / BL0937
  2213. #ifndef HLW8012_SUPPORT
  2214. #define HLW8012_SUPPORT 1
  2215. #endif
  2216. #define HLW8012_SEL_PIN 12
  2217. #define HLW8012_CF1_PIN 5
  2218. #define HLW8012_CF_PIN 4
  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. // BUTTON1 and LED1 are using Serial pins
  2225. #define DEBUG_SERIAL_SUPPORT 0
  2226. // -----------------------------------------------------------------------------
  2227. // Teckin SP22 v1.4 - v1.6
  2228. // -----------------------------------------------------------------------------
  2229. #elif defined(TECKIN_SP22_V14)
  2230. // Info
  2231. #define MANUFACTURER "TECKIN"
  2232. #define DEVICE "SP22_V14"
  2233. // Buttons
  2234. #define BUTTON1_PIN 1
  2235. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2236. #define BUTTON1_RELAY 1
  2237. // Relays
  2238. #define RELAY1_PIN 14
  2239. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2240. // LEDs
  2241. #define LED1_PIN 3
  2242. #define LED1_PIN_INVERSE 1
  2243. #define LED2_PIN 13
  2244. #define LED2_PIN_INVERSE 1
  2245. #define LED2_MODE LED_MODE_FINDME
  2246. #define LED2_RELAY 1
  2247. // HJL01 / BL0937
  2248. #ifndef HLW8012_SUPPORT
  2249. #define HLW8012_SUPPORT 1
  2250. #endif
  2251. #define HLW8012_SEL_PIN 12
  2252. #define HLW8012_CF1_PIN 5
  2253. #define HLW8012_CF_PIN 4
  2254. #define HLW8012_SEL_CURRENT LOW
  2255. #define HLW8012_CURRENT_RATIO 20730
  2256. #define HLW8012_VOLTAGE_RATIO 264935
  2257. #define HLW8012_POWER_RATIO 2533110
  2258. #define HLW8012_INTERRUPT_ON FALLING
  2259. // BUTTON1 and LED1 are using Serial pins
  2260. #define DEBUG_SERIAL_SUPPORT 0
  2261. // -----------------------------------------------------------------------------
  2262. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  2263. // Also model number KS-602S
  2264. // -----------------------------------------------------------------------------
  2265. #elif defined(GOSUND_WS1)
  2266. // Info
  2267. #define MANUFACTURER "GOSUND"
  2268. #define DEVICE "WS1"
  2269. // Buttons
  2270. #define BUTTON1_PIN 0
  2271. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2272. #define BUTTON1_RELAY 1
  2273. // Relays
  2274. #define RELAY1_PIN 14
  2275. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2276. // LEDs
  2277. #define LED1_PIN 1
  2278. #define LED1_PIN_INVERSE 1
  2279. // LED1 is using TX pin
  2280. #define DEBUG_SERIAL_SUPPORT 0
  2281. // ----------------------------------------------------------------------------------------
  2282. // Homecube 16A is similar but some pins differ and it also has RGB LEDs
  2283. // https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
  2284. // ----------------------------------------------------------------------------------------
  2285. #elif defined(HOMECUBE_16A)
  2286. // Info
  2287. #define MANUFACTURER "HOMECUBE"
  2288. #define DEVICE "16A"
  2289. // Buttons
  2290. #define BUTTON1_PIN 13
  2291. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2292. #define BUTTON1_RELAY 1
  2293. // Relays
  2294. #define RELAY1_PIN 15
  2295. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2296. // LEDs
  2297. //LED Pin 4 - ESP8266 onboard LED
  2298. //Red LED: 0
  2299. //Green LED: 12
  2300. //Blue LED: 2
  2301. // Blue
  2302. #define LED1_PIN 2
  2303. #define LED1_PIN_INVERSE 0
  2304. // Green
  2305. #define LED2_PIN 12
  2306. #define LED2_PIN_INVERSE 1
  2307. #define LED2_MODE LED_MODE_RELAY
  2308. // Red
  2309. #define LED3_PIN 0
  2310. #define LED3_PIN_INVERSE 0
  2311. #define LED3_MODE LED_MODE_OFF
  2312. // HJL01 / BL0937
  2313. #ifndef HLW8012_SUPPORT
  2314. #define HLW8012_SUPPORT 1
  2315. #endif
  2316. #define HLW8012_SEL_PIN 16
  2317. #define HLW8012_CF1_PIN 14
  2318. #define HLW8012_CF_PIN 5
  2319. #define HLW8012_SEL_CURRENT LOW
  2320. #define HLW8012_CURRENT_RATIO 25740
  2321. #define HLW8012_VOLTAGE_RATIO 313400
  2322. #define HLW8012_POWER_RATIO 3414290
  2323. #define HLW8012_INTERRUPT_ON FALLING
  2324. // -----------------------------------------------------------------------------
  2325. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  2326. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  2327. // -----------------------------------------------------------------------------
  2328. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  2329. // Info
  2330. #define MANUFACTURER "VANZAVANZU"
  2331. #define DEVICE "SMART_WIFI_PLUG_MINI"
  2332. // Buttons
  2333. #define BUTTON1_PIN 13
  2334. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2335. #define BUTTON1_RELAY 1
  2336. // Relays
  2337. #define RELAY1_PIN 15
  2338. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2339. // LEDs
  2340. #define LED1_PIN 2
  2341. #define LED1_PIN_INVERSE 1
  2342. #define LED2_PIN 0
  2343. #define LED2_PIN_INVERSE 1
  2344. #define LED2_MODE LED_MODE_FINDME
  2345. #define LED2_RELAY 1
  2346. // Disable UART noise
  2347. #define DEBUG_SERIAL_SUPPORT 0
  2348. // HJL01 / BL0937
  2349. #ifndef HLW8012_SUPPORT
  2350. #define HLW8012_SUPPORT 1
  2351. #endif
  2352. #define HLW8012_SEL_PIN 3
  2353. #define HLW8012_CF1_PIN 14
  2354. #define HLW8012_CF_PIN 5
  2355. #define HLW8012_SEL_CURRENT LOW
  2356. #define HLW8012_CURRENT_RATIO 25740
  2357. #define HLW8012_VOLTAGE_RATIO 313400
  2358. #define HLW8012_POWER_RATIO 3414290
  2359. #define HLW8012_INTERRUPT_ON FALLING
  2360. // -----------------------------------------------------------------------------
  2361. #elif defined(GENERIC_AG_L4)
  2362. // Info
  2363. #define MANUFACTURER "GENERIC"
  2364. #define DEVICE "AG_L4"
  2365. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2366. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2367. #define DUMMY_RELAY_COUNT 1
  2368. // button 1: "power" button
  2369. #define BUTTON1_PIN 4
  2370. #define BUTTON1_RELAY 1
  2371. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2372. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  2373. #define BUTTON1_CLICK BUTTON_MODE_NONE
  2374. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2375. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2376. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  2377. // button 2: "wifi" button
  2378. #define BUTTON2_PIN 2
  2379. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2380. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  2381. #define BUTTON2_CLICK BUTTON_MODE_NONE
  2382. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  2383. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  2384. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  2385. // LEDs
  2386. #define LED1_PIN 5 // red status led
  2387. #define LED1_PIN_INVERSE 0
  2388. #define LED2_PIN 16 // master light power
  2389. #define LED2_PIN_INVERSE 1
  2390. #define LED2_MODE LED_MODE_RELAY
  2391. // Light
  2392. #define LIGHT_CHANNELS 3
  2393. #define LIGHT_CH1_PIN 14 // RED
  2394. #define LIGHT_CH2_PIN 13 // GREEN
  2395. #define LIGHT_CH3_PIN 12 // BLUE
  2396. #define LIGHT_CH1_INVERSE 0
  2397. #define LIGHT_CH2_INVERSE 0
  2398. #define LIGHT_CH3_INVERSE 0
  2399. // -----------------------------------------------------------------------------
  2400. #elif defined(ALLTERCO_SHELLY1)
  2401. // Info
  2402. #define MANUFACTURER "ALLTERCO"
  2403. #define DEVICE "SHELLY1"
  2404. // Buttons
  2405. #define BUTTON1_PIN 5
  2406. #define BUTTON1_MODE BUTTON_SWITCH
  2407. #define BUTTON1_RELAY 1
  2408. // Relays
  2409. #define RELAY1_PIN 4
  2410. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2411. #elif defined(ALLTERCO_SHELLY2)
  2412. // Info
  2413. #define MANUFACTURER "ALLTERCO"
  2414. #define DEVICE "SHELLY2"
  2415. // Buttons
  2416. #define BUTTON1_PIN 12
  2417. #define BUTTON2_PIN 14
  2418. #define BUTTON1_MODE BUTTON_SWITCH
  2419. #define BUTTON2_MODE BUTTON_SWITCH
  2420. #define BUTTON1_RELAY 1
  2421. #define BUTTON2_RELAY 2
  2422. // Relays
  2423. #define RELAY1_PIN 4
  2424. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2425. #define RELAY2_PIN 5
  2426. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2427. // -----------------------------------------------------------------------------
  2428. #elif defined(LOHAS_9W)
  2429. // Info
  2430. #define MANUFACTURER "LOHAS"
  2431. #define DEVICE "E27_9W"
  2432. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2433. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2434. #define DUMMY_RELAY_COUNT 1
  2435. // Light
  2436. #define LIGHT_CHANNELS 5
  2437. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2438. #define MY92XX_CHIPS 2
  2439. #define MY92XX_DI_PIN 13
  2440. #define MY92XX_DCKI_PIN 15
  2441. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2442. #define MY92XX_MAPPING 0, 1, 2, 3, 4
  2443. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  2444. // -----------------------------------------------------------------------------
  2445. #elif defined(XIAOMI_SMART_DESK_LAMP)
  2446. // Info
  2447. #define MANUFACTURER "XIAOMI"
  2448. #define DEVICE "SMART_DESK_LAMP"
  2449. // Buttons
  2450. #define BUTTON1_PIN 2
  2451. #define BUTTON2_PIN 14
  2452. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2453. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2454. // This button doubles as switch here and as encoder mode switch below
  2455. // Clicking it (for less than 500ms) will turn the light on and off
  2456. // Double and Long clicks will not work as these are used to modify the encoder action
  2457. #define BUTTON1_RELAY 1
  2458. #define BUTTON_LNGCLICK_DELAY 500
  2459. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2460. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2461. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  2462. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  2463. #define BUTTON2_DBLCLICK BUTTON_MODE_AP
  2464. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  2465. // Light
  2466. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2467. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2468. #define DUMMY_RELAY_COUNT 1
  2469. #define LIGHT_STEP 8
  2470. #define LIGHT_CHANNELS 2
  2471. #define LIGHT_CH1_PIN 5 // warm white
  2472. #define LIGHT_CH1_INVERSE 0
  2473. #define LIGHT_CH2_PIN 4 // cold white
  2474. #define LIGHT_CH2_INVERSE 0
  2475. // Encoder
  2476. // If mode is ENCODER_MODE_RATIO, the value ratio between both channels is changed
  2477. // when the button is not pressed, and the overall brightness when pressed
  2478. // If mode is ENCODER_MODE_CHANNEL, the first channel value is changed
  2479. // when the button is not pressed, and the second channel when pressed
  2480. // If no ENCODERX_BUTTON_PIN defined it will only change the value of the first defined channel
  2481. #define ENCODER_SUPPORT 1
  2482. #define ENCODER1_PIN1 12
  2483. #define ENCODER1_PIN2 13
  2484. #define ENCODER1_BUTTON_PIN 2 // active low by default, with software pullup
  2485. #define ENCODER1_CHANNEL1 0 // please note this value is 0-based (LIGHT_CH1 above)
  2486. #define ENCODER1_CHANNEL2 1 // please note this value is 0-based (LIGHT_CH2 above)
  2487. #define ENCODER1_MODE ENCODER_MODE_RATIO
  2488. #elif defined(PHYX_ESP12_RGB)
  2489. // Info
  2490. #define MANUFACTURER "PHYX"
  2491. #define DEVICE "ESP12_RGB"
  2492. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2493. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2494. #define DUMMY_RELAY_COUNT 1
  2495. // Light
  2496. #define LIGHT_CHANNELS 3
  2497. #define LIGHT_CH1_PIN 4 // RED
  2498. #define LIGHT_CH2_PIN 14 // GREEN
  2499. #define LIGHT_CH3_PIN 12 // BLUE
  2500. #define LIGHT_CH1_INVERSE 0
  2501. #define LIGHT_CH2_INVERSE 0
  2502. #define LIGHT_CH3_INVERSE 0
  2503. // -----------------------------------------------------------------------------
  2504. // iWoole LED Table Lamp
  2505. // 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
  2506. // -----------------------------------------------------------------------------
  2507. #elif defined(IWOOLE_LED_TABLE_LAMP)
  2508. // Info
  2509. #define MANUFACTURER "IWOOLE"
  2510. #define DEVICE "LED_TABLE_LAMP"
  2511. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2512. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2513. #define DUMMY_RELAY_COUNT 1
  2514. // Light
  2515. #define LIGHT_CHANNELS 4
  2516. #define LIGHT_CH1_PIN 12 // RED
  2517. #define LIGHT_CH2_PIN 5 // GREEN
  2518. #define LIGHT_CH3_PIN 14 // BLUE
  2519. #define LIGHT_CH4_PIN 4 // WHITE
  2520. #define LIGHT_CH1_INVERSE 0
  2521. #define LIGHT_CH2_INVERSE 0
  2522. #define LIGHT_CH3_INVERSE 0
  2523. #define LIGHT_CH4_INVERSE 0
  2524. // -----------------------------------------------------------------------------
  2525. // Generic GU10
  2526. // https://www.ebay.com/itm/1-10PC-GU10-RGB-Smart-Bulb-Wireless-WiFi-App-Remote-Ctrl-Light-for-Alexa-Google/173724116351
  2527. // -----------------------------------------------------------------------------
  2528. #elif defined(GENERIC_GU10)
  2529. // Info
  2530. #define MANUFACTURER "GENERIC"
  2531. #define DEVICE "GU10"
  2532. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2533. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2534. #define DUMMY_RELAY_COUNT 1
  2535. // Light
  2536. #define LIGHT_CHANNELS 4
  2537. #define LIGHT_CH1_PIN 14 // RED
  2538. #define LIGHT_CH2_PIN 12 // GREEN
  2539. #define LIGHT_CH3_PIN 13 // BLUE
  2540. #define LIGHT_CH4_PIN 4 // WHITE
  2541. #define LIGHT_CH1_INVERSE 0
  2542. #define LIGHT_CH2_INVERSE 0
  2543. #define LIGHT_CH3_INVERSE 0
  2544. #define LIGHT_CH4_INVERSE 0
  2545. // -----------------------------------------------------------------------------
  2546. // Lombex Lux Nova 2 Tunable White
  2547. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2548. // -----------------------------------------------------------------------------
  2549. #elif defined(LOMBEX_LUX_NOVA2_TUNABLE_WHITE)
  2550. // Info
  2551. #define MANUFACTURER "LOMBEX"
  2552. #define DEVICE "LUX_NOVA2_TUNABLE_WHITE"
  2553. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2554. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2555. #define DUMMY_RELAY_COUNT 1
  2556. // Light
  2557. #define LIGHT_CHANNELS 5
  2558. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2559. #define MY92XX_CHIPS 1
  2560. #define MY92XX_DI_PIN 4
  2561. #define MY92XX_DCKI_PIN 5
  2562. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2563. // No RGB on this bulb. Warm white on channel 0, cool white on channel 3
  2564. #define MY92XX_MAPPING 255, 255, 255, 3, 0
  2565. // -----------------------------------------------------------------------------
  2566. // Lombex Lux Nova 2 White and Color
  2567. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2568. // -----------------------------------------------------------------------------
  2569. #elif defined(LOMBEX_LUX_NOVA2_WHITE_COLOR)
  2570. // Info
  2571. #define MANUFACTURER "LOMBEX"
  2572. #define DEVICE "LUX_NOVA2_WHITE_COLOR"
  2573. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2574. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2575. #define DUMMY_RELAY_COUNT 1
  2576. // Light
  2577. #define LIGHT_CHANNELS 4
  2578. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2579. #define MY92XX_CHIPS 1
  2580. #define MY92XX_DI_PIN 4
  2581. #define MY92XX_DCKI_PIN 5
  2582. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2583. // RGB on channels 0/1/2, either cool or warm white on channel 3
  2584. // The bulb *should* have cool leds, but could also have warm leds as a common defect
  2585. #define MY92XX_MAPPING 0, 1, 2, 3
  2586. // -----------------------------------------------------------------------------
  2587. // Bestek Smart Plug with 2 USB ports
  2588. // https://www.bestekcorp.com/bestek-smart-plug-works-with-amazon-alexa-google-assistant-and-ifttt-with-2-usb
  2589. // -----------------------------------------------------------------------------
  2590. #elif defined(BESTEK_MRJ1011)
  2591. // Info
  2592. #define MANUFACTURER "BESTEK"
  2593. #define DEVICE "MRJ1011"
  2594. // Buttons
  2595. #define BUTTON1_PIN 13
  2596. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2597. #define BUTTON1_RELAY 1
  2598. // Relay
  2599. #define RELAY1_PIN 12
  2600. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2601. // LED
  2602. #define LED1_PIN 4
  2603. #define LED1_PIN_INVERSE 1
  2604. // -----------------------------------------------------------------------------
  2605. // GBLIFE RGBW SOCKET
  2606. // -----------------------------------------------------------------------------
  2607. #elif defined(GBLIFE_RGBW_SOCKET)
  2608. // Info
  2609. #define MANUFACTURER "GBLIFE"
  2610. #define DEVICE "RGBW_SOCKET"
  2611. // Buttons
  2612. #define BUTTON1_PIN 13
  2613. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2614. #define BUTTON1_RELAY 1
  2615. // Relays
  2616. #define RELAY1_PIN 15
  2617. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2618. // Light RGBW
  2619. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2620. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2621. #define DUMMY_RELAY_COUNT 1
  2622. #define LIGHT_CHANNELS 4
  2623. #define LIGHT_CH1_PIN 5 // RED
  2624. #define LIGHT_CH2_PIN 14 // GREEN
  2625. #define LIGHT_CH3_PIN 12 // BLUE
  2626. #define LIGHT_CH4_PIN 4 // WHITE
  2627. #define LIGHT_CH1_INVERSE 0
  2628. #define LIGHT_CH2_INVERSE 0
  2629. #define LIGHT_CH3_INVERSE 0
  2630. #define LIGHT_CH4_INVERSE 0
  2631. // ----------------------------------------------------------------------------------------
  2632. // Smart life Mini Smart Socket is similar Homecube 16A but some GPIOs differ
  2633. // https://www.ebay.de/itm/Smart-Steckdose-WIFI-WLAN-Amazon-Alexa-Fernbedienung-Home-Socket-Zeitschaltuh-DE/123352026749?hash=item1cb85a8e7d:g:IasAAOSwk6dbj390
  2634. // Also labeled NETVIP
  2635. // https://www.amazon.es/Inteligente-NETVIP-Inal%C3%A1mbrico-Interruptor-Funciona/dp/B07KH8YWS5
  2636. // ----------------------------------------------------------------------------------------
  2637. #elif defined(SMARTLIFE_MINI_SMART_SOCKET)
  2638. // Info
  2639. #define MANUFACTURER "SMARTLIFE"
  2640. #define DEVICE "MINI_SMART_SOCKET"
  2641. // Buttons
  2642. #define BUTTON1_PIN 13
  2643. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2644. #define BUTTON1_RELAY 1
  2645. // Relays
  2646. #define RELAY1_PIN 15
  2647. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2648. // LEDs
  2649. //Red LED: 0
  2650. //Green LED: 4
  2651. //Blue LED: 2
  2652. // Light
  2653. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2654. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2655. #define DUMMY_RELAY_COUNT 1
  2656. #define LIGHT_CHANNELS 3
  2657. #define LIGHT_CH1_PIN 0 // RED
  2658. #define LIGHT_CH2_PIN 4 // GREEN
  2659. #define LIGHT_CH3_PIN 2 // BLUE
  2660. #define LIGHT_CH1_INVERSE 0
  2661. #define LIGHT_CH2_INVERSE 0
  2662. #define LIGHT_CH3_INVERSE 0
  2663. // HJL01 / BL0937
  2664. #ifndef HLW8012_SUPPORT
  2665. #define HLW8012_SUPPORT 1
  2666. #endif
  2667. #define HLW8012_SEL_PIN 12
  2668. #define HLW8012_CF1_PIN 14
  2669. #define HLW8012_CF_PIN 5
  2670. #define HLW8012_SEL_CURRENT LOW
  2671. #define HLW8012_CURRENT_RATIO 25740
  2672. #define HLW8012_VOLTAGE_RATIO 313400
  2673. #define HLW8012_POWER_RATIO 3414290
  2674. #define HLW8012_INTERRUPT_ON FALLING
  2675. // ----------------------------------------------------------------------------------------
  2676. // Hama WiFi Steckdose (00176533)
  2677. // https://at.hama.com/00176533/hama-wifi-steckdose-3500w-16a
  2678. // ----------------------------------------------------------------------------------------
  2679. #elif defined(HAMA_WIFI_STECKDOSE_00176533)
  2680. // Info
  2681. #define MANUFACTURER "HAMA"
  2682. #define DEVICE "WIFI_STECKDOSE_00176533"
  2683. // Buttons
  2684. #define BUTTON1_PIN 13
  2685. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2686. #define BUTTON1_RELAY 1
  2687. // Relays
  2688. #define RELAY1_PIN 12
  2689. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2690. // LEDs
  2691. #define LED1_PIN 4
  2692. #define LED1_PIN_INVERSE 1
  2693. // -----------------------------------------------------------------------------
  2694. // Oxaoxe NX-SP202
  2695. // Digoo NX-SP202 (not tested)
  2696. // Digoo DG-SP202 (not tested)
  2697. // https://github.com/xoseperez/espurna/issues/1502
  2698. // -----------------------------------------------------------------------------
  2699. #elif defined(DIGOO_NX_SP202)
  2700. // Info
  2701. #define MANUFACTURER "DIGOO"
  2702. #define DEVICE "NX_SP202"
  2703. // Buttons
  2704. #define BUTTON1_PIN 0
  2705. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2706. #define BUTTON1_RELAY 1
  2707. #define BUTTON2_PIN 16
  2708. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2709. #define BUTTON2_RELAY 2
  2710. // Relays
  2711. #define RELAY1_PIN 15
  2712. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2713. #define RELAY2_PIN 14
  2714. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2715. // LEDs
  2716. #define LED1_PIN 13
  2717. #define LED1_PIN_INVERSE 1
  2718. // HJL01 / BL0937
  2719. #ifndef HLW8012_SUPPORT
  2720. #define HLW8012_SUPPORT 1
  2721. #endif
  2722. #define HLW8012_SEL_PIN 12
  2723. #define HLW8012_CF1_PIN 5
  2724. #define HLW8012_CF_PIN 4
  2725. #define HLW8012_SEL_CURRENT LOW
  2726. #define HLW8012_CURRENT_RATIO 23296
  2727. #define HLW8012_VOLTAGE_RATIO 310085
  2728. #define HLW8012_POWER_RATIO 3368471
  2729. #define HLW8012_INTERRUPT_ON FALLING
  2730. // -----------------------------------------------------------------------------
  2731. // Foxel's LightFox dual
  2732. // https://github.com/foxel/esp-dual-rf-switch
  2733. // -----------------------------------------------------------------------------
  2734. #elif defined(FOXEL_LIGHTFOX_DUAL)
  2735. // Info
  2736. #define MANUFACTURER "FOXEL"
  2737. #define DEVICE "LIGHTFOX_DUAL"
  2738. #define SERIAL_BAUDRATE 19200
  2739. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  2740. #define DUMMY_RELAY_COUNT 2
  2741. #define DEBUG_SERIAL_SUPPORT 0
  2742. // Buttons
  2743. #define BUTTON1_RELAY 1
  2744. #define BUTTON2_RELAY 2
  2745. #define BUTTON3_RELAY 2
  2746. #define BUTTON4_RELAY 1
  2747. // -----------------------------------------------------------------------------
  2748. // Teckin SP20
  2749. // -----------------------------------------------------------------------------
  2750. #elif defined(TECKIN_SP20)
  2751. // Info
  2752. #define MANUFACTURER "TECKIN"
  2753. #define DEVICE "SP20"
  2754. // Buttons
  2755. #define BUTTON1_PIN 13
  2756. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2757. #define BUTTON1_RELAY 1
  2758. // Relays
  2759. #define RELAY1_PIN 4
  2760. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2761. // LEDs
  2762. #define LED1_PIN 2
  2763. #define LED1_PIN_INVERSE 1
  2764. #define LED2_PIN 0
  2765. #define LED2_PIN_INVERSE 1
  2766. #define LED2_MODE LED_MODE_FINDME
  2767. #define LED2_RELAY 0
  2768. // HJL01 / BL0937
  2769. #ifndef HLW8012_SUPPORT
  2770. #define HLW8012_SUPPORT 1
  2771. #endif
  2772. #define HLW8012_SEL_PIN 12
  2773. #define HLW8012_CF1_PIN 14
  2774. #define HLW8012_CF_PIN 5
  2775. #define HLW8012_SEL_CURRENT LOW
  2776. #define HLW8012_CURRENT_RATIO 25740
  2777. #define HLW8012_VOLTAGE_RATIO 313400
  2778. #define HLW8012_POWER_RATIO 3414290
  2779. #define HLW8012_INTERRUPT_ON FALLING
  2780. // -----------------------------------------------------------------------------
  2781. // Charging Essentials / LITESUN LA-WF3
  2782. // -----------------------------------------------------------------------------
  2783. #elif defined(LITESUN_LA_WF3)
  2784. // Info
  2785. #define MANUFACTURER "LITESUN"
  2786. #define DEVICE "LA_WF3"
  2787. // Buttons
  2788. #define BUTTON1_PIN 13
  2789. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2790. #define BUTTON1_RELAY 1
  2791. // Relays
  2792. #define RELAY1_PIN 12
  2793. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2794. // LEDs
  2795. #define LED1_PIN 4 // 4 blue led
  2796. #define LED1_MODE LED_MODE_WIFI
  2797. #define LED1_PIN_INVERSE 1
  2798. #define LED2_PIN 5 // 5 red led
  2799. #define LED2_MODE LED_MODE_RELAY
  2800. #define LED2_PIN_INVERSE 1
  2801. // -----------------------------------------------------------------------------
  2802. // PSH
  2803. // -----------------------------------------------------------------------------
  2804. #elif defined(PSH_WIFI_PLUG)
  2805. // Info
  2806. #define MANUFACTURER "PSH"
  2807. #define DEVICE "WIFI_PLUG"
  2808. // Relays
  2809. #define RELAY1_PIN 2
  2810. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2811. // LEDs
  2812. #define LED1_PIN 0
  2813. #define LED1_PIN_INVERSE 0
  2814. #elif defined(PSH_RGBW_CONTROLLER)
  2815. // Info
  2816. #define MANUFACTURER "PSH"
  2817. #define DEVICE "RGBW_CONTROLLER"
  2818. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2819. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2820. #define DUMMY_RELAY_COUNT 1
  2821. // LEDs
  2822. #define LED1_PIN 13
  2823. #define LED1_PIN_INVERSE 1
  2824. // Light
  2825. #define LIGHT_CHANNELS 4
  2826. #define LIGHT_CH1_PIN 5 // RED
  2827. #define LIGHT_CH2_PIN 4 // GREEN
  2828. #define LIGHT_CH3_PIN 12 // BLUE
  2829. #define LIGHT_CH4_PIN 14 // WHITE1
  2830. #define LIGHT_CH1_INVERSE 0
  2831. #define LIGHT_CH2_INVERSE 0
  2832. #define LIGHT_CH3_INVERSE 0
  2833. #define LIGHT_CH4_INVERSE 0
  2834. #elif defined(PSH_WIFI_SENSOR)
  2835. // Info
  2836. #define MANUFACTURER "PSH"
  2837. #define DEVICE "WIFI_SENSOR"
  2838. // DHT12 Sensor
  2839. #define DHT_SUPPORT 1
  2840. #define DHT_PIN 14
  2841. #define DHT_TYPE DHT_CHIP_DHT12
  2842. // LDR Sensor
  2843. #define LDR_SUPPORT 1
  2844. #define LDR_TYPE LDR_GL5528
  2845. #define LDR_ON_GROUND false
  2846. #define LDR_RESISTOR 10000
  2847. #elif defined(JINVOO_VALVE_SM_AW713)
  2848. // Reflashing from original Tuya firmware
  2849. // to thirdparty firmware like espurna by:
  2850. // https://github.com/ct-Open-Source/tuya-convert
  2851. // Info
  2852. #define MANUFACTURER "JINVOO"
  2853. #define DEVICE "VALVE_SM_AW713"
  2854. // Buttons
  2855. #define BUTTON1_PIN 13
  2856. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2857. #define BUTTON1_RELAY 1
  2858. // Relays
  2859. #define RELAY1_PIN 12
  2860. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2861. // LED
  2862. #define LED1_PIN 5 // 5 red led
  2863. #define LED1_PIN_INVERSE 0
  2864. #define LED1_RELAY 1
  2865. #define LED1_MODE LED_MODE_RELAY
  2866. #define LED2_PIN 4 // 4 blue led
  2867. #define LED2_PIN_INVERSE 0
  2868. #define LED2_RELAY 1
  2869. #define LED2_MODE LED_MODE_FINDME_WIFI
  2870. // -----------------------------------------------------------------------------
  2871. // TEST boards (do not use!!)
  2872. // -----------------------------------------------------------------------------
  2873. #elif defined(TRAVIS01)
  2874. // Info
  2875. #define MANUFACTURER "TravisCI"
  2876. #define DEVICE "Virtual board 01"
  2877. // Some buttons - pin 0
  2878. #define BUTTON1_PIN 0
  2879. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2880. #define BUTTON1_RELAY 1
  2881. // Some relays - pin 1
  2882. #define RELAY1_PIN 1
  2883. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2884. // Some LEDs - pin 2
  2885. #define LED1_PIN 2
  2886. #define LED1_PIN_INVERSE 1
  2887. // A bit of I2C - pins 3,4
  2888. #define I2C_SDA_PIN 3
  2889. #define I2C_SCL_PIN 4
  2890. // And, as they say in "From Dusk till Dawn":
  2891. // This is a sensor blow out!
  2892. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  2893. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  2894. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  2895. // C'mon, you want sensor, come on in sensor lovers!
  2896. // If we don’t got it, you don't want it!
  2897. #define AM2320_SUPPORT 1
  2898. #define BH1750_SUPPORT 1
  2899. #define BMP180_SUPPORT 1
  2900. #define BMX280_SUPPORT 1
  2901. #define SHT3X_I2C_SUPPORT 1
  2902. #define EMON_ADC121_SUPPORT 1
  2903. #define EMON_ADS1X15_SUPPORT 1
  2904. #define SHT3X_I2C_SUPPORT 1
  2905. #define SI7021_SUPPORT 1
  2906. #define PMSX003_SUPPORT 1
  2907. #define SENSEAIR_SUPPORT 1
  2908. #define VL53L1X_SUPPORT 1
  2909. #define MAX6675_SUPPORT 1
  2910. // A bit of lights - pin 5
  2911. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2912. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2913. #define DUMMY_RELAY_COUNT 1
  2914. #define LIGHT_CHANNELS 1
  2915. #define LIGHT_CH1_PIN 5
  2916. #define LIGHT_CH1_INVERSE 0
  2917. #define ENCODER_SUPPORT 1
  2918. // A bit of HLW8012 - pins 6,7,8
  2919. #ifndef HLW8012_SUPPORT
  2920. #define HLW8012_SUPPORT 1
  2921. #endif
  2922. #define HLW8012_SEL_PIN 6
  2923. #define HLW8012_CF1_PIN 7
  2924. #define HLW8012_CF_PIN 8
  2925. // A bit of Dallas - pin 9
  2926. #ifndef DALLAS_SUPPORT
  2927. #define DALLAS_SUPPORT 1
  2928. #endif
  2929. #define DALLAS_PIN 9
  2930. // A bit of ECH1560 - pins 10,11, 12
  2931. #ifndef ECH1560_SUPPORT
  2932. #define ECH1560_SUPPORT 1
  2933. #endif
  2934. #define ECH1560_CLK_PIN 10
  2935. #define ECH1560_MISO_PIN 11
  2936. #define ECH1560_INVERTED 12
  2937. // MICS-2710 & MICS-5525 test
  2938. #define MICS2710_SUPPORT 1
  2939. #define MICS5525_SUPPORT 1
  2940. // MAX6675 14 11 10
  2941. #ifndef MAX6675_SUPPORT
  2942. #define MAX6675_SUPPORT 1
  2943. #endif
  2944. #define MAX6675_CS_PIN 14
  2945. #define MAX6675_SO_PIN 11
  2946. #define MAX6675_SCK_PIN 10
  2947. #elif defined(TRAVIS02)
  2948. // Relay provider dual
  2949. #define MANUFACTURER "TravisCI"
  2950. #define DEVICE "Virtual board 02"
  2951. // Some buttons - pin 0
  2952. #define BUTTON1_PIN 0
  2953. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2954. #define BUTTON1_RELAY 1
  2955. // A bit of CSE7766 - pin 1
  2956. #ifndef CSE7766_SUPPORT
  2957. #define CSE7766_SUPPORT 1
  2958. #endif
  2959. #define CSE7766_PIN 1
  2960. // Relay type dual - pins 2,3
  2961. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  2962. #define RELAY1_PIN 2
  2963. #define RELAY2_PIN 3
  2964. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2965. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2966. // IR - pin 4
  2967. #define IR_SUPPORT 1
  2968. #define IR_RX_PIN 4
  2969. #define IR_BUTTON_SET 1
  2970. // A bit of DHT - pin 5
  2971. #ifndef DHT_SUPPORT
  2972. #define DHT_SUPPORT 1
  2973. #endif
  2974. #define DHT_PIN 5
  2975. // A bit of TMP3X (analog)
  2976. #define TMP3X_SUPPORT 1
  2977. // A bit of EVENTS - pin 10
  2978. #define EVENTS_SUPPORT 1
  2979. #define EVENTS_PIN 6
  2980. // Sonar
  2981. #define SONAR_SUPPORT 1
  2982. #define SONAR_TRIGGER 7
  2983. #define SONAR_ECHO 8
  2984. // MHZ19
  2985. #define MHZ19_SUPPORT 1
  2986. #define MHZ19_RX_PIN 9
  2987. #define MHZ19_TX_PIN 10
  2988. // PZEM004T
  2989. #define PZEM004T_SUPPORT 1
  2990. #define PZEM004T_RX_PIN 11
  2991. #define PZEM004T_TX_PIN 12
  2992. // V9261F
  2993. #define V9261F_SUPPORT 1
  2994. #define V9261F_PIN 13
  2995. // GUVAS12SD
  2996. #define GUVAS12SD_SUPPORT 1
  2997. #define GUVAS12SD_PIN 14
  2998. // Test non-default modules
  2999. #define MDNS_CLIENT_SUPPORT 1
  3000. #define NOFUSS_SUPPORT 1
  3001. #define UART_MQTT_SUPPORT 1
  3002. #define INFLUXDB_SUPPORT 1
  3003. #define IR_SUPPORT 1
  3004. #define RF_SUPPORT 1
  3005. #define RFB_DIRECT 1
  3006. #define RFB_RX_PIN 4
  3007. #elif defined(TRAVIS03)
  3008. // Relay provider light/my92XX
  3009. #define MANUFACTURER "TravisCI"
  3010. #define DEVICE "Virtual board 03"
  3011. // Some buttons - pin 0
  3012. #define BUTTON1_PIN 0
  3013. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3014. #define BUTTON1_RELAY 1
  3015. // MY9231 Light - pins 1,2
  3016. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3017. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  3018. #define DUMMY_RELAY_COUNT 1
  3019. #define LIGHT_CHANNELS 5
  3020. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  3021. #define MY92XX_CHIPS 2
  3022. #define MY92XX_DI_PIN 1
  3023. #define MY92XX_DCKI_PIN 2
  3024. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  3025. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  3026. // A bit of analog,
  3027. // will not work on real life since they all share GPIO
  3028. // but it's OK to test build
  3029. #define EMON_ANALOG_SUPPORT 1
  3030. #define NTC_SUPPORT 1
  3031. #define LDR_SUPPORT 1
  3032. #define PULSEMETER_SUPPORT 1
  3033. // Test non-default modules
  3034. #define LLMNR_SUPPORT 1
  3035. #define NETBIOS_SUPPORT 1
  3036. #define SSDP_SUPPORT 1
  3037. #define RF_SUPPORT 1
  3038. #endif
  3039. // -----------------------------------------------------------------------------
  3040. // Check definitions
  3041. // -----------------------------------------------------------------------------
  3042. #if not defined(MANUFACTURER) || not defined(DEVICE)
  3043. #error "UNSUPPORTED HARDWARE!!"
  3044. #endif