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.

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