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.

3827 lines
122 KiB

7 years ago
7 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. // -----------------------------------------------------------------------------
  2. // Configuration HELP
  3. // -----------------------------------------------------------------------------
  4. //
  5. // MANUFACTURER: Name of the manufacturer of the board ("string")
  6. // DEVICE: Name of the device ("string")
  7. // BUTTON#_PIN: GPIO for the n-th button (1-based, up to 4 buttons)
  8. // BUTTON#_RELAY: Relay number that will be bind to the n-th button (1-based)
  9. // BUTTON#_MODE: A mask of options (BUTTON_PUSHBUTTON and BUTTON_SWITCH cannot be together)
  10. // - BUTTON_PUSHBUTTON: button event is fired when released
  11. // - BUTTON_SWITCH: button event is fired when pressed or released
  12. // - BUTTON_DEFAULT_HIGH: there is a pull up in place
  13. // - BUTTON_SET_PULLUP: set pullup by software
  14. // RELAY#_PIN: GPIO for the n-th relay (1-based, up to 8 relays)
  15. // RELAY#_TYPE: Relay can be RELAY_TYPE_NORMAL, RELAY_TYPE_INVERSE, RELAY_TYPE_LATCHED or RELAY_TYPE_LATCHED_INVERSE
  16. // LED#_PIN: GPIO for the n-th LED (1-based, up to 8 LEDs)
  17. // LED#_PIN_INVERSE: LED has inversed logic (lit when pulled down)
  18. // LED#_MODE: Check types.h for LED_MODE_%
  19. // LED#_RELAY: Linked relay (1-based)
  20. //
  21. // Besides, other hardware specific information should be stated here
  22. // -----------------------------------------------------------------------------
  23. // ESPurna Core
  24. // -----------------------------------------------------------------------------
  25. #if defined(ESPURNA_CORE)
  26. // This is a special device targeted to generate a light-weight binary image
  27. // meant to be able to do two-step-updates:
  28. // https://github.com/xoseperez/espurna/wiki/TwoStepUpdates
  29. // Info
  30. #define MANUFACTURER "ESPRESSIF"
  31. #define DEVICE "ESPURNA_CORE"
  32. // Disable non-core modules
  33. #define ALEXA_SUPPORT 0
  34. #define 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 1
  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 1
  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 1
  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. // -----------------------------------------------------------------------------
  1017. // HUACANXING H801 & H802
  1018. // -----------------------------------------------------------------------------
  1019. #elif defined(HUACANXING_H801)
  1020. // Info
  1021. #define MANUFACTURER "HUACANXING"
  1022. #define DEVICE "H801"
  1023. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1024. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1025. #define DUMMY_RELAY_COUNT 1
  1026. #define DEBUG_PORT Serial1
  1027. #define SERIAL_RX_ENABLED 1
  1028. // LEDs
  1029. #define LED1_PIN 5
  1030. #define LED1_PIN_INVERSE 1
  1031. // Light
  1032. #define LIGHT_CHANNELS 5
  1033. #define LIGHT_CH1_PIN 15 // RED
  1034. #define LIGHT_CH2_PIN 13 // GREEN
  1035. #define LIGHT_CH3_PIN 12 // BLUE
  1036. #define LIGHT_CH4_PIN 14 // WHITE1
  1037. #define LIGHT_CH5_PIN 4 // WHITE2
  1038. #define LIGHT_CH1_INVERSE 0
  1039. #define LIGHT_CH2_INVERSE 0
  1040. #define LIGHT_CH3_INVERSE 0
  1041. #define LIGHT_CH4_INVERSE 0
  1042. #define LIGHT_CH5_INVERSE 0
  1043. #elif defined(HUACANXING_H802)
  1044. // Info
  1045. #define MANUFACTURER "HUACANXING"
  1046. #define DEVICE "H802"
  1047. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1048. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1049. #define DUMMY_RELAY_COUNT 1
  1050. #define DEBUG_PORT Serial1
  1051. #define SERIAL_RX_ENABLED 1
  1052. // Light
  1053. #define LIGHT_CHANNELS 4
  1054. #define LIGHT_CH1_PIN 12 // RED
  1055. #define LIGHT_CH2_PIN 14 // GREEN
  1056. #define LIGHT_CH3_PIN 13 // BLUE
  1057. #define LIGHT_CH4_PIN 15 // WHITE
  1058. #define LIGHT_CH1_INVERSE 0
  1059. #define LIGHT_CH2_INVERSE 0
  1060. #define LIGHT_CH3_INVERSE 0
  1061. #define LIGHT_CH4_INVERSE 0
  1062. // -----------------------------------------------------------------------------
  1063. // Jan Goedeke Wifi Relay
  1064. // https://github.com/JanGoe/esp8266-wifi-relay
  1065. // -----------------------------------------------------------------------------
  1066. #elif defined(JANGOE_WIFI_RELAY_NC)
  1067. // Info
  1068. #define MANUFACTURER "JANGOE"
  1069. #define DEVICE "WIFI_RELAY_NC"
  1070. // Buttons
  1071. #define BUTTON1_PIN 12
  1072. #define BUTTON2_PIN 13
  1073. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1074. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1075. #define BUTTON1_RELAY 1
  1076. #define BUTTON2_RELAY 2
  1077. // Relays
  1078. #define RELAY1_PIN 2
  1079. #define RELAY2_PIN 14
  1080. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1081. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1082. #elif defined(JANGOE_WIFI_RELAY_NO)
  1083. // Info
  1084. #define MANUFACTURER "JANGOE"
  1085. #define DEVICE "WIFI_RELAY_NO"
  1086. // Buttons
  1087. #define BUTTON1_PIN 12
  1088. #define BUTTON2_PIN 13
  1089. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1090. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1091. #define BUTTON1_RELAY 1
  1092. #define BUTTON2_RELAY 2
  1093. // Relays
  1094. #define RELAY1_PIN 2
  1095. #define RELAY2_PIN 14
  1096. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1097. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1098. // -----------------------------------------------------------------------------
  1099. // Jorge García Wifi+Relays Board Kit
  1100. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  1101. // https://github.com/jorgegarciadev/wifikit
  1102. // -----------------------------------------------------------------------------
  1103. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  1104. // Info
  1105. #define MANUFACTURER "JORGEGARCIA"
  1106. #define DEVICE "WIFI_RELAYS"
  1107. // Relays
  1108. #define RELAY1_PIN 0
  1109. #define RELAY2_PIN 2
  1110. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1111. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1112. // -----------------------------------------------------------------------------
  1113. // WiFi MQTT Relay / Thermostat
  1114. // -----------------------------------------------------------------------------
  1115. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  1116. // Info
  1117. #define MANUFACTURER "OPENENERGYMONITOR"
  1118. #define DEVICE "MQTT_RELAY"
  1119. // Buttons
  1120. #define BUTTON1_PIN 0
  1121. #define BUTTON1_RELAY 1
  1122. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1123. // Relays
  1124. #define RELAY1_PIN 12
  1125. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1126. // LEDs
  1127. #define LED1_PIN 16
  1128. #define LED1_PIN_INVERSE 0
  1129. // -----------------------------------------------------------------------------
  1130. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  1131. // 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
  1132. // 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
  1133. // -----------------------------------------------------------------------------
  1134. #elif defined(WION_50055)
  1135. // Currently untested, does not support energy monitoring
  1136. // Info
  1137. #define MANUFACTURER "WION"
  1138. #define DEVICE "50055"
  1139. // Buttons
  1140. #define BUTTON1_PIN 13
  1141. #define BUTTON1_RELAY 1
  1142. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1143. // Relays
  1144. #define RELAY1_PIN 15
  1145. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1146. // LEDs
  1147. #define LED1_PIN 2
  1148. #define LED1_PIN_INVERSE 0
  1149. // -----------------------------------------------------------------------------
  1150. // EX-Store Wifi Relay v3.1
  1151. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  1152. // -----------------------------------------------------------------------------
  1153. #elif defined(EXS_WIFI_RELAY_V31)
  1154. // Untested
  1155. // Info
  1156. #define MANUFACTURER "EXS"
  1157. #define DEVICE "WIFI_RELAY_V31"
  1158. // Buttons
  1159. #define BUTTON1_PIN 0
  1160. #define BUTTON1_RELAY 1
  1161. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1162. // Relays
  1163. #define RELAY1_PIN 13
  1164. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1165. #define RELAY1_RESET_PIN 12
  1166. // -----------------------------------------------------------------------------
  1167. // EX-Store Wifi Relay v5.0
  1168. // -----------------------------------------------------------------------------
  1169. #elif defined(EXS_WIFI_RELAY_V50)
  1170. // Info
  1171. #define MANUFACTURER "EXS"
  1172. #define DEVICE "WIFI_RELAY_V50"
  1173. // Buttons
  1174. #define BUTTON1_PIN 5
  1175. #define BUTTON2_PIN 4
  1176. #define BUTTON1_RELAY 1
  1177. #define BUTTON2_RELAY 2
  1178. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1179. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1180. // Relays
  1181. #define RELAY1_PIN 14
  1182. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1183. #define RELAY1_RESET_PIN 16
  1184. #define RELAY2_PIN 13
  1185. #define RELAY2_TYPE RELAY_TYPE_LATCHED
  1186. #define RELAY2_RESET_PIN 12
  1187. // LEDs
  1188. #define LED1_PIN 15
  1189. #define LED1_PIN_INVERSE 0
  1190. // -----------------------------------------------------------------------------
  1191. // V9261F
  1192. // -----------------------------------------------------------------------------
  1193. #elif defined(GENERIC_V9261F)
  1194. // Info
  1195. #define MANUFACTURER "GENERIC"
  1196. #define DEVICE "V9261F"
  1197. #define ALEXA_SUPPORT 0
  1198. // V9261F
  1199. #define V9261F_SUPPORT 1
  1200. #define V9261F_PIN 2
  1201. #define V9261F_PIN_INVERSE 1
  1202. // -----------------------------------------------------------------------------
  1203. // ECH1560
  1204. // -----------------------------------------------------------------------------
  1205. #elif defined(GENERIC_ECH1560)
  1206. // Info
  1207. #define MANUFACTURER "GENERIC"
  1208. #define DEVICE "ECH1560"
  1209. #define ALEXA_SUPPORT 0
  1210. // ECH1560
  1211. #define ECH1560_SUPPORT 1
  1212. #define ECH1560_CLK_PIN 4
  1213. #define ECH1560_MISO_PIN 5
  1214. #define ECH1560_INVERTED 0
  1215. // -----------------------------------------------------------------------------
  1216. // ESPLive
  1217. // https://github.com/ManCaveMade/ESP-Live
  1218. // -----------------------------------------------------------------------------
  1219. #elif defined(MANCAVEMADE_ESPLIVE)
  1220. // Info
  1221. #define MANUFACTURER "MANCAVEMADE"
  1222. #define DEVICE "ESPLIVE"
  1223. // Buttons
  1224. #define BUTTON1_PIN 4
  1225. #define BUTTON2_PIN 5
  1226. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1227. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1228. #define BUTTON1_RELAY 1
  1229. #define BUTTON2_RELAY 2
  1230. // Relays
  1231. #define RELAY1_PIN 12
  1232. #define RELAY2_PIN 13
  1233. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1234. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1235. // DS18B20
  1236. #ifndef DALLAS_SUPPORT
  1237. #define DALLAS_SUPPORT 1
  1238. #endif
  1239. #define DALLAS_PIN 2
  1240. #define DALLAS_UPDATE_INTERVAL 5000
  1241. #define TEMPERATURE_MIN_CHANGE 1.0
  1242. // -----------------------------------------------------------------------------
  1243. // QuinLED
  1244. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  1245. // -----------------------------------------------------------------------------
  1246. #elif defined(INTERMITTECH_QUINLED)
  1247. // Info
  1248. #define MANUFACTURER "INTERMITTECH"
  1249. #define DEVICE "QUINLED"
  1250. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1251. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1252. #define DUMMY_RELAY_COUNT 1
  1253. // LEDs
  1254. #define LED1_PIN 5
  1255. #define LED1_PIN_INVERSE 1
  1256. // Light
  1257. #define LIGHT_CHANNELS 2
  1258. #define LIGHT_CH1_PIN 0
  1259. #define LIGHT_CH2_PIN 2
  1260. #define LIGHT_CH1_INVERSE 0
  1261. #define LIGHT_CH2_INVERSE 0
  1262. // -----------------------------------------------------------------------------
  1263. // Arilux AL-LC06
  1264. // -----------------------------------------------------------------------------
  1265. #elif defined(ARILUX_AL_LC01)
  1266. // Info
  1267. #define MANUFACTURER "ARILUX"
  1268. #define DEVICE "AL_LC01"
  1269. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1270. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1271. #define DUMMY_RELAY_COUNT 1
  1272. // Light
  1273. #define LIGHT_CHANNELS 3
  1274. #define LIGHT_CH1_PIN 5 // RED
  1275. #define LIGHT_CH2_PIN 12 // GREEN
  1276. #define LIGHT_CH3_PIN 13 // BLUE
  1277. #define LIGHT_CH1_INVERSE 0
  1278. #define LIGHT_CH2_INVERSE 0
  1279. #define LIGHT_CH3_INVERSE 0
  1280. #elif defined(ARILUX_AL_LC02)
  1281. // Info
  1282. #define MANUFACTURER "ARILUX"
  1283. #define DEVICE "AL_LC02"
  1284. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1285. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1286. #define DUMMY_RELAY_COUNT 1
  1287. // Light
  1288. #define LIGHT_CHANNELS 4
  1289. #define LIGHT_CH1_PIN 12 // RED
  1290. #define LIGHT_CH2_PIN 5 // GREEN
  1291. #define LIGHT_CH3_PIN 13 // BLUE
  1292. #define LIGHT_CH4_PIN 15 // WHITE1
  1293. #define LIGHT_CH1_INVERSE 0
  1294. #define LIGHT_CH2_INVERSE 0
  1295. #define LIGHT_CH3_INVERSE 0
  1296. #define LIGHT_CH4_INVERSE 0
  1297. #elif defined(ARILUX_AL_LC02_V14)
  1298. // Info
  1299. #define MANUFACTURER "ARILUX"
  1300. #define DEVICE "AL_LC02_V14"
  1301. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1302. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1303. #define DUMMY_RELAY_COUNT 1
  1304. // Light
  1305. #define LIGHT_CHANNELS 4
  1306. #define LIGHT_CH1_PIN 14 // RED
  1307. #define LIGHT_CH2_PIN 5 // GREEN
  1308. #define LIGHT_CH3_PIN 12 // BLUE
  1309. #define LIGHT_CH4_PIN 13 // WHITE1
  1310. #define LIGHT_CH1_INVERSE 0
  1311. #define LIGHT_CH2_INVERSE 0
  1312. #define LIGHT_CH3_INVERSE 0
  1313. #define LIGHT_CH4_INVERSE 0
  1314. #elif defined(ARILUX_AL_LC06)
  1315. // Info
  1316. #define MANUFACTURER "ARILUX"
  1317. #define DEVICE "AL_LC06"
  1318. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1319. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1320. #define DUMMY_RELAY_COUNT 1
  1321. // Buttons
  1322. #define BUTTON1_PIN 0
  1323. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1324. #define BUTTON1_RELAY 1
  1325. // Light
  1326. #define LIGHT_CHANNELS 5
  1327. #define LIGHT_CH1_PIN 14 // RED
  1328. #define LIGHT_CH2_PIN 12 // GREEN
  1329. #define LIGHT_CH3_PIN 13 // BLUE
  1330. #define LIGHT_CH4_PIN 15 // WHITE1
  1331. #define LIGHT_CH5_PIN 5 // WHITE2
  1332. #define LIGHT_CH1_INVERSE 0
  1333. #define LIGHT_CH2_INVERSE 0
  1334. #define LIGHT_CH3_INVERSE 0
  1335. #define LIGHT_CH4_INVERSE 0
  1336. #define LIGHT_CH5_INVERSE 0
  1337. #elif defined(ARILUX_AL_LC11)
  1338. // Info
  1339. #define MANUFACTURER "ARILUX"
  1340. #define DEVICE "AL_LC11"
  1341. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1342. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1343. #define DUMMY_RELAY_COUNT 1
  1344. // Light
  1345. #define LIGHT_CHANNELS 5
  1346. #define LIGHT_CH1_PIN 5 // RED
  1347. #define LIGHT_CH2_PIN 4 // GREEN
  1348. #define LIGHT_CH3_PIN 14 // BLUE
  1349. #define LIGHT_CH4_PIN 13 // WHITE1
  1350. #define LIGHT_CH5_PIN 12 // WHITE1
  1351. #define LIGHT_CH1_INVERSE 0
  1352. #define LIGHT_CH2_INVERSE 0
  1353. #define LIGHT_CH3_INVERSE 0
  1354. #define LIGHT_CH4_INVERSE 0
  1355. #define LIGHT_CH5_INVERSE 0
  1356. #elif defined(ARILUX_E27)
  1357. // Info
  1358. #define MANUFACTURER "ARILUX"
  1359. #define DEVICE "E27"
  1360. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1361. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1362. #define DUMMY_RELAY_COUNT 1
  1363. // Light
  1364. #define LIGHT_CHANNELS 4
  1365. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  1366. #define MY92XX_CHIPS 1
  1367. #define MY92XX_DI_PIN 13
  1368. #define MY92XX_DCKI_PIN 15
  1369. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1370. #define MY92XX_MAPPING 0, 1, 2, 3
  1371. // -----------------------------------------------------------------------------
  1372. // XENON SM-PW701U
  1373. // -----------------------------------------------------------------------------
  1374. #elif defined(XENON_SM_PW702U)
  1375. // Info
  1376. #define MANUFACTURER "XENON"
  1377. #define DEVICE "SM_PW702U"
  1378. // Buttons
  1379. #define BUTTON1_PIN 13
  1380. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1381. #define BUTTON1_RELAY 1
  1382. // Relays
  1383. #define RELAY1_PIN 12
  1384. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1385. // LEDs
  1386. #define LED1_PIN 4
  1387. #define LED1_PIN_INVERSE 1
  1388. // -----------------------------------------------------------------------------
  1389. // AUTHOMETION LYT8266
  1390. // https://authometion.com/shop/en/home/13-lyt8266.html
  1391. // -----------------------------------------------------------------------------
  1392. #elif defined(AUTHOMETION_LYT8266)
  1393. // Info
  1394. #define MANUFACTURER "AUTHOMETION"
  1395. #define DEVICE "LYT8266"
  1396. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1397. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1398. #define DUMMY_RELAY_COUNT 1
  1399. // Light
  1400. #define LIGHT_CHANNELS 4
  1401. #define LIGHT_CH1_PIN 13 // RED
  1402. #define LIGHT_CH2_PIN 12 // GREEN
  1403. #define LIGHT_CH3_PIN 14 // BLUE
  1404. #define LIGHT_CH4_PIN 2 // WHITE
  1405. #define LIGHT_CH1_INVERSE 0
  1406. #define LIGHT_CH2_INVERSE 0
  1407. #define LIGHT_CH3_INVERSE 0
  1408. #define LIGHT_CH4_INVERSE 0
  1409. #define LIGHT_ENABLE_PIN 15
  1410. #elif defined(GIZWITS_WITTY_CLOUD)
  1411. // Info
  1412. #define MANUFACTURER "GIZWITS"
  1413. #define DEVICE "WITTY_CLOUD"
  1414. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1415. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1416. #define DUMMY_RELAY_COUNT 1
  1417. // Buttons
  1418. #define BUTTON1_PIN 4
  1419. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1420. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  1421. #define BUTTON1_CLICK BUTTON_MODE_NONE
  1422. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1423. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1424. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  1425. #define ANALOG_SUPPORT 1
  1426. // LEDs
  1427. #define LED1_PIN 2 // BLUE build-in
  1428. #define LED1_PIN_INVERSE 1
  1429. // Light
  1430. #define LIGHT_CHANNELS 3
  1431. #define LIGHT_CH1_PIN 15 // RED
  1432. #define LIGHT_CH2_PIN 12 // GREEN
  1433. #define LIGHT_CH3_PIN 13 // BLUE
  1434. #define LIGHT_CH1_INVERSE 0
  1435. #define LIGHT_CH2_INVERSE 0
  1436. #define LIGHT_CH3_INVERSE 0
  1437. // -----------------------------------------------------------------------------
  1438. // KMC 70011
  1439. // https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
  1440. // -----------------------------------------------------------------------------
  1441. #elif defined(KMC_70011)
  1442. // Info
  1443. #define MANUFACTURER "KMC"
  1444. #define DEVICE "70011"
  1445. // Buttons
  1446. #define BUTTON1_PIN 0
  1447. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1448. #define BUTTON1_RELAY 1
  1449. // Relays
  1450. #define RELAY1_PIN 14
  1451. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1452. // LEDs
  1453. #define LED1_PIN 13
  1454. #define LED1_PIN_INVERSE 1
  1455. // HLW8012
  1456. #ifndef HLW8012_SUPPORT
  1457. #define HLW8012_SUPPORT 1
  1458. #endif
  1459. #define HLW8012_SEL_PIN 12
  1460. #define HLW8012_CF1_PIN 5
  1461. #define HLW8012_CF_PIN 4
  1462. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1463. // -----------------------------------------------------------------------------
  1464. // Euromate (?) Wifi Stecker Schuko
  1465. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  1466. // Thanks to @Geitde
  1467. // -----------------------------------------------------------------------------
  1468. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  1469. // Info
  1470. #define MANUFACTURER "EUROMATE"
  1471. #define DEVICE "WIFI_STECKER_SCHUKO"
  1472. // Buttons
  1473. #define BUTTON1_PIN 14
  1474. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1475. #define BUTTON1_RELAY 1
  1476. // The relay in the device is not a bistable (latched) relay.
  1477. // The device is reported to have a flip-flop circuit to drive the relay
  1478. // So @Geitde hack is still the only possible
  1479. // Hack: drive GPIO12 low and use GPIO5 as normal relay pin:
  1480. #define RELAY1_PIN 5
  1481. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1482. #define LED2_PIN 12 /* DUMMY: exploit default off state for GPIO12=low */
  1483. #define LED2_PIN_INVERSE 0
  1484. // LEDs
  1485. #define LED1_PIN 4
  1486. #define LED1_PIN_INVERSE 0
  1487. // -----------------------------------------------------------------------------
  1488. // Euromate (?) Wifi Stecker Schuko Version 2
  1489. // This configuration is for the second generation of devices sold by OBI.
  1490. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko-weiss/p/4077806
  1491. // -----------------------------------------------------------------------------
  1492. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO_V2)
  1493. // Info
  1494. #define MANUFACTURER "EUROMATE"
  1495. #define DEVICE "WIFI_STECKER_SCHUKO_V2"
  1496. // Buttons
  1497. #define BUTTON1_PIN 5
  1498. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1499. #define BUTTON1_RELAY 1
  1500. // Relays
  1501. #define RELAY1_PIN 4
  1502. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1503. // Green
  1504. #define LED1_PIN 12
  1505. #define LED1_MODE LED_MODE_WIFI
  1506. #define LED1_PIN_INVERSE 0
  1507. // Red
  1508. #define LED2_PIN 13
  1509. #define LED2_MODE LED_MODE_RELAY
  1510. #define LED2_PIN_INVERSE 0
  1511. // -----------------------------------------------------------------------------
  1512. // Generic 8CH
  1513. // -----------------------------------------------------------------------------
  1514. #elif defined(GENERIC_8CH)
  1515. // Info
  1516. #define MANUFACTURER "GENERIC"
  1517. #define DEVICE "8CH"
  1518. // Relays
  1519. #define RELAY1_PIN 0
  1520. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1521. #define RELAY2_PIN 2
  1522. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1523. #define RELAY3_PIN 4
  1524. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1525. #define RELAY4_PIN 5
  1526. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1527. #define RELAY5_PIN 12
  1528. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1529. #define RELAY6_PIN 13
  1530. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  1531. #define RELAY7_PIN 14
  1532. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  1533. #define RELAY8_PIN 15
  1534. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  1535. // -----------------------------------------------------------------------------
  1536. // STM RELAY
  1537. // -----------------------------------------------------------------------------
  1538. #elif defined(STM_RELAY)
  1539. // Info
  1540. #define MANUFACTURER "STM_RELAY"
  1541. #define DEVICE "2CH"
  1542. // Relays
  1543. #define DUMMY_RELAY_COUNT 2
  1544. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  1545. // Remove UART noise on serial line
  1546. #define DEBUG_SERIAL_SUPPORT 0
  1547. // -----------------------------------------------------------------------------
  1548. // Tonbux Powerstrip02
  1549. // -----------------------------------------------------------------------------
  1550. #elif defined(TONBUX_POWERSTRIP02)
  1551. // Info
  1552. #define MANUFACTURER "TONBUX"
  1553. #define DEVICE "POWERSTRIP02"
  1554. // Buttons
  1555. #define BUTTON1_PIN 5
  1556. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1557. #define BUTTON1_RELAY 0
  1558. // Relays
  1559. #define RELAY1_PIN 4
  1560. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1561. #define RELAY2_PIN 13
  1562. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1563. #define RELAY3_PIN 12
  1564. #define RELAY3_TYPE RELAY_TYPE_INVERSE
  1565. #define RELAY4_PIN 14
  1566. #define RELAY4_TYPE RELAY_TYPE_INVERSE
  1567. // Not a relay. USB ports on/off
  1568. #define RELAY5_PIN 16
  1569. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1570. // LEDs
  1571. #define LED1_PIN 0 // 1 blue led
  1572. #define LED1_PIN_INVERSE 1
  1573. #define LED2_PIN 3 // 3 red leds
  1574. #define LED2_PIN_INVERSE 1
  1575. // -----------------------------------------------------------------------------
  1576. // Lingan SWA1
  1577. // -----------------------------------------------------------------------------
  1578. #elif defined(LINGAN_SWA1)
  1579. // Info
  1580. #define MANUFACTURER "LINGAN"
  1581. #define DEVICE "SWA1"
  1582. // Buttons
  1583. #define BUTTON1_PIN 13
  1584. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1585. #define BUTTON1_RELAY 1
  1586. // Relays
  1587. #define RELAY1_PIN 5
  1588. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1589. // LEDs
  1590. #define LED1_PIN 4
  1591. #define LED1_PIN_INVERSE 1
  1592. // -----------------------------------------------------------------------------
  1593. // HEYGO HY02
  1594. // -----------------------------------------------------------------------------
  1595. #elif defined(HEYGO_HY02)
  1596. // Info
  1597. #define MANUFACTURER "HEYGO"
  1598. #define DEVICE "HY02"
  1599. // Buttons
  1600. #define BUTTON1_PIN 13
  1601. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1602. #define BUTTON1_RELAY 1
  1603. // Relays
  1604. #define RELAY1_PIN 12
  1605. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1606. // LEDs
  1607. #define LED1_PIN 4
  1608. #define LED1_PIN_INVERSE 0
  1609. // -----------------------------------------------------------------------------
  1610. // Maxcio W-US002S
  1611. // -----------------------------------------------------------------------------
  1612. #elif defined(MAXCIO_WUS002S)
  1613. // Info
  1614. #define MANUFACTURER "MAXCIO"
  1615. #define DEVICE "WUS002S"
  1616. // Buttons
  1617. #define BUTTON1_PIN 2
  1618. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1619. #define BUTTON1_RELAY 1
  1620. // Relays
  1621. #define RELAY1_PIN 13
  1622. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1623. // LEDs
  1624. #define LED1_PIN 3
  1625. #define LED1_PIN_INVERSE 0
  1626. // HLW8012
  1627. #ifndef HLW8012_SUPPORT
  1628. #define HLW8012_SUPPORT 1
  1629. #endif
  1630. #define HLW8012_SEL_PIN 12
  1631. #define HLW8012_CF1_PIN 5
  1632. #define HLW8012_CF_PIN 4
  1633. #define HLW8012_CURRENT_R 0.002 // Current resistor
  1634. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1635. // LED1 on RX pin
  1636. #define DEBUG_SERIAL_SUPPORT 1
  1637. // -----------------------------------------------------------------------------
  1638. // Maxcio W-DE004
  1639. // -----------------------------------------------------------------------------
  1640. #elif defined(MAXCIO_WDE004)
  1641. // Info
  1642. #define MANUFACTURER "MAXCIO"
  1643. #define DEVICE "WDE004"
  1644. // Buttons
  1645. #define BUTTON1_PIN 1
  1646. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1647. #define BUTTON1_RELAY 1
  1648. // Relays
  1649. #define RELAY1_PIN 14
  1650. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1651. // LEDs
  1652. #define LED1_PIN 13
  1653. #define LED1_PIN_INVERSE 1
  1654. // -----------------------------------------------------------------------------
  1655. // Oukitel P1 Smart Plug
  1656. // 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
  1657. // -----------------------------------------------------------------------------
  1658. #elif defined(OUKITEL_P1)
  1659. // Info
  1660. #define MANUFACTURER "Oukitel"
  1661. #define DEVICE "P1"
  1662. // Buttons
  1663. #define BUTTON1_PIN 13
  1664. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1665. #define BUTTON1_RELAY 1
  1666. // Relays
  1667. // Right
  1668. #define RELAY1_PIN 12
  1669. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1670. // Left
  1671. #define RELAY2_PIN 15
  1672. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1673. // LEDs
  1674. #define LED1_PIN 0 // blue
  1675. #define LED1_PIN_INVERSE 1
  1676. #define LED1_MODE LED_MODE_WIFI
  1677. // -----------------------------------------------------------------------------
  1678. // YiDian XS-SSA05
  1679. // -----------------------------------------------------------------------------
  1680. #elif defined(YIDIAN_XSSSA05)
  1681. // Info
  1682. #define MANUFACTURER "YIDIAN"
  1683. #define DEVICE "XSSSA05"
  1684. // Buttons
  1685. #define BUTTON1_PIN 13
  1686. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1687. #define BUTTON1_RELAY 1
  1688. // Relays
  1689. #define RELAY1_PIN 12
  1690. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1691. // LEDs
  1692. #define LED1_PIN 0 // red
  1693. #define LED1_PIN_INVERSE 1
  1694. #define LED1_MODE LED_MODE_WIFI
  1695. #define LED2_PIN 15 // blue
  1696. #define LED2_PIN_INVERSE 1
  1697. #define LED2_MODE LED_MODE_RELAY
  1698. // HLW8012
  1699. #ifndef HLW8012_SUPPORT
  1700. #define HLW8012_SUPPORT 1
  1701. #endif
  1702. #define HLW8012_SEL_PIN 3
  1703. #define HLW8012_CF1_PIN 14
  1704. #define HLW8012_CF_PIN 5
  1705. #define HLW8012_SEL_CURRENT LOW
  1706. #define HLW8012_CURRENT_RATIO 25740
  1707. #define HLW8012_VOLTAGE_RATIO 313400
  1708. #define HLW8012_POWER_RATIO 3414290
  1709. #define HLW8012_INTERRUPT_ON FALLING
  1710. // -----------------------------------------------------------------------------
  1711. // TONBUX XS-SSA01
  1712. // -----------------------------------------------------------------------------
  1713. #elif defined(TONBUX_XSSSA01)
  1714. // Info
  1715. #define MANUFACTURER "TONBUX"
  1716. #define DEVICE "XSSSA01"
  1717. // Buttons
  1718. #define BUTTON1_PIN 4
  1719. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1720. #define BUTTON1_RELAY 1
  1721. // Relays
  1722. #define RELAY1_PIN 14
  1723. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1724. // LEDs
  1725. #define LED1_PIN 13
  1726. #define LED1_PIN_INVERSE 0
  1727. // -----------------------------------------------------------------------------
  1728. // TONBUX XS-SSA06
  1729. // -----------------------------------------------------------------------------
  1730. #elif defined(TONBUX_XSSSA06)
  1731. // Info
  1732. #define MANUFACTURER "TONBUX"
  1733. #define DEVICE "XSSSA06"
  1734. // Buttons
  1735. #define BUTTON1_PIN 13
  1736. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1737. #define BUTTON1_RELAY 1
  1738. // Relays
  1739. #define RELAY1_PIN 15
  1740. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1741. // LEDs
  1742. #define LED1_PIN 0 // R - 8 rgb led ring
  1743. #define LED1_PIN_INVERSE 0
  1744. #define LED2_PIN 5 // G
  1745. #define LED2_PIN_INVERSE 0
  1746. #define LED3_PIN 2 // B
  1747. #define LED3_PIN_INVERSE 0
  1748. // -----------------------------------------------------------------------------
  1749. // GREEN ESP8266 RELAY MODULE
  1750. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1751. // -----------------------------------------------------------------------------
  1752. #elif defined(GREEN_ESP8266RELAY)
  1753. // Info
  1754. #define MANUFACTURER "GREEN"
  1755. #define DEVICE "ESP8266RELAY"
  1756. // Buttons
  1757. // Not a button but input via Optocoupler
  1758. #define BUTTON1_PIN 5
  1759. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1760. #define BUTTON1_RELAY 1
  1761. // Relays
  1762. #define RELAY1_PIN 4
  1763. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1764. // LEDs
  1765. #define LED1_PIN 2
  1766. #define LED1_PIN_INVERSE 1
  1767. // -----------------------------------------------------------------------------
  1768. // Henrique Gravina ESPIKE
  1769. // https://github.com/Henriquegravina/Espike
  1770. // -----------------------------------------------------------------------------
  1771. #elif defined(IKE_ESPIKE)
  1772. #define MANUFACTURER "IKE"
  1773. #define DEVICE "ESPIKE"
  1774. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1775. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1776. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1777. #define BUTTON1_PIN 13
  1778. #define BUTTON1_RELAY 1
  1779. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1780. #define BUTTON2_PIN 12
  1781. #define BUTTON2_RELAY 2
  1782. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1783. #define BUTTON3_PIN 14
  1784. #define BUTTON3_RELAY 3
  1785. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1786. #define RELAY1_PIN 4
  1787. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1788. #define RELAY2_PIN 5
  1789. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1790. #define RELAY3_PIN 16
  1791. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1792. #define LED1_PIN 2
  1793. #define LED1_PIN_INVERSE 1
  1794. // -----------------------------------------------------------------------------
  1795. // SWIFITCH
  1796. // https://github.com/ArnieX/swifitch
  1797. // -----------------------------------------------------------------------------
  1798. #elif defined(ARNIEX_SWIFITCH)
  1799. // Info
  1800. #define MANUFACTURER "ARNIEX"
  1801. #define DEVICE "SWIFITCH"
  1802. // Buttons
  1803. #define BUTTON1_PIN 4 // D2
  1804. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1805. #define BUTTON1_RELAY 1
  1806. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1807. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1808. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1809. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1810. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1811. // Relays
  1812. #define RELAY1_PIN 5 // D1
  1813. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1814. // LEDs
  1815. #define LED1_PIN 12 // D6
  1816. #define LED1_PIN_INVERSE 1
  1817. // -----------------------------------------------------------------------------
  1818. // ESP-01S RELAY v4.0
  1819. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  1820. // -----------------------------------------------------------------------------
  1821. #elif defined(GENERIC_ESP01S_RELAY_V40)
  1822. // Info
  1823. #define MANUFACTURER "GENERIC"
  1824. #define DEVICE "ESP01S_RELAY_40"
  1825. // Relays
  1826. #define RELAY1_PIN 0
  1827. #ifndef RELAY1_TYPE
  1828. #define RELAY1_TYPE RELAY_TYPE_NORMAL // See #1504 and #1554
  1829. #endif
  1830. // LEDs
  1831. #define LED1_PIN 2
  1832. #define LED1_PIN_INVERSE 0
  1833. // -----------------------------------------------------------------------------
  1834. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  1835. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  1836. // -----------------------------------------------------------------------------
  1837. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  1838. // Info
  1839. #define MANUFACTURER "GENERIC"
  1840. #define DEVICE "ESP01S_RGBLED_10"
  1841. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  1842. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  1843. // Buttons
  1844. //#define BUTTON1_PIN 2
  1845. // Relays
  1846. //#define RELAY1_PIN 2
  1847. // LEDs
  1848. #define LED1_PIN 2
  1849. #define LED1_PIN_INVERSE 0
  1850. // -----------------------------------------------------------------------------
  1851. // ESP-01S DHT11 v1.0
  1852. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  1853. // -----------------------------------------------------------------------------
  1854. #elif defined(GENERIC_ESP01S_DHT11_V10)
  1855. // Info
  1856. #define MANUFACTURER "GENERIC"
  1857. #define DEVICE "ESP01S_DHT11_10"
  1858. // DHT11
  1859. #ifndef DHT_SUPPORT
  1860. #define DHT_SUPPORT 1
  1861. #endif
  1862. #define DHT_PIN 2
  1863. #define DHT_TYPE DHT_CHIP_DHT11
  1864. // -----------------------------------------------------------------------------
  1865. // ESP-01S DS18B20 v1.0
  1866. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  1867. // -----------------------------------------------------------------------------
  1868. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  1869. // Info
  1870. #define MANUFACTURER "GENERIC"
  1871. #define DEVICE "ESP01S_DS18B20_10"
  1872. // DB18B20
  1873. #ifndef DALLAS_SUPPORT
  1874. #define DALLAS_SUPPORT 1
  1875. #endif
  1876. #define DALLAS_PIN 2
  1877. // -----------------------------------------------------------------------------
  1878. // ESP-DIN relay board V1
  1879. // https://github.com/pilotak/esp_din
  1880. // -----------------------------------------------------------------------------
  1881. #elif defined(PILOTAK_ESP_DIN_V1)
  1882. // Info
  1883. #define MANUFACTURER "PILOTAK"
  1884. #define DEVICE "ESP_DIN_V1"
  1885. // Buttons
  1886. #define BUTTON1_PIN 0
  1887. #define BUTTON1_RELAY 1
  1888. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1889. // Relays
  1890. #define RELAY1_PIN 4
  1891. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1892. #define RELAY2_PIN 5
  1893. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1894. // LEDs
  1895. #define LED1_PIN 15
  1896. #define LED1_PIN_INVERSE 0
  1897. #define I2C_SDA_PIN 12
  1898. #define I2C_SCL_PIN 13
  1899. #ifndef DALLAS_SUPPORT
  1900. #define DALLAS_SUPPORT 1
  1901. #endif
  1902. #define DALLAS_PIN 2
  1903. #define RF_SUPPORT 1
  1904. #define RFB_DIRECT 1
  1905. #define RFB_RX_PIN 14
  1906. #ifndef DIGITAL_SUPPORT
  1907. #define DIGITAL_SUPPORT 1
  1908. #endif
  1909. #define DIGITAL_PIN 16
  1910. #define DIGITAL_PIN_MODE INPUT
  1911. // -----------------------------------------------------------------------------
  1912. // Heltec Touch Relay
  1913. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  1914. // -----------------------------------------------------------------------------
  1915. #elif defined(HELTEC_TOUCHRELAY)
  1916. // Info
  1917. #define MANUFACTURER "HELTEC"
  1918. #define DEVICE "TOUCH_RELAY"
  1919. // Buttons
  1920. #define BUTTON1_PIN 14
  1921. #define BUTTON1_RELAY 1
  1922. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1923. // Relays
  1924. #define RELAY1_PIN 12
  1925. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1926. // -----------------------------------------------------------------------------
  1927. // Zhilde ZLD-EU44-W
  1928. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  1929. // -----------------------------------------------------------------------------
  1930. #elif defined(ZHILDE_EU44_W)
  1931. // Info
  1932. #define MANUFACTURER "ZHILDE"
  1933. #define DEVICE "EU44_W"
  1934. // Based on the reporter, this product uses GPIO1 and 3 for the button
  1935. // and onboard LED, so hardware serial should be disabled...
  1936. #define DEBUG_SERIAL_SUPPORT 0
  1937. // Buttons
  1938. #define BUTTON1_PIN 3
  1939. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1940. // Relays
  1941. #define RELAY1_PIN 5
  1942. #define RELAY2_PIN 4
  1943. #define RELAY3_PIN 12
  1944. #define RELAY4_PIN 13
  1945. #define RELAY5_PIN 14
  1946. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1947. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1948. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1949. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1950. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1951. // LEDs
  1952. #define LED1_PIN 1
  1953. #define LED1_PIN_INVERSE 1
  1954. // -----------------------------------------------------------------------------
  1955. // Allnet 4duino ESP8266-UP-Relais
  1956. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  1957. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  1958. // -----------------------------------------------------------------------------
  1959. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  1960. // Info
  1961. #define MANUFACTURER "ALLNET"
  1962. #define DEVICE "4DUINO_IOT_WLAN_RELAIS"
  1963. // Relays
  1964. #define RELAY1_PIN 14
  1965. #define RELAY1_RESET_PIN 12
  1966. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1967. // LEDs
  1968. #define LED1_PIN 0
  1969. #define LED1_PIN_INVERSE 1
  1970. // Buttons
  1971. //#define BUTTON1_PIN 0
  1972. //#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1973. // Using pins labelled as SDA & SCL as buttons
  1974. #define BUTTON2_PIN 4
  1975. #define BUTTON2_MODE BUTTON_PUSHBUTTON
  1976. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  1977. #define BUTTON2_CLICK BUTTON_MODE_NONE
  1978. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  1979. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  1980. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  1981. #define BUTTON3_PIN 5
  1982. #define BUTTON3_MODE BUTTON_PUSHBUTTON
  1983. // Using pins labelled as SDA & SCL for I2C
  1984. //#define I2C_SDA_PIN 4
  1985. //#define I2C_SCL_PIN 5
  1986. // -----------------------------------------------------------------------------
  1987. // Luani HVIO
  1988. // https://luani.de/projekte/esp8266-hvio/
  1989. // https://luani.de/blog/esp8266-230v-io-modul/
  1990. // -----------------------------------------------------------------------------
  1991. #elif defined(LUANI_HVIO)
  1992. // Info
  1993. #define MANUFACTURER "LUANI"
  1994. #define DEVICE "HVIO"
  1995. // Buttons
  1996. #define BUTTON1_PIN 12
  1997. #define BUTTON1_RELAY 1
  1998. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  1999. #define BUTTON1_PRESS BUTTON_MODE_NONE
  2000. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  2001. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2002. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2003. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  2004. #define BUTTON2_PIN 13
  2005. #define BUTTON2_RELAY 2
  2006. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  2007. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  2008. // Relays
  2009. #define RELAY1_PIN 4
  2010. #define RELAY2_PIN 5
  2011. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2012. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2013. // LEDs
  2014. #define LED1_PIN 15
  2015. #define LED1_PIN_INVERSE 0
  2016. // -----------------------------------------------------------------------------
  2017. // Tonbux 50-100M Smart Mosquito Killer USB
  2018. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  2019. // -----------------------------------------------------------------------------
  2020. #elif defined(TONBUX_MOSQUITO_KILLER)
  2021. // Info
  2022. #define MANUFACTURER "TONBUX"
  2023. #define DEVICE "MOSQUITO_KILLER"
  2024. // Buttons
  2025. #define BUTTON1_PIN 2
  2026. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2027. #define BUTTON1_RELAY 1
  2028. // Relays
  2029. #define RELAY1_PIN 5 // not a relay, fan
  2030. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2031. // LEDs
  2032. #define LED1_PIN 15 // blue led
  2033. #define LED1_PIN_INVERSE 1
  2034. #define LED1_MODE LED_MODE_WIFI
  2035. #define LED2_PIN 14 // red led
  2036. #define LED2_PIN_INVERSE 1
  2037. #define LED2_MODE LED_MODE_RELAY
  2038. #define LED3_PIN 12 // UV leds (1-2-3-4-5-6-7-8)
  2039. #define LED3_PIN_INVERSE 0
  2040. #define LED3_RELAY 1
  2041. #define LED4_PIN 16 // UV leds (9-10-11)
  2042. #define LED4_PIN_INVERSE 0
  2043. #define LED4_RELAY 1
  2044. // -----------------------------------------------------------------------------
  2045. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  2046. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  2047. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  2048. // -----------------------------------------------------------------------------
  2049. #elif defined(NEO_COOLCAM_NAS_WR01W)
  2050. // Info
  2051. #define MANUFACTURER "NEO_COOLCAM"
  2052. #define DEVICE "NAS_WR01W"
  2053. // Buttons
  2054. #define BUTTON1_PIN 13
  2055. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2056. #define BUTTON1_RELAY 1
  2057. // Relays
  2058. #define RELAY1_PIN 12
  2059. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2060. // LEDs
  2061. #define LED1_PIN 4
  2062. #define LED1_PIN_INVERSE 1
  2063. // ------------------------------------------------------------------------------
  2064. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  2065. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  2066. // Also: Estink Wifi Power Strip
  2067. // -----------------------------------------------------------------------------
  2068. #elif defined(FORNORM_ZLD_34EU)
  2069. // Info
  2070. #define MANUFACTURER "FORNORM"
  2071. #define DEVICE "ZLD_34EU"
  2072. // Disable UART noise since this board uses GPIO3
  2073. #define DEBUG_SERIAL_SUPPORT 0
  2074. // Buttons
  2075. #define BUTTON1_PIN 16
  2076. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2077. #define BUTTON1_RELAY 4
  2078. // Relays
  2079. #define RELAY1_PIN 14 // USB power
  2080. #define RELAY2_PIN 13 // power plug 1
  2081. #define RELAY3_PIN 4 // power plug 2
  2082. #define RELAY4_PIN 15 // power plug 3
  2083. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2084. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2085. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2086. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2087. // LEDs
  2088. #define LED1_PIN 0 // power led
  2089. #define LED2_PIN 12 // power plug 1
  2090. #define LED3_PIN 3 // power plug 2
  2091. #define LED4_PIN 5 // power plug 3
  2092. #define LED1_PIN_INVERSE 1
  2093. #define LED2_PIN_INVERSE 1
  2094. #define LED3_PIN_INVERSE 1
  2095. #define LED4_PIN_INVERSE 1
  2096. #define LED1_MODE LED_MODE_FINDME
  2097. #define LED2_MODE LED_MODE_FOLLOW
  2098. #define LED3_MODE LED_MODE_FOLLOW
  2099. #define LED4_MODE LED_MODE_FOLLOW
  2100. #define LED2_RELAY 2
  2101. #define LED3_RELAY 3
  2102. #define LED4_RELAY 4
  2103. // -----------------------------------------------------------------------------
  2104. // Bruno Horta's OnOfre
  2105. // https://www.bhonofre.pt/
  2106. // https://github.com/brunohorta82/BH_OnOfre/
  2107. // -----------------------------------------------------------------------------
  2108. #elif defined(BH_ONOFRE)
  2109. // Info
  2110. #define MANUFACTURER "BH"
  2111. #define DEVICE "ONOFRE"
  2112. // Buttons
  2113. #define BUTTON1_PIN 12
  2114. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2115. #define BUTTON1_RELAY 1
  2116. #define BUTTON2_PIN 13
  2117. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2118. #define BUTTON2_RELAY 2
  2119. // Relays
  2120. #define RELAY1_PIN 4
  2121. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2122. #define RELAY2_PIN 5
  2123. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2124. // -----------------------------------------------------------------------------
  2125. // BlitzWolf SHP2 and SHP6
  2126. // Also several boards under different names uing a power chip labelled BL0937 or HJL-01
  2127. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  2128. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  2129. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  2130. // * Gosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  2131. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  2132. // -----------------------------------------------------------------------------
  2133. #elif defined(BLITZWOLF_BWSHPX)
  2134. // Info
  2135. #define MANUFACTURER "BLITZWOLF"
  2136. #define DEVICE "BWSHPX"
  2137. // Buttons
  2138. #define BUTTON1_PIN 13
  2139. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2140. #define BUTTON1_RELAY 1
  2141. // Relays
  2142. #define RELAY1_PIN 15
  2143. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2144. // LEDs
  2145. #define LED1_PIN 2
  2146. #define LED1_PIN_INVERSE 1
  2147. #define LED2_PIN 0
  2148. #define LED2_PIN_INVERSE 1
  2149. #define LED2_MODE LED_MODE_FINDME
  2150. #define LED2_RELAY 1
  2151. // HJL01 / BL0937
  2152. #ifndef HLW8012_SUPPORT
  2153. #define HLW8012_SUPPORT 1
  2154. #endif
  2155. #define HLW8012_SEL_PIN 12
  2156. #define HLW8012_CF1_PIN 14
  2157. #define HLW8012_CF_PIN 5
  2158. #define HLW8012_SEL_CURRENT LOW
  2159. #define HLW8012_CURRENT_RATIO 25740
  2160. #define HLW8012_VOLTAGE_RATIO 313400
  2161. #define HLW8012_POWER_RATIO 3414290
  2162. #define HLW8012_INTERRUPT_ON FALLING
  2163. // -----------------------------------------------------------------------------
  2164. // Same as the above but new board version marked V2.3
  2165. // BlitzWolf SHP2 V2.3
  2166. // Gosund SP1 V2.3
  2167. // -----------------------------------------------------------------------------
  2168. #elif defined(BLITZWOLF_BWSHPX_V23)
  2169. // Info
  2170. #define MANUFACTURER "BLITZWOLF"
  2171. #define DEVICE "BWSHPX_V23"
  2172. // Buttons
  2173. #define BUTTON1_PIN 3
  2174. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2175. #define BUTTON1_RELAY 1
  2176. // Relays
  2177. #define RELAY1_PIN 14
  2178. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2179. // LEDs
  2180. #define LED1_PIN 1
  2181. #define LED1_PIN_INVERSE 1
  2182. #define LED2_PIN 13
  2183. #define LED2_PIN_INVERSE 1
  2184. #define LED2_MODE LED_MODE_FINDME
  2185. #define LED2_RELAY 1
  2186. // HJL01 / BL0937
  2187. #ifndef HLW8012_SUPPORT
  2188. #define HLW8012_SUPPORT 1
  2189. #endif
  2190. #define HLW8012_SEL_PIN 12
  2191. #define HLW8012_CF1_PIN 5
  2192. #define HLW8012_CF_PIN 4
  2193. #define HLW8012_SEL_CURRENT LOW
  2194. #define HLW8012_CURRENT_RATIO 25740
  2195. #define HLW8012_VOLTAGE_RATIO 313400
  2196. #define HLW8012_POWER_RATIO 3414290
  2197. #define HLW8012_INTERRUPT_ON FALLING
  2198. // BUTTON1 and LED1 are using Serial pins
  2199. #define DEBUG_SERIAL_SUPPORT 0
  2200. // -----------------------------------------------------------------------------
  2201. // Teckin SP22 v1.4 - v1.6
  2202. // -----------------------------------------------------------------------------
  2203. #elif defined(TECKIN_SP22_V14)
  2204. // Info
  2205. #define MANUFACTURER "TECKIN"
  2206. #define DEVICE "SP22_V14"
  2207. // Buttons
  2208. #define BUTTON1_PIN 1
  2209. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2210. #define BUTTON1_RELAY 1
  2211. // Relays
  2212. #define RELAY1_PIN 14
  2213. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2214. // LEDs
  2215. #define LED1_PIN 3
  2216. #define LED1_PIN_INVERSE 1
  2217. #define LED2_PIN 13
  2218. #define LED2_PIN_INVERSE 1
  2219. #define LED2_MODE LED_MODE_FINDME
  2220. #define LED2_RELAY 1
  2221. // HJL01 / BL0937
  2222. #ifndef HLW8012_SUPPORT
  2223. #define HLW8012_SUPPORT 1
  2224. #endif
  2225. #define HLW8012_SEL_PIN 12
  2226. #define HLW8012_CF1_PIN 5
  2227. #define HLW8012_CF_PIN 4
  2228. #define HLW8012_SEL_CURRENT LOW
  2229. #define HLW8012_CURRENT_RATIO 20730
  2230. #define HLW8012_VOLTAGE_RATIO 264935
  2231. #define HLW8012_POWER_RATIO 2533110
  2232. #define HLW8012_INTERRUPT_ON FALLING
  2233. // BUTTON1 and LED1 are using Serial pins
  2234. #define DEBUG_SERIAL_SUPPORT 0
  2235. // -----------------------------------------------------------------------------
  2236. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  2237. // Also model number KS-602S
  2238. // -----------------------------------------------------------------------------
  2239. #elif defined(GOSUND_WS1)
  2240. // Info
  2241. #define MANUFACTURER "GOSUND"
  2242. #define DEVICE "WS1"
  2243. // Buttons
  2244. #define BUTTON1_PIN 0
  2245. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2246. #define BUTTON1_RELAY 1
  2247. // Relays
  2248. #define RELAY1_PIN 14
  2249. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2250. // LEDs
  2251. #define LED1_PIN 1
  2252. #define LED1_PIN_INVERSE 1
  2253. // LED1 is using TX pin
  2254. #define DEBUG_SERIAL_SUPPORT 0
  2255. // ----------------------------------------------------------------------------------------
  2256. // Homecube 16A is similar but some pins differ and it also has RGB LEDs
  2257. // https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
  2258. // ----------------------------------------------------------------------------------------
  2259. #elif defined(HOMECUBE_16A)
  2260. // Info
  2261. #define MANUFACTURER "HOMECUBE"
  2262. #define DEVICE "16A"
  2263. // Buttons
  2264. #define BUTTON1_PIN 13
  2265. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2266. #define BUTTON1_RELAY 1
  2267. // Relays
  2268. #define RELAY1_PIN 15
  2269. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2270. // LEDs
  2271. //LED Pin 4 - ESP8266 onboard LED
  2272. //Red LED: 0
  2273. //Green LED: 12
  2274. //Blue LED: 2
  2275. // Blue
  2276. #define LED1_PIN 2
  2277. #define LED1_PIN_INVERSE 0
  2278. // Green
  2279. #define LED2_PIN 12
  2280. #define LED2_PIN_INVERSE 1
  2281. #define LED2_MODE LED_MODE_RELAY
  2282. // Red
  2283. #define LED3_PIN 0
  2284. #define LED3_PIN_INVERSE 0
  2285. #define LED3_MODE LED_MODE_OFF
  2286. // HJL01 / BL0937
  2287. #ifndef HLW8012_SUPPORT
  2288. #define HLW8012_SUPPORT 1
  2289. #endif
  2290. #define HLW8012_SEL_PIN 16
  2291. #define HLW8012_CF1_PIN 14
  2292. #define HLW8012_CF_PIN 5
  2293. #define HLW8012_SEL_CURRENT LOW
  2294. #define HLW8012_CURRENT_RATIO 25740
  2295. #define HLW8012_VOLTAGE_RATIO 313400
  2296. #define HLW8012_POWER_RATIO 3414290
  2297. #define HLW8012_INTERRUPT_ON FALLING
  2298. // -----------------------------------------------------------------------------
  2299. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  2300. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  2301. // -----------------------------------------------------------------------------
  2302. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  2303. // Info
  2304. #define MANUFACTURER "VANZAVANZU"
  2305. #define DEVICE "SMART_WIFI_PLUG_MINI"
  2306. // Buttons
  2307. #define BUTTON1_PIN 13
  2308. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2309. #define BUTTON1_RELAY 1
  2310. // Relays
  2311. #define RELAY1_PIN 15
  2312. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2313. // LEDs
  2314. #define LED1_PIN 2
  2315. #define LED1_PIN_INVERSE 1
  2316. #define LED2_PIN 0
  2317. #define LED2_PIN_INVERSE 1
  2318. #define LED2_MODE LED_MODE_FINDME
  2319. #define LED2_RELAY 1
  2320. // Disable UART noise
  2321. #define DEBUG_SERIAL_SUPPORT 0
  2322. // HJL01 / BL0937
  2323. #ifndef HLW8012_SUPPORT
  2324. #define HLW8012_SUPPORT 1
  2325. #endif
  2326. #define HLW8012_SEL_PIN 3
  2327. #define HLW8012_CF1_PIN 14
  2328. #define HLW8012_CF_PIN 5
  2329. #define HLW8012_SEL_CURRENT LOW
  2330. #define HLW8012_CURRENT_RATIO 25740
  2331. #define HLW8012_VOLTAGE_RATIO 313400
  2332. #define HLW8012_POWER_RATIO 3414290
  2333. #define HLW8012_INTERRUPT_ON FALLING
  2334. // -----------------------------------------------------------------------------
  2335. #elif defined(GENERIC_AG_L4)
  2336. // Info
  2337. #define MANUFACTURER "GENERIC"
  2338. #define DEVICE "AG_L4"
  2339. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2340. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2341. #define DUMMY_RELAY_COUNT 1
  2342. // button 1: "power" button
  2343. #define BUTTON1_PIN 4
  2344. #define BUTTON1_RELAY 1
  2345. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2346. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  2347. #define BUTTON1_CLICK BUTTON_MODE_NONE
  2348. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2349. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2350. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  2351. // button 2: "wifi" button
  2352. #define BUTTON2_PIN 2
  2353. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2354. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  2355. #define BUTTON2_CLICK BUTTON_MODE_NONE
  2356. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  2357. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  2358. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  2359. // LEDs
  2360. #define LED1_PIN 5 // red status led
  2361. #define LED1_PIN_INVERSE 0
  2362. #define LED2_PIN 16 // master light power
  2363. #define LED2_PIN_INVERSE 1
  2364. #define LED2_MODE LED_MODE_RELAY
  2365. // Light
  2366. #define LIGHT_CHANNELS 3
  2367. #define LIGHT_CH1_PIN 14 // RED
  2368. #define LIGHT_CH2_PIN 13 // GREEN
  2369. #define LIGHT_CH3_PIN 12 // BLUE
  2370. #define LIGHT_CH1_INVERSE 0
  2371. #define LIGHT_CH2_INVERSE 0
  2372. #define LIGHT_CH3_INVERSE 0
  2373. // -----------------------------------------------------------------------------
  2374. #elif defined(ALLTERCO_SHELLY1)
  2375. // Info
  2376. #define MANUFACTURER "ALLTERCO"
  2377. #define DEVICE "SHELLY1"
  2378. // Buttons
  2379. #define BUTTON1_PIN 5
  2380. #define BUTTON1_MODE BUTTON_SWITCH
  2381. #define BUTTON1_RELAY 1
  2382. // Relays
  2383. #define RELAY1_PIN 4
  2384. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2385. #elif defined(ALLTERCO_SHELLY2)
  2386. // Info
  2387. #define MANUFACTURER "ALLTERCO"
  2388. #define DEVICE "SHELLY2"
  2389. // Buttons
  2390. #define BUTTON1_PIN 12
  2391. #define BUTTON2_PIN 14
  2392. #define BUTTON1_MODE BUTTON_SWITCH
  2393. #define BUTTON2_MODE BUTTON_SWITCH
  2394. #define BUTTON1_RELAY 1
  2395. #define BUTTON2_RELAY 2
  2396. // Relays
  2397. #define RELAY1_PIN 4
  2398. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2399. #define RELAY2_PIN 5
  2400. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2401. // -----------------------------------------------------------------------------
  2402. #elif defined(LOHAS_9W)
  2403. // Info
  2404. #define MANUFACTURER "LOHAS"
  2405. #define DEVICE "E27_9W"
  2406. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2407. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2408. #define DUMMY_RELAY_COUNT 1
  2409. // Light
  2410. #define LIGHT_CHANNELS 5
  2411. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2412. #define MY92XX_CHIPS 2
  2413. #define MY92XX_DI_PIN 13
  2414. #define MY92XX_DCKI_PIN 15
  2415. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2416. #define MY92XX_MAPPING 0, 1, 2, 3, 4
  2417. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  2418. // -----------------------------------------------------------------------------
  2419. #elif defined(XIAOMI_SMART_DESK_LAMP)
  2420. // Info
  2421. #define MANUFACTURER "XIAOMI"
  2422. #define DEVICE "SMART_DESK_LAMP"
  2423. // Buttons
  2424. #define BUTTON1_PIN 2
  2425. #define BUTTON2_PIN 14
  2426. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2427. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2428. // This button doubles as switch here and as encoder mode switch below
  2429. // Clicking it (for less than 500ms) will turn the light on and off
  2430. // Double and Long clicks will not work as these are used to modify the encoder action
  2431. #define BUTTON1_RELAY 1
  2432. #define BUTTON_LNGCLICK_DELAY 500
  2433. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2434. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2435. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  2436. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  2437. #define BUTTON2_DBLCLICK BUTTON_MODE_AP
  2438. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  2439. // Light
  2440. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2441. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2442. #define DUMMY_RELAY_COUNT 1
  2443. #define LIGHT_STEP 8
  2444. #define LIGHT_CHANNELS 2
  2445. #define LIGHT_CH1_PIN 5 // warm white
  2446. #define LIGHT_CH1_INVERSE 0
  2447. #define LIGHT_CH2_PIN 4 // cold white
  2448. #define LIGHT_CH2_INVERSE 0
  2449. // Encoder
  2450. // If mode is ENCODER_MODE_RATIO, the value ratio between both channels is changed
  2451. // when the button is not pressed, and the overall brightness when pressed
  2452. // If mode is ENCODER_MODE_CHANNEL, the first channel value is changed
  2453. // when the button is not pressed, and the second channel when pressed
  2454. // If no ENCODERX_BUTTON_PIN defined it will only change the value of the first defined channel
  2455. #define ENCODER_SUPPORT 1
  2456. #define ENCODER1_PIN1 12
  2457. #define ENCODER1_PIN2 13
  2458. #define ENCODER1_BUTTON_PIN 2 // active low by default, with software pullup
  2459. #define ENCODER1_CHANNEL1 0 // please note this value is 0-based (LIGHT_CH1 above)
  2460. #define ENCODER1_CHANNEL2 1 // please note this value is 0-based (LIGHT_CH2 above)
  2461. #define ENCODER1_MODE ENCODER_MODE_RATIO
  2462. #elif defined(PHYX_ESP12_RGB)
  2463. // Info
  2464. #define MANUFACTURER "PHYX"
  2465. #define DEVICE "ESP12_RGB"
  2466. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2467. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2468. #define DUMMY_RELAY_COUNT 1
  2469. // Light
  2470. #define LIGHT_CHANNELS 3
  2471. #define LIGHT_CH1_PIN 4 // RED
  2472. #define LIGHT_CH2_PIN 14 // GREEN
  2473. #define LIGHT_CH3_PIN 12 // BLUE
  2474. #define LIGHT_CH1_INVERSE 0
  2475. #define LIGHT_CH2_INVERSE 0
  2476. #define LIGHT_CH3_INVERSE 0
  2477. // -----------------------------------------------------------------------------
  2478. // iWoole LED Table Lamp
  2479. // 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
  2480. // -----------------------------------------------------------------------------
  2481. #elif defined(IWOOLE_LED_TABLE_LAMP)
  2482. // Info
  2483. #define MANUFACTURER "IWOOLE"
  2484. #define DEVICE "LED_TABLE_LAMP"
  2485. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2486. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2487. #define DUMMY_RELAY_COUNT 1
  2488. // Light
  2489. #define LIGHT_CHANNELS 4
  2490. #define LIGHT_CH1_PIN 12 // RED
  2491. #define LIGHT_CH2_PIN 5 // GREEN
  2492. #define LIGHT_CH3_PIN 14 // BLUE
  2493. #define LIGHT_CH4_PIN 4 // WHITE
  2494. #define LIGHT_CH1_INVERSE 0
  2495. #define LIGHT_CH2_INVERSE 0
  2496. #define LIGHT_CH3_INVERSE 0
  2497. #define LIGHT_CH4_INVERSE 0
  2498. // -----------------------------------------------------------------------------
  2499. // Generic GU10
  2500. // https://www.ebay.com/itm/1-10PC-GU10-RGB-Smart-Bulb-Wireless-WiFi-App-Remote-Ctrl-Light-for-Alexa-Google/173724116351
  2501. // -----------------------------------------------------------------------------
  2502. #elif defined(GENERIC_GU10)
  2503. // Info
  2504. #define MANUFACTURER "GENERIC"
  2505. #define DEVICE "GU10"
  2506. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2507. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2508. #define DUMMY_RELAY_COUNT 1
  2509. // Light
  2510. #define LIGHT_CHANNELS 4
  2511. #define LIGHT_CH1_PIN 14 // RED
  2512. #define LIGHT_CH2_PIN 12 // GREEN
  2513. #define LIGHT_CH3_PIN 13 // BLUE
  2514. #define LIGHT_CH4_PIN 4 // WHITE
  2515. #define LIGHT_CH1_INVERSE 0
  2516. #define LIGHT_CH2_INVERSE 0
  2517. #define LIGHT_CH3_INVERSE 0
  2518. #define LIGHT_CH4_INVERSE 0
  2519. // -----------------------------------------------------------------------------
  2520. // Lombex Lux Nova 2 Tunable White
  2521. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2522. // -----------------------------------------------------------------------------
  2523. #elif defined(LOMBEX_LUX_NOVA2_TUNABLE_WHITE)
  2524. // Info
  2525. #define MANUFACTURER "LOMBEX"
  2526. #define DEVICE "LUX_NOVA2_TUNABLE_WHITE"
  2527. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2528. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2529. #define DUMMY_RELAY_COUNT 1
  2530. // Light
  2531. #define LIGHT_CHANNELS 5
  2532. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2533. #define MY92XX_CHIPS 1
  2534. #define MY92XX_DI_PIN 4
  2535. #define MY92XX_DCKI_PIN 5
  2536. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2537. // No RGB on this bulb. Warm white on channel 0, cool white on channel 3
  2538. #define MY92XX_MAPPING 255, 255, 255, 3, 0
  2539. // -----------------------------------------------------------------------------
  2540. // Lombex Lux Nova 2 White and Color
  2541. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2542. // -----------------------------------------------------------------------------
  2543. #elif defined(LOMBEX_LUX_NOVA2_WHITE_COLOR)
  2544. // Info
  2545. #define MANUFACTURER "LOMBEX"
  2546. #define DEVICE "LUX_NOVA2_WHITE_COLOR"
  2547. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2548. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2549. #define DUMMY_RELAY_COUNT 1
  2550. // Light
  2551. #define LIGHT_CHANNELS 4
  2552. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2553. #define MY92XX_CHIPS 1
  2554. #define MY92XX_DI_PIN 4
  2555. #define MY92XX_DCKI_PIN 5
  2556. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2557. // RGB on channels 0/1/2, either cool or warm white on channel 3
  2558. // The bulb *should* have cool leds, but could also have warm leds as a common defect
  2559. #define MY92XX_MAPPING 0, 1, 2, 3
  2560. // -----------------------------------------------------------------------------
  2561. // Bestek Smart Plug with 2 USB ports
  2562. // https://www.bestekcorp.com/bestek-smart-plug-works-with-amazon-alexa-google-assistant-and-ifttt-with-2-usb
  2563. // -----------------------------------------------------------------------------
  2564. #elif defined(BESTEK_MRJ1011)
  2565. // Info
  2566. #define MANUFACTURER "BESTEK"
  2567. #define DEVICE "MRJ1011"
  2568. // Buttons
  2569. #define BUTTON1_PIN 13
  2570. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2571. #define BUTTON1_RELAY 1
  2572. // Relay
  2573. #define RELAY1_PIN 12
  2574. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2575. // LED
  2576. #define LED1_PIN 4
  2577. #define LED1_PIN_INVERSE 1
  2578. // -----------------------------------------------------------------------------
  2579. // GBLIFE RGBW SOCKET
  2580. // -----------------------------------------------------------------------------
  2581. #elif defined(GBLIFE_RGBW_SOCKET)
  2582. // Info
  2583. #define MANUFACTURER "GBLIFE"
  2584. #define DEVICE "RGBW_SOCKET"
  2585. // Buttons
  2586. #define BUTTON1_PIN 13
  2587. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2588. #define BUTTON1_RELAY 1
  2589. // Relays
  2590. #define RELAY1_PIN 15
  2591. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2592. // Light RGBW
  2593. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2594. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2595. #define DUMMY_RELAY_COUNT 1
  2596. #define LIGHT_CHANNELS 4
  2597. #define LIGHT_CH1_PIN 5 // RED
  2598. #define LIGHT_CH2_PIN 14 // GREEN
  2599. #define LIGHT_CH3_PIN 12 // BLUE
  2600. #define LIGHT_CH4_PIN 4 // WHITE
  2601. #define LIGHT_CH1_INVERSE 0
  2602. #define LIGHT_CH2_INVERSE 0
  2603. #define LIGHT_CH3_INVERSE 0
  2604. #define LIGHT_CH4_INVERSE 0
  2605. // ----------------------------------------------------------------------------------------
  2606. // Smart life Mini Smart Socket is similar Homecube 16A but some GPIOs differ
  2607. // https://www.ebay.de/itm/Smart-Steckdose-WIFI-WLAN-Amazon-Alexa-Fernbedienung-Home-Socket-Zeitschaltuh-DE/123352026749?hash=item1cb85a8e7d:g:IasAAOSwk6dbj390
  2608. // Also labeled NETVIP
  2609. // https://www.amazon.es/Inteligente-NETVIP-Inal%C3%A1mbrico-Interruptor-Funciona/dp/B07KH8YWS5
  2610. // ----------------------------------------------------------------------------------------
  2611. #elif defined(SMARTLIFE_MINI_SMART_SOCKET)
  2612. // Info
  2613. #define MANUFACTURER "SMARTLIFE"
  2614. #define DEVICE "MINI_SMART_SOCKET"
  2615. // Buttons
  2616. #define BUTTON1_PIN 13
  2617. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2618. #define BUTTON1_RELAY 1
  2619. // Relays
  2620. #define RELAY1_PIN 15
  2621. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2622. // LEDs
  2623. //Red LED: 0
  2624. //Green LED: 4
  2625. //Blue LED: 2
  2626. // Light
  2627. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2628. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2629. #define DUMMY_RELAY_COUNT 1
  2630. #define LIGHT_CHANNELS 3
  2631. #define LIGHT_CH1_PIN 0 // RED
  2632. #define LIGHT_CH2_PIN 4 // GREEN
  2633. #define LIGHT_CH3_PIN 2 // BLUE
  2634. #define LIGHT_CH1_INVERSE 0
  2635. #define LIGHT_CH2_INVERSE 0
  2636. #define LIGHT_CH3_INVERSE 0
  2637. // HJL01 / BL0937
  2638. #ifndef HLW8012_SUPPORT
  2639. #define HLW8012_SUPPORT 1
  2640. #endif
  2641. #define HLW8012_SEL_PIN 12
  2642. #define HLW8012_CF1_PIN 14
  2643. #define HLW8012_CF_PIN 5
  2644. #define HLW8012_SEL_CURRENT LOW
  2645. #define HLW8012_CURRENT_RATIO 25740
  2646. #define HLW8012_VOLTAGE_RATIO 313400
  2647. #define HLW8012_POWER_RATIO 3414290
  2648. #define HLW8012_INTERRUPT_ON FALLING
  2649. // ----------------------------------------------------------------------------------------
  2650. // Hama WiFi Steckdose (00176533)
  2651. // https://at.hama.com/00176533/hama-wifi-steckdose-3500w-16a
  2652. // ----------------------------------------------------------------------------------------
  2653. #elif defined(HAMA_WIFI_STECKDOSE_00176533)
  2654. // Info
  2655. #define MANUFACTURER "HAMA"
  2656. #define DEVICE "WIFI_STECKDOSE_00176533"
  2657. // Buttons
  2658. #define BUTTON1_PIN 13
  2659. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2660. #define BUTTON1_RELAY 1
  2661. // Relays
  2662. #define RELAY1_PIN 12
  2663. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2664. // LEDs
  2665. #define LED1_PIN 4
  2666. #define LED1_PIN_INVERSE 1
  2667. // -----------------------------------------------------------------------------
  2668. // Oxaoxe NX-SP202
  2669. // Digoo NX-SP202 (not tested)
  2670. // Digoo DG-SP202 (not tested)
  2671. // https://github.com/xoseperez/espurna/issues/1502
  2672. // -----------------------------------------------------------------------------
  2673. #elif defined(DIGOO_NX_SP202)
  2674. // Info
  2675. #define MANUFACTURER "DIGOO"
  2676. #define DEVICE "NX_SP202"
  2677. // Buttons
  2678. #define BUTTON1_PIN 0
  2679. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2680. #define BUTTON1_RELAY 1
  2681. #define BUTTON2_PIN 16
  2682. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2683. #define BUTTON2_RELAY 2
  2684. // Relays
  2685. #define RELAY1_PIN 15
  2686. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2687. #define RELAY2_PIN 14
  2688. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2689. // LEDs
  2690. #define LED1_PIN 13
  2691. #define LED1_PIN_INVERSE 1
  2692. // HJL01 / BL0937
  2693. #ifndef HLW8012_SUPPORT
  2694. #define HLW8012_SUPPORT 1
  2695. #endif
  2696. #define HLW8012_SEL_PIN 12
  2697. #define HLW8012_CF1_PIN 5
  2698. #define HLW8012_CF_PIN 4
  2699. #define HLW8012_SEL_CURRENT LOW
  2700. #define HLW8012_CURRENT_RATIO 23296
  2701. #define HLW8012_VOLTAGE_RATIO 310085
  2702. #define HLW8012_POWER_RATIO 3368471
  2703. #define HLW8012_INTERRUPT_ON FALLING
  2704. // -----------------------------------------------------------------------------
  2705. // Foxel's LightFox dual
  2706. // https://github.com/foxel/esp-dual-rf-switch
  2707. // -----------------------------------------------------------------------------
  2708. #elif defined(FOXEL_LIGHTFOX_DUAL)
  2709. // Info
  2710. #define MANUFACTURER "FOXEL"
  2711. #define DEVICE "LIGHTFOX_DUAL"
  2712. #define SERIAL_BAUDRATE 19200
  2713. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  2714. #define DUMMY_RELAY_COUNT 2
  2715. #define DEBUG_SERIAL_SUPPORT 0
  2716. // Buttons
  2717. #define BUTTON1_RELAY 1
  2718. #define BUTTON2_RELAY 2
  2719. #define BUTTON3_RELAY 2
  2720. #define BUTTON4_RELAY 1
  2721. // -----------------------------------------------------------------------------
  2722. // Teckin SP20
  2723. // -----------------------------------------------------------------------------
  2724. #elif defined(TECKIN_SP20)
  2725. // Info
  2726. #define MANUFACTURER "TECKIN"
  2727. #define DEVICE "SP20"
  2728. // Buttons
  2729. #define BUTTON1_PIN 13
  2730. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2731. #define BUTTON1_RELAY 1
  2732. // Relays
  2733. #define RELAY1_PIN 4
  2734. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2735. // LEDs
  2736. #define LED1_PIN 2
  2737. #define LED1_PIN_INVERSE 1
  2738. #define LED2_PIN 0
  2739. #define LED2_PIN_INVERSE 1
  2740. #define LED2_MODE LED_MODE_FINDME
  2741. #define LED2_RELAY 0
  2742. // HJL01 / BL0937
  2743. #ifndef HLW8012_SUPPORT
  2744. #define HLW8012_SUPPORT 1
  2745. #endif
  2746. #define HLW8012_SEL_PIN 12
  2747. #define HLW8012_CF1_PIN 14
  2748. #define HLW8012_CF_PIN 5
  2749. #define HLW8012_SEL_CURRENT LOW
  2750. #define HLW8012_CURRENT_RATIO 25740
  2751. #define HLW8012_VOLTAGE_RATIO 313400
  2752. #define HLW8012_POWER_RATIO 3414290
  2753. #define HLW8012_INTERRUPT_ON FALLING
  2754. // -----------------------------------------------------------------------------
  2755. // Charging Essentials / LITESUN LA-WF3
  2756. // -----------------------------------------------------------------------------
  2757. #elif defined(LITESUN_LA_WF3)
  2758. // Info
  2759. #define MANUFACTURER "LITESUN"
  2760. #define DEVICE "LA_WF3"
  2761. // Buttons
  2762. #define BUTTON1_PIN 13
  2763. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2764. #define BUTTON1_RELAY 1
  2765. // Relays
  2766. #define RELAY1_PIN 12
  2767. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2768. // LEDs
  2769. #define LED1_PIN 4 // 4 blue led
  2770. #define LED1_MODE LED_MODE_WIFI
  2771. #define LED1_PIN_INVERSE 1
  2772. #define LED2_PIN 5 // 5 red led
  2773. #define LED2_MODE LED_MODE_RELAY
  2774. #define LED2_PIN_INVERSE 1
  2775. // -----------------------------------------------------------------------------
  2776. // PSH
  2777. // -----------------------------------------------------------------------------
  2778. #elif defined(PSH_WIFI_PLUG)
  2779. // Info
  2780. #define MANUFACTURER "PSH"
  2781. #define DEVICE "WIFI_PLUG"
  2782. // Relays
  2783. #define RELAY1_PIN 2
  2784. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2785. // LEDs
  2786. #define LED1_PIN 0
  2787. #define LED1_PIN_INVERSE 0
  2788. #elif defined(PSH_RGBW_CONTROLLER)
  2789. // Info
  2790. #define MANUFACTURER "PSH"
  2791. #define DEVICE "RGBW_CONTROLLER"
  2792. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2793. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2794. #define DUMMY_RELAY_COUNT 1
  2795. // LEDs
  2796. #define LED1_PIN 13
  2797. #define LED1_PIN_INVERSE 1
  2798. // Light
  2799. #define LIGHT_CHANNELS 4
  2800. #define LIGHT_CH1_PIN 5 // RED
  2801. #define LIGHT_CH2_PIN 4 // GREEN
  2802. #define LIGHT_CH3_PIN 12 // BLUE
  2803. #define LIGHT_CH4_PIN 14 // WHITE1
  2804. #define LIGHT_CH1_INVERSE 0
  2805. #define LIGHT_CH2_INVERSE 0
  2806. #define LIGHT_CH3_INVERSE 0
  2807. #define LIGHT_CH4_INVERSE 0
  2808. #elif defined(PSH_WIFI_SENSOR)
  2809. // Info
  2810. #define MANUFACTURER "PSH"
  2811. #define DEVICE "WIFI_SENSOR"
  2812. // DHT12 Sensor
  2813. #define DHT_SUPPORT 1
  2814. #define DHT_PIN 14
  2815. #define DHT_TYPE DHT_CHIP_DHT12
  2816. // LDR Sensor
  2817. #define LDR_SUPPORT 1
  2818. #define LDR_TYPE LDR_GL5528
  2819. #define LDR_ON_GROUND false
  2820. #define LDR_RESISTOR 10000
  2821. #elif defined(JINVOO_VALVE_SM_AW713)
  2822. // Reflashing from original Tuya firmware
  2823. // to thirdparty firmware like espurna by:
  2824. // https://github.com/ct-Open-Source/tuya-convert
  2825. // Info
  2826. #define MANUFACTURER "JINVOO"
  2827. #define DEVICE "VALVE_SM_AW713"
  2828. // Buttons
  2829. #define BUTTON1_PIN 13
  2830. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2831. #define BUTTON1_RELAY 1
  2832. // Relays
  2833. #define RELAY1_PIN 12
  2834. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2835. // LED
  2836. #define LED1_PIN 5 // 5 red led
  2837. #define LED1_PIN_INVERSE 0
  2838. #define LED1_RELAY 1
  2839. #define LED1_MODE LED_MODE_RELAY
  2840. #define LED2_PIN 4 // 4 blue led
  2841. #define LED2_PIN_INVERSE 0
  2842. #define LED2_RELAY 1
  2843. #define LED2_MODE LED_MODE_FINDME_WIFI
  2844. // -----------------------------------------------------------------------------
  2845. // TEST boards (do not use!!)
  2846. // -----------------------------------------------------------------------------
  2847. #elif defined(TRAVIS01)
  2848. // Info
  2849. #define MANUFACTURER "TravisCI"
  2850. #define DEVICE "Virtual board 01"
  2851. // Some buttons - pin 0
  2852. #define BUTTON1_PIN 0
  2853. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2854. #define BUTTON1_RELAY 1
  2855. // Some relays - pin 1
  2856. #define RELAY1_PIN 1
  2857. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2858. // Some LEDs - pin 2
  2859. #define LED1_PIN 2
  2860. #define LED1_PIN_INVERSE 1
  2861. // A bit of I2C - pins 3,4
  2862. #define I2C_SDA_PIN 3
  2863. #define I2C_SCL_PIN 4
  2864. // And, as they say in "From Dusk till Dawn":
  2865. // This is a sensor blow out!
  2866. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  2867. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  2868. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  2869. // C'mon, you want sensor, come on in sensor lovers!
  2870. // If we don’t got it, you don't want it!
  2871. #define AM2320_SUPPORT 1
  2872. #define BH1750_SUPPORT 1
  2873. #define BMP180_SUPPORT 1
  2874. #define BMX280_SUPPORT 1
  2875. #define SHT3X_I2C_SUPPORT 1
  2876. #define EMON_ADC121_SUPPORT 1
  2877. #define EMON_ADS1X15_SUPPORT 1
  2878. #define SHT3X_I2C_SUPPORT 1
  2879. #define SI7021_SUPPORT 1
  2880. #define PMSX003_SUPPORT 1
  2881. #define SENSEAIR_SUPPORT 1
  2882. #define VL53L1X_SUPPORT 1
  2883. #define MAX6675_SUPPORT 1
  2884. // A bit of lights - pin 5
  2885. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2886. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2887. #define DUMMY_RELAY_COUNT 1
  2888. #define LIGHT_CHANNELS 1
  2889. #define LIGHT_CH1_PIN 5
  2890. #define LIGHT_CH1_INVERSE 0
  2891. // A bit of HLW8012 - pins 6,7,8
  2892. #ifndef HLW8012_SUPPORT
  2893. #define HLW8012_SUPPORT 1
  2894. #endif
  2895. #define HLW8012_SEL_PIN 6
  2896. #define HLW8012_CF1_PIN 7
  2897. #define HLW8012_CF_PIN 8
  2898. // A bit of Dallas - pin 9
  2899. #ifndef DALLAS_SUPPORT
  2900. #define DALLAS_SUPPORT 1
  2901. #endif
  2902. #define DALLAS_PIN 9
  2903. // A bit of ECH1560 - pins 10,11, 12
  2904. #ifndef ECH1560_SUPPORT
  2905. #define ECH1560_SUPPORT 1
  2906. #endif
  2907. #define ECH1560_CLK_PIN 10
  2908. #define ECH1560_MISO_PIN 11
  2909. #define ECH1560_INVERTED 12
  2910. // MICS-2710 & MICS-5525 test
  2911. #define MICS2710_SUPPORT 1
  2912. #define MICS5525_SUPPORT 1
  2913. // MAX6675 14 11 10
  2914. #ifndef MAX6675_SUPPORT
  2915. #define MAX6675_SUPPORT 1
  2916. #endif
  2917. #define MAX6675_CS_PIN 14
  2918. #define MAX6675_SO_PIN 11
  2919. #define MAX6675_SCK_PIN 10
  2920. #elif defined(TRAVIS02)
  2921. // Relay provider dual
  2922. #define MANUFACTURER "TravisCI"
  2923. #define DEVICE "Virtual board 02"
  2924. // Some buttons - pin 0
  2925. #define BUTTON1_PIN 0
  2926. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2927. #define BUTTON1_RELAY 1
  2928. // A bit of CSE7766 - pin 1
  2929. #ifndef CSE7766_SUPPORT
  2930. #define CSE7766_SUPPORT 1
  2931. #endif
  2932. #define CSE7766_PIN 1
  2933. // Relay type dual - pins 2,3
  2934. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  2935. #define RELAY1_PIN 2
  2936. #define RELAY2_PIN 3
  2937. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2938. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2939. // IR - pin 4
  2940. #define IR_SUPPORT 1
  2941. #define IR_RX_PIN 4
  2942. #define IR_BUTTON_SET 1
  2943. // A bit of DHT - pin 5
  2944. #ifndef DHT_SUPPORT
  2945. #define DHT_SUPPORT 1
  2946. #endif
  2947. #define DHT_PIN 5
  2948. // A bit of TMP3X (analog)
  2949. #define TMP3X_SUPPORT 1
  2950. // A bit of EVENTS - pin 10
  2951. #define EVENTS_SUPPORT 1
  2952. #define EVENTS_PIN 6
  2953. // Sonar
  2954. #define SONAR_SUPPORT 1
  2955. #define SONAR_TRIGGER 7
  2956. #define SONAR_ECHO 8
  2957. // MHZ19
  2958. #define MHZ19_SUPPORT 1
  2959. #define MHZ19_RX_PIN 9
  2960. #define MHZ19_TX_PIN 10
  2961. // PZEM004T
  2962. #define PZEM004T_SUPPORT 1
  2963. #define PZEM004T_RX_PIN 11
  2964. #define PZEM004T_TX_PIN 12
  2965. // V9261F
  2966. #define V9261F_SUPPORT 1
  2967. #define V9261F_PIN 13
  2968. // GUVAS12SD
  2969. #define GUVAS12SD_SUPPORT 1
  2970. #define GUVAS12SD_PIN 14
  2971. // Test non-default modules
  2972. #define MDNS_CLIENT_SUPPORT 1
  2973. #define NOFUSS_SUPPORT 1
  2974. #define UART_MQTT_SUPPORT 1
  2975. #define INFLUXDB_SUPPORT 1
  2976. #define IR_SUPPORT 1
  2977. #define RF_SUPPORT 1
  2978. #define RFB_DIRECT 1
  2979. #define RFB_RX_PIN 4
  2980. #elif defined(TRAVIS03)
  2981. // Relay provider light/my92XX
  2982. #define MANUFACTURER "TravisCI"
  2983. #define DEVICE "Virtual board 03"
  2984. // Some buttons - pin 0
  2985. #define BUTTON1_PIN 0
  2986. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2987. #define BUTTON1_RELAY 1
  2988. // MY9231 Light - pins 1,2
  2989. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2990. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2991. #define DUMMY_RELAY_COUNT 1
  2992. #define LIGHT_CHANNELS 5
  2993. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2994. #define MY92XX_CHIPS 2
  2995. #define MY92XX_DI_PIN 1
  2996. #define MY92XX_DCKI_PIN 2
  2997. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2998. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  2999. // A bit of analog,
  3000. // will not work on real life since they all share GPIO
  3001. // but it's OK to test build
  3002. #define EMON_ANALOG_SUPPORT 1
  3003. #define NTC_SUPPORT 1
  3004. #define LDR_SUPPORT 1
  3005. #define PULSEMETER_SUPPORT 1
  3006. // Test non-default modules
  3007. #define LLMNR_SUPPORT 1
  3008. #define NETBIOS_SUPPORT 1
  3009. #define SSDP_SUPPORT 1
  3010. #define RF_SUPPORT 1
  3011. #endif
  3012. // -----------------------------------------------------------------------------
  3013. // Check definitions
  3014. // -----------------------------------------------------------------------------
  3015. #if not defined(MANUFACTURER) || not defined(DEVICE)
  3016. #error "UNSUPPORTED HARDWARE!!"
  3017. #endif