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.

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