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.

4641 lines
149 KiB

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