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.

3780 lines
121 KiB

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