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.

4376 lines
140 KiB

6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
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. // -----------------------------------------------------------------------------
  1131. // HUACANXING H801 & H802
  1132. // -----------------------------------------------------------------------------
  1133. #elif defined(HUACANXING_H801)
  1134. // Info
  1135. #define MANUFACTURER "HUACANXING"
  1136. #define DEVICE "H801"
  1137. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1138. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1139. #define DUMMY_RELAY_COUNT 1
  1140. #define DEBUG_PORT Serial1
  1141. #define SERIAL_RX_ENABLED 1
  1142. // LEDs
  1143. #define LED1_PIN 5
  1144. #define LED1_PIN_INVERSE 1
  1145. // Light
  1146. #define LIGHT_CHANNELS 5
  1147. #define LIGHT_CH1_PIN 15 // RED
  1148. #define LIGHT_CH2_PIN 13 // GREEN
  1149. #define LIGHT_CH3_PIN 12 // BLUE
  1150. #define LIGHT_CH4_PIN 14 // WHITE1
  1151. #define LIGHT_CH5_PIN 4 // WHITE2
  1152. #define LIGHT_CH1_INVERSE 0
  1153. #define LIGHT_CH2_INVERSE 0
  1154. #define LIGHT_CH3_INVERSE 0
  1155. #define LIGHT_CH4_INVERSE 0
  1156. #define LIGHT_CH5_INVERSE 0
  1157. #elif defined(HUACANXING_H802)
  1158. // Info
  1159. #define MANUFACTURER "HUACANXING"
  1160. #define DEVICE "H802"
  1161. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1162. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1163. #define DUMMY_RELAY_COUNT 1
  1164. #define DEBUG_PORT Serial1
  1165. #define SERIAL_RX_ENABLED 1
  1166. // Light
  1167. #define LIGHT_CHANNELS 4
  1168. #define LIGHT_CH1_PIN 12 // RED
  1169. #define LIGHT_CH2_PIN 14 // GREEN
  1170. #define LIGHT_CH3_PIN 13 // BLUE
  1171. #define LIGHT_CH4_PIN 15 // WHITE
  1172. #define LIGHT_CH1_INVERSE 0
  1173. #define LIGHT_CH2_INVERSE 0
  1174. #define LIGHT_CH3_INVERSE 0
  1175. #define LIGHT_CH4_INVERSE 0
  1176. // -----------------------------------------------------------------------------
  1177. // Jan Goedeke Wifi Relay
  1178. // https://github.com/JanGoe/esp8266-wifi-relay
  1179. // -----------------------------------------------------------------------------
  1180. #elif defined(JANGOE_WIFI_RELAY_NC)
  1181. // Info
  1182. #define MANUFACTURER "JANGOE"
  1183. #define DEVICE "WIFI_RELAY_NC"
  1184. // Buttons
  1185. #define BUTTON1_PIN 12
  1186. #define BUTTON2_PIN 13
  1187. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1188. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1189. #define BUTTON1_RELAY 1
  1190. #define BUTTON2_RELAY 2
  1191. // Relays
  1192. #define RELAY1_PIN 2
  1193. #define RELAY2_PIN 14
  1194. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1195. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1196. #elif defined(JANGOE_WIFI_RELAY_NO)
  1197. // Info
  1198. #define MANUFACTURER "JANGOE"
  1199. #define DEVICE "WIFI_RELAY_NO"
  1200. // Buttons
  1201. #define BUTTON1_PIN 12
  1202. #define BUTTON2_PIN 13
  1203. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1204. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1205. #define BUTTON1_RELAY 1
  1206. #define BUTTON2_RELAY 2
  1207. // Relays
  1208. #define RELAY1_PIN 2
  1209. #define RELAY2_PIN 14
  1210. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1211. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1212. // -----------------------------------------------------------------------------
  1213. // Jorge García Wifi+Relays Board Kit
  1214. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  1215. // https://github.com/jorgegarciadev/wifikit
  1216. // -----------------------------------------------------------------------------
  1217. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  1218. // Info
  1219. #define MANUFACTURER "JORGEGARCIA"
  1220. #define DEVICE "WIFI_RELAYS"
  1221. // Relays
  1222. #define RELAY1_PIN 0
  1223. #define RELAY2_PIN 2
  1224. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1225. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1226. // -----------------------------------------------------------------------------
  1227. // WiFi MQTT Relay / Thermostat
  1228. // -----------------------------------------------------------------------------
  1229. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  1230. // Info
  1231. #define MANUFACTURER "OPENENERGYMONITOR"
  1232. #define DEVICE "MQTT_RELAY"
  1233. // Buttons
  1234. #define BUTTON1_PIN 0
  1235. #define BUTTON1_RELAY 1
  1236. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1237. // Relays
  1238. #define RELAY1_PIN 12
  1239. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1240. // LEDs
  1241. #define LED1_PIN 16
  1242. #define LED1_PIN_INVERSE 0
  1243. // -----------------------------------------------------------------------------
  1244. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  1245. // 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
  1246. // 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
  1247. // -----------------------------------------------------------------------------
  1248. #elif defined(WION_50055)
  1249. // Currently untested, does not support energy monitoring
  1250. // Info
  1251. #define MANUFACTURER "WION"
  1252. #define DEVICE "50055"
  1253. // Buttons
  1254. #define BUTTON1_PIN 13
  1255. #define BUTTON1_RELAY 1
  1256. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1257. // Relays
  1258. #define RELAY1_PIN 15
  1259. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1260. // LEDs
  1261. #define LED1_PIN 2
  1262. #define LED1_PIN_INVERSE 0
  1263. // -----------------------------------------------------------------------------
  1264. // EX-Store Wifi Relay v3.1
  1265. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  1266. // -----------------------------------------------------------------------------
  1267. #elif defined(EXS_WIFI_RELAY_V31)
  1268. // Untested
  1269. // Info
  1270. #define MANUFACTURER "EXS"
  1271. #define DEVICE "WIFI_RELAY_V31"
  1272. // Buttons
  1273. #define BUTTON1_PIN 0
  1274. #define BUTTON1_RELAY 1
  1275. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1276. // Relays
  1277. #define RELAY1_PIN 13
  1278. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1279. #define RELAY1_RESET_PIN 12
  1280. // -----------------------------------------------------------------------------
  1281. // EX-Store Wifi Relay v5.0
  1282. // -----------------------------------------------------------------------------
  1283. #elif defined(EXS_WIFI_RELAY_V50)
  1284. // Info
  1285. #define MANUFACTURER "EXS"
  1286. #define DEVICE "WIFI_RELAY_V50"
  1287. // Buttons
  1288. #define BUTTON1_PIN 5
  1289. #define BUTTON2_PIN 4
  1290. #define BUTTON1_RELAY 1
  1291. #define BUTTON2_RELAY 2
  1292. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1293. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1294. // Relays
  1295. #define RELAY1_PIN 14
  1296. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1297. #define RELAY1_RESET_PIN 16
  1298. #define RELAY2_PIN 13
  1299. #define RELAY2_TYPE RELAY_TYPE_LATCHED
  1300. #define RELAY2_RESET_PIN 12
  1301. // LEDs
  1302. #define LED1_PIN 15
  1303. #define LED1_PIN_INVERSE 0
  1304. // -----------------------------------------------------------------------------
  1305. // V9261F
  1306. // -----------------------------------------------------------------------------
  1307. #elif defined(GENERIC_V9261F)
  1308. // Info
  1309. #define MANUFACTURER "GENERIC"
  1310. #define DEVICE "V9261F"
  1311. #define ALEXA_SUPPORT 0
  1312. // V9261F
  1313. #define V9261F_SUPPORT 1
  1314. #define V9261F_PIN 2
  1315. #define V9261F_PIN_INVERSE 1
  1316. // -----------------------------------------------------------------------------
  1317. // ECH1560
  1318. // -----------------------------------------------------------------------------
  1319. #elif defined(GENERIC_ECH1560)
  1320. // Info
  1321. #define MANUFACTURER "GENERIC"
  1322. #define DEVICE "ECH1560"
  1323. #define ALEXA_SUPPORT 0
  1324. // ECH1560
  1325. #define ECH1560_SUPPORT 1
  1326. #define ECH1560_CLK_PIN 4
  1327. #define ECH1560_MISO_PIN 5
  1328. #define ECH1560_INVERTED 0
  1329. // -----------------------------------------------------------------------------
  1330. // ESPLive
  1331. // https://github.com/ManCaveMade/ESP-Live
  1332. // -----------------------------------------------------------------------------
  1333. #elif defined(MANCAVEMADE_ESPLIVE)
  1334. // Info
  1335. #define MANUFACTURER "MANCAVEMADE"
  1336. #define DEVICE "ESPLIVE"
  1337. // Buttons
  1338. #define BUTTON1_PIN 4
  1339. #define BUTTON2_PIN 5
  1340. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1341. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1342. #define BUTTON1_RELAY 1
  1343. #define BUTTON2_RELAY 2
  1344. // Relays
  1345. #define RELAY1_PIN 12
  1346. #define RELAY2_PIN 13
  1347. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1348. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1349. // DS18B20
  1350. #ifndef DALLAS_SUPPORT
  1351. #define DALLAS_SUPPORT 1
  1352. #endif
  1353. #define DALLAS_PIN 2
  1354. #define DALLAS_UPDATE_INTERVAL 5000
  1355. #define TEMPERATURE_MIN_CHANGE 1.0
  1356. // -----------------------------------------------------------------------------
  1357. // QuinLED
  1358. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  1359. // -----------------------------------------------------------------------------
  1360. #elif defined(INTERMITTECH_QUINLED)
  1361. // Info
  1362. #define MANUFACTURER "INTERMITTECH"
  1363. #define DEVICE "QUINLED"
  1364. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1365. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1366. #define DUMMY_RELAY_COUNT 1
  1367. // LEDs
  1368. #define LED1_PIN 5
  1369. #define LED1_PIN_INVERSE 1
  1370. // Light
  1371. #define LIGHT_CHANNELS 2
  1372. #define LIGHT_CH1_PIN 0
  1373. #define LIGHT_CH2_PIN 2
  1374. #define LIGHT_CH1_INVERSE 0
  1375. #define LIGHT_CH2_INVERSE 0
  1376. // -----------------------------------------------------------------------------
  1377. // Arilux AL-LC06
  1378. // -----------------------------------------------------------------------------
  1379. #elif defined(ARILUX_AL_LC01)
  1380. // Info
  1381. #define MANUFACTURER "ARILUX"
  1382. #define DEVICE "AL_LC01"
  1383. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1384. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1385. #define DUMMY_RELAY_COUNT 1
  1386. // Light
  1387. #define LIGHT_CHANNELS 3
  1388. #define LIGHT_CH1_PIN 5 // RED
  1389. #define LIGHT_CH2_PIN 12 // GREEN
  1390. #define LIGHT_CH3_PIN 13 // BLUE
  1391. #define LIGHT_CH1_INVERSE 0
  1392. #define LIGHT_CH2_INVERSE 0
  1393. #define LIGHT_CH3_INVERSE 0
  1394. #elif defined(ARILUX_AL_LC02)
  1395. // Info
  1396. #define MANUFACTURER "ARILUX"
  1397. #define DEVICE "AL_LC02"
  1398. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1399. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1400. #define DUMMY_RELAY_COUNT 1
  1401. // Light
  1402. #define LIGHT_CHANNELS 4
  1403. #define LIGHT_CH1_PIN 12 // RED
  1404. #define LIGHT_CH2_PIN 5 // GREEN
  1405. #define LIGHT_CH3_PIN 13 // BLUE
  1406. #define LIGHT_CH4_PIN 15 // WHITE1
  1407. #define LIGHT_CH1_INVERSE 0
  1408. #define LIGHT_CH2_INVERSE 0
  1409. #define LIGHT_CH3_INVERSE 0
  1410. #define LIGHT_CH4_INVERSE 0
  1411. #elif defined(ARILUX_AL_LC02_V14)
  1412. // Info
  1413. #define MANUFACTURER "ARILUX"
  1414. #define DEVICE "AL_LC02_V14"
  1415. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1416. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1417. #define DUMMY_RELAY_COUNT 1
  1418. // Light
  1419. #define LIGHT_CHANNELS 4
  1420. #define LIGHT_CH1_PIN 14 // RED
  1421. #define LIGHT_CH2_PIN 5 // GREEN
  1422. #define LIGHT_CH3_PIN 12 // BLUE
  1423. #define LIGHT_CH4_PIN 13 // WHITE1
  1424. #define LIGHT_CH1_INVERSE 0
  1425. #define LIGHT_CH2_INVERSE 0
  1426. #define LIGHT_CH3_INVERSE 0
  1427. #define LIGHT_CH4_INVERSE 0
  1428. #elif defined(ARILUX_AL_LC06)
  1429. // Info
  1430. #define MANUFACTURER "ARILUX"
  1431. #define DEVICE "AL_LC06"
  1432. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1433. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1434. #define DUMMY_RELAY_COUNT 1
  1435. // Buttons
  1436. #define BUTTON1_PIN 0
  1437. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1438. #define BUTTON1_RELAY 1
  1439. // Light
  1440. #define LIGHT_CHANNELS 5
  1441. #define LIGHT_CH1_PIN 14 // RED
  1442. #define LIGHT_CH2_PIN 12 // GREEN
  1443. #define LIGHT_CH3_PIN 13 // BLUE
  1444. #define LIGHT_CH4_PIN 15 // WHITE1
  1445. #define LIGHT_CH5_PIN 5 // WHITE2
  1446. #define LIGHT_CH1_INVERSE 0
  1447. #define LIGHT_CH2_INVERSE 0
  1448. #define LIGHT_CH3_INVERSE 0
  1449. #define LIGHT_CH4_INVERSE 0
  1450. #define LIGHT_CH5_INVERSE 0
  1451. #elif defined(ARILUX_AL_LC11)
  1452. // Info
  1453. #define MANUFACTURER "ARILUX"
  1454. #define DEVICE "AL_LC11"
  1455. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1456. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1457. #define DUMMY_RELAY_COUNT 1
  1458. // Light
  1459. #define LIGHT_CHANNELS 5
  1460. #define LIGHT_CH1_PIN 5 // RED
  1461. #define LIGHT_CH2_PIN 4 // GREEN
  1462. #define LIGHT_CH3_PIN 14 // BLUE
  1463. #define LIGHT_CH4_PIN 13 // WHITE1
  1464. #define LIGHT_CH5_PIN 12 // WHITE1
  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_E27)
  1471. // Info
  1472. #define MANUFACTURER "ARILUX"
  1473. #define DEVICE "E27"
  1474. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1475. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1476. #define DUMMY_RELAY_COUNT 1
  1477. // Light
  1478. #define LIGHT_CHANNELS 4
  1479. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  1480. #define MY92XX_CHIPS 1
  1481. #define MY92XX_DI_PIN 13
  1482. #define MY92XX_DCKI_PIN 15
  1483. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1484. #define MY92XX_MAPPING 0, 1, 2, 3
  1485. // -----------------------------------------------------------------------------
  1486. // XENON SM-PW701U
  1487. // -----------------------------------------------------------------------------
  1488. #elif defined(XENON_SM_PW702U)
  1489. // Info
  1490. #define MANUFACTURER "XENON"
  1491. #define DEVICE "SM_PW702U"
  1492. // Buttons
  1493. #define BUTTON1_PIN 13
  1494. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1495. #define BUTTON1_RELAY 1
  1496. // Relays
  1497. #define RELAY1_PIN 12
  1498. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1499. // LEDs
  1500. #define LED1_PIN 4
  1501. #define LED1_PIN_INVERSE 1
  1502. // -----------------------------------------------------------------------------
  1503. // ISELECTOR SM-PW702
  1504. // -----------------------------------------------------------------------------
  1505. #elif defined(ISELECTOR_SM_PW702)
  1506. // Info
  1507. #define MANUFACTURER "ISELECTOR"
  1508. #define DEVICE "SM_PW702"
  1509. // Buttons
  1510. #define BUTTON1_PIN 13
  1511. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1512. #define BUTTON1_RELAY 1
  1513. // Relays
  1514. #define RELAY1_PIN 12
  1515. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1516. // LEDs
  1517. #define LED1_PIN 4 //BLUE
  1518. #define LED1_PIN_INVERSE 0
  1519. #define LED2_PIN 5 //RED
  1520. #define LED2_PIN_INVERSE 1
  1521. // -----------------------------------------------------------------------------
  1522. // AUTHOMETION LYT8266
  1523. // https://authometion.com/shop/en/home/13-lyt8266.html
  1524. // -----------------------------------------------------------------------------
  1525. #elif defined(AUTHOMETION_LYT8266)
  1526. // Info
  1527. #define MANUFACTURER "AUTHOMETION"
  1528. #define DEVICE "LYT8266"
  1529. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1530. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1531. #define DUMMY_RELAY_COUNT 1
  1532. // Light
  1533. #define LIGHT_CHANNELS 4
  1534. #define LIGHT_CH1_PIN 13 // RED
  1535. #define LIGHT_CH2_PIN 12 // GREEN
  1536. #define LIGHT_CH3_PIN 14 // BLUE
  1537. #define LIGHT_CH4_PIN 2 // WHITE
  1538. #define LIGHT_CH1_INVERSE 0
  1539. #define LIGHT_CH2_INVERSE 0
  1540. #define LIGHT_CH3_INVERSE 0
  1541. #define LIGHT_CH4_INVERSE 0
  1542. #define LIGHT_ENABLE_PIN 15
  1543. #elif defined(GIZWITS_WITTY_CLOUD)
  1544. // Info
  1545. #define MANUFACTURER "GIZWITS"
  1546. #define DEVICE "WITTY_CLOUD"
  1547. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1548. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1549. #define DUMMY_RELAY_COUNT 1
  1550. // Buttons
  1551. #define BUTTON1_PIN 4
  1552. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1553. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  1554. #define BUTTON1_CLICK BUTTON_MODE_NONE
  1555. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1556. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1557. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  1558. #define ANALOG_SUPPORT 1
  1559. // LEDs
  1560. #define LED1_PIN 2 // BLUE build-in
  1561. #define LED1_PIN_INVERSE 1
  1562. // Light
  1563. #define LIGHT_CHANNELS 3
  1564. #define LIGHT_CH1_PIN 15 // RED
  1565. #define LIGHT_CH2_PIN 12 // GREEN
  1566. #define LIGHT_CH3_PIN 13 // BLUE
  1567. #define LIGHT_CH1_INVERSE 0
  1568. #define LIGHT_CH2_INVERSE 0
  1569. #define LIGHT_CH3_INVERSE 0
  1570. // -----------------------------------------------------------------------------
  1571. // KMC 70011
  1572. // https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
  1573. // -----------------------------------------------------------------------------
  1574. #elif defined(KMC_70011)
  1575. // Info
  1576. #define MANUFACTURER "KMC"
  1577. #define DEVICE "70011"
  1578. // Buttons
  1579. #define BUTTON1_PIN 0
  1580. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1581. #define BUTTON1_RELAY 1
  1582. // Relays
  1583. #define RELAY1_PIN 14
  1584. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1585. // LEDs
  1586. #define LED1_PIN 13
  1587. #define LED1_PIN_INVERSE 1
  1588. // HLW8012
  1589. #ifndef HLW8012_SUPPORT
  1590. #define HLW8012_SUPPORT 1
  1591. #endif
  1592. #define HLW8012_SEL_PIN 12
  1593. #define HLW8012_CF1_PIN 5
  1594. #define HLW8012_CF_PIN 4
  1595. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1596. // -----------------------------------------------------------------------------
  1597. // Euromate (?) Wifi Stecker Schuko
  1598. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  1599. // Thanks to @Geitde
  1600. // -----------------------------------------------------------------------------
  1601. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  1602. // Info
  1603. #define MANUFACTURER "EUROMATE"
  1604. #define DEVICE "WIFI_STECKER_SCHUKO"
  1605. // Buttons
  1606. #define BUTTON1_PIN 14
  1607. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1608. #define BUTTON1_RELAY 1
  1609. // The relay in the device is not a bistable (latched) relay.
  1610. // The device is reported to have a flip-flop circuit to drive the relay
  1611. // So @Geitde hack is still the only possible
  1612. // Hack: drive GPIO12 low and use GPIO5 as normal relay pin:
  1613. #define RELAY1_PIN 5
  1614. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1615. #define LED2_PIN 12 /* DUMMY: exploit default off state for GPIO12=low */
  1616. #define LED2_PIN_INVERSE 0
  1617. // LEDs
  1618. #define LED1_PIN 4
  1619. #define LED1_PIN_INVERSE 0
  1620. // -----------------------------------------------------------------------------
  1621. // Euromate (?) Wifi Stecker Schuko Version 2
  1622. // This configuration is for the second generation of devices sold by OBI.
  1623. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko-weiss/p/4077806
  1624. // -----------------------------------------------------------------------------
  1625. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO_V2)
  1626. // Info
  1627. #define MANUFACTURER "EUROMATE"
  1628. #define DEVICE "WIFI_STECKER_SCHUKO_V2"
  1629. // Buttons
  1630. #define BUTTON1_PIN 5
  1631. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1632. #define BUTTON1_RELAY 1
  1633. // Relays
  1634. #define RELAY1_PIN 4
  1635. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1636. // Green
  1637. #define LED1_PIN 12
  1638. #define LED1_MODE LED_MODE_WIFI
  1639. #define LED1_PIN_INVERSE 0
  1640. // Red
  1641. #define LED2_PIN 13
  1642. #define LED2_MODE LED_MODE_RELAY
  1643. #define LED2_PIN_INVERSE 0
  1644. // -----------------------------------------------------------------------------
  1645. // Generic 8CH
  1646. // -----------------------------------------------------------------------------
  1647. #elif defined(GENERIC_8CH)
  1648. // Info
  1649. #define MANUFACTURER "GENERIC"
  1650. #define DEVICE "8CH"
  1651. // Relays
  1652. #define RELAY1_PIN 0
  1653. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1654. #define RELAY2_PIN 2
  1655. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1656. #define RELAY3_PIN 4
  1657. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1658. #define RELAY4_PIN 5
  1659. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1660. #define RELAY5_PIN 12
  1661. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1662. #define RELAY6_PIN 13
  1663. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  1664. #define RELAY7_PIN 14
  1665. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  1666. #define RELAY8_PIN 15
  1667. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  1668. // -----------------------------------------------------------------------------
  1669. // STM RELAY
  1670. // -----------------------------------------------------------------------------
  1671. #elif defined(STM_RELAY)
  1672. // Info
  1673. #define MANUFACTURER "STM_RELAY"
  1674. #define DEVICE "2CH"
  1675. // Relays
  1676. #define DUMMY_RELAY_COUNT 2
  1677. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  1678. // Remove UART noise on serial line
  1679. #define DEBUG_SERIAL_SUPPORT 0
  1680. // -----------------------------------------------------------------------------
  1681. // Tonbux Powerstrip02
  1682. // -----------------------------------------------------------------------------
  1683. #elif defined(TONBUX_POWERSTRIP02)
  1684. // Info
  1685. #define MANUFACTURER "TONBUX"
  1686. #define DEVICE "POWERSTRIP02"
  1687. // Buttons
  1688. #define BUTTON1_PIN 5
  1689. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1690. #define BUTTON1_RELAY 0
  1691. // Relays
  1692. #define RELAY1_PIN 4
  1693. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1694. #define RELAY2_PIN 13
  1695. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1696. #define RELAY3_PIN 12
  1697. #define RELAY3_TYPE RELAY_TYPE_INVERSE
  1698. #define RELAY4_PIN 14
  1699. #define RELAY4_TYPE RELAY_TYPE_INVERSE
  1700. // Not a relay. USB ports on/off
  1701. #define RELAY5_PIN 16
  1702. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1703. // LEDs
  1704. #define LED1_PIN 0 // 1 blue led
  1705. #define LED1_PIN_INVERSE 1
  1706. #define LED2_PIN 3 // 3 red leds
  1707. #define LED2_PIN_INVERSE 1
  1708. // -----------------------------------------------------------------------------
  1709. // Lingan SWA1
  1710. // -----------------------------------------------------------------------------
  1711. #elif defined(LINGAN_SWA1)
  1712. // Info
  1713. #define MANUFACTURER "LINGAN"
  1714. #define DEVICE "SWA1"
  1715. // Buttons
  1716. #define BUTTON1_PIN 13
  1717. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1718. #define BUTTON1_RELAY 1
  1719. // Relays
  1720. #define RELAY1_PIN 5
  1721. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1722. // LEDs
  1723. #define LED1_PIN 4
  1724. #define LED1_PIN_INVERSE 1
  1725. // -----------------------------------------------------------------------------
  1726. // HEYGO HY02
  1727. // -----------------------------------------------------------------------------
  1728. #elif defined(HEYGO_HY02)
  1729. // Info
  1730. #define MANUFACTURER "HEYGO"
  1731. #define DEVICE "HY02"
  1732. // Buttons
  1733. #define BUTTON1_PIN 13
  1734. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1735. #define BUTTON1_RELAY 1
  1736. // Relays
  1737. #define RELAY1_PIN 12
  1738. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1739. // LEDs
  1740. #define LED1_PIN 4
  1741. #define LED1_PIN_INVERSE 0
  1742. // -----------------------------------------------------------------------------
  1743. // Maxcio W-US002S
  1744. // -----------------------------------------------------------------------------
  1745. #elif defined(MAXCIO_WUS002S)
  1746. // Info
  1747. #define MANUFACTURER "MAXCIO"
  1748. #define DEVICE "WUS002S"
  1749. // Buttons
  1750. #define BUTTON1_PIN 2
  1751. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1752. #define BUTTON1_RELAY 1
  1753. // Relays
  1754. #define RELAY1_PIN 13
  1755. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1756. // LEDs
  1757. #define LED1_PIN 3
  1758. #define LED1_PIN_INVERSE 0
  1759. // HLW8012
  1760. #ifndef HLW8012_SUPPORT
  1761. #define HLW8012_SUPPORT 1
  1762. #endif
  1763. #define HLW8012_SEL_PIN 12
  1764. #define HLW8012_CF1_PIN 5
  1765. #define HLW8012_CF_PIN 4
  1766. #define HLW8012_CURRENT_R 0.002 // Current resistor
  1767. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1768. // LED1 on RX pin
  1769. #define DEBUG_SERIAL_SUPPORT 1
  1770. // -----------------------------------------------------------------------------
  1771. // Maxcio W-DE004
  1772. // -----------------------------------------------------------------------------
  1773. #elif defined(MAXCIO_WDE004)
  1774. // Info
  1775. #define MANUFACTURER "MAXCIO"
  1776. #define DEVICE "WDE004"
  1777. // Buttons
  1778. #define BUTTON1_PIN 1
  1779. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1780. #define BUTTON1_RELAY 1
  1781. // Relays
  1782. #define RELAY1_PIN 14
  1783. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1784. // LEDs
  1785. #define LED1_PIN 13
  1786. #define LED1_PIN_INVERSE 1
  1787. // -----------------------------------------------------------------------------
  1788. // Oukitel P1 Smart Plug
  1789. // 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
  1790. // -----------------------------------------------------------------------------
  1791. #elif defined(OUKITEL_P1)
  1792. // Info
  1793. #define MANUFACTURER "Oukitel"
  1794. #define DEVICE "P1"
  1795. // Buttons
  1796. #define BUTTON1_PIN 13
  1797. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1798. #define BUTTON1_RELAY 1
  1799. // Relays
  1800. // Right
  1801. #define RELAY1_PIN 12
  1802. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1803. // Left
  1804. #define RELAY2_PIN 15
  1805. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1806. // LEDs
  1807. #define LED1_PIN 0 // blue
  1808. #define LED1_PIN_INVERSE 1
  1809. #define LED1_MODE LED_MODE_WIFI
  1810. // -----------------------------------------------------------------------------
  1811. // YiDian XS-SSA05
  1812. // -----------------------------------------------------------------------------
  1813. #elif defined(YIDIAN_XSSSA05)
  1814. // Info
  1815. #define MANUFACTURER "YIDIAN"
  1816. #define DEVICE "XSSSA05"
  1817. // Buttons
  1818. #define BUTTON1_PIN 13
  1819. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1820. #define BUTTON1_RELAY 1
  1821. // Relays
  1822. #define RELAY1_PIN 12
  1823. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1824. // LEDs
  1825. #define LED1_PIN 0 // red
  1826. #define LED1_PIN_INVERSE 1
  1827. #define LED1_MODE LED_MODE_WIFI
  1828. #define LED2_PIN 15 // blue
  1829. #define LED2_PIN_INVERSE 1
  1830. #define LED2_MODE LED_MODE_RELAY
  1831. // HLW8012
  1832. #ifndef HLW8012_SUPPORT
  1833. #define HLW8012_SUPPORT 1
  1834. #endif
  1835. #define HLW8012_SEL_PIN 3
  1836. #define HLW8012_CF1_PIN 14
  1837. #define HLW8012_CF_PIN 5
  1838. #define HLW8012_SEL_CURRENT LOW
  1839. #define HLW8012_CURRENT_RATIO 25740
  1840. #define HLW8012_VOLTAGE_RATIO 313400
  1841. #define HLW8012_POWER_RATIO 3414290
  1842. #define HLW8012_INTERRUPT_ON FALLING
  1843. // -----------------------------------------------------------------------------
  1844. // TONBUX XS-SSA01
  1845. // -----------------------------------------------------------------------------
  1846. #elif defined(TONBUX_XSSSA01)
  1847. // Info
  1848. #define MANUFACTURER "TONBUX"
  1849. #define DEVICE "XSSSA01"
  1850. // Buttons
  1851. #define BUTTON1_PIN 4
  1852. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1853. #define BUTTON1_RELAY 1
  1854. // Relays
  1855. #define RELAY1_PIN 14
  1856. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1857. // LEDs
  1858. #define LED1_PIN 13
  1859. #define LED1_PIN_INVERSE 0
  1860. // -----------------------------------------------------------------------------
  1861. // TONBUX XS-SSA06
  1862. // -----------------------------------------------------------------------------
  1863. #elif defined(TONBUX_XSSSA06)
  1864. // Info
  1865. #define MANUFACTURER "TONBUX"
  1866. #define DEVICE "XSSSA06"
  1867. // Buttons
  1868. #define BUTTON1_PIN 13
  1869. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1870. #define BUTTON1_RELAY 1
  1871. // Relays
  1872. #define RELAY1_PIN 15
  1873. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1874. // LEDs
  1875. #define LED1_PIN 0 // R - 8 rgb led ring
  1876. #define LED1_PIN_INVERSE 0
  1877. #define LED2_PIN 5 // G
  1878. #define LED2_PIN_INVERSE 0
  1879. #define LED3_PIN 2 // B
  1880. #define LED3_PIN_INVERSE 0
  1881. // -----------------------------------------------------------------------------
  1882. // GREEN ESP8266 RELAY MODULE
  1883. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1884. // -----------------------------------------------------------------------------
  1885. #elif defined(GREEN_ESP8266RELAY)
  1886. // Info
  1887. #define MANUFACTURER "GREEN"
  1888. #define DEVICE "ESP8266RELAY"
  1889. // Buttons
  1890. // Not a button but input via Optocoupler
  1891. #define BUTTON1_PIN 5
  1892. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1893. #define BUTTON1_RELAY 1
  1894. // Relays
  1895. #define RELAY1_PIN 4
  1896. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1897. // LEDs
  1898. #define LED1_PIN 2
  1899. #define LED1_PIN_INVERSE 1
  1900. // -----------------------------------------------------------------------------
  1901. // Henrique Gravina ESPIKE
  1902. // https://github.com/Henriquegravina/Espike
  1903. // -----------------------------------------------------------------------------
  1904. #elif defined(IKE_ESPIKE)
  1905. #define MANUFACTURER "IKE"
  1906. #define DEVICE "ESPIKE"
  1907. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1908. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1909. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1910. #define BUTTON1_PIN 13
  1911. #define BUTTON1_RELAY 1
  1912. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1913. #define BUTTON2_PIN 12
  1914. #define BUTTON2_RELAY 2
  1915. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1916. #define BUTTON3_PIN 14
  1917. #define BUTTON3_RELAY 3
  1918. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1919. #define RELAY1_PIN 4
  1920. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1921. #define RELAY2_PIN 5
  1922. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1923. #define RELAY3_PIN 16
  1924. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1925. #define LED1_PIN 2
  1926. #define LED1_PIN_INVERSE 1
  1927. // -----------------------------------------------------------------------------
  1928. // SWIFITCH
  1929. // https://github.com/ArnieX/swifitch
  1930. // -----------------------------------------------------------------------------
  1931. #elif defined(ARNIEX_SWIFITCH)
  1932. // Info
  1933. #define MANUFACTURER "ARNIEX"
  1934. #define DEVICE "SWIFITCH"
  1935. // Buttons
  1936. #define BUTTON1_PIN 4 // D2
  1937. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1938. #define BUTTON1_RELAY 1
  1939. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1940. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1941. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1942. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1943. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1944. // Relays
  1945. #define RELAY1_PIN 5 // D1
  1946. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1947. // LEDs
  1948. #define LED1_PIN 12 // D6
  1949. #define LED1_PIN_INVERSE 1
  1950. // -----------------------------------------------------------------------------
  1951. // ESP-01S RELAY v4.0
  1952. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  1953. // -----------------------------------------------------------------------------
  1954. #elif defined(GENERIC_ESP01S_RELAY_V40)
  1955. // Info
  1956. #define MANUFACTURER "GENERIC"
  1957. #define DEVICE "ESP01S_RELAY_40"
  1958. // Relays
  1959. #define RELAY1_PIN 0
  1960. #ifndef RELAY1_TYPE
  1961. #define RELAY1_TYPE RELAY_TYPE_NORMAL // See #1504 and #1554
  1962. #endif
  1963. // LEDs
  1964. #define LED1_PIN 2
  1965. #define LED1_PIN_INVERSE 0
  1966. // -----------------------------------------------------------------------------
  1967. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  1968. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  1969. // -----------------------------------------------------------------------------
  1970. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  1971. // Info
  1972. #define MANUFACTURER "GENERIC"
  1973. #define DEVICE "ESP01S_RGBLED_10"
  1974. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  1975. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  1976. // Buttons
  1977. //#define BUTTON1_PIN 2
  1978. // Relays
  1979. //#define RELAY1_PIN 2
  1980. // LEDs
  1981. #define LED1_PIN 2
  1982. #define LED1_PIN_INVERSE 0
  1983. // -----------------------------------------------------------------------------
  1984. // ESP-01S DHT11 v1.0
  1985. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  1986. // -----------------------------------------------------------------------------
  1987. #elif defined(GENERIC_ESP01S_DHT11_V10)
  1988. // Info
  1989. #define MANUFACTURER "GENERIC"
  1990. #define DEVICE "ESP01S_DHT11_10"
  1991. // DHT11
  1992. #ifndef DHT_SUPPORT
  1993. #define DHT_SUPPORT 1
  1994. #endif
  1995. #define DHT_PIN 2
  1996. #define DHT_TYPE DHT_CHIP_DHT11
  1997. // -----------------------------------------------------------------------------
  1998. // ESP-01S DS18B20 v1.0
  1999. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  2000. // -----------------------------------------------------------------------------
  2001. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  2002. // Info
  2003. #define MANUFACTURER "GENERIC"
  2004. #define DEVICE "ESP01S_DS18B20_10"
  2005. // DB18B20
  2006. #ifndef DALLAS_SUPPORT
  2007. #define DALLAS_SUPPORT 1
  2008. #endif
  2009. #define DALLAS_PIN 2
  2010. // -----------------------------------------------------------------------------
  2011. // ESP-DIN relay board V1
  2012. // https://github.com/pilotak/esp_din
  2013. // -----------------------------------------------------------------------------
  2014. #elif defined(PILOTAK_ESP_DIN_V1)
  2015. // Info
  2016. #define MANUFACTURER "PILOTAK"
  2017. #define DEVICE "ESP_DIN_V1"
  2018. // Buttons
  2019. #define BUTTON1_PIN 0
  2020. #define BUTTON1_RELAY 1
  2021. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2022. // Relays
  2023. #define RELAY1_PIN 4
  2024. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2025. #define RELAY2_PIN 5
  2026. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2027. // LEDs
  2028. #define LED1_PIN 15
  2029. #define LED1_PIN_INVERSE 0
  2030. #define I2C_SDA_PIN 12
  2031. #define I2C_SCL_PIN 13
  2032. #ifndef DALLAS_SUPPORT
  2033. #define DALLAS_SUPPORT 1
  2034. #endif
  2035. #define DALLAS_PIN 2
  2036. #define RF_SUPPORT 1
  2037. #define RFB_DIRECT 1
  2038. #define RFB_RX_PIN 14
  2039. #ifndef DIGITAL_SUPPORT
  2040. #define DIGITAL_SUPPORT 1
  2041. #endif
  2042. #define DIGITAL1_PIN 16
  2043. #define DIGITAL1_PIN_MODE INPUT
  2044. #define DIGITAL1_DEFAULT_STATE 0
  2045. // -----------------------------------------------------------------------------
  2046. // Heltec Touch Relay
  2047. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  2048. // -----------------------------------------------------------------------------
  2049. #elif defined(HELTEC_TOUCHRELAY)
  2050. // Info
  2051. #define MANUFACTURER "HELTEC"
  2052. #define DEVICE "TOUCH_RELAY"
  2053. // Buttons
  2054. #define BUTTON1_PIN 14
  2055. #define BUTTON1_RELAY 1
  2056. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  2057. // Relays
  2058. #define RELAY1_PIN 12
  2059. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2060. // -----------------------------------------------------------------------------
  2061. // Zhilde ZLD-EU44-W
  2062. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  2063. // -----------------------------------------------------------------------------
  2064. #elif defined(ZHILDE_EU44_W)
  2065. // Info
  2066. #define MANUFACTURER "ZHILDE"
  2067. #define DEVICE "EU44_W"
  2068. // Based on the reporter, this product uses GPIO1 and 3 for the button
  2069. // and onboard LED, so hardware serial should be disabled...
  2070. #define DEBUG_SERIAL_SUPPORT 0
  2071. // Buttons
  2072. #define BUTTON1_PIN 3
  2073. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2074. // Relays
  2075. #define RELAY1_PIN 5
  2076. #define RELAY2_PIN 4
  2077. #define RELAY3_PIN 12
  2078. #define RELAY4_PIN 13
  2079. #define RELAY5_PIN 14
  2080. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2081. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2082. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2083. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2084. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  2085. // LEDs
  2086. #define LED1_PIN 1
  2087. #define LED1_PIN_INVERSE 1
  2088. // -----------------------------------------------------------------------------
  2089. // Allnet 4duino ESP8266-UP-Relais
  2090. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  2091. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  2092. // -----------------------------------------------------------------------------
  2093. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  2094. // Info
  2095. #define MANUFACTURER "ALLNET"
  2096. #define DEVICE "4DUINO_IOT_WLAN_RELAIS"
  2097. // Relays
  2098. #define RELAY1_PIN 14
  2099. #define RELAY1_RESET_PIN 12
  2100. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  2101. // LEDs
  2102. #define LED1_PIN 0
  2103. #define LED1_PIN_INVERSE 1
  2104. // Buttons
  2105. //#define BUTTON1_PIN 0
  2106. //#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2107. // Using pins labelled as SDA & SCL as buttons
  2108. #define BUTTON2_PIN 4
  2109. #define BUTTON2_MODE BUTTON_PUSHBUTTON
  2110. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  2111. #define BUTTON2_CLICK BUTTON_MODE_NONE
  2112. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  2113. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  2114. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  2115. #define BUTTON3_PIN 5
  2116. #define BUTTON3_MODE BUTTON_PUSHBUTTON
  2117. // Using pins labelled as SDA & SCL for I2C
  2118. //#define I2C_SDA_PIN 4
  2119. //#define I2C_SCL_PIN 5
  2120. // -----------------------------------------------------------------------------
  2121. // Luani HVIO
  2122. // https://luani.de/projekte/esp8266-hvio/
  2123. // https://luani.de/blog/esp8266-230v-io-modul/
  2124. // -----------------------------------------------------------------------------
  2125. #elif defined(LUANI_HVIO)
  2126. // Info
  2127. #define MANUFACTURER "LUANI"
  2128. #define DEVICE "HVIO"
  2129. // Buttons
  2130. #define BUTTON1_PIN 12
  2131. #define BUTTON1_RELAY 1
  2132. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  2133. #define BUTTON1_PRESS BUTTON_MODE_NONE
  2134. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  2135. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2136. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2137. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  2138. #define BUTTON2_PIN 13
  2139. #define BUTTON2_RELAY 2
  2140. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  2141. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  2142. // Relays
  2143. #define RELAY1_PIN 4
  2144. #define RELAY2_PIN 5
  2145. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2146. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2147. // LEDs
  2148. #define LED1_PIN 15
  2149. #define LED1_PIN_INVERSE 0
  2150. // -----------------------------------------------------------------------------
  2151. // Tonbux 50-100M Smart Mosquito Killer USB
  2152. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  2153. // -----------------------------------------------------------------------------
  2154. #elif defined(TONBUX_MOSQUITO_KILLER)
  2155. // Info
  2156. #define MANUFACTURER "TONBUX"
  2157. #define DEVICE "MOSQUITO_KILLER"
  2158. // Buttons
  2159. #define BUTTON1_PIN 2
  2160. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2161. #define BUTTON1_RELAY 1
  2162. // Relays
  2163. #define RELAY1_PIN 5 // not a relay, fan
  2164. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2165. // LEDs
  2166. #define LED1_PIN 15 // blue led
  2167. #define LED1_PIN_INVERSE 1
  2168. #define LED1_MODE LED_MODE_WIFI
  2169. #define LED2_PIN 14 // red led
  2170. #define LED2_PIN_INVERSE 1
  2171. #define LED2_MODE LED_MODE_RELAY
  2172. #define LED3_PIN 12 // UV leds (1-2-3-4-5-6-7-8)
  2173. #define LED3_PIN_INVERSE 0
  2174. #define LED3_RELAY 1
  2175. #define LED4_PIN 16 // UV leds (9-10-11)
  2176. #define LED4_PIN_INVERSE 0
  2177. #define LED4_RELAY 1
  2178. // -----------------------------------------------------------------------------
  2179. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  2180. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  2181. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  2182. // -----------------------------------------------------------------------------
  2183. #elif defined(NEO_COOLCAM_NAS_WR01W)
  2184. // Info
  2185. #define MANUFACTURER "NEO_COOLCAM"
  2186. #define DEVICE "NAS_WR01W"
  2187. // Buttons
  2188. #define BUTTON1_PIN 13
  2189. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2190. #define BUTTON1_RELAY 1
  2191. // Relays
  2192. #define RELAY1_PIN 12
  2193. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2194. // LEDs
  2195. #define LED1_PIN 4
  2196. #define LED1_PIN_INVERSE 1
  2197. // ------------------------------------------------------------------------------
  2198. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  2199. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  2200. // Also: Estink Wifi Power Strip
  2201. // -----------------------------------------------------------------------------
  2202. #elif defined(FORNORM_ZLD_34EU)
  2203. // Info
  2204. #define MANUFACTURER "FORNORM"
  2205. #define DEVICE "ZLD_34EU"
  2206. // Disable UART noise since this board uses GPIO3
  2207. #define DEBUG_SERIAL_SUPPORT 0
  2208. // Buttons
  2209. #define BUTTON1_PIN 16
  2210. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2211. #define BUTTON1_RELAY 4
  2212. // Relays
  2213. #define RELAY1_PIN 14 // USB power
  2214. #define RELAY2_PIN 13 // power plug 1
  2215. #define RELAY3_PIN 4 // power plug 2
  2216. #define RELAY4_PIN 15 // power plug 3
  2217. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2218. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2219. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2220. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2221. // LEDs
  2222. #define LED1_PIN 0 // power led
  2223. #define LED2_PIN 12 // power plug 1
  2224. #define LED3_PIN 3 // power plug 2
  2225. #define LED4_PIN 5 // power plug 3
  2226. #define LED1_PIN_INVERSE 1
  2227. #define LED2_PIN_INVERSE 1
  2228. #define LED3_PIN_INVERSE 1
  2229. #define LED4_PIN_INVERSE 1
  2230. #define LED1_MODE LED_MODE_FINDME
  2231. #define LED2_MODE LED_MODE_FOLLOW
  2232. #define LED3_MODE LED_MODE_FOLLOW
  2233. #define LED4_MODE LED_MODE_FOLLOW
  2234. #define LED2_RELAY 2
  2235. #define LED3_RELAY 3
  2236. #define LED4_RELAY 4
  2237. // -----------------------------------------------------------------------------
  2238. // Bruno Horta's OnOfre
  2239. // https://www.bhonofre.pt/
  2240. // https://github.com/brunohorta82/BH_OnOfre/
  2241. // -----------------------------------------------------------------------------
  2242. #elif defined(BH_ONOFRE)
  2243. // Info
  2244. #define MANUFACTURER "BH"
  2245. #define DEVICE "ONOFRE"
  2246. // Buttons
  2247. #define BUTTON1_PIN 12
  2248. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2249. #define BUTTON1_RELAY 1
  2250. #define BUTTON2_PIN 13
  2251. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2252. #define BUTTON2_RELAY 2
  2253. // Relays
  2254. #define RELAY1_PIN 4
  2255. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2256. #define RELAY2_PIN 5
  2257. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2258. // -----------------------------------------------------------------------------
  2259. // BlitzWolf SHP2 and SHP6
  2260. // Also several boards under different names uing a power chip labelled BL0937 or HJL-01
  2261. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  2262. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  2263. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  2264. // * Gosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  2265. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  2266. // * DIY Tech Smart Home (https://www.amazon.es/gp/product/B07HHKXYS9)
  2267. // -----------------------------------------------------------------------------
  2268. #elif defined(BLITZWOLF_BWSHPX)
  2269. // Info
  2270. #define MANUFACTURER "BLITZWOLF"
  2271. #define DEVICE "BWSHPX"
  2272. // Buttons
  2273. #define BUTTON1_PIN 13
  2274. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2275. #define BUTTON1_RELAY 1
  2276. // Relays
  2277. #define RELAY1_PIN 15
  2278. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2279. // LEDs
  2280. #define LED1_PIN 2
  2281. #define LED1_PIN_INVERSE 1
  2282. #define LED2_PIN 0
  2283. #define LED2_PIN_INVERSE 1
  2284. #define LED2_MODE LED_MODE_FINDME
  2285. #define LED2_RELAY 1
  2286. // HJL01 / BL0937
  2287. #ifndef HLW8012_SUPPORT
  2288. #define HLW8012_SUPPORT 1
  2289. #endif
  2290. #define HLW8012_SEL_PIN 12
  2291. #define HLW8012_CF1_PIN 14
  2292. #define HLW8012_CF_PIN 5
  2293. #define HLW8012_SEL_CURRENT LOW
  2294. #define HLW8012_CURRENT_RATIO 25740
  2295. #define HLW8012_VOLTAGE_RATIO 313400
  2296. #define HLW8012_POWER_RATIO 3414290
  2297. #define HLW8012_INTERRUPT_ON FALLING
  2298. // -----------------------------------------------------------------------------
  2299. // Same as the above but new board version marked V2.3
  2300. // BlitzWolf SHP2 V2.3
  2301. // Gosund SP1 V2.3
  2302. // -----------------------------------------------------------------------------
  2303. #elif defined(BLITZWOLF_BWSHPX_V23)
  2304. // Info
  2305. #define MANUFACTURER "BLITZWOLF"
  2306. #define DEVICE "BWSHPX_V23"
  2307. // Buttons
  2308. #define BUTTON1_PIN 3
  2309. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2310. #define BUTTON1_RELAY 1
  2311. // Relays
  2312. #define RELAY1_PIN 14
  2313. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2314. // LEDs
  2315. #define LED1_PIN 1
  2316. #define LED1_PIN_INVERSE 1
  2317. #define LED2_PIN 13
  2318. #define LED2_PIN_INVERSE 1
  2319. #define LED2_MODE LED_MODE_FINDME
  2320. #define LED2_RELAY 1
  2321. // HJL01 / BL0937
  2322. #ifndef HLW8012_SUPPORT
  2323. #define HLW8012_SUPPORT 1
  2324. #endif
  2325. #define HLW8012_SEL_PIN 12
  2326. #define HLW8012_CF1_PIN 5
  2327. #define HLW8012_CF_PIN 4
  2328. #define HLW8012_SEL_CURRENT LOW
  2329. #define HLW8012_CURRENT_RATIO 25740
  2330. #define HLW8012_VOLTAGE_RATIO 313400
  2331. #define HLW8012_POWER_RATIO 3414290
  2332. #define HLW8012_INTERRUPT_ON FALLING
  2333. // BUTTON1 and LED1 are using Serial pins
  2334. #define DEBUG_SERIAL_SUPPORT 0
  2335. // -----------------------------------------------------------------------------
  2336. // Similar to both devices above but also with switchable USB ports
  2337. // and other sensor (CSE7766).
  2338. // the pin layout is different to the above two versions
  2339. // BlitzWolf SHP5
  2340. // -----------------------------------------------------------------------------
  2341. #elif defined(BLITZWOLF_BWSHP5)
  2342. // Info
  2343. #define MANUFACTURER "BLITZWOLF"
  2344. #define DEVICE "BWSHP5"
  2345. // Buttons
  2346. #define BUTTON1_PIN 16
  2347. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2348. #define BUTTON1_RELAY 1
  2349. // Relays
  2350. // Power plug
  2351. #define RELAY1_PIN 14
  2352. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2353. // USB
  2354. #define RELAY2_PIN 5
  2355. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2356. // LEDs
  2357. #define LED1_PIN 2
  2358. #define LED1_PIN_INVERSE 1
  2359. #define LED2_PIN 0
  2360. #define LED2_PIN_INVERSE 1
  2361. #define LED2_MODE LED_MODE_FINDME
  2362. #define LED2_RELAY 1
  2363. // Disable UART noise
  2364. #define DEBUG_SERIAL_SUPPORT 0
  2365. // CSE7766
  2366. #ifndef CSE7766_SUPPORT
  2367. #define CSE7766_SUPPORT 1
  2368. #endif
  2369. #define CSE7766_PIN 1
  2370. // -----------------------------------------------------------------------------
  2371. // Teckin SP21
  2372. // -----------------------------------------------------------------------------
  2373. #elif defined(TECKIN_SP21)
  2374. // Info
  2375. #define MANUFACTURER "TECKIN"
  2376. #define DEVICE "SP21"
  2377. // Buttons
  2378. #define BUTTON1_PIN 13
  2379. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2380. #define BUTTON1_RELAY 1
  2381. // Relays
  2382. #define RELAY1_PIN 15
  2383. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2384. // LEDs
  2385. #define LED1_PIN 2
  2386. #define LED1_PIN_INVERSE 1
  2387. // -----------------------------------------------------------------------------
  2388. // Teckin SP22 v1.4 - v1.6
  2389. // -----------------------------------------------------------------------------
  2390. #elif defined(TECKIN_SP22_V14)
  2391. // Info
  2392. #define MANUFACTURER "TECKIN"
  2393. #define DEVICE "SP22_V14"
  2394. // Buttons
  2395. #define BUTTON1_PIN 1
  2396. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2397. #define BUTTON1_RELAY 1
  2398. // Relays
  2399. #define RELAY1_PIN 14
  2400. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2401. // LEDs
  2402. #define LED1_PIN 3
  2403. #define LED1_PIN_INVERSE 1
  2404. #define LED2_PIN 13
  2405. #define LED2_PIN_INVERSE 1
  2406. #define LED2_MODE LED_MODE_FINDME
  2407. #define LED2_RELAY 1
  2408. // HJL01 / BL0937
  2409. #ifndef HLW8012_SUPPORT
  2410. #define HLW8012_SUPPORT 1
  2411. #endif
  2412. #define HLW8012_SEL_PIN 12
  2413. #define HLW8012_CF1_PIN 5
  2414. #define HLW8012_CF_PIN 4
  2415. #define HLW8012_SEL_CURRENT LOW
  2416. #define HLW8012_CURRENT_RATIO 20730
  2417. #define HLW8012_VOLTAGE_RATIO 264935
  2418. #define HLW8012_POWER_RATIO 2533110
  2419. #define HLW8012_INTERRUPT_ON FALLING
  2420. // BUTTON1 and LED1 are using Serial pins
  2421. #define DEBUG_SERIAL_SUPPORT 0
  2422. // -----------------------------------------------------------------------------
  2423. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  2424. // Also model number KS-602S
  2425. // -----------------------------------------------------------------------------
  2426. #elif defined(GOSUND_WS1)
  2427. // Info
  2428. #define MANUFACTURER "GOSUND"
  2429. #define DEVICE "WS1"
  2430. // Buttons
  2431. #define BUTTON1_PIN 0
  2432. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2433. #define BUTTON1_RELAY 1
  2434. // Relays
  2435. #define RELAY1_PIN 14
  2436. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2437. // LEDs
  2438. #define LED1_PIN 1
  2439. #define LED1_PIN_INVERSE 1
  2440. // LED1 is using TX pin
  2441. #define DEBUG_SERIAL_SUPPORT 0
  2442. // ----------------------------------------------------------------------------------------
  2443. // Homecube 16A is similar but some pins differ and it also has RGB LEDs
  2444. // https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
  2445. // ----------------------------------------------------------------------------------------
  2446. #elif defined(HOMECUBE_16A)
  2447. // Info
  2448. #define MANUFACTURER "HOMECUBE"
  2449. #define DEVICE "16A"
  2450. // Buttons
  2451. #define BUTTON1_PIN 13
  2452. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2453. #define BUTTON1_RELAY 1
  2454. // Relays
  2455. #define RELAY1_PIN 15
  2456. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2457. // LEDs
  2458. //LED Pin 4 - ESP8266 onboard LED
  2459. //Red LED: 0
  2460. //Green LED: 12
  2461. //Blue LED: 2
  2462. // Blue
  2463. #define LED1_PIN 2
  2464. #define LED1_PIN_INVERSE 0
  2465. // Green
  2466. #define LED2_PIN 12
  2467. #define LED2_PIN_INVERSE 1
  2468. #define LED2_MODE LED_MODE_RELAY
  2469. // Red
  2470. #define LED3_PIN 0
  2471. #define LED3_PIN_INVERSE 0
  2472. #define LED3_MODE LED_MODE_OFF
  2473. // HJL01 / BL0937
  2474. #ifndef HLW8012_SUPPORT
  2475. #define HLW8012_SUPPORT 1
  2476. #endif
  2477. #define HLW8012_SEL_PIN 16
  2478. #define HLW8012_CF1_PIN 14
  2479. #define HLW8012_CF_PIN 5
  2480. #define HLW8012_SEL_CURRENT LOW
  2481. #define HLW8012_CURRENT_RATIO 25740
  2482. #define HLW8012_VOLTAGE_RATIO 313400
  2483. #define HLW8012_POWER_RATIO 3414290
  2484. #define HLW8012_INTERRUPT_ON FALLING
  2485. // -----------------------------------------------------------------------------
  2486. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  2487. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  2488. // -----------------------------------------------------------------------------
  2489. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  2490. // Info
  2491. #define MANUFACTURER "VANZAVANZU"
  2492. #define DEVICE "SMART_WIFI_PLUG_MINI"
  2493. // Buttons
  2494. #define BUTTON1_PIN 13
  2495. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2496. #define BUTTON1_RELAY 1
  2497. // Relays
  2498. #define RELAY1_PIN 15
  2499. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2500. // LEDs
  2501. #define LED1_PIN 2
  2502. #define LED1_PIN_INVERSE 1
  2503. #define LED2_PIN 0
  2504. #define LED2_PIN_INVERSE 1
  2505. #define LED2_MODE LED_MODE_FINDME
  2506. #define LED2_RELAY 1
  2507. // Disable UART noise
  2508. #define DEBUG_SERIAL_SUPPORT 0
  2509. // HJL01 / BL0937
  2510. #ifndef HLW8012_SUPPORT
  2511. #define HLW8012_SUPPORT 1
  2512. #endif
  2513. #define HLW8012_SEL_PIN 3
  2514. #define HLW8012_CF1_PIN 14
  2515. #define HLW8012_CF_PIN 5
  2516. #define HLW8012_SEL_CURRENT LOW
  2517. #define HLW8012_CURRENT_RATIO 25740
  2518. #define HLW8012_VOLTAGE_RATIO 313400
  2519. #define HLW8012_POWER_RATIO 3414290
  2520. #define HLW8012_INTERRUPT_ON FALLING
  2521. // -----------------------------------------------------------------------------
  2522. #elif defined(GENERIC_AG_L4)
  2523. // Info
  2524. #define MANUFACTURER "GENERIC"
  2525. #define DEVICE "AG_L4"
  2526. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2527. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2528. #define DUMMY_RELAY_COUNT 1
  2529. // button 1: "power" button
  2530. #define BUTTON1_PIN 4
  2531. #define BUTTON1_RELAY 1
  2532. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2533. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  2534. #define BUTTON1_CLICK BUTTON_MODE_NONE
  2535. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2536. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2537. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  2538. // button 2: "wifi" button
  2539. #define BUTTON2_PIN 2
  2540. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2541. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  2542. #define BUTTON2_CLICK BUTTON_MODE_NONE
  2543. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  2544. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  2545. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  2546. // LEDs
  2547. #define LED1_PIN 5 // red status led
  2548. #define LED1_PIN_INVERSE 0
  2549. #define LED2_PIN 16 // master light power
  2550. #define LED2_PIN_INVERSE 1
  2551. #define LED2_MODE LED_MODE_RELAY
  2552. // Light
  2553. #define LIGHT_CHANNELS 3
  2554. #define LIGHT_CH1_PIN 14 // RED
  2555. #define LIGHT_CH2_PIN 13 // GREEN
  2556. #define LIGHT_CH3_PIN 12 // BLUE
  2557. #define LIGHT_CH1_INVERSE 0
  2558. #define LIGHT_CH2_INVERSE 0
  2559. #define LIGHT_CH3_INVERSE 0
  2560. // -----------------------------------------------------------------------------
  2561. #elif defined(ALLTERCO_SHELLY1)
  2562. // Info
  2563. #define MANUFACTURER "ALLTERCO"
  2564. #define DEVICE "SHELLY1"
  2565. // Buttons
  2566. #define BUTTON1_PIN 5
  2567. #define BUTTON1_MODE BUTTON_SWITCH
  2568. #define BUTTON1_RELAY 1
  2569. // Relays
  2570. #define RELAY1_PIN 4
  2571. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2572. #elif defined(ALLTERCO_SHELLY2)
  2573. // Info
  2574. #define MANUFACTURER "ALLTERCO"
  2575. #define DEVICE "SHELLY2"
  2576. // Buttons
  2577. #define BUTTON1_PIN 12
  2578. #define BUTTON2_PIN 14
  2579. #define BUTTON1_MODE BUTTON_SWITCH
  2580. #define BUTTON2_MODE BUTTON_SWITCH
  2581. #define BUTTON1_RELAY 1
  2582. #define BUTTON2_RELAY 2
  2583. // Relays
  2584. #define RELAY1_PIN 4
  2585. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2586. #define RELAY2_PIN 5
  2587. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2588. #elif defined(ALLTERCO_SHELLY1PM)
  2589. // Info
  2590. #define MANUFACTURER "ALLTERCO"
  2591. #define DEVICE "SHELLY1PM"
  2592. // Buttons
  2593. #define BUTTON1_PIN 4
  2594. #define BUTTON1_MODE BUTTON_SWITCH
  2595. #define BUTTON1_RELAY 1
  2596. #define BUTTON2_PIN 2
  2597. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2598. #define BUTTON2_LNGCLICK BUTTON_MODE_RESET
  2599. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_FACTORY
  2600. // Relays
  2601. #define RELAY1_PIN 15
  2602. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2603. // Light
  2604. #define LED1_PIN 0
  2605. #define LED1_PIN_INVERSE 1
  2606. // HJL01 / BL0937
  2607. #define HLW8012_SUPPORT 1
  2608. #define HLW8012_SEL_PIN 12
  2609. #define HLW8012_CF1_PIN 13
  2610. #define HLW8012_CF_PIN 5
  2611. #define HLW8012_SEL_CURRENT LOW
  2612. #define HLW8012_CURRENT_RATIO 25740
  2613. #define HLW8012_VOLTAGE_RATIO 313400
  2614. #define HLW8012_POWER_RATIO 3414290
  2615. #define HLW8012_INTERRUPT_ON FALLING
  2616. //Temperature
  2617. #define NTC_SUPPORT 1
  2618. #define SENSOR_SUPPORT 1
  2619. #define NTC_BETA 3350
  2620. #define NTC_R_UP 10000
  2621. #define NTC_R_DOWN 0
  2622. #define NTC_R0 8000
  2623. #elif defined(ALLTERCO_SHELLY25)
  2624. // Info
  2625. #define MANUFACTURER "ALLTERCO"
  2626. #define DEVICE "SHELLY25"
  2627. // Buttons
  2628. #define BUTTON1_PIN 13
  2629. #define BUTTON1_MODE BUTTON_SWITCH
  2630. #define BUTTON1_RELAY 1
  2631. #define BUTTON2_PIN 5
  2632. #define BUTTON2_MODE BUTTON_SWITCH
  2633. #define BUTTON2_RELAY 2
  2634. #define BUTTON3_PIN 2
  2635. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2636. #define BUTTON3_LNGCLICK BUTTON_MODE_RESET
  2637. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_FACTORY
  2638. // Relays
  2639. #define RELAY1_PIN 4
  2640. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2641. #define RELAY2_PIN 15
  2642. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2643. // Light
  2644. #define LED1_PIN 0
  2645. #define LED1_PIN_INVERSE 1
  2646. //Temperature
  2647. #define NTC_SUPPORT 1
  2648. #define SENSOR_SUPPORT 1
  2649. #define NTC_BETA 3350
  2650. #define NTC_R_UP 10000
  2651. #define NTC_R_DOWN 0
  2652. #define NTC_R0 8000
  2653. //Current
  2654. #define ADE7953_SUPPORT 1
  2655. #define I2C_SDA_PIN 12
  2656. #define I2C_SCL_PIN 14
  2657. // -----------------------------------------------------------------------------
  2658. // also works with https://www.amazon.com/gp/product/B07TMY394G/
  2659. // see https://github.com/xoseperez/espurna/issues/2055
  2660. #elif defined(LOHAS_E27_9W)
  2661. // Info
  2662. #define MANUFACTURER "LOHAS"
  2663. #define DEVICE "E27_9W"
  2664. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2665. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2666. #define DUMMY_RELAY_COUNT 1
  2667. // Light
  2668. #define LIGHT_CHANNELS 5
  2669. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2670. #define MY92XX_CHIPS 2
  2671. #define MY92XX_DI_PIN 13
  2672. #define MY92XX_DCKI_PIN 15
  2673. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2674. #define MY92XX_MAPPING 0, 1, 2, 3, 4
  2675. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  2676. // https://www.amazon.com/gp/product/B07T7W7ZMW
  2677. #elif defined(LOHAS_E26_A19)
  2678. // Info
  2679. #define MANUFACTURER "LOHAS"
  2680. #define DEVICE "E26_A19"
  2681. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2682. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2683. #define DUMMY_RELAY_COUNT 1
  2684. // Light
  2685. #define LIGHT_CHANNELS 5
  2686. #define LIGHT_CH1_PIN 5 // RED
  2687. #define LIGHT_CH2_PIN 4 // GREEN
  2688. #define LIGHT_CH3_PIN 13 // BLUE
  2689. #define LIGHT_CH4_PIN 14 // WHITE1
  2690. #define LIGHT_CH5_PIN 12 // WHITE1
  2691. // -----------------------------------------------------------------------------
  2692. #elif defined(TECKIN_SB53)
  2693. // Info
  2694. #define MANUFACTURER "TECKIN"
  2695. #define DEVICE "SB53"
  2696. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2697. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2698. #define DUMMY_RELAY_COUNT 1
  2699. // Light
  2700. #define LIGHT_CHANNELS 5
  2701. #define LIGHT_CH1_PIN 4 // RED
  2702. #define LIGHT_CH2_PIN 12 // GREEN
  2703. #define LIGHT_CH3_PIN 14 // BLUE
  2704. #define LIGHT_CH4_PIN 13 // WARM WHITE
  2705. #define LIGHT_CH5_PIN 5 // COLD WHITE
  2706. // -----------------------------------------------------------------------------
  2707. #elif defined(XIAOMI_SMART_DESK_LAMP)
  2708. // Info
  2709. #define MANUFACTURER "XIAOMI"
  2710. #define DEVICE "SMART_DESK_LAMP"
  2711. // Buttons
  2712. #define BUTTON1_PIN 2
  2713. #define BUTTON2_PIN 14
  2714. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2715. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2716. // This button doubles as switch here and as encoder mode switch below
  2717. // Clicking it (for less than 500ms) will turn the light on and off
  2718. // Double and Long clicks will not work as these are used to modify the encoder action
  2719. #define BUTTON1_RELAY 1
  2720. #define BUTTON_LNGCLICK_DELAY 500
  2721. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2722. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2723. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  2724. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  2725. #define BUTTON2_DBLCLICK BUTTON_MODE_AP
  2726. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  2727. // Light
  2728. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2729. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2730. #define DUMMY_RELAY_COUNT 1
  2731. #define LIGHT_STEP 8
  2732. #define LIGHT_CHANNELS 2
  2733. #define LIGHT_CH1_PIN 5 // warm white
  2734. #define LIGHT_CH1_INVERSE 0
  2735. #define LIGHT_CH2_PIN 4 // cold white
  2736. #define LIGHT_CH2_INVERSE 0
  2737. // https://www.xiaomitoday.com/xiaomi-mijia-mjtd01yl-led-desk-lamp-review/
  2738. #define LIGHT_COLDWHITE_MIRED 153
  2739. #define LIGHT_WARMWHITE_MIRED 370
  2740. // Encoder
  2741. // If mode is ENCODER_MODE_RATIO, the value ratio between both channels is changed
  2742. // when the button is not pressed, and the overall brightness when pressed
  2743. // If mode is ENCODER_MODE_CHANNEL, the first channel value is changed
  2744. // when the button is not pressed, and the second channel when pressed
  2745. // If no ENCODERX_BUTTON_PIN defined it will only change the value of the first defined channel
  2746. #define ENCODER_SUPPORT 1
  2747. #define ENCODER1_PIN1 12
  2748. #define ENCODER1_PIN2 13
  2749. #define ENCODER1_BUTTON_PIN 2 // active low by default, with software pullup
  2750. #define ENCODER1_CHANNEL1 0 // please note this value is 0-based (LIGHT_CH1 above)
  2751. #define ENCODER1_CHANNEL2 1 // please note this value is 0-based (LIGHT_CH2 above)
  2752. #define ENCODER1_MODE ENCODER_MODE_RATIO
  2753. #elif defined(PHYX_ESP12_RGB)
  2754. // Info
  2755. #define MANUFACTURER "PHYX"
  2756. #define DEVICE "ESP12_RGB"
  2757. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2758. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2759. #define DUMMY_RELAY_COUNT 1
  2760. // Light
  2761. #define LIGHT_CHANNELS 3
  2762. #define LIGHT_CH1_PIN 4 // RED
  2763. #define LIGHT_CH2_PIN 14 // GREEN
  2764. #define LIGHT_CH3_PIN 12 // BLUE
  2765. #define LIGHT_CH1_INVERSE 0
  2766. #define LIGHT_CH2_INVERSE 0
  2767. #define LIGHT_CH3_INVERSE 0
  2768. // -----------------------------------------------------------------------------
  2769. // iWoole LED Table Lamp
  2770. // 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
  2771. // -----------------------------------------------------------------------------
  2772. #elif defined(IWOOLE_LED_TABLE_LAMP)
  2773. // Info
  2774. #define MANUFACTURER "IWOOLE"
  2775. #define DEVICE "LED_TABLE_LAMP"
  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 4
  2781. #define LIGHT_CH1_PIN 12 // RED
  2782. #define LIGHT_CH2_PIN 5 // GREEN
  2783. #define LIGHT_CH3_PIN 14 // BLUE
  2784. #define LIGHT_CH4_PIN 4 // WHITE
  2785. #define LIGHT_CH1_INVERSE 0
  2786. #define LIGHT_CH2_INVERSE 0
  2787. #define LIGHT_CH3_INVERSE 0
  2788. #define LIGHT_CH4_INVERSE 0
  2789. // -----------------------------------------------------------------------------
  2790. // Generic GU10
  2791. // https://www.ebay.com/itm/1-10PC-GU10-RGB-Smart-Bulb-Wireless-WiFi-App-Remote-Ctrl-Light-for-Alexa-Google/173724116351
  2792. // -----------------------------------------------------------------------------
  2793. #elif defined(GENERIC_GU10)
  2794. // Info
  2795. #define MANUFACTURER "GENERIC"
  2796. #define DEVICE "GU10"
  2797. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2798. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2799. #define DUMMY_RELAY_COUNT 1
  2800. // Light
  2801. #define LIGHT_CHANNELS 4
  2802. #define LIGHT_CH1_PIN 14 // RED
  2803. #define LIGHT_CH2_PIN 12 // GREEN
  2804. #define LIGHT_CH3_PIN 13 // BLUE
  2805. #define LIGHT_CH4_PIN 4 // WHITE
  2806. #define LIGHT_CH1_INVERSE 0
  2807. #define LIGHT_CH2_INVERSE 0
  2808. #define LIGHT_CH3_INVERSE 0
  2809. #define LIGHT_CH4_INVERSE 0
  2810. // -----------------------------------------------------------------------------
  2811. // Generic E14
  2812. // https://www.ebay.com/itm/LED-Bulb-Wifi-E14-4-5W-Candle-RGB-W-4in1-Dimmable-V-tac-Smart-VT-5114/163899840601
  2813. // -----------------------------------------------------------------------------
  2814. #elif defined(GENERIC_E14)
  2815. // Info
  2816. #define MANUFACTURER "GENERIC"
  2817. #define DEVICE "E14"
  2818. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2819. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2820. #define DUMMY_RELAY_COUNT 1
  2821. // Light
  2822. #define LIGHT_CHANNELS 4
  2823. #define LIGHT_CH1_PIN 4 // RED
  2824. #define LIGHT_CH2_PIN 12 // GREEN
  2825. #define LIGHT_CH3_PIN 14 // BLUE
  2826. #define LIGHT_CH4_PIN 5 // WHITE
  2827. #define LIGHT_CH1_INVERSE 0
  2828. #define LIGHT_CH2_INVERSE 0
  2829. #define LIGHT_CH3_INVERSE 0
  2830. #define LIGHT_CH4_INVERSE 0
  2831. // -----------------------------------------------------------------------------
  2832. // Nexete A19
  2833. // https://www.ebay.com/itm/Wifi-Smart-LED-light-Bulb-9W-60W-A19-850LM-RGBW-Dimmable-for-Alexa-Google-Home/283514779201
  2834. // -----------------------------------------------------------------------------
  2835. #elif defined(NEXETE_A19)
  2836. // Info
  2837. #define MANUFACTURER "NEXETE"
  2838. #define DEVICE "A19"
  2839. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2840. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2841. #define DUMMY_RELAY_COUNT 1
  2842. // Light
  2843. #define LIGHT_CHANNELS 4
  2844. #define LIGHT_CH1_PIN 12 // RED
  2845. #define LIGHT_CH2_PIN 15 // GREEN
  2846. #define LIGHT_CH3_PIN 14 // BLUE
  2847. #define LIGHT_CH4_PIN 5 // WHITE
  2848. #define LIGHT_CH1_INVERSE 0
  2849. #define LIGHT_CH2_INVERSE 0
  2850. #define LIGHT_CH3_INVERSE 0
  2851. #define LIGHT_CH4_INVERSE 0
  2852. // -----------------------------------------------------------------------------
  2853. // Lombex Lux Nova 2 Tunable White
  2854. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2855. // -----------------------------------------------------------------------------
  2856. #elif defined(LOMBEX_LUX_NOVA2_TUNABLE_WHITE)
  2857. // Info
  2858. #define MANUFACTURER "LOMBEX"
  2859. #define DEVICE "LUX_NOVA2_TUNABLE_WHITE"
  2860. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2861. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2862. #define DUMMY_RELAY_COUNT 1
  2863. // Light
  2864. #define LIGHT_CHANNELS 5
  2865. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2866. #define MY92XX_CHIPS 1
  2867. #define MY92XX_DI_PIN 4
  2868. #define MY92XX_DCKI_PIN 5
  2869. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2870. // No RGB on this bulb. Warm white on channel 0, cool white on channel 3
  2871. #define MY92XX_MAPPING 255, 255, 255, 3, 0
  2872. // -----------------------------------------------------------------------------
  2873. // Lombex Lux Nova 2 White and Color
  2874. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2875. // -----------------------------------------------------------------------------
  2876. #elif defined(LOMBEX_LUX_NOVA2_WHITE_COLOR)
  2877. // Info
  2878. #define MANUFACTURER "LOMBEX"
  2879. #define DEVICE "LUX_NOVA2_WHITE_COLOR"
  2880. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2881. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2882. #define DUMMY_RELAY_COUNT 1
  2883. // Light
  2884. #define LIGHT_CHANNELS 4
  2885. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2886. #define MY92XX_CHIPS 1
  2887. #define MY92XX_DI_PIN 4
  2888. #define MY92XX_DCKI_PIN 5
  2889. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2890. // RGB on channels 0/1/2, either cool or warm white on channel 3
  2891. // The bulb *should* have cool leds, but could also have warm leds as a common defect
  2892. #define MY92XX_MAPPING 0, 1, 2, 3
  2893. // -----------------------------------------------------------------------------
  2894. // Bestek Smart Plug with 2 USB ports
  2895. // https://www.bestekcorp.com/bestek-smart-plug-works-with-amazon-alexa-google-assistant-and-ifttt-with-2-usb
  2896. // -----------------------------------------------------------------------------
  2897. #elif defined(BESTEK_MRJ1011)
  2898. // Info
  2899. #define MANUFACTURER "BESTEK"
  2900. #define DEVICE "MRJ1011"
  2901. // Buttons
  2902. #define BUTTON1_PIN 13
  2903. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2904. #define BUTTON1_RELAY 1
  2905. // Relay
  2906. #define RELAY1_PIN 12
  2907. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2908. // LED
  2909. #define LED1_PIN 4
  2910. #define LED1_PIN_INVERSE 1
  2911. // -----------------------------------------------------------------------------
  2912. // GBLIFE RGBW SOCKET
  2913. // -----------------------------------------------------------------------------
  2914. #elif defined(GBLIFE_RGBW_SOCKET)
  2915. // Info
  2916. #define MANUFACTURER "GBLIFE"
  2917. #define DEVICE "RGBW_SOCKET"
  2918. // Buttons
  2919. #define BUTTON1_PIN 13
  2920. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2921. #define BUTTON1_RELAY 1
  2922. // Relays
  2923. #define RELAY1_PIN 15
  2924. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2925. // Light RGBW
  2926. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2927. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2928. #define DUMMY_RELAY_COUNT 1
  2929. #define LIGHT_CHANNELS 4
  2930. #define LIGHT_CH1_PIN 5 // RED
  2931. #define LIGHT_CH2_PIN 14 // GREEN
  2932. #define LIGHT_CH3_PIN 12 // BLUE
  2933. #define LIGHT_CH4_PIN 4 // WHITE
  2934. #define LIGHT_CH1_INVERSE 0
  2935. #define LIGHT_CH2_INVERSE 0
  2936. #define LIGHT_CH3_INVERSE 0
  2937. #define LIGHT_CH4_INVERSE 0
  2938. // ----------------------------------------------------------------------------------------
  2939. // Smart life Mini Smart Socket is similar Homecube 16A but some GPIOs differ
  2940. // https://www.ebay.de/itm/Smart-Steckdose-WIFI-WLAN-Amazon-Alexa-Fernbedienung-Home-Socket-Zeitschaltuh-DE/123352026749?hash=item1cb85a8e7d:g:IasAAOSwk6dbj390
  2941. // Also labeled NETVIP
  2942. // https://www.amazon.es/Inteligente-NETVIP-Inal%C3%A1mbrico-Interruptor-Funciona/dp/B07KH8YWS5
  2943. // ----------------------------------------------------------------------------------------
  2944. #elif defined(SMARTLIFE_MINI_SMART_SOCKET)
  2945. // Info
  2946. #define MANUFACTURER "SMARTLIFE"
  2947. #define DEVICE "MINI_SMART_SOCKET"
  2948. // Buttons
  2949. #define BUTTON1_PIN 13
  2950. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2951. #define BUTTON1_RELAY 1
  2952. // Relays
  2953. #define RELAY1_PIN 15
  2954. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2955. // LEDs
  2956. //Red LED: 0
  2957. //Green LED: 4
  2958. //Blue LED: 2
  2959. // Light
  2960. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2961. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2962. #define DUMMY_RELAY_COUNT 1
  2963. #define LIGHT_CHANNELS 3
  2964. #define LIGHT_CH1_PIN 0 // RED
  2965. #define LIGHT_CH2_PIN 4 // GREEN
  2966. #define LIGHT_CH3_PIN 2 // BLUE
  2967. #define LIGHT_CH1_INVERSE 0
  2968. #define LIGHT_CH2_INVERSE 0
  2969. #define LIGHT_CH3_INVERSE 0
  2970. // HJL01 / BL0937
  2971. #ifndef HLW8012_SUPPORT
  2972. #define HLW8012_SUPPORT 1
  2973. #endif
  2974. #define HLW8012_SEL_PIN 12
  2975. #define HLW8012_CF1_PIN 14
  2976. #define HLW8012_CF_PIN 5
  2977. #define HLW8012_SEL_CURRENT LOW
  2978. #define HLW8012_CURRENT_RATIO 25740
  2979. #define HLW8012_VOLTAGE_RATIO 313400
  2980. #define HLW8012_POWER_RATIO 3414290
  2981. #define HLW8012_INTERRUPT_ON FALLING
  2982. // ----------------------------------------------------------------------------------------
  2983. // Hama WiFi Steckdose (00176533)
  2984. // https://at.hama.com/00176533/hama-wifi-steckdose-3500w-16a
  2985. // ----------------------------------------------------------------------------------------
  2986. #elif defined(HAMA_WIFI_STECKDOSE_00176533)
  2987. // Info
  2988. #define MANUFACTURER "HAMA"
  2989. #define DEVICE "WIFI_STECKDOSE_00176533"
  2990. // Buttons
  2991. #define BUTTON1_PIN 13
  2992. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2993. #define BUTTON1_RELAY 1
  2994. // Relays
  2995. #define RELAY1_PIN 12
  2996. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2997. // LEDs
  2998. #define LED1_PIN 4
  2999. #define LED1_PIN_INVERSE 1
  3000. // -----------------------------------------------------------------------------
  3001. // Oxaoxe NX-SP202
  3002. // Digoo NX-SP202 (not tested)
  3003. // Digoo DG-SP202 (not tested)
  3004. // https://github.com/xoseperez/espurna/issues/1502
  3005. // -----------------------------------------------------------------------------
  3006. #elif defined(DIGOO_NX_SP202)
  3007. // Info
  3008. #define MANUFACTURER "DIGOO"
  3009. #define DEVICE "NX_SP202"
  3010. // Buttons
  3011. #define BUTTON1_PIN 0
  3012. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3013. #define BUTTON1_RELAY 1
  3014. #define BUTTON2_PIN 16
  3015. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  3016. #define BUTTON2_RELAY 2
  3017. // Relays
  3018. #define RELAY1_PIN 15
  3019. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3020. #define RELAY2_PIN 14
  3021. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3022. // LEDs
  3023. #define LED1_PIN 13
  3024. #define LED1_PIN_INVERSE 1
  3025. // HJL01 / BL0937
  3026. #ifndef HLW8012_SUPPORT
  3027. #define HLW8012_SUPPORT 1
  3028. #endif
  3029. #define HLW8012_SEL_PIN 12
  3030. #define HLW8012_CF1_PIN 5
  3031. #define HLW8012_CF_PIN 4
  3032. #define HLW8012_SEL_CURRENT LOW
  3033. #define HLW8012_CURRENT_RATIO 23296
  3034. #define HLW8012_VOLTAGE_RATIO 310085
  3035. #define HLW8012_POWER_RATIO 3368471
  3036. #define HLW8012_INTERRUPT_ON FALLING
  3037. // -----------------------------------------------------------------------------
  3038. // Foxel's LightFox dual
  3039. // https://github.com/foxel/esp-dual-rf-switch
  3040. // -----------------------------------------------------------------------------
  3041. #elif defined(FOXEL_LIGHTFOX_DUAL)
  3042. // Info
  3043. #define MANUFACTURER "FOXEL"
  3044. #define DEVICE "LIGHTFOX_DUAL"
  3045. #define SERIAL_BAUDRATE 19200
  3046. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  3047. #define DUMMY_RELAY_COUNT 2
  3048. #define DEBUG_SERIAL_SUPPORT 0
  3049. // Buttons
  3050. #define BUTTON1_RELAY 1
  3051. #define BUTTON2_RELAY 2
  3052. #define BUTTON3_RELAY 2
  3053. #define BUTTON4_RELAY 1
  3054. // -----------------------------------------------------------------------------
  3055. // Teckin SP20
  3056. // -----------------------------------------------------------------------------
  3057. #elif defined(TECKIN_SP20)
  3058. // Info
  3059. #define MANUFACTURER "TECKIN"
  3060. #define DEVICE "SP20"
  3061. // Buttons
  3062. #define BUTTON1_PIN 13
  3063. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3064. #define BUTTON1_RELAY 1
  3065. // Relays
  3066. #define RELAY1_PIN 4
  3067. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3068. // LEDs
  3069. #define LED1_PIN 2
  3070. #define LED1_PIN_INVERSE 1
  3071. #define LED2_PIN 0
  3072. #define LED2_PIN_INVERSE 1
  3073. #define LED2_MODE LED_MODE_FINDME
  3074. #define LED2_RELAY 0
  3075. // HJL01 / BL0937
  3076. #ifndef HLW8012_SUPPORT
  3077. #define HLW8012_SUPPORT 1
  3078. #endif
  3079. #define HLW8012_SEL_PIN 12
  3080. #define HLW8012_CF1_PIN 14
  3081. #define HLW8012_CF_PIN 5
  3082. #define HLW8012_SEL_CURRENT LOW
  3083. #define HLW8012_CURRENT_RATIO 25740
  3084. #define HLW8012_VOLTAGE_RATIO 313400
  3085. #define HLW8012_POWER_RATIO 3414290
  3086. #define HLW8012_INTERRUPT_ON FALLING
  3087. // -----------------------------------------------------------------------------
  3088. // Charging Essentials / LITESUN LA-WF3
  3089. // -----------------------------------------------------------------------------
  3090. #elif defined(LITESUN_LA_WF3)
  3091. // Info
  3092. #define MANUFACTURER "LITESUN"
  3093. #define DEVICE "LA_WF3"
  3094. // Buttons
  3095. #define BUTTON1_PIN 13
  3096. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3097. #define BUTTON1_RELAY 1
  3098. // Relays
  3099. #define RELAY1_PIN 12
  3100. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3101. // LEDs
  3102. #define LED1_PIN 4 // 4 blue led
  3103. #define LED1_MODE LED_MODE_WIFI
  3104. #define LED1_PIN_INVERSE 1
  3105. #define LED2_PIN 5 // 5 red led
  3106. #define LED2_MODE LED_MODE_RELAY
  3107. #define LED2_PIN_INVERSE 1
  3108. // -----------------------------------------------------------------------------
  3109. // PSH
  3110. // -----------------------------------------------------------------------------
  3111. #elif defined(PSH_WIFI_PLUG)
  3112. // Info
  3113. #define MANUFACTURER "PSH"
  3114. #define DEVICE "WIFI_PLUG"
  3115. // Relays
  3116. #define RELAY1_PIN 2
  3117. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3118. // LEDs
  3119. #define LED1_PIN 0
  3120. #define LED1_PIN_INVERSE 0
  3121. #elif defined(PSH_RGBW_CONTROLLER)
  3122. // Info
  3123. #define MANUFACTURER "PSH"
  3124. #define DEVICE "RGBW_CONTROLLER"
  3125. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3126. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3127. #define DUMMY_RELAY_COUNT 1
  3128. // LEDs
  3129. #define LED1_PIN 13
  3130. #define LED1_PIN_INVERSE 1
  3131. // Light
  3132. #define LIGHT_CHANNELS 4
  3133. #define LIGHT_CH1_PIN 5 // RED
  3134. #define LIGHT_CH2_PIN 4 // GREEN
  3135. #define LIGHT_CH3_PIN 12 // BLUE
  3136. #define LIGHT_CH4_PIN 14 // WHITE1
  3137. #define LIGHT_CH1_INVERSE 0
  3138. #define LIGHT_CH2_INVERSE 0
  3139. #define LIGHT_CH3_INVERSE 0
  3140. #define LIGHT_CH4_INVERSE 0
  3141. #elif defined(PSH_WIFI_SENSOR)
  3142. // Info
  3143. #define MANUFACTURER "PSH"
  3144. #define DEVICE "WIFI_SENSOR"
  3145. // DHT12 Sensor
  3146. #define DHT_SUPPORT 1
  3147. #define DHT_PIN 14
  3148. #define DHT_TYPE DHT_CHIP_DHT12
  3149. // LDR Sensor
  3150. #define LDR_SUPPORT 1
  3151. #define LDR_TYPE LDR_GL5528
  3152. #define LDR_ON_GROUND false
  3153. #define LDR_RESISTOR 10000
  3154. #elif defined(JINVOO_VALVE_SM_AW713)
  3155. // Reflashing from original Tuya firmware
  3156. // to thirdparty firmware like espurna by:
  3157. // https://github.com/ct-Open-Source/tuya-convert
  3158. // Info
  3159. #define MANUFACTURER "JINVOO"
  3160. #define DEVICE "VALVE_SM_AW713"
  3161. // Buttons
  3162. #define BUTTON1_PIN 13
  3163. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3164. #define BUTTON1_RELAY 1
  3165. // Relays
  3166. #define RELAY1_PIN 12
  3167. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3168. // LED
  3169. #define LED1_PIN 5 // 5 red led
  3170. #define LED1_PIN_INVERSE 0
  3171. #define LED1_RELAY 1
  3172. #define LED1_MODE LED_MODE_RELAY
  3173. #define LED2_PIN 4 // 4 blue led
  3174. #define LED2_PIN_INVERSE 0
  3175. #define LED2_RELAY 1
  3176. #define LED2_MODE LED_MODE_FINDME_WIFI
  3177. #elif defined(TUYA_GENERIC_DIMMER)
  3178. #define MANUFACTURER "TUYA"
  3179. #define DEVICE "GENERIC_DIMMER"
  3180. #define LIGHT_PROVIDER LIGHT_PROVIDER_TUYA
  3181. #define LIGHT_CHANNELS 0
  3182. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3183. #define DUMMY_RELAY_COUNT 0
  3184. // -----------------------------------------------------------------------------
  3185. // Etekcity ESW01-USA
  3186. // https://www.amazon.com/Etekcity-Voltson-Outlet-Monitoring-Required/dp/B01M3MYIFS
  3187. // -----------------------------------------------------------------------------
  3188. #elif defined(ETEKCITY_ESW01_USA)
  3189. // Info
  3190. #define MANUFACTURER "ETEKCITY"
  3191. #define DEVICE "ESW01-USA"
  3192. // Buttons
  3193. #define BUTTON1_PIN 14
  3194. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3195. #define BUTTON1_RELAY 1
  3196. // Relays
  3197. #define RELAY1_PIN 4
  3198. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3199. // LEDs
  3200. // Blue
  3201. #define LED1_PIN 5
  3202. #define LED1_PIN_INVERSE 0
  3203. #define LED1_MODE LED_MODE_WIFI
  3204. // Yellow
  3205. #define LED2_PIN 16
  3206. #define LED2_PIN_INVERSE 0
  3207. #define LED2_MODE LED_MODE_FOLLOW
  3208. #define LED2_RELAY 1
  3209. // HLW8012
  3210. #ifndef HLW8012_SUPPORT
  3211. #define HLW8012_SUPPORT 1
  3212. #endif
  3213. #define HLW8012_SEL_PIN 15
  3214. #define HLW8012_CF1_PIN 12
  3215. #define HLW8012_CF_PIN 13
  3216. #define HLW8012_SEL_CURRENT HIGH // SEL pin to HIGH to measure current
  3217. #define HLW8012_CURRENT_R 0.001 // Current resistor
  3218. #define HLW8012_VOLTAGE_R_UP ( 4 * 470000 ) // Upstream voltage resistor
  3219. #define HLW8012_VOLTAGE_R_DOWN ( 1000 ) // Downstream voltage resistor
  3220. #define HLW8012_INTERRUPT_ON CHANGE
  3221. // -----------------------------------------------------------------------------
  3222. // FS UAP1
  3223. // http://frank-schuetz.de/index.php/fhem/13-hoermann-torantrieb-mit-espeasy-in-fhem-einbinden
  3224. #elif defined(FS_UAP1)
  3225. // Info
  3226. #define MANUFACTURER "FS"
  3227. #define DEVICE "UAP1"
  3228. // Inputs
  3229. #define DIGITAL1_PIN 4
  3230. #define DIGITAL2_PIN 5
  3231. // Relays
  3232. #define RELAY1_PIN 12
  3233. #define RELAY2_PIN 13
  3234. #define RELAY3_PIN 14
  3235. #define RELAY4_PIN 15
  3236. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3237. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3238. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  3239. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  3240. // LEDs
  3241. #define LED1_PIN 2
  3242. #define LED1_PIN_INVERSE 0
  3243. // Disable UART noise
  3244. #define DEBUG_SERIAL_SUPPORT 0
  3245. // -----------------------------------------------------------------------------
  3246. // TFLAG NX-SM100 & NX-SM200
  3247. // -----------------------------------------------------------------------------
  3248. #elif defined(TFLAG_NX_SMX00)
  3249. // Info
  3250. #define MANUFACTURER "TFLAG"
  3251. #define DEVICE "NX_SMX00"
  3252. // Buttons
  3253. #define BUTTON1_PIN 13
  3254. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3255. #define BUTTON1_RELAY 1
  3256. // Relays
  3257. #define RELAY1_PIN 12
  3258. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3259. // LEDs
  3260. #define LED1_PIN 0
  3261. #define LED1_PIN_INVERSE 1
  3262. #define LED1_MODE LED_MODE_FOLLOW_INVERSE
  3263. #define LED1_RELAY 1
  3264. #define LED2_PIN 15
  3265. #define LED2_PIN_INVERSE 1
  3266. #define LED2_MODE LED_MODE_WIFI
  3267. // HJL01 / BL0937
  3268. #ifndef HLW8012_SUPPORT
  3269. #define HLW8012_SUPPORT 1
  3270. #endif
  3271. #define HLW8012_SEL_PIN 16
  3272. #define HLW8012_CF1_PIN 14
  3273. #define HLW8012_CF_PIN 5
  3274. #define HLW8012_SEL_CURRENT LOW
  3275. #define HLW8012_CURRENT_RATIO 632
  3276. #define HLW8012_VOLTAGE_RATIO 313400
  3277. #define HLW8012_POWER_RATIO 3711185
  3278. #define HLW8012_INTERRUPT_ON FALLING
  3279. // -----------------------------------------------------------------------------
  3280. // MUVIT_IO_MIOBULB001
  3281. // -----------------------------------------------------------------------------
  3282. #elif defined(MUVIT_IO_MIOBULB001)
  3283. // Info
  3284. #define MANUFACTURER "MUVIT_IO"
  3285. #define DEVICE "MIOBULB001"
  3286. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3287. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3288. #define DUMMY_RELAY_COUNT 1
  3289. // Light
  3290. #define LIGHT_CHANNELS 4
  3291. #define LIGHT_CH1_PIN 14 // RED
  3292. #define LIGHT_CH2_PIN 12 // GREEN
  3293. #define LIGHT_CH3_PIN 13 // BLUE
  3294. #define LIGHT_CH4_PIN 4 // WHITE
  3295. #define LIGHT_CH1_INVERSE 0
  3296. #define LIGHT_CH2_INVERSE 0
  3297. #define LIGHT_CH3_INVERSE 0
  3298. #define LIGHT_CH4_INVERSE 0
  3299. // -----------------------------------------------------------------------------
  3300. // Hykker Power Plug (Smart Home Series) available in Jerónimo Martins Polska (Biedronka)
  3301. // https://www.hykker.com/akcesoria/gniazdo-wi-fi-z-licznikiem-energii/
  3302. // Reflashing from original Tuya firmware
  3303. // to thirdparty firmware like espurna by:
  3304. // https://github.com/ct-Open-Source/tuya-convert
  3305. // -----------------------------------------------------------------------------
  3306. #elif defined(HYKKER_SMART_HOME_POWER_PLUG)
  3307. // Info
  3308. #define MANUFACTURER "HYKKER"
  3309. #define DEVICE "SMART_HOME_POWER_PLUG"
  3310. // Buttons
  3311. #define BUTTON1_PIN 0
  3312. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3313. #define BUTTON1_RELAY 1
  3314. // Relays
  3315. #define RELAY1_PIN 14
  3316. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3317. // LED
  3318. // Red
  3319. #define LED1_PIN 13
  3320. #define LED1_MODE LED_MODE_WIFI
  3321. #define LED1_PIN_INVERSE 1
  3322. // Blue connected to relay
  3323. // HLW8012
  3324. #ifndef HLW8012_SUPPORT
  3325. #define HLW8012_SUPPORT 1
  3326. #endif
  3327. #define HLW8012_SEL_PIN 12
  3328. #define HLW8012_CF1_PIN 5
  3329. #define HLW8012_CF_PIN 4
  3330. #define HLW8012_SEL_CURRENT LOW
  3331. #define HLW8012_CURRENT_RATIO 25740
  3332. #define HLW8012_VOLTAGE_RATIO 282060
  3333. #define HLW8012_POWER_RATIO 3414290
  3334. #define HLW8012_INTERRUPT_ON FALLING
  3335. #define SENSOR_ENERGY_UNITS ENERGY_KWH
  3336. #define SENSOR_POWER_UNITS POWER_WATTS
  3337. // -----------------------------------------------------------------------------
  3338. // Kogan Smarter Home Plug with Energy Meter (Australia)
  3339. // Product code: KASPEMHA
  3340. // https://www.kogan.com/au/buy/kogan-smarterhome-smart-plug-energy-meter/
  3341. // Reflashing from original Tuya firmware
  3342. // to thirdparty firmware like espurna by:
  3343. // https://github.com/ct-Open-Source/tuya-convert
  3344. // -----------------------------------------------------------------------------
  3345. #elif defined(KOGAN_SMARTER_HOME_PLUG_W_POW)
  3346. // Info
  3347. #define MANUFACTURER "KOGAN"
  3348. #define DEVICE "SMARTER_HOME_PLUG_W_POW"
  3349. // Buttons
  3350. #define BUTTON1_PIN 0
  3351. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  3352. #define BUTTON1_RELAY 1
  3353. // Relays
  3354. #define RELAY1_PIN 14
  3355. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3356. // LED
  3357. // Red
  3358. #define LED1_PIN 13
  3359. #define LED1_MODE LED_MODE_WIFI
  3360. #define LED1_PIN_INVERSE 1
  3361. // Blue connected to relay
  3362. // HLW8012
  3363. #ifndef HLW8012_SUPPORT
  3364. #define HLW8012_SUPPORT 1
  3365. #endif
  3366. #define HLW8012_SEL_PIN 12
  3367. #define HLW8012_CF1_PIN 5
  3368. #define HLW8012_CF_PIN 4
  3369. #define HLW8012_SEL_CURRENT LOW
  3370. #define HLW8012_CURRENT_RATIO 25740
  3371. #define HLW8012_VOLTAGE_RATIO 282060
  3372. #define HLW8012_POWER_RATIO 3414290
  3373. #define HLW8012_INTERRUPT_ON FALLING
  3374. #define SENSOR_ENERGY_UNITS ENERGY_KWH
  3375. #define SENSOR_POWER_UNITS POWER_WATTS
  3376. // -----------------------------------------------------------------------------
  3377. // LSC Smart LED Light Strip (Smart CXonnect Series) available ACTION (Germany)
  3378. // https://www.action.com/de-de/p/lsc-smart-connect-intelligenter-multicolor-led-strip-/
  3379. // Reflashing from original Tuya firmware
  3380. // to thirdparty firmware like espurna by:
  3381. // https://github.com/ct-Open-Source/tuya-convert
  3382. // -----------------------------------------------------------------------------
  3383. #elif defined(LSC_SMART_LED_LIGHT_STRIP)
  3384. // Info
  3385. #define MANUFACTURER "LSC"
  3386. #define DEVICE "SMART_LED_LIGHT_STRIP"
  3387. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3388. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3389. #define DUMMY_RELAY_COUNT 1
  3390. // Light RGBW
  3391. #define LIGHT_CHANNELS 4
  3392. #define LIGHT_CH1_PIN 4 // RED
  3393. #define LIGHT_CH2_PIN 12 // GREEN
  3394. #define LIGHT_CH3_PIN 14 // BLUE
  3395. #define LIGHT_CH4_PIN 13 // WHITE
  3396. // #define LIGHT_CH5_PIN 5 // CW (not connected, but circuit supports it)
  3397. #define LIGHT_CH1_INVERSE 0
  3398. #define LIGHT_CH2_INVERSE 0
  3399. #define LIGHT_CH3_INVERSE 0
  3400. #define LIGHT_CH4_INVERSE 0
  3401. // IR
  3402. #define IR_SUPPORT 1
  3403. #define IR_RX_PIN 0
  3404. #define IR_BUTTON_SET 5
  3405. // -----------------------------------------------------------------------------
  3406. // eHomeDIY WT02
  3407. // https://github.com/eHomeDIY/WT02-hardware
  3408. // -----------------------------------------------------------------------------
  3409. #elif defined(EHOMEDIY_WT02)
  3410. // Info
  3411. #define MANUFACTURER "EHOMEDIY"
  3412. #define DEVICE "WT02"
  3413. #define I2C_SDA_PIN 0
  3414. #define I2C_SCL_PIN 2
  3415. #define BMX280_SUPPORT 1
  3416. // #define SI7021_SUPPORT 1
  3417. // -----------------------------------------------------------------------------
  3418. // eHomeDIY WT03
  3419. // https://github.com/eHomeDIY/WT03-hardware
  3420. // -----------------------------------------------------------------------------
  3421. #elif defined(EHOMEDIY_WT03)
  3422. // Info
  3423. #define MANUFACTURER "EHOMEDIY"
  3424. #define DEVICE "WT03"
  3425. #define I2C_SDA_PIN 2
  3426. #define I2C_SCL_PIN 0
  3427. #define BMX280_SUPPORT 1
  3428. // #define SI7021_SUPPORT 1
  3429. // -----------------------------------------------------------------------------
  3430. // Linksprite R4
  3431. // http://linksprite.com/wiki/index.php?title=LinkNode_R4:_Arduino-compatible_WiFi_relay_controller
  3432. // -----------------------------------------------------------------------------
  3433. #elif defined(LINKSPRITE_LINKNODE_R4)
  3434. // Info
  3435. #define MANUFACTURER "LINKSPRITE"
  3436. #define DEVICE "LINKNODE_R4"
  3437. // Relays
  3438. #define RELAY1_PIN 12
  3439. #define RELAY2_PIN 13
  3440. #define RELAY3_PIN 14
  3441. #define RELAY4_PIN 16
  3442. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3443. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3444. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  3445. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  3446. // -----------------------------------------------------------------------------
  3447. #else
  3448. #error "UNSUPPORTED HARDWARE!!"
  3449. #endif