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.

4633 lines
149 KiB

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