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.

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