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.

3822 lines
122 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 1
  768. #elif defined(YJZK_SWITCH_2CH)
  769. // Info
  770. #define MANUFACTURER "YJZK"
  771. #define DEVICE "SWITCH_2CH"
  772. // Buttons
  773. #define BUTTON1_PIN 0
  774. #define BUTTON2_PIN 9
  775. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  776. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  777. #define BUTTON1_CLICK BUTTON_MODE_NONE
  778. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  779. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  780. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  781. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  782. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  783. #define BUTTON2_CLICK BUTTON_MODE_NONE
  784. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  785. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  786. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  787. #define BUTTON1_RELAY 1
  788. #define BUTTON2_RELAY 2
  789. // Relays
  790. #define RELAY1_PIN 12
  791. #define RELAY2_PIN 5
  792. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  793. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  794. // LEDs
  795. #define LED1_PIN 13
  796. #define LED1_PIN_INVERSE 1
  797. // YJZK 3CH switch
  798. // Also Lixin Touch Wifi 3M
  799. #elif defined(YJZK_SWITCH_3CH)
  800. // Info
  801. #define MANUFACTURER "YJZK"
  802. #define DEVICE "SWITCH_3CH"
  803. // Buttons
  804. #define BUTTON1_PIN 0
  805. #define BUTTON2_PIN 9
  806. #define BUTTON3_PIN 10
  807. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  808. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  809. #define BUTTON1_CLICK BUTTON_MODE_NONE
  810. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  811. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  812. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  813. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  814. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  815. #define BUTTON2_CLICK BUTTON_MODE_NONE
  816. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  817. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  818. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  819. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  820. #define BUTTON3_PRESS BUTTON_MODE_TOGGLE
  821. #define BUTTON3_CLICK BUTTON_MODE_NONE
  822. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  823. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  824. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_RESET
  825. #define BUTTON1_RELAY 1
  826. #define BUTTON2_RELAY 2
  827. #define BUTTON3_RELAY 3
  828. // Relays
  829. #define RELAY1_PIN 12
  830. #define RELAY2_PIN 5
  831. #define RELAY3_PIN 4
  832. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  833. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  834. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  835. // LEDs
  836. #define LED1_PIN 13
  837. #define LED1_PIN_INVERSE 1
  838. // -----------------------------------------------------------------------------
  839. // Electrodragon boards
  840. // -----------------------------------------------------------------------------
  841. #elif defined(ELECTRODRAGON_WIFI_IOT)
  842. // Info
  843. #define MANUFACTURER "ELECTRODRAGON"
  844. #define DEVICE "WIFI_IOT"
  845. // Buttons
  846. #define BUTTON1_PIN 0
  847. #define BUTTON2_PIN 2
  848. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  849. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  850. #define BUTTON1_RELAY 1
  851. #define BUTTON2_RELAY 2
  852. // Relays
  853. #define RELAY1_PIN 12
  854. #define RELAY2_PIN 13
  855. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  856. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  857. // LEDs
  858. #define LED1_PIN 16
  859. #define LED1_PIN_INVERSE 0
  860. // -----------------------------------------------------------------------------
  861. // WorkChoice ecoPlug
  862. // -----------------------------------------------------------------------------
  863. #elif defined(WORKCHOICE_ECOPLUG)
  864. // Info
  865. #define MANUFACTURER "WORKCHOICE"
  866. #define DEVICE "ECOPLUG"
  867. // Buttons
  868. #define BUTTON1_PIN 13
  869. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  870. #define BUTTON1_RELAY 1
  871. // Relays
  872. #define RELAY1_PIN 15
  873. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  874. // LEDs
  875. #define LED1_PIN 2
  876. #define LED1_PIN_INVERSE 0
  877. // -----------------------------------------------------------------------------
  878. // AI Thinker
  879. // -----------------------------------------------------------------------------
  880. #elif defined(AITHINKER_AI_LIGHT)
  881. // Info
  882. #define MANUFACTURER "AITHINKER"
  883. #define DEVICE "AI_LIGHT"
  884. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  885. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  886. #define DUMMY_RELAY_COUNT 1
  887. // Light
  888. #define LIGHT_CHANNELS 4
  889. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  890. #define MY92XX_CHIPS 1
  891. #define MY92XX_DI_PIN 13
  892. #define MY92XX_DCKI_PIN 15
  893. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  894. #define MY92XX_MAPPING 0, 1, 2, 3
  895. // -----------------------------------------------------------------------------
  896. // Lyasi LED
  897. // -----------------------------------------------------------------------------
  898. #elif defined(LYASI_LIGHT)
  899. // Info
  900. #define MANUFACTURER "LYASI"
  901. #define DEVICE "RGB-LED"
  902. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  903. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  904. #define DUMMY_RELAY_COUNT 1
  905. // Light
  906. #define LIGHT_CHANNELS 4
  907. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  908. #define MY92XX_CHIPS 1
  909. #define MY92XX_DI_PIN 4
  910. #define MY92XX_DCKI_PIN 5
  911. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  912. #define MY92XX_MAPPING 0, 1, 2, 3
  913. // -----------------------------------------------------------------------------
  914. // LED Controller
  915. // -----------------------------------------------------------------------------
  916. #elif defined(MAGICHOME_LED_CONTROLLER)
  917. // Info
  918. #define MANUFACTURER "MAGICHOME"
  919. #define DEVICE "LED_CONTROLLER"
  920. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  921. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  922. #define DUMMY_RELAY_COUNT 1
  923. // LEDs
  924. #define LED1_PIN 2
  925. #define LED1_PIN_INVERSE 1
  926. // Light
  927. #define LIGHT_CHANNELS 4
  928. #define LIGHT_CH1_PIN 14 // RED
  929. #define LIGHT_CH2_PIN 5 // GREEN
  930. #define LIGHT_CH3_PIN 12 // BLUE
  931. #define LIGHT_CH4_PIN 13 // WHITE
  932. #define LIGHT_CH1_INVERSE 0
  933. #define LIGHT_CH2_INVERSE 0
  934. #define LIGHT_CH3_INVERSE 0
  935. #define LIGHT_CH4_INVERSE 0
  936. // IR
  937. #define IR_SUPPORT 1
  938. #define IR_RX_PIN 4
  939. #define IR_BUTTON_SET 1
  940. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  941. // Info
  942. #define MANUFACTURER "MAGICHOME"
  943. #define DEVICE "LED_CONTROLLER_20"
  944. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  945. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  946. #define DUMMY_RELAY_COUNT 1
  947. // LEDs
  948. #define LED1_PIN 2
  949. #define LED1_PIN_INVERSE 1
  950. // Light
  951. #define LIGHT_CHANNELS 4
  952. #define LIGHT_CH1_PIN 5 // RED
  953. #define LIGHT_CH2_PIN 12 // GREEN
  954. #define LIGHT_CH3_PIN 13 // BLUE
  955. #define LIGHT_CH4_PIN 15 // WHITE
  956. #define LIGHT_CH1_INVERSE 0
  957. #define LIGHT_CH2_INVERSE 0
  958. #define LIGHT_CH3_INVERSE 0
  959. #define LIGHT_CH4_INVERSE 0
  960. // IR
  961. #define IR_SUPPORT 1
  962. #define IR_RX_PIN 4
  963. #define IR_BUTTON_SET 1
  964. #elif defined(MAGICHOME_ZJ_WFMN_A_11)
  965. // Info
  966. #define MANUFACTURER "MAGICHOME"
  967. #define DEVICE "ZJ_WFMN_A_11"
  968. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  969. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  970. #define DUMMY_RELAY_COUNT 1
  971. // LEDs
  972. #define LED1_PIN 2
  973. #define LED1_PIN_INVERSE 1
  974. #define LED2_PIN 15
  975. #define LED2_PIN_INVERSE 1
  976. // Light
  977. #define LIGHT_CHANNELS 4
  978. #define LIGHT_CH1_PIN 12 // RED
  979. #define LIGHT_CH2_PIN 5 // GREEN
  980. #define LIGHT_CH3_PIN 13 // BLUE
  981. #define LIGHT_CH4_PIN 14 // WHITE
  982. #define LIGHT_CH1_INVERSE 0
  983. #define LIGHT_CH2_INVERSE 0
  984. #define LIGHT_CH3_INVERSE 0
  985. #define LIGHT_CH4_INVERSE 0
  986. // IR
  987. #define IR_SUPPORT 1
  988. #define IR_RX_PIN 4
  989. #define IR_BUTTON_SET 1
  990. #elif defined(MAGICHOME_ZJ_WFMN_B_11)
  991. // Info
  992. #define MANUFACTURER "MAGICHOME"
  993. #define DEVICE "ZJ_WFMN_B_11"
  994. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  995. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  996. #define DUMMY_RELAY_COUNT 1
  997. // LEDs
  998. #define LED1_PIN 2
  999. #define LED1_PIN_INVERSE 1
  1000. #define LED2_PIN 15
  1001. #define LED2_PIN_INVERSE 1
  1002. // Light
  1003. #define LIGHT_CHANNELS 4
  1004. #define LIGHT_CH1_PIN 14 // RED
  1005. #define LIGHT_CH2_PIN 5 // GREEN
  1006. #define LIGHT_CH3_PIN 12 // BLUE
  1007. #define LIGHT_CH4_PIN 13 // WHITE
  1008. #define LIGHT_CH1_INVERSE 0
  1009. #define LIGHT_CH2_INVERSE 0
  1010. #define LIGHT_CH3_INVERSE 0
  1011. #define LIGHT_CH4_INVERSE 0
  1012. // RF
  1013. #define RF_SUPPORT 1
  1014. #define RFB_DIRECT 1
  1015. #define RFB_RX_PIN 4
  1016. // -----------------------------------------------------------------------------
  1017. // HUACANXING H801 & H802
  1018. // -----------------------------------------------------------------------------
  1019. #elif defined(HUACANXING_H801)
  1020. // Info
  1021. #define MANUFACTURER "HUACANXING"
  1022. #define DEVICE "H801"
  1023. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1024. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1025. #define DUMMY_RELAY_COUNT 1
  1026. #define DEBUG_PORT Serial1
  1027. #define SERIAL_RX_ENABLED 1
  1028. // LEDs
  1029. #define LED1_PIN 5
  1030. #define LED1_PIN_INVERSE 1
  1031. // Light
  1032. #define LIGHT_CHANNELS 5
  1033. #define LIGHT_CH1_PIN 15 // RED
  1034. #define LIGHT_CH2_PIN 13 // GREEN
  1035. #define LIGHT_CH3_PIN 12 // BLUE
  1036. #define LIGHT_CH4_PIN 14 // WHITE1
  1037. #define LIGHT_CH5_PIN 4 // WHITE2
  1038. #define LIGHT_CH1_INVERSE 0
  1039. #define LIGHT_CH2_INVERSE 0
  1040. #define LIGHT_CH3_INVERSE 0
  1041. #define LIGHT_CH4_INVERSE 0
  1042. #define LIGHT_CH5_INVERSE 0
  1043. #elif defined(HUACANXING_H802)
  1044. // Info
  1045. #define MANUFACTURER "HUACANXING"
  1046. #define DEVICE "H802"
  1047. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1048. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1049. #define DUMMY_RELAY_COUNT 1
  1050. #define DEBUG_PORT Serial1
  1051. #define SERIAL_RX_ENABLED 1
  1052. // Light
  1053. #define LIGHT_CHANNELS 4
  1054. #define LIGHT_CH1_PIN 12 // RED
  1055. #define LIGHT_CH2_PIN 14 // GREEN
  1056. #define LIGHT_CH3_PIN 13 // BLUE
  1057. #define LIGHT_CH4_PIN 15 // WHITE
  1058. #define LIGHT_CH1_INVERSE 0
  1059. #define LIGHT_CH2_INVERSE 0
  1060. #define LIGHT_CH3_INVERSE 0
  1061. #define LIGHT_CH4_INVERSE 0
  1062. // -----------------------------------------------------------------------------
  1063. // Jan Goedeke Wifi Relay
  1064. // https://github.com/JanGoe/esp8266-wifi-relay
  1065. // -----------------------------------------------------------------------------
  1066. #elif defined(JANGOE_WIFI_RELAY_NC)
  1067. // Info
  1068. #define MANUFACTURER "JANGOE"
  1069. #define DEVICE "WIFI_RELAY_NC"
  1070. // Buttons
  1071. #define BUTTON1_PIN 12
  1072. #define BUTTON2_PIN 13
  1073. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1074. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1075. #define BUTTON1_RELAY 1
  1076. #define BUTTON2_RELAY 2
  1077. // Relays
  1078. #define RELAY1_PIN 2
  1079. #define RELAY2_PIN 14
  1080. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1081. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1082. #elif defined(JANGOE_WIFI_RELAY_NO)
  1083. // Info
  1084. #define MANUFACTURER "JANGOE"
  1085. #define DEVICE "WIFI_RELAY_NO"
  1086. // Buttons
  1087. #define BUTTON1_PIN 12
  1088. #define BUTTON2_PIN 13
  1089. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1090. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1091. #define BUTTON1_RELAY 1
  1092. #define BUTTON2_RELAY 2
  1093. // Relays
  1094. #define RELAY1_PIN 2
  1095. #define RELAY2_PIN 14
  1096. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1097. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1098. // -----------------------------------------------------------------------------
  1099. // Jorge García Wifi+Relays Board Kit
  1100. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  1101. // https://github.com/jorgegarciadev/wifikit
  1102. // -----------------------------------------------------------------------------
  1103. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  1104. // Info
  1105. #define MANUFACTURER "JORGEGARCIA"
  1106. #define DEVICE "WIFI_RELAYS"
  1107. // Relays
  1108. #define RELAY1_PIN 0
  1109. #define RELAY2_PIN 2
  1110. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1111. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1112. // -----------------------------------------------------------------------------
  1113. // WiFi MQTT Relay / Thermostat
  1114. // -----------------------------------------------------------------------------
  1115. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  1116. // Info
  1117. #define MANUFACTURER "OPENENERGYMONITOR"
  1118. #define DEVICE "MQTT_RELAY"
  1119. // Buttons
  1120. #define BUTTON1_PIN 0
  1121. #define BUTTON1_RELAY 1
  1122. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1123. // Relays
  1124. #define RELAY1_PIN 12
  1125. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1126. // LEDs
  1127. #define LED1_PIN 16
  1128. #define LED1_PIN_INVERSE 0
  1129. // -----------------------------------------------------------------------------
  1130. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  1131. // https://rover.ebay.com/rover/1/711-53200-19255-0/1?icep_id=114&ipn=icep&toolid=20004&campid=5338044841&mpre=http%3A%2F%2Fwww.ebay.com%2Fitm%2FWiOn-50050-Indoor-Wi-Fi-Outlet-Wireless-Switch-Programmable-Timer-%2F263112281551
  1132. // https://rover.ebay.com/rover/1/711-53200-19255-0/1?icep_id=114&ipn=icep&toolid=20004&campid=5338044841&mpre=http%3A%2F%2Fwww.ebay.com%2Fitm%2FWiOn-50055-Indoor-Wi-Fi-Wall-Tap-Monitor-Energy-Usage-Wireless-Smart-Switch-%2F263020837777
  1133. // -----------------------------------------------------------------------------
  1134. #elif defined(WION_50055)
  1135. // Currently untested, does not support energy monitoring
  1136. // Info
  1137. #define MANUFACTURER "WION"
  1138. #define DEVICE "50055"
  1139. // Buttons
  1140. #define BUTTON1_PIN 13
  1141. #define BUTTON1_RELAY 1
  1142. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1143. // Relays
  1144. #define RELAY1_PIN 15
  1145. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1146. // LEDs
  1147. #define LED1_PIN 2
  1148. #define LED1_PIN_INVERSE 0
  1149. // -----------------------------------------------------------------------------
  1150. // EX-Store Wifi Relay v3.1
  1151. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  1152. // -----------------------------------------------------------------------------
  1153. #elif defined(EXS_WIFI_RELAY_V31)
  1154. // Untested
  1155. // Info
  1156. #define MANUFACTURER "EXS"
  1157. #define DEVICE "WIFI_RELAY_V31"
  1158. // Buttons
  1159. #define BUTTON1_PIN 0
  1160. #define BUTTON1_RELAY 1
  1161. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1162. // Relays
  1163. #define RELAY1_PIN 13
  1164. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1165. #define RELAY1_RESET_PIN 12
  1166. // -----------------------------------------------------------------------------
  1167. // EX-Store Wifi Relay v5.0
  1168. // -----------------------------------------------------------------------------
  1169. #elif defined(EXS_WIFI_RELAY_V50)
  1170. // Info
  1171. #define MANUFACTURER "EXS"
  1172. #define DEVICE "WIFI_RELAY_V50"
  1173. // Buttons
  1174. #define BUTTON1_PIN 5
  1175. #define BUTTON2_PIN 4
  1176. #define BUTTON1_RELAY 1
  1177. #define BUTTON2_RELAY 2
  1178. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1179. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1180. // Relays
  1181. #define RELAY1_PIN 14
  1182. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1183. #define RELAY1_RESET_PIN 16
  1184. #define RELAY2_PIN 13
  1185. #define RELAY2_TYPE RELAY_TYPE_LATCHED
  1186. #define RELAY2_RESET_PIN 12
  1187. // LEDs
  1188. #define LED1_PIN 15
  1189. #define LED1_PIN_INVERSE 0
  1190. // -----------------------------------------------------------------------------
  1191. // V9261F
  1192. // -----------------------------------------------------------------------------
  1193. #elif defined(GENERIC_V9261F)
  1194. // Info
  1195. #define MANUFACTURER "GENERIC"
  1196. #define DEVICE "V9261F"
  1197. #define ALEXA_SUPPORT 0
  1198. // V9261F
  1199. #define V9261F_SUPPORT 1
  1200. #define V9261F_PIN 2
  1201. #define V9261F_PIN_INVERSE 1
  1202. // -----------------------------------------------------------------------------
  1203. // ECH1560
  1204. // -----------------------------------------------------------------------------
  1205. #elif defined(GENERIC_ECH1560)
  1206. // Info
  1207. #define MANUFACTURER "GENERIC"
  1208. #define DEVICE "ECH1560"
  1209. #define ALEXA_SUPPORT 0
  1210. // ECH1560
  1211. #define ECH1560_SUPPORT 1
  1212. #define ECH1560_CLK_PIN 4
  1213. #define ECH1560_MISO_PIN 5
  1214. #define ECH1560_INVERTED 0
  1215. // -----------------------------------------------------------------------------
  1216. // ESPLive
  1217. // https://github.com/ManCaveMade/ESP-Live
  1218. // -----------------------------------------------------------------------------
  1219. #elif defined(MANCAVEMADE_ESPLIVE)
  1220. // Info
  1221. #define MANUFACTURER "MANCAVEMADE"
  1222. #define DEVICE "ESPLIVE"
  1223. // Buttons
  1224. #define BUTTON1_PIN 4
  1225. #define BUTTON2_PIN 5
  1226. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1227. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1228. #define BUTTON1_RELAY 1
  1229. #define BUTTON2_RELAY 2
  1230. // Relays
  1231. #define RELAY1_PIN 12
  1232. #define RELAY2_PIN 13
  1233. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1234. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1235. // DS18B20
  1236. #ifndef DALLAS_SUPPORT
  1237. #define DALLAS_SUPPORT 1
  1238. #endif
  1239. #define DALLAS_PIN 2
  1240. #define DALLAS_UPDATE_INTERVAL 5000
  1241. #define TEMPERATURE_MIN_CHANGE 1.0
  1242. // -----------------------------------------------------------------------------
  1243. // QuinLED
  1244. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  1245. // -----------------------------------------------------------------------------
  1246. #elif defined(INTERMITTECH_QUINLED)
  1247. // Info
  1248. #define MANUFACTURER "INTERMITTECH"
  1249. #define DEVICE "QUINLED"
  1250. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1251. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1252. #define DUMMY_RELAY_COUNT 1
  1253. // LEDs
  1254. #define LED1_PIN 5
  1255. #define LED1_PIN_INVERSE 1
  1256. // Light
  1257. #define LIGHT_CHANNELS 2
  1258. #define LIGHT_CH1_PIN 0
  1259. #define LIGHT_CH2_PIN 2
  1260. #define LIGHT_CH1_INVERSE 0
  1261. #define LIGHT_CH2_INVERSE 0
  1262. // -----------------------------------------------------------------------------
  1263. // Arilux AL-LC06
  1264. // -----------------------------------------------------------------------------
  1265. #elif defined(ARILUX_AL_LC01)
  1266. // Info
  1267. #define MANUFACTURER "ARILUX"
  1268. #define DEVICE "AL_LC01"
  1269. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1270. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1271. #define DUMMY_RELAY_COUNT 1
  1272. // Light
  1273. #define LIGHT_CHANNELS 3
  1274. #define LIGHT_CH1_PIN 5 // RED
  1275. #define LIGHT_CH2_PIN 12 // GREEN
  1276. #define LIGHT_CH3_PIN 13 // BLUE
  1277. #define LIGHT_CH1_INVERSE 0
  1278. #define LIGHT_CH2_INVERSE 0
  1279. #define LIGHT_CH3_INVERSE 0
  1280. #elif defined(ARILUX_AL_LC02)
  1281. // Info
  1282. #define MANUFACTURER "ARILUX"
  1283. #define DEVICE "AL_LC02"
  1284. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1285. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1286. #define DUMMY_RELAY_COUNT 1
  1287. // Light
  1288. #define LIGHT_CHANNELS 4
  1289. #define LIGHT_CH1_PIN 12 // RED
  1290. #define LIGHT_CH2_PIN 5 // GREEN
  1291. #define LIGHT_CH3_PIN 13 // BLUE
  1292. #define LIGHT_CH4_PIN 15 // WHITE1
  1293. #define LIGHT_CH1_INVERSE 0
  1294. #define LIGHT_CH2_INVERSE 0
  1295. #define LIGHT_CH3_INVERSE 0
  1296. #define LIGHT_CH4_INVERSE 0
  1297. #elif defined(ARILUX_AL_LC02_V14)
  1298. // Info
  1299. #define MANUFACTURER "ARILUX"
  1300. #define DEVICE "AL_LC02_V14"
  1301. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1302. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1303. #define DUMMY_RELAY_COUNT 1
  1304. // Light
  1305. #define LIGHT_CHANNELS 4
  1306. #define LIGHT_CH1_PIN 14 // RED
  1307. #define LIGHT_CH2_PIN 5 // GREEN
  1308. #define LIGHT_CH3_PIN 12 // BLUE
  1309. #define LIGHT_CH4_PIN 13 // WHITE1
  1310. #define LIGHT_CH1_INVERSE 0
  1311. #define LIGHT_CH2_INVERSE 0
  1312. #define LIGHT_CH3_INVERSE 0
  1313. #define LIGHT_CH4_INVERSE 0
  1314. #elif defined(ARILUX_AL_LC06)
  1315. // Info
  1316. #define MANUFACTURER "ARILUX"
  1317. #define DEVICE "AL_LC06"
  1318. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1319. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1320. #define DUMMY_RELAY_COUNT 1
  1321. // 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. // LED1 on RX pin
  1632. #define DEBUG_SERIAL_SUPPORT 1
  1633. // -----------------------------------------------------------------------------
  1634. // Maxcio W-DE004
  1635. // -----------------------------------------------------------------------------
  1636. #elif defined(MAXCIO_WDE004)
  1637. // Info
  1638. #define MANUFACTURER "MAXCIO"
  1639. #define DEVICE "WDE004"
  1640. // Buttons
  1641. #define BUTTON1_PIN 1
  1642. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1643. #define BUTTON1_RELAY 1
  1644. // Relays
  1645. #define RELAY1_PIN 14
  1646. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1647. // LEDs
  1648. #define LED1_PIN 13
  1649. #define LED1_PIN_INVERSE 1
  1650. // -----------------------------------------------------------------------------
  1651. // Oukitel P1 Smart Plug
  1652. // 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
  1653. // -----------------------------------------------------------------------------
  1654. #elif defined(OUKITEL_P1)
  1655. // Info
  1656. #define MANUFACTURER "Oukitel"
  1657. #define DEVICE "P1"
  1658. // Buttons
  1659. #define BUTTON1_PIN 13
  1660. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1661. #define BUTTON1_RELAY 1
  1662. // Relays
  1663. // Right
  1664. #define RELAY1_PIN 12
  1665. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1666. // Left
  1667. #define RELAY2_PIN 15
  1668. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1669. // LEDs
  1670. #define LED1_PIN 0 // blue
  1671. #define LED1_PIN_INVERSE 1
  1672. #define LED1_MODE LED_MODE_WIFI
  1673. // -----------------------------------------------------------------------------
  1674. // YiDian XS-SSA05
  1675. // -----------------------------------------------------------------------------
  1676. #elif defined(YIDIAN_XSSSA05)
  1677. // Info
  1678. #define MANUFACTURER "YIDIAN"
  1679. #define DEVICE "XSSSA05"
  1680. // Buttons
  1681. #define BUTTON1_PIN 13
  1682. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1683. #define BUTTON1_RELAY 1
  1684. // Relays
  1685. #define RELAY1_PIN 12
  1686. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1687. // LEDs
  1688. #define LED1_PIN 0 // red
  1689. #define LED1_PIN_INVERSE 1
  1690. #define LED1_MODE LED_MODE_WIFI
  1691. #define LED2_PIN 15 // blue
  1692. #define LED2_PIN_INVERSE 1
  1693. #define LED2_MODE LED_MODE_RELAY
  1694. // HLW8012
  1695. #ifndef HLW8012_SUPPORT
  1696. #define HLW8012_SUPPORT 1
  1697. #endif
  1698. #define HLW8012_SEL_PIN 3
  1699. #define HLW8012_CF1_PIN 14
  1700. #define HLW8012_CF_PIN 5
  1701. #define HLW8012_SEL_CURRENT LOW
  1702. #define HLW8012_CURRENT_RATIO 25740
  1703. #define HLW8012_VOLTAGE_RATIO 313400
  1704. #define HLW8012_POWER_RATIO 3414290
  1705. #define HLW8012_INTERRUPT_ON FALLING
  1706. // -----------------------------------------------------------------------------
  1707. // TONBUX XS-SSA01
  1708. // -----------------------------------------------------------------------------
  1709. #elif defined(TONBUX_XSSSA01)
  1710. // Info
  1711. #define MANUFACTURER "TONBUX"
  1712. #define DEVICE "XSSSA01"
  1713. // Buttons
  1714. #define BUTTON1_PIN 4
  1715. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1716. #define BUTTON1_RELAY 1
  1717. // Relays
  1718. #define RELAY1_PIN 14
  1719. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1720. // LEDs
  1721. #define LED1_PIN 13
  1722. #define LED1_PIN_INVERSE 0
  1723. // -----------------------------------------------------------------------------
  1724. // TONBUX XS-SSA06
  1725. // -----------------------------------------------------------------------------
  1726. #elif defined(TONBUX_XSSSA06)
  1727. // Info
  1728. #define MANUFACTURER "TONBUX"
  1729. #define DEVICE "XSSSA06"
  1730. // Buttons
  1731. #define BUTTON1_PIN 13
  1732. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1733. #define BUTTON1_RELAY 1
  1734. // Relays
  1735. #define RELAY1_PIN 15
  1736. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1737. // LEDs
  1738. #define LED1_PIN 0 // R - 8 rgb led ring
  1739. #define LED1_PIN_INVERSE 0
  1740. #define LED2_PIN 5 // G
  1741. #define LED2_PIN_INVERSE 0
  1742. #define LED3_PIN 2 // B
  1743. #define LED3_PIN_INVERSE 0
  1744. // -----------------------------------------------------------------------------
  1745. // GREEN ESP8266 RELAY MODULE
  1746. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1747. // -----------------------------------------------------------------------------
  1748. #elif defined(GREEN_ESP8266RELAY)
  1749. // Info
  1750. #define MANUFACTURER "GREEN"
  1751. #define DEVICE "ESP8266RELAY"
  1752. // Buttons
  1753. // Not a button but input via Optocoupler
  1754. #define BUTTON1_PIN 5
  1755. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1756. #define BUTTON1_RELAY 1
  1757. // Relays
  1758. #define RELAY1_PIN 4
  1759. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1760. // LEDs
  1761. #define LED1_PIN 2
  1762. #define LED1_PIN_INVERSE 1
  1763. // -----------------------------------------------------------------------------
  1764. // Henrique Gravina ESPIKE
  1765. // https://github.com/Henriquegravina/Espike
  1766. // -----------------------------------------------------------------------------
  1767. #elif defined(IKE_ESPIKE)
  1768. #define MANUFACTURER "IKE"
  1769. #define DEVICE "ESPIKE"
  1770. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1771. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1772. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1773. #define BUTTON1_PIN 13
  1774. #define BUTTON1_RELAY 1
  1775. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1776. #define BUTTON2_PIN 12
  1777. #define BUTTON2_RELAY 2
  1778. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1779. #define BUTTON3_PIN 14
  1780. #define BUTTON3_RELAY 3
  1781. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1782. #define RELAY1_PIN 4
  1783. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1784. #define RELAY2_PIN 5
  1785. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1786. #define RELAY3_PIN 16
  1787. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1788. #define LED1_PIN 2
  1789. #define LED1_PIN_INVERSE 1
  1790. // -----------------------------------------------------------------------------
  1791. // SWIFITCH
  1792. // https://github.com/ArnieX/swifitch
  1793. // -----------------------------------------------------------------------------
  1794. #elif defined(ARNIEX_SWIFITCH)
  1795. // Info
  1796. #define MANUFACTURER "ARNIEX"
  1797. #define DEVICE "SWIFITCH"
  1798. // Buttons
  1799. #define BUTTON1_PIN 4 // D2
  1800. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1801. #define BUTTON1_RELAY 1
  1802. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1803. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1804. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1805. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1806. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1807. // Relays
  1808. #define RELAY1_PIN 5 // D1
  1809. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1810. // LEDs
  1811. #define LED1_PIN 12 // D6
  1812. #define LED1_PIN_INVERSE 1
  1813. // -----------------------------------------------------------------------------
  1814. // ESP-01S RELAY v4.0
  1815. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  1816. // -----------------------------------------------------------------------------
  1817. #elif defined(GENERIC_ESP01S_RELAY_V40)
  1818. // Info
  1819. #define MANUFACTURER "GENERIC"
  1820. #define DEVICE "ESP01S_RELAY_40"
  1821. // Relays
  1822. #define RELAY1_PIN 0
  1823. #ifndef RELAY1_TYPE
  1824. #define RELAY1_TYPE RELAY_TYPE_NORMAL // See #1504 and #1554
  1825. #endif
  1826. // LEDs
  1827. #define LED1_PIN 2
  1828. #define LED1_PIN_INVERSE 0
  1829. // -----------------------------------------------------------------------------
  1830. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  1831. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  1832. // -----------------------------------------------------------------------------
  1833. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  1834. // Info
  1835. #define MANUFACTURER "GENERIC"
  1836. #define DEVICE "ESP01S_RGBLED_10"
  1837. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  1838. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  1839. // Buttons
  1840. //#define BUTTON1_PIN 2
  1841. // Relays
  1842. //#define RELAY1_PIN 2
  1843. // LEDs
  1844. #define LED1_PIN 2
  1845. #define LED1_PIN_INVERSE 0
  1846. // -----------------------------------------------------------------------------
  1847. // ESP-01S DHT11 v1.0
  1848. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  1849. // -----------------------------------------------------------------------------
  1850. #elif defined(GENERIC_ESP01S_DHT11_V10)
  1851. // Info
  1852. #define MANUFACTURER "GENERIC"
  1853. #define DEVICE "ESP01S_DHT11_10"
  1854. // DHT11
  1855. #ifndef DHT_SUPPORT
  1856. #define DHT_SUPPORT 1
  1857. #endif
  1858. #define DHT_PIN 2
  1859. #define DHT_TYPE DHT_CHIP_DHT11
  1860. // -----------------------------------------------------------------------------
  1861. // ESP-01S DS18B20 v1.0
  1862. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  1863. // -----------------------------------------------------------------------------
  1864. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  1865. // Info
  1866. #define MANUFACTURER "GENERIC"
  1867. #define DEVICE "ESP01S_DS18B20_10"
  1868. // DB18B20
  1869. #ifndef DALLAS_SUPPORT
  1870. #define DALLAS_SUPPORT 1
  1871. #endif
  1872. #define DALLAS_PIN 2
  1873. // -----------------------------------------------------------------------------
  1874. // ESP-DIN relay board V1
  1875. // https://github.com/pilotak/esp_din
  1876. // -----------------------------------------------------------------------------
  1877. #elif defined(PILOTAK_ESP_DIN_V1)
  1878. // Info
  1879. #define MANUFACTURER "PILOTAK"
  1880. #define DEVICE "ESP_DIN_V1"
  1881. // Buttons
  1882. #define BUTTON1_PIN 0
  1883. #define BUTTON1_RELAY 1
  1884. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1885. // Relays
  1886. #define RELAY1_PIN 4
  1887. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1888. #define RELAY2_PIN 5
  1889. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1890. // LEDs
  1891. #define LED1_PIN 15
  1892. #define LED1_PIN_INVERSE 0
  1893. #define I2C_SDA_PIN 12
  1894. #define I2C_SCL_PIN 13
  1895. #ifndef DALLAS_SUPPORT
  1896. #define DALLAS_SUPPORT 1
  1897. #endif
  1898. #define DALLAS_PIN 2
  1899. #define RF_SUPPORT 1
  1900. #define RFB_DIRECT 1
  1901. #define RFB_RX_PIN 14
  1902. #ifndef DIGITAL_SUPPORT
  1903. #define DIGITAL_SUPPORT 1
  1904. #endif
  1905. #define DIGITAL_PIN 16
  1906. #define DIGITAL_PIN_MODE INPUT
  1907. // -----------------------------------------------------------------------------
  1908. // Heltec Touch Relay
  1909. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  1910. // -----------------------------------------------------------------------------
  1911. #elif defined(HELTEC_TOUCHRELAY)
  1912. // Info
  1913. #define MANUFACTURER "HELTEC"
  1914. #define DEVICE "TOUCH_RELAY"
  1915. // Buttons
  1916. #define BUTTON1_PIN 14
  1917. #define BUTTON1_RELAY 1
  1918. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1919. // Relays
  1920. #define RELAY1_PIN 12
  1921. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1922. // -----------------------------------------------------------------------------
  1923. // Zhilde ZLD-EU44-W
  1924. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  1925. // -----------------------------------------------------------------------------
  1926. #elif defined(ZHILDE_EU44_W)
  1927. // Info
  1928. #define MANUFACTURER "ZHILDE"
  1929. #define DEVICE "EU44_W"
  1930. // Based on the reporter, this product uses GPIO1 and 3 for the button
  1931. // and onboard LED, so hardware serial should be disabled...
  1932. #define DEBUG_SERIAL_SUPPORT 0
  1933. // Buttons
  1934. #define BUTTON1_PIN 3
  1935. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1936. // Relays
  1937. #define RELAY1_PIN 5
  1938. #define RELAY2_PIN 4
  1939. #define RELAY3_PIN 12
  1940. #define RELAY4_PIN 13
  1941. #define RELAY5_PIN 14
  1942. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1943. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1944. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1945. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1946. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1947. // LEDs
  1948. #define LED1_PIN 1
  1949. #define LED1_PIN_INVERSE 1
  1950. // -----------------------------------------------------------------------------
  1951. // Allnet 4duino ESP8266-UP-Relais
  1952. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  1953. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  1954. // -----------------------------------------------------------------------------
  1955. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  1956. // Info
  1957. #define MANUFACTURER "ALLNET"
  1958. #define DEVICE "4DUINO_IOT_WLAN_RELAIS"
  1959. // Relays
  1960. #define RELAY1_PIN 14
  1961. #define RELAY1_RESET_PIN 12
  1962. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1963. // LEDs
  1964. #define LED1_PIN 0
  1965. #define LED1_PIN_INVERSE 1
  1966. // Buttons
  1967. //#define BUTTON1_PIN 0
  1968. //#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1969. // Using pins labelled as SDA & SCL as buttons
  1970. #define BUTTON2_PIN 4
  1971. #define BUTTON2_MODE BUTTON_PUSHBUTTON
  1972. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  1973. #define BUTTON2_CLICK BUTTON_MODE_NONE
  1974. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  1975. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  1976. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  1977. #define BUTTON3_PIN 5
  1978. #define BUTTON3_MODE BUTTON_PUSHBUTTON
  1979. // Using pins labelled as SDA & SCL for I2C
  1980. //#define I2C_SDA_PIN 4
  1981. //#define I2C_SCL_PIN 5
  1982. // -----------------------------------------------------------------------------
  1983. // Luani HVIO
  1984. // https://luani.de/projekte/esp8266-hvio/
  1985. // https://luani.de/blog/esp8266-230v-io-modul/
  1986. // -----------------------------------------------------------------------------
  1987. #elif defined(LUANI_HVIO)
  1988. // Info
  1989. #define MANUFACTURER "LUANI"
  1990. #define DEVICE "HVIO"
  1991. // Buttons
  1992. #define BUTTON1_PIN 12
  1993. #define BUTTON1_RELAY 1
  1994. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  1995. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1996. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1997. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1998. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1999. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  2000. #define BUTTON2_PIN 13
  2001. #define BUTTON2_RELAY 2
  2002. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  2003. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  2004. // Relays
  2005. #define RELAY1_PIN 4
  2006. #define RELAY2_PIN 5
  2007. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2008. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2009. // LEDs
  2010. #define LED1_PIN 15
  2011. #define LED1_PIN_INVERSE 0
  2012. // -----------------------------------------------------------------------------
  2013. // Tonbux 50-100M Smart Mosquito Killer USB
  2014. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  2015. // -----------------------------------------------------------------------------
  2016. #elif defined(TONBUX_MOSQUITO_KILLER)
  2017. // Info
  2018. #define MANUFACTURER "TONBUX"
  2019. #define DEVICE "MOSQUITO_KILLER"
  2020. // Buttons
  2021. #define BUTTON1_PIN 2
  2022. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2023. #define BUTTON1_RELAY 1
  2024. // Relays
  2025. #define RELAY1_PIN 5 // not a relay, fan
  2026. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2027. // LEDs
  2028. #define LED1_PIN 15 // blue led
  2029. #define LED1_PIN_INVERSE 1
  2030. #define LED1_MODE LED_MODE_WIFI
  2031. #define LED2_PIN 14 // red led
  2032. #define LED2_PIN_INVERSE 1
  2033. #define LED2_MODE LED_MODE_RELAY
  2034. #define LED3_PIN 12 // UV leds (1-2-3-4-5-6-7-8)
  2035. #define LED3_PIN_INVERSE 0
  2036. #define LED3_RELAY 1
  2037. #define LED4_PIN 16 // UV leds (9-10-11)
  2038. #define LED4_PIN_INVERSE 0
  2039. #define LED4_RELAY 1
  2040. // -----------------------------------------------------------------------------
  2041. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  2042. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  2043. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  2044. // -----------------------------------------------------------------------------
  2045. #elif defined(NEO_COOLCAM_NAS_WR01W)
  2046. // Info
  2047. #define MANUFACTURER "NEO_COOLCAM"
  2048. #define DEVICE "NAS_WR01W"
  2049. // Buttons
  2050. #define BUTTON1_PIN 13
  2051. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2052. #define BUTTON1_RELAY 1
  2053. // Relays
  2054. #define RELAY1_PIN 12
  2055. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2056. // LEDs
  2057. #define LED1_PIN 4
  2058. #define LED1_PIN_INVERSE 1
  2059. // ------------------------------------------------------------------------------
  2060. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  2061. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  2062. // Also: Estink Wifi Power Strip
  2063. // -----------------------------------------------------------------------------
  2064. #elif defined(FORNORM_ZLD_34EU)
  2065. // Info
  2066. #define MANUFACTURER "FORNORM"
  2067. #define DEVICE "ZLD_34EU"
  2068. // Disable UART noise since this board uses GPIO3
  2069. #define DEBUG_SERIAL_SUPPORT 0
  2070. // Buttons
  2071. #define BUTTON1_PIN 16
  2072. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2073. #define BUTTON1_RELAY 4
  2074. // Relays
  2075. #define RELAY1_PIN 14 // USB power
  2076. #define RELAY2_PIN 13 // power plug 1
  2077. #define RELAY3_PIN 4 // power plug 2
  2078. #define RELAY4_PIN 15 // power plug 3
  2079. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2080. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2081. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2082. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2083. // LEDs
  2084. #define LED1_PIN 0 // power led
  2085. #define LED2_PIN 12 // power plug 1
  2086. #define LED3_PIN 3 // power plug 2
  2087. #define LED4_PIN 5 // power plug 3
  2088. #define LED1_PIN_INVERSE 1
  2089. #define LED2_PIN_INVERSE 1
  2090. #define LED3_PIN_INVERSE 1
  2091. #define LED4_PIN_INVERSE 1
  2092. #define LED1_MODE LED_MODE_FINDME
  2093. #define LED2_MODE LED_MODE_FOLLOW
  2094. #define LED3_MODE LED_MODE_FOLLOW
  2095. #define LED4_MODE LED_MODE_FOLLOW
  2096. #define LED2_RELAY 2
  2097. #define LED3_RELAY 3
  2098. #define LED4_RELAY 4
  2099. // -----------------------------------------------------------------------------
  2100. // Bruno Horta's OnOfre
  2101. // https://www.bhonofre.pt/
  2102. // https://github.com/brunohorta82/BH_OnOfre/
  2103. // -----------------------------------------------------------------------------
  2104. #elif defined(BH_ONOFRE)
  2105. // Info
  2106. #define MANUFACTURER "BH"
  2107. #define DEVICE "ONOFRE"
  2108. // Buttons
  2109. #define BUTTON1_PIN 12
  2110. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2111. #define BUTTON1_RELAY 1
  2112. #define BUTTON2_PIN 13
  2113. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2114. #define BUTTON2_RELAY 2
  2115. // Relays
  2116. #define RELAY1_PIN 4
  2117. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2118. #define RELAY2_PIN 5
  2119. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2120. // -----------------------------------------------------------------------------
  2121. // BlitzWolf SHP2 and SHP6
  2122. // Also several boards under different names uing a power chip labelled BL0937 or HJL-01
  2123. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  2124. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  2125. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  2126. // * Gosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  2127. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  2128. // -----------------------------------------------------------------------------
  2129. #elif defined(BLITZWOLF_BWSHPX)
  2130. // Info
  2131. #define MANUFACTURER "BLITZWOLF"
  2132. #define DEVICE "BWSHPX"
  2133. // Buttons
  2134. #define BUTTON1_PIN 13
  2135. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2136. #define BUTTON1_RELAY 1
  2137. // Relays
  2138. #define RELAY1_PIN 15
  2139. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2140. // LEDs
  2141. #define LED1_PIN 2
  2142. #define LED1_PIN_INVERSE 1
  2143. #define LED2_PIN 0
  2144. #define LED2_PIN_INVERSE 1
  2145. #define LED2_MODE LED_MODE_FINDME
  2146. #define LED2_RELAY 1
  2147. // HJL01 / BL0937
  2148. #ifndef HLW8012_SUPPORT
  2149. #define HLW8012_SUPPORT 1
  2150. #endif
  2151. #define HLW8012_SEL_PIN 12
  2152. #define HLW8012_CF1_PIN 14
  2153. #define HLW8012_CF_PIN 5
  2154. #define HLW8012_SEL_CURRENT LOW
  2155. #define HLW8012_CURRENT_RATIO 25740
  2156. #define HLW8012_VOLTAGE_RATIO 313400
  2157. #define HLW8012_POWER_RATIO 3414290
  2158. #define HLW8012_INTERRUPT_ON FALLING
  2159. // -----------------------------------------------------------------------------
  2160. // Same as the above but new board version marked V2.3
  2161. // BlitzWolf SHP2 V2.3
  2162. // Gosund SP1 V2.3
  2163. // -----------------------------------------------------------------------------
  2164. #elif defined(BLITZWOLF_BWSHPX_V23)
  2165. // Info
  2166. #define MANUFACTURER "BLITZWOLF"
  2167. #define DEVICE "BWSHPX_V23"
  2168. // Buttons
  2169. #define BUTTON1_PIN 3
  2170. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2171. #define BUTTON1_RELAY 1
  2172. // Relays
  2173. #define RELAY1_PIN 14
  2174. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2175. // LEDs
  2176. #define LED1_PIN 1
  2177. #define LED1_PIN_INVERSE 1
  2178. #define LED2_PIN 13
  2179. #define LED2_PIN_INVERSE 1
  2180. #define LED2_MODE LED_MODE_FINDME
  2181. #define LED2_RELAY 1
  2182. // HJL01 / BL0937
  2183. #ifndef HLW8012_SUPPORT
  2184. #define HLW8012_SUPPORT 1
  2185. #endif
  2186. #define HLW8012_SEL_PIN 12
  2187. #define HLW8012_CF1_PIN 5
  2188. #define HLW8012_CF_PIN 4
  2189. #define HLW8012_SEL_CURRENT LOW
  2190. #define HLW8012_CURRENT_RATIO 25740
  2191. #define HLW8012_VOLTAGE_RATIO 313400
  2192. #define HLW8012_POWER_RATIO 3414290
  2193. #define HLW8012_INTERRUPT_ON FALLING
  2194. // BUTTON1 and LED1 are using Serial pins
  2195. #define DEBUG_SERIAL_SUPPORT 0
  2196. // -----------------------------------------------------------------------------
  2197. // Teckin SP22 v1.4 - v1.6
  2198. // -----------------------------------------------------------------------------
  2199. #elif defined(TECKIN_SP22_V14)
  2200. // Info
  2201. #define MANUFACTURER "TECKIN"
  2202. #define DEVICE "SP22_V14"
  2203. // Buttons
  2204. #define BUTTON1_PIN 1
  2205. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2206. #define BUTTON1_RELAY 1
  2207. // Relays
  2208. #define RELAY1_PIN 14
  2209. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2210. // LEDs
  2211. #define LED1_PIN 3
  2212. #define LED1_PIN_INVERSE 1
  2213. #define LED2_PIN 13
  2214. #define LED2_PIN_INVERSE 1
  2215. #define LED2_MODE LED_MODE_FINDME
  2216. #define LED2_RELAY 1
  2217. // HJL01 / BL0937
  2218. #ifndef HLW8012_SUPPORT
  2219. #define HLW8012_SUPPORT 1
  2220. #endif
  2221. #define HLW8012_SEL_PIN 12
  2222. #define HLW8012_CF1_PIN 5
  2223. #define HLW8012_CF_PIN 4
  2224. #define HLW8012_SEL_CURRENT LOW
  2225. #define HLW8012_CURRENT_RATIO 20730
  2226. #define HLW8012_VOLTAGE_RATIO 264935
  2227. #define HLW8012_POWER_RATIO 2533110
  2228. #define HLW8012_INTERRUPT_ON FALLING
  2229. // BUTTON1 and LED1 are using Serial pins
  2230. #define DEBUG_SERIAL_SUPPORT 0
  2231. // -----------------------------------------------------------------------------
  2232. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  2233. // Also model number KS-602S
  2234. // -----------------------------------------------------------------------------
  2235. #elif defined(GOSUND_WS1)
  2236. // Info
  2237. #define MANUFACTURER "GOSUND"
  2238. #define DEVICE "WS1"
  2239. // Buttons
  2240. #define BUTTON1_PIN 0
  2241. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2242. #define BUTTON1_RELAY 1
  2243. // Relays
  2244. #define RELAY1_PIN 14
  2245. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2246. // LEDs
  2247. #define LED1_PIN 1
  2248. #define LED1_PIN_INVERSE 1
  2249. // LED1 is using TX pin
  2250. #define DEBUG_SERIAL_SUPPORT 0
  2251. // ----------------------------------------------------------------------------------------
  2252. // Homecube 16A is similar but some pins differ and it also has RGB LEDs
  2253. // https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
  2254. // ----------------------------------------------------------------------------------------
  2255. #elif defined(HOMECUBE_16A)
  2256. // Info
  2257. #define MANUFACTURER "HOMECUBE"
  2258. #define DEVICE "16A"
  2259. // Buttons
  2260. #define BUTTON1_PIN 13
  2261. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2262. #define BUTTON1_RELAY 1
  2263. // Relays
  2264. #define RELAY1_PIN 15
  2265. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2266. // LEDs
  2267. //LED Pin 4 - ESP8266 onboard LED
  2268. //Red LED: 0
  2269. //Green LED: 12
  2270. //Blue LED: 2
  2271. // Blue
  2272. #define LED1_PIN 2
  2273. #define LED1_PIN_INVERSE 0
  2274. // Green
  2275. #define LED2_PIN 12
  2276. #define LED2_PIN_INVERSE 1
  2277. #define LED2_MODE LED_MODE_RELAY
  2278. // Red
  2279. #define LED3_PIN 0
  2280. #define LED3_PIN_INVERSE 0
  2281. #define LED3_MODE LED_MODE_OFF
  2282. // HJL01 / BL0937
  2283. #ifndef HLW8012_SUPPORT
  2284. #define HLW8012_SUPPORT 1
  2285. #endif
  2286. #define HLW8012_SEL_PIN 16
  2287. #define HLW8012_CF1_PIN 14
  2288. #define HLW8012_CF_PIN 5
  2289. #define HLW8012_SEL_CURRENT LOW
  2290. #define HLW8012_CURRENT_RATIO 25740
  2291. #define HLW8012_VOLTAGE_RATIO 313400
  2292. #define HLW8012_POWER_RATIO 3414290
  2293. #define HLW8012_INTERRUPT_ON FALLING
  2294. // -----------------------------------------------------------------------------
  2295. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  2296. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  2297. // -----------------------------------------------------------------------------
  2298. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  2299. // Info
  2300. #define MANUFACTURER "VANZAVANZU"
  2301. #define DEVICE "SMART_WIFI_PLUG_MINI"
  2302. // Buttons
  2303. #define BUTTON1_PIN 13
  2304. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2305. #define BUTTON1_RELAY 1
  2306. // Relays
  2307. #define RELAY1_PIN 15
  2308. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2309. // LEDs
  2310. #define LED1_PIN 2
  2311. #define LED1_PIN_INVERSE 1
  2312. #define LED2_PIN 0
  2313. #define LED2_PIN_INVERSE 1
  2314. #define LED2_MODE LED_MODE_FINDME
  2315. #define LED2_RELAY 1
  2316. // Disable UART noise
  2317. #define DEBUG_SERIAL_SUPPORT 0
  2318. // HJL01 / BL0937
  2319. #ifndef HLW8012_SUPPORT
  2320. #define HLW8012_SUPPORT 1
  2321. #endif
  2322. #define HLW8012_SEL_PIN 3
  2323. #define HLW8012_CF1_PIN 14
  2324. #define HLW8012_CF_PIN 5
  2325. #define HLW8012_SEL_CURRENT LOW
  2326. #define HLW8012_CURRENT_RATIO 25740
  2327. #define HLW8012_VOLTAGE_RATIO 313400
  2328. #define HLW8012_POWER_RATIO 3414290
  2329. #define HLW8012_INTERRUPT_ON FALLING
  2330. // -----------------------------------------------------------------------------
  2331. #elif defined(GENERIC_AG_L4)
  2332. // Info
  2333. #define MANUFACTURER "GENERIC"
  2334. #define DEVICE "AG_L4"
  2335. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2336. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2337. #define DUMMY_RELAY_COUNT 1
  2338. // button 1: "power" button
  2339. #define BUTTON1_PIN 4
  2340. #define BUTTON1_RELAY 1
  2341. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2342. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  2343. #define BUTTON1_CLICK BUTTON_MODE_NONE
  2344. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2345. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2346. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  2347. // button 2: "wifi" button
  2348. #define BUTTON2_PIN 2
  2349. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2350. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  2351. #define BUTTON2_CLICK BUTTON_MODE_NONE
  2352. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  2353. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  2354. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  2355. // LEDs
  2356. #define LED1_PIN 5 // red status led
  2357. #define LED1_PIN_INVERSE 0
  2358. #define LED2_PIN 16 // master light power
  2359. #define LED2_PIN_INVERSE 1
  2360. #define LED2_MODE LED_MODE_RELAY
  2361. // Light
  2362. #define LIGHT_CHANNELS 3
  2363. #define LIGHT_CH1_PIN 14 // RED
  2364. #define LIGHT_CH2_PIN 13 // GREEN
  2365. #define LIGHT_CH3_PIN 12 // BLUE
  2366. #define LIGHT_CH1_INVERSE 0
  2367. #define LIGHT_CH2_INVERSE 0
  2368. #define LIGHT_CH3_INVERSE 0
  2369. // -----------------------------------------------------------------------------
  2370. #elif defined(ALLTERCO_SHELLY1)
  2371. // Info
  2372. #define MANUFACTURER "ALLTERCO"
  2373. #define DEVICE "SHELLY1"
  2374. // Buttons
  2375. #define BUTTON1_PIN 5
  2376. #define BUTTON1_MODE BUTTON_SWITCH
  2377. #define BUTTON1_RELAY 1
  2378. // Relays
  2379. #define RELAY1_PIN 4
  2380. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2381. #elif defined(ALLTERCO_SHELLY2)
  2382. // Info
  2383. #define MANUFACTURER "ALLTERCO"
  2384. #define DEVICE "SHELLY2"
  2385. // Buttons
  2386. #define BUTTON1_PIN 12
  2387. #define BUTTON2_PIN 14
  2388. #define BUTTON1_MODE BUTTON_SWITCH
  2389. #define BUTTON2_MODE BUTTON_SWITCH
  2390. #define BUTTON1_RELAY 1
  2391. #define BUTTON2_RELAY 2
  2392. // Relays
  2393. #define RELAY1_PIN 4
  2394. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2395. #define RELAY2_PIN 5
  2396. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2397. // -----------------------------------------------------------------------------
  2398. #elif defined(LOHAS_9W)
  2399. // Info
  2400. #define MANUFACTURER "LOHAS"
  2401. #define DEVICE "E27_9W"
  2402. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2403. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2404. #define DUMMY_RELAY_COUNT 1
  2405. // Light
  2406. #define LIGHT_CHANNELS 5
  2407. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2408. #define MY92XX_CHIPS 2
  2409. #define MY92XX_DI_PIN 13
  2410. #define MY92XX_DCKI_PIN 15
  2411. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2412. #define MY92XX_MAPPING 0, 1, 2, 3, 4
  2413. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  2414. // -----------------------------------------------------------------------------
  2415. #elif defined(XIAOMI_SMART_DESK_LAMP)
  2416. // Info
  2417. #define MANUFACTURER "XIAOMI"
  2418. #define DEVICE "SMART_DESK_LAMP"
  2419. // Buttons
  2420. #define BUTTON1_PIN 2
  2421. #define BUTTON2_PIN 14
  2422. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2423. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2424. // This button doubles as switch here and as encoder mode switch below
  2425. // Clicking it (for less than 500ms) will turn the light on and off
  2426. // Double and Long clicks will not work as these are used to modify the encoder action
  2427. #define BUTTON1_RELAY 1
  2428. #define BUTTON_LNGCLICK_DELAY 500
  2429. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2430. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2431. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  2432. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  2433. #define BUTTON2_DBLCLICK BUTTON_MODE_AP
  2434. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  2435. // Light
  2436. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2437. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2438. #define DUMMY_RELAY_COUNT 1
  2439. #define LIGHT_STEP 8
  2440. #define LIGHT_CHANNELS 2
  2441. #define LIGHT_CH1_PIN 5 // warm white
  2442. #define LIGHT_CH1_INVERSE 0
  2443. #define LIGHT_CH2_PIN 4 // cold white
  2444. #define LIGHT_CH2_INVERSE 0
  2445. // Encoder
  2446. // If mode is ENCODER_MODE_RATIO, the value ratio between both channels is changed
  2447. // when the button is not pressed, and the overall brightness when pressed
  2448. // If mode is ENCODER_MODE_CHANNEL, the first channel value is changed
  2449. // when the button is not pressed, and the second channel when pressed
  2450. // If no ENCODERX_BUTTON_PIN defined it will only change the value of the first defined channel
  2451. #define ENCODER_SUPPORT 1
  2452. #define ENCODER1_PIN1 12
  2453. #define ENCODER1_PIN2 13
  2454. #define ENCODER1_BUTTON_PIN 2 // active low by default, with software pullup
  2455. #define ENCODER1_CHANNEL1 0 // please note this value is 0-based (LIGHT_CH1 above)
  2456. #define ENCODER1_CHANNEL2 1 // please note this value is 0-based (LIGHT_CH2 above)
  2457. #define ENCODER1_MODE ENCODER_MODE_RATIO
  2458. #elif defined(PHYX_ESP12_RGB)
  2459. // Info
  2460. #define MANUFACTURER "PHYX"
  2461. #define DEVICE "ESP12_RGB"
  2462. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2463. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2464. #define DUMMY_RELAY_COUNT 1
  2465. // Light
  2466. #define LIGHT_CHANNELS 3
  2467. #define LIGHT_CH1_PIN 4 // RED
  2468. #define LIGHT_CH2_PIN 14 // GREEN
  2469. #define LIGHT_CH3_PIN 12 // BLUE
  2470. #define LIGHT_CH1_INVERSE 0
  2471. #define LIGHT_CH2_INVERSE 0
  2472. #define LIGHT_CH3_INVERSE 0
  2473. // -----------------------------------------------------------------------------
  2474. // iWoole LED Table Lamp
  2475. // 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
  2476. // -----------------------------------------------------------------------------
  2477. #elif defined(IWOOLE_LED_TABLE_LAMP)
  2478. // Info
  2479. #define MANUFACTURER "IWOOLE"
  2480. #define DEVICE "LED_TABLE_LAMP"
  2481. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2482. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2483. #define DUMMY_RELAY_COUNT 1
  2484. // Light
  2485. #define LIGHT_CHANNELS 4
  2486. #define LIGHT_CH1_PIN 12 // RED
  2487. #define LIGHT_CH2_PIN 5 // GREEN
  2488. #define LIGHT_CH3_PIN 14 // BLUE
  2489. #define LIGHT_CH4_PIN 4 // WHITE
  2490. #define LIGHT_CH1_INVERSE 0
  2491. #define LIGHT_CH2_INVERSE 0
  2492. #define LIGHT_CH3_INVERSE 0
  2493. #define LIGHT_CH4_INVERSE 0
  2494. // -----------------------------------------------------------------------------
  2495. // Generic GU10
  2496. // https://www.ebay.com/itm/1-10PC-GU10-RGB-Smart-Bulb-Wireless-WiFi-App-Remote-Ctrl-Light-for-Alexa-Google/173724116351
  2497. // -----------------------------------------------------------------------------
  2498. #elif defined(GENERIC_GU10)
  2499. // Info
  2500. #define MANUFACTURER "GENERIC"
  2501. #define DEVICE "GU10"
  2502. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2503. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2504. #define DUMMY_RELAY_COUNT 1
  2505. // Light
  2506. #define LIGHT_CHANNELS 4
  2507. #define LIGHT_CH1_PIN 14 // RED
  2508. #define LIGHT_CH2_PIN 12 // GREEN
  2509. #define LIGHT_CH3_PIN 13 // BLUE
  2510. #define LIGHT_CH4_PIN 4 // WHITE
  2511. #define LIGHT_CH1_INVERSE 0
  2512. #define LIGHT_CH2_INVERSE 0
  2513. #define LIGHT_CH3_INVERSE 0
  2514. #define LIGHT_CH4_INVERSE 0
  2515. // -----------------------------------------------------------------------------
  2516. // Lombex Lux Nova 2 Tunable White
  2517. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2518. // -----------------------------------------------------------------------------
  2519. #elif defined(LOMBEX_LUX_NOVA2_TUNABLE_WHITE)
  2520. // Info
  2521. #define MANUFACTURER "LOMBEX"
  2522. #define DEVICE "LUX_NOVA2_TUNABLE_WHITE"
  2523. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2524. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2525. #define DUMMY_RELAY_COUNT 1
  2526. // Light
  2527. #define LIGHT_CHANNELS 5
  2528. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2529. #define MY92XX_CHIPS 1
  2530. #define MY92XX_DI_PIN 4
  2531. #define MY92XX_DCKI_PIN 5
  2532. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2533. // No RGB on this bulb. Warm white on channel 0, cool white on channel 3
  2534. #define MY92XX_MAPPING 255, 255, 255, 3, 0
  2535. // -----------------------------------------------------------------------------
  2536. // Lombex Lux Nova 2 White and Color
  2537. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2538. // -----------------------------------------------------------------------------
  2539. #elif defined(LOMBEX_LUX_NOVA2_WHITE_COLOR)
  2540. // Info
  2541. #define MANUFACTURER "LOMBEX"
  2542. #define DEVICE "LUX_NOVA2_WHITE_COLOR"
  2543. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2544. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2545. #define DUMMY_RELAY_COUNT 1
  2546. // Light
  2547. #define LIGHT_CHANNELS 4
  2548. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2549. #define MY92XX_CHIPS 1
  2550. #define MY92XX_DI_PIN 4
  2551. #define MY92XX_DCKI_PIN 5
  2552. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2553. // RGB on channels 0/1/2, either cool or warm white on channel 3
  2554. // The bulb *should* have cool leds, but could also have warm leds as a common defect
  2555. #define MY92XX_MAPPING 0, 1, 2, 3
  2556. // -----------------------------------------------------------------------------
  2557. // Bestek Smart Plug with 2 USB ports
  2558. // https://www.bestekcorp.com/bestek-smart-plug-works-with-amazon-alexa-google-assistant-and-ifttt-with-2-usb
  2559. // -----------------------------------------------------------------------------
  2560. #elif defined(BESTEK_MRJ1011)
  2561. // Info
  2562. #define MANUFACTURER "BESTEK"
  2563. #define DEVICE "MRJ1011"
  2564. // Buttons
  2565. #define BUTTON1_PIN 13
  2566. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2567. #define BUTTON1_RELAY 1
  2568. // Relay
  2569. #define RELAY1_PIN 12
  2570. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2571. // LED
  2572. #define LED1_PIN 4
  2573. #define LED1_PIN_INVERSE 1
  2574. // -----------------------------------------------------------------------------
  2575. // GBLIFE RGBW SOCKET
  2576. // -----------------------------------------------------------------------------
  2577. #elif defined(GBLIFE_RGBW_SOCKET)
  2578. // Info
  2579. #define MANUFACTURER "GBLIFE"
  2580. #define DEVICE "RGBW_SOCKET"
  2581. // Buttons
  2582. #define BUTTON1_PIN 13
  2583. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2584. #define BUTTON1_RELAY 1
  2585. // Relays
  2586. #define RELAY1_PIN 15
  2587. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2588. // Light RGBW
  2589. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2590. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2591. #define DUMMY_RELAY_COUNT 1
  2592. #define LIGHT_CHANNELS 4
  2593. #define LIGHT_CH1_PIN 5 // RED
  2594. #define LIGHT_CH2_PIN 14 // GREEN
  2595. #define LIGHT_CH3_PIN 12 // BLUE
  2596. #define LIGHT_CH4_PIN 4 // WHITE
  2597. #define LIGHT_CH1_INVERSE 0
  2598. #define LIGHT_CH2_INVERSE 0
  2599. #define LIGHT_CH3_INVERSE 0
  2600. #define LIGHT_CH4_INVERSE 0
  2601. // ----------------------------------------------------------------------------------------
  2602. // Smart life Mini Smart Socket is similar Homecube 16A but some GPIOs differ
  2603. // https://www.ebay.de/itm/Smart-Steckdose-WIFI-WLAN-Amazon-Alexa-Fernbedienung-Home-Socket-Zeitschaltuh-DE/123352026749?hash=item1cb85a8e7d:g:IasAAOSwk6dbj390
  2604. // Also labeled NETVIP
  2605. // https://www.amazon.es/Inteligente-NETVIP-Inal%C3%A1mbrico-Interruptor-Funciona/dp/B07KH8YWS5
  2606. // ----------------------------------------------------------------------------------------
  2607. #elif defined(SMARTLIFE_MINI_SMART_SOCKET)
  2608. // Info
  2609. #define MANUFACTURER "SMARTLIFE"
  2610. #define DEVICE "MINI_SMART_SOCKET"
  2611. // Buttons
  2612. #define BUTTON1_PIN 13
  2613. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2614. #define BUTTON1_RELAY 1
  2615. // Relays
  2616. #define RELAY1_PIN 15
  2617. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2618. // LEDs
  2619. //Red LED: 0
  2620. //Green LED: 4
  2621. //Blue LED: 2
  2622. // Light
  2623. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2624. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2625. #define DUMMY_RELAY_COUNT 1
  2626. #define LIGHT_CHANNELS 3
  2627. #define LIGHT_CH1_PIN 0 // RED
  2628. #define LIGHT_CH2_PIN 4 // GREEN
  2629. #define LIGHT_CH3_PIN 2 // BLUE
  2630. #define LIGHT_CH1_INVERSE 0
  2631. #define LIGHT_CH2_INVERSE 0
  2632. #define LIGHT_CH3_INVERSE 0
  2633. // HJL01 / BL0937
  2634. #ifndef HLW8012_SUPPORT
  2635. #define HLW8012_SUPPORT 1
  2636. #endif
  2637. #define HLW8012_SEL_PIN 12
  2638. #define HLW8012_CF1_PIN 14
  2639. #define HLW8012_CF_PIN 5
  2640. #define HLW8012_SEL_CURRENT LOW
  2641. #define HLW8012_CURRENT_RATIO 25740
  2642. #define HLW8012_VOLTAGE_RATIO 313400
  2643. #define HLW8012_POWER_RATIO 3414290
  2644. #define HLW8012_INTERRUPT_ON FALLING
  2645. // ----------------------------------------------------------------------------------------
  2646. // Hama WiFi Steckdose (00176533)
  2647. // https://at.hama.com/00176533/hama-wifi-steckdose-3500w-16a
  2648. // ----------------------------------------------------------------------------------------
  2649. #elif defined(HAMA_WIFI_STECKDOSE_00176533)
  2650. // Info
  2651. #define MANUFACTURER "HAMA"
  2652. #define DEVICE "WIFI_STECKDOSE_00176533"
  2653. // Buttons
  2654. #define BUTTON1_PIN 13
  2655. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2656. #define BUTTON1_RELAY 1
  2657. // Relays
  2658. #define RELAY1_PIN 12
  2659. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2660. // LEDs
  2661. #define LED1_PIN 4
  2662. #define LED1_PIN_INVERSE 1
  2663. // -----------------------------------------------------------------------------
  2664. // Oxaoxe NX-SP202
  2665. // Digoo NX-SP202 (not tested)
  2666. // Digoo DG-SP202 (not tested)
  2667. // https://github.com/xoseperez/espurna/issues/1502
  2668. // -----------------------------------------------------------------------------
  2669. #elif defined(DIGOO_NX_SP202)
  2670. // Info
  2671. #define MANUFACTURER "DIGOO"
  2672. #define DEVICE "NX_SP202"
  2673. // Buttons
  2674. #define BUTTON1_PIN 0
  2675. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2676. #define BUTTON1_RELAY 1
  2677. #define BUTTON2_PIN 16
  2678. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2679. #define BUTTON2_RELAY 2
  2680. // Relays
  2681. #define RELAY1_PIN 15
  2682. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2683. #define RELAY2_PIN 14
  2684. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2685. // LEDs
  2686. #define LED1_PIN 13
  2687. #define LED1_PIN_INVERSE 1
  2688. // HJL01 / BL0937
  2689. #ifndef HLW8012_SUPPORT
  2690. #define HLW8012_SUPPORT 1
  2691. #endif
  2692. #define HLW8012_SEL_PIN 12
  2693. #define HLW8012_CF1_PIN 5
  2694. #define HLW8012_CF_PIN 4
  2695. #define HLW8012_SEL_CURRENT LOW
  2696. #define HLW8012_CURRENT_RATIO 23296
  2697. #define HLW8012_VOLTAGE_RATIO 310085
  2698. #define HLW8012_POWER_RATIO 3368471
  2699. #define HLW8012_INTERRUPT_ON FALLING
  2700. // -----------------------------------------------------------------------------
  2701. // Foxel's LightFox dual
  2702. // https://github.com/foxel/esp-dual-rf-switch
  2703. // -----------------------------------------------------------------------------
  2704. #elif defined(FOXEL_LIGHTFOX_DUAL)
  2705. // Info
  2706. #define MANUFACTURER "FOXEL"
  2707. #define DEVICE "LIGHTFOX_DUAL"
  2708. #define SERIAL_BAUDRATE 19200
  2709. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  2710. #define DUMMY_RELAY_COUNT 2
  2711. #define DEBUG_SERIAL_SUPPORT 0
  2712. // Buttons
  2713. #define BUTTON1_RELAY 1
  2714. #define BUTTON2_RELAY 2
  2715. #define BUTTON3_RELAY 2
  2716. #define BUTTON4_RELAY 1
  2717. // -----------------------------------------------------------------------------
  2718. // Teckin SP20
  2719. // -----------------------------------------------------------------------------
  2720. #elif defined(TECKIN_SP20)
  2721. // Info
  2722. #define MANUFACTURER "TECKIN"
  2723. #define DEVICE "SP20"
  2724. // Buttons
  2725. #define BUTTON1_PIN 13
  2726. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2727. #define BUTTON1_RELAY 1
  2728. // Relays
  2729. #define RELAY1_PIN 4
  2730. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2731. // LEDs
  2732. #define LED1_PIN 2
  2733. #define LED1_PIN_INVERSE 1
  2734. #define LED2_PIN 0
  2735. #define LED2_PIN_INVERSE 1
  2736. #define LED2_MODE LED_MODE_FINDME
  2737. #define LED2_RELAY 0
  2738. // HJL01 / BL0937
  2739. #ifndef HLW8012_SUPPORT
  2740. #define HLW8012_SUPPORT 1
  2741. #endif
  2742. #define HLW8012_SEL_PIN 12
  2743. #define HLW8012_CF1_PIN 14
  2744. #define HLW8012_CF_PIN 5
  2745. #define HLW8012_SEL_CURRENT LOW
  2746. #define HLW8012_CURRENT_RATIO 25740
  2747. #define HLW8012_VOLTAGE_RATIO 313400
  2748. #define HLW8012_POWER_RATIO 3414290
  2749. #define HLW8012_INTERRUPT_ON FALLING
  2750. // -----------------------------------------------------------------------------
  2751. // Charging Essentials / LITESUN LA-WF3
  2752. // -----------------------------------------------------------------------------
  2753. #elif defined(LITESUN_LA_WF3)
  2754. // Info
  2755. #define MANUFACTURER "LITESUN"
  2756. #define DEVICE "LA_WF3"
  2757. // Buttons
  2758. #define BUTTON1_PIN 13
  2759. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2760. #define BUTTON1_RELAY 1
  2761. // Relays
  2762. #define RELAY1_PIN 12
  2763. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2764. // LEDs
  2765. #define LED1_PIN 4 // 4 blue led
  2766. #define LED1_MODE LED_MODE_WIFI
  2767. #define LED1_PIN_INVERSE 1
  2768. #define LED2_PIN 5 // 5 red led
  2769. #define LED2_MODE LED_MODE_RELAY
  2770. #define LED2_PIN_INVERSE 1
  2771. // -----------------------------------------------------------------------------
  2772. // PSH
  2773. // -----------------------------------------------------------------------------
  2774. #elif defined(PSH_WIFI_PLUG)
  2775. // Info
  2776. #define MANUFACTURER "PSH"
  2777. #define DEVICE "WIFI_PLUG"
  2778. // Relays
  2779. #define RELAY1_PIN 2
  2780. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2781. // LEDs
  2782. #define LED1_PIN 0
  2783. #define LED1_PIN_INVERSE 0
  2784. #elif defined(PSH_RGBW_CONTROLLER)
  2785. // Info
  2786. #define MANUFACTURER "PSH"
  2787. #define DEVICE "RGBW_CONTROLLER"
  2788. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2789. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2790. #define DUMMY_RELAY_COUNT 1
  2791. // LEDs
  2792. #define LED1_PIN 13
  2793. #define LED1_PIN_INVERSE 1
  2794. // Light
  2795. #define LIGHT_CHANNELS 4
  2796. #define LIGHT_CH1_PIN 5 // RED
  2797. #define LIGHT_CH2_PIN 4 // GREEN
  2798. #define LIGHT_CH3_PIN 12 // BLUE
  2799. #define LIGHT_CH4_PIN 14 // WHITE1
  2800. #define LIGHT_CH1_INVERSE 0
  2801. #define LIGHT_CH2_INVERSE 0
  2802. #define LIGHT_CH3_INVERSE 0
  2803. #define LIGHT_CH4_INVERSE 0
  2804. #elif defined(PSH_WIFI_SENSOR)
  2805. // Info
  2806. #define MANUFACTURER "PSH"
  2807. #define DEVICE "WIFI_SENSOR"
  2808. // DHT12 Sensor
  2809. #define DHT_SUPPORT 1
  2810. #define DHT_PIN 14
  2811. #define DHT_TYPE DHT_CHIP_DHT12
  2812. // LDR Sensor
  2813. #define LDR_SUPPORT 1
  2814. #define LDR_TYPE LDR_GL5528
  2815. #define LDR_ON_GROUND false
  2816. #define LDR_RESISTOR 10000
  2817. #elif defined(JINVOO_VALVE_SM_AW713)
  2818. // Reflashing from original Tuya firmware
  2819. // to thirdparty firmware like espurna by:
  2820. // https://github.com/ct-Open-Source/tuya-convert
  2821. // Info
  2822. #define MANUFACTURER "JINVOO"
  2823. #define DEVICE "VALVE_SM_AW713"
  2824. // Buttons
  2825. #define BUTTON1_PIN 13
  2826. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2827. #define BUTTON1_RELAY 1
  2828. // Relays
  2829. #define RELAY1_PIN 12
  2830. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2831. // LED
  2832. #define LED1_PIN 5 // 5 red led
  2833. #define LED1_PIN_INVERSE 0
  2834. #define LED1_RELAY 1
  2835. #define LED1_MODE LED_MODE_RELAY
  2836. #define LED2_PIN 4 // 4 blue led
  2837. #define LED2_PIN_INVERSE 0
  2838. #define LED2_RELAY 1
  2839. #define LED2_MODE LED_MODE_FINDME_WIFI
  2840. // -----------------------------------------------------------------------------
  2841. // TEST boards (do not use!!)
  2842. // -----------------------------------------------------------------------------
  2843. #elif defined(TRAVIS01)
  2844. // Info
  2845. #define MANUFACTURER "TravisCI"
  2846. #define DEVICE "Virtual board 01"
  2847. // Some buttons - pin 0
  2848. #define BUTTON1_PIN 0
  2849. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2850. #define BUTTON1_RELAY 1
  2851. // Some relays - pin 1
  2852. #define RELAY1_PIN 1
  2853. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2854. // Some LEDs - pin 2
  2855. #define LED1_PIN 2
  2856. #define LED1_PIN_INVERSE 1
  2857. // A bit of I2C - pins 3,4
  2858. #define I2C_SDA_PIN 3
  2859. #define I2C_SCL_PIN 4
  2860. // And, as they say in "From Dusk till Dawn":
  2861. // This is a sensor blow out!
  2862. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  2863. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  2864. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  2865. // C'mon, you want sensor, come on in sensor lovers!
  2866. // If we don’t got it, you don't want it!
  2867. #define AM2320_SUPPORT 1
  2868. #define BH1750_SUPPORT 1
  2869. #define BMP180_SUPPORT 1
  2870. #define BMX280_SUPPORT 1
  2871. #define SHT3X_I2C_SUPPORT 1
  2872. #define EMON_ADC121_SUPPORT 1
  2873. #define EMON_ADS1X15_SUPPORT 1
  2874. #define SHT3X_I2C_SUPPORT 1
  2875. #define SI7021_SUPPORT 1
  2876. #define PMSX003_SUPPORT 1
  2877. #define SENSEAIR_SUPPORT 1
  2878. #define VL53L1X_SUPPORT 1
  2879. #define MAX6675_SUPPORT 1
  2880. // A bit of lights - pin 5
  2881. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2882. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2883. #define DUMMY_RELAY_COUNT 1
  2884. #define LIGHT_CHANNELS 1
  2885. #define LIGHT_CH1_PIN 5
  2886. #define LIGHT_CH1_INVERSE 0
  2887. // A bit of HLW8012 - pins 6,7,8
  2888. #ifndef HLW8012_SUPPORT
  2889. #define HLW8012_SUPPORT 1
  2890. #endif
  2891. #define HLW8012_SEL_PIN 6
  2892. #define HLW8012_CF1_PIN 7
  2893. #define HLW8012_CF_PIN 8
  2894. // A bit of Dallas - pin 9
  2895. #ifndef DALLAS_SUPPORT
  2896. #define DALLAS_SUPPORT 1
  2897. #endif
  2898. #define DALLAS_PIN 9
  2899. // A bit of ECH1560 - pins 10,11, 12
  2900. #ifndef ECH1560_SUPPORT
  2901. #define ECH1560_SUPPORT 1
  2902. #endif
  2903. #define ECH1560_CLK_PIN 10
  2904. #define ECH1560_MISO_PIN 11
  2905. #define ECH1560_INVERTED 12
  2906. // MICS-2710 & MICS-5525 test
  2907. #define MICS2710_SUPPORT 1
  2908. #define MICS5525_SUPPORT 1
  2909. // MAX6675 14 11 10
  2910. #ifndef MAX6675_SUPPORT
  2911. #define MAX6675_SUPPORT 1
  2912. #endif
  2913. #define MAX6675_CS_PIN 14
  2914. #define MAX6675_SO_PIN 11
  2915. #define MAX6675_SCK_PIN 10
  2916. #elif defined(TRAVIS02)
  2917. // Relay provider dual
  2918. #define MANUFACTURER "TravisCI"
  2919. #define DEVICE "Virtual board 02"
  2920. // Some buttons - pin 0
  2921. #define BUTTON1_PIN 0
  2922. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2923. #define BUTTON1_RELAY 1
  2924. // A bit of CSE7766 - pin 1
  2925. #ifndef CSE7766_SUPPORT
  2926. #define CSE7766_SUPPORT 1
  2927. #endif
  2928. #define CSE7766_PIN 1
  2929. // Relay type dual - pins 2,3
  2930. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  2931. #define RELAY1_PIN 2
  2932. #define RELAY2_PIN 3
  2933. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2934. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2935. // IR - pin 4
  2936. #define IR_SUPPORT 1
  2937. #define IR_RX_PIN 4
  2938. #define IR_BUTTON_SET 1
  2939. // A bit of DHT - pin 5
  2940. #ifndef DHT_SUPPORT
  2941. #define DHT_SUPPORT 1
  2942. #endif
  2943. #define DHT_PIN 5
  2944. // A bit of TMP3X (analog)
  2945. #define TMP3X_SUPPORT 1
  2946. // A bit of EVENTS - pin 10
  2947. #define EVENTS_SUPPORT 1
  2948. #define EVENTS_PIN 6
  2949. // Sonar
  2950. #define SONAR_SUPPORT 1
  2951. #define SONAR_TRIGGER 7
  2952. #define SONAR_ECHO 8
  2953. // MHZ19
  2954. #define MHZ19_SUPPORT 1
  2955. #define MHZ19_RX_PIN 9
  2956. #define MHZ19_TX_PIN 10
  2957. // PZEM004T
  2958. #define PZEM004T_SUPPORT 1
  2959. #define PZEM004T_RX_PIN 11
  2960. #define PZEM004T_TX_PIN 12
  2961. // V9261F
  2962. #define V9261F_SUPPORT 1
  2963. #define V9261F_PIN 13
  2964. // GUVAS12SD
  2965. #define GUVAS12SD_SUPPORT 1
  2966. #define GUVAS12SD_PIN 14
  2967. // Test non-default modules
  2968. #define MDNS_CLIENT_SUPPORT 1
  2969. #define NOFUSS_SUPPORT 1
  2970. #define UART_MQTT_SUPPORT 1
  2971. #define INFLUXDB_SUPPORT 1
  2972. #define IR_SUPPORT 1
  2973. #define RF_SUPPORT 1
  2974. #define RFB_DIRECT 1
  2975. #define RFB_RX_PIN 4
  2976. #elif defined(TRAVIS03)
  2977. // Relay provider light/my92XX
  2978. #define MANUFACTURER "TravisCI"
  2979. #define DEVICE "Virtual board 03"
  2980. // Some buttons - pin 0
  2981. #define BUTTON1_PIN 0
  2982. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2983. #define BUTTON1_RELAY 1
  2984. // MY9231 Light - pins 1,2
  2985. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2986. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2987. #define DUMMY_RELAY_COUNT 1
  2988. #define LIGHT_CHANNELS 5
  2989. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2990. #define MY92XX_CHIPS 2
  2991. #define MY92XX_DI_PIN 1
  2992. #define MY92XX_DCKI_PIN 2
  2993. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2994. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  2995. // A bit of analog,
  2996. // will not work on real life since they all share GPIO
  2997. // but it's OK to test build
  2998. #define EMON_ANALOG_SUPPORT 1
  2999. #define NTC_SUPPORT 1
  3000. #define LDR_SUPPORT 1
  3001. #define PULSEMETER_SUPPORT 1
  3002. // Test non-default modules
  3003. #define LLMNR_SUPPORT 1
  3004. #define NETBIOS_SUPPORT 1
  3005. #define SSDP_SUPPORT 1
  3006. #define RF_SUPPORT 1
  3007. #endif
  3008. // -----------------------------------------------------------------------------
  3009. // Check definitions
  3010. // -----------------------------------------------------------------------------
  3011. #if not defined(MANUFACTURER) || not defined(DEVICE)
  3012. #error "UNSUPPORTED HARDWARE!!"
  3013. #endif