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.

3726 lines
119 KiB

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