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.

4309 lines
138 KiB

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