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.

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