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.

4110 lines
131 KiB

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