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.

4502 lines
144 KiB

6 years ago
6 years ago
6 years ago
6 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
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. #elif defined(MAGICHOME_ZJ_LB_RGBWW_L)
  1131. // Info
  1132. #define MANUFACTURER "MAGICHOME"
  1133. #define DEVICE "ZJ_LB_RGBWW_L"
  1134. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1135. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1136. #define DUMMY_RELAY_COUNT 1
  1137. // Light
  1138. #define LIGHT_CHANNELS 5
  1139. #define LIGHT_CH1_PIN 5 // RED
  1140. #define LIGHT_CH2_PIN 4 // GREEN
  1141. #define LIGHT_CH3_PIN 14 // BLUE
  1142. #define LIGHT_CH4_PIN 12 // COLD WHITE
  1143. #define LIGHT_CH5_PIN 13 // WARM WHITE
  1144. #define LIGHT_CH1_INVERSE 0
  1145. #define LIGHT_CH2_INVERSE 0
  1146. #define LIGHT_CH3_INVERSE 0
  1147. #define LIGHT_CH4_INVERSE 0
  1148. #define LIGHT_CH5_INVERSE 0
  1149. // -----------------------------------------------------------------------------
  1150. // HUACANXING H801 & H802
  1151. // -----------------------------------------------------------------------------
  1152. #elif defined(HUACANXING_H801)
  1153. // Info
  1154. #define MANUFACTURER "HUACANXING"
  1155. #define DEVICE "H801"
  1156. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1157. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1158. #define DUMMY_RELAY_COUNT 1
  1159. #define DEBUG_PORT Serial1
  1160. #define SERIAL_RX_ENABLED 1
  1161. // LEDs
  1162. #define LED1_PIN 5
  1163. #define LED1_PIN_INVERSE 1
  1164. // Light
  1165. #define LIGHT_CHANNELS 5
  1166. #define LIGHT_CH1_PIN 15 // RED
  1167. #define LIGHT_CH2_PIN 13 // GREEN
  1168. #define LIGHT_CH3_PIN 12 // BLUE
  1169. #define LIGHT_CH4_PIN 14 // WHITE1
  1170. #define LIGHT_CH5_PIN 4 // WHITE2
  1171. #define LIGHT_CH1_INVERSE 0
  1172. #define LIGHT_CH2_INVERSE 0
  1173. #define LIGHT_CH3_INVERSE 0
  1174. #define LIGHT_CH4_INVERSE 0
  1175. #define LIGHT_CH5_INVERSE 0
  1176. #elif defined(HUACANXING_H802)
  1177. // Info
  1178. #define MANUFACTURER "HUACANXING"
  1179. #define DEVICE "H802"
  1180. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1181. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1182. #define DUMMY_RELAY_COUNT 1
  1183. #define DEBUG_PORT Serial1
  1184. #define SERIAL_RX_ENABLED 1
  1185. // Light
  1186. #define LIGHT_CHANNELS 4
  1187. #define LIGHT_CH1_PIN 12 // RED
  1188. #define LIGHT_CH2_PIN 14 // GREEN
  1189. #define LIGHT_CH3_PIN 13 // BLUE
  1190. #define LIGHT_CH4_PIN 15 // WHITE
  1191. #define LIGHT_CH1_INVERSE 0
  1192. #define LIGHT_CH2_INVERSE 0
  1193. #define LIGHT_CH3_INVERSE 0
  1194. #define LIGHT_CH4_INVERSE 0
  1195. // -----------------------------------------------------------------------------
  1196. // Jan Goedeke Wifi Relay
  1197. // https://github.com/JanGoe/esp8266-wifi-relay
  1198. // -----------------------------------------------------------------------------
  1199. #elif defined(JANGOE_WIFI_RELAY_NC)
  1200. // Info
  1201. #define MANUFACTURER "JANGOE"
  1202. #define DEVICE "WIFI_RELAY_NC"
  1203. // Buttons
  1204. #define BUTTON1_PIN 12
  1205. #define BUTTON2_PIN 13
  1206. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1207. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1208. #define BUTTON1_RELAY 1
  1209. #define BUTTON2_RELAY 2
  1210. // Relays
  1211. #define RELAY1_PIN 2
  1212. #define RELAY2_PIN 14
  1213. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1214. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1215. #elif defined(JANGOE_WIFI_RELAY_NO)
  1216. // Info
  1217. #define MANUFACTURER "JANGOE"
  1218. #define DEVICE "WIFI_RELAY_NO"
  1219. // Buttons
  1220. #define BUTTON1_PIN 12
  1221. #define BUTTON2_PIN 13
  1222. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1223. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1224. #define BUTTON1_RELAY 1
  1225. #define BUTTON2_RELAY 2
  1226. // Relays
  1227. #define RELAY1_PIN 2
  1228. #define RELAY2_PIN 14
  1229. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1230. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1231. // -----------------------------------------------------------------------------
  1232. // Jorge García Wifi+Relays Board Kit
  1233. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  1234. // https://github.com/jorgegarciadev/wifikit
  1235. // -----------------------------------------------------------------------------
  1236. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  1237. // Info
  1238. #define MANUFACTURER "JORGEGARCIA"
  1239. #define DEVICE "WIFI_RELAYS"
  1240. // Relays
  1241. #define RELAY1_PIN 0
  1242. #define RELAY2_PIN 2
  1243. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1244. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1245. // -----------------------------------------------------------------------------
  1246. // WiFi MQTT Relay / Thermostat
  1247. // -----------------------------------------------------------------------------
  1248. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  1249. // Info
  1250. #define MANUFACTURER "OPENENERGYMONITOR"
  1251. #define DEVICE "MQTT_RELAY"
  1252. // Buttons
  1253. #define BUTTON1_PIN 0
  1254. #define BUTTON1_RELAY 1
  1255. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1256. // Relays
  1257. #define RELAY1_PIN 12
  1258. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1259. // LEDs
  1260. #define LED1_PIN 16
  1261. #define LED1_PIN_INVERSE 0
  1262. // -----------------------------------------------------------------------------
  1263. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  1264. // 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
  1265. // 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
  1266. // -----------------------------------------------------------------------------
  1267. #elif defined(WION_50055)
  1268. // Currently untested, does not support energy monitoring
  1269. // Info
  1270. #define MANUFACTURER "WION"
  1271. #define DEVICE "50055"
  1272. // Buttons
  1273. #define BUTTON1_PIN 13
  1274. #define BUTTON1_RELAY 1
  1275. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1276. // Relays
  1277. #define RELAY1_PIN 15
  1278. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1279. // LEDs
  1280. #define LED1_PIN 2
  1281. #define LED1_PIN_INVERSE 0
  1282. // -----------------------------------------------------------------------------
  1283. // EX-Store Wifi Relay v3.1
  1284. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  1285. // -----------------------------------------------------------------------------
  1286. #elif defined(EXS_WIFI_RELAY_V31)
  1287. // Untested
  1288. // Info
  1289. #define MANUFACTURER "EXS"
  1290. #define DEVICE "WIFI_RELAY_V31"
  1291. // Buttons
  1292. #define BUTTON1_PIN 0
  1293. #define BUTTON1_RELAY 1
  1294. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1295. // Relays
  1296. #define RELAY1_PIN 13
  1297. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1298. #define RELAY1_RESET_PIN 12
  1299. // -----------------------------------------------------------------------------
  1300. // EX-Store Wifi Relay v5.0
  1301. // -----------------------------------------------------------------------------
  1302. #elif defined(EXS_WIFI_RELAY_V50)
  1303. // Info
  1304. #define MANUFACTURER "EXS"
  1305. #define DEVICE "WIFI_RELAY_V50"
  1306. // Buttons
  1307. #define BUTTON1_PIN 5
  1308. #define BUTTON2_PIN 4
  1309. #define BUTTON1_RELAY 1
  1310. #define BUTTON2_RELAY 2
  1311. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1312. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1313. // Relays
  1314. #define RELAY1_PIN 14
  1315. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1316. #define RELAY1_RESET_PIN 16
  1317. #define RELAY2_PIN 13
  1318. #define RELAY2_TYPE RELAY_TYPE_LATCHED
  1319. #define RELAY2_RESET_PIN 12
  1320. // LEDs
  1321. #define LED1_PIN 15
  1322. #define LED1_PIN_INVERSE 0
  1323. // -----------------------------------------------------------------------------
  1324. // V9261F
  1325. // -----------------------------------------------------------------------------
  1326. #elif defined(GENERIC_V9261F)
  1327. // Info
  1328. #define MANUFACTURER "GENERIC"
  1329. #define DEVICE "V9261F"
  1330. #define ALEXA_SUPPORT 0
  1331. // V9261F
  1332. #define V9261F_SUPPORT 1
  1333. #define V9261F_PIN 2
  1334. #define V9261F_PIN_INVERSE 1
  1335. // -----------------------------------------------------------------------------
  1336. // ECH1560
  1337. // -----------------------------------------------------------------------------
  1338. #elif defined(GENERIC_ECH1560)
  1339. // Info
  1340. #define MANUFACTURER "GENERIC"
  1341. #define DEVICE "ECH1560"
  1342. #define ALEXA_SUPPORT 0
  1343. // ECH1560
  1344. #define ECH1560_SUPPORT 1
  1345. #define ECH1560_CLK_PIN 4
  1346. #define ECH1560_MISO_PIN 5
  1347. #define ECH1560_INVERTED 0
  1348. // -----------------------------------------------------------------------------
  1349. // ESPLive
  1350. // https://github.com/ManCaveMade/ESP-Live
  1351. // -----------------------------------------------------------------------------
  1352. #elif defined(MANCAVEMADE_ESPLIVE)
  1353. // Info
  1354. #define MANUFACTURER "MANCAVEMADE"
  1355. #define DEVICE "ESPLIVE"
  1356. // Buttons
  1357. #define BUTTON1_PIN 4
  1358. #define BUTTON2_PIN 5
  1359. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1360. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1361. #define BUTTON1_RELAY 1
  1362. #define BUTTON2_RELAY 2
  1363. // Relays
  1364. #define RELAY1_PIN 12
  1365. #define RELAY2_PIN 13
  1366. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1367. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1368. // DS18B20
  1369. #ifndef DALLAS_SUPPORT
  1370. #define DALLAS_SUPPORT 1
  1371. #endif
  1372. #define DALLAS_PIN 2
  1373. #define DALLAS_UPDATE_INTERVAL 5000
  1374. #define TEMPERATURE_MIN_CHANGE 1.0
  1375. // -----------------------------------------------------------------------------
  1376. // QuinLED
  1377. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  1378. // -----------------------------------------------------------------------------
  1379. #elif defined(INTERMITTECH_QUINLED)
  1380. // Info
  1381. #define MANUFACTURER "INTERMITTECH"
  1382. #define DEVICE "QUINLED"
  1383. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1384. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1385. #define DUMMY_RELAY_COUNT 1
  1386. // LEDs
  1387. #define LED1_PIN 5
  1388. #define LED1_PIN_INVERSE 1
  1389. // Light
  1390. #define LIGHT_CHANNELS 2
  1391. #define LIGHT_CH1_PIN 0
  1392. #define LIGHT_CH2_PIN 2
  1393. #define LIGHT_CH1_INVERSE 0
  1394. #define LIGHT_CH2_INVERSE 0
  1395. // -----------------------------------------------------------------------------
  1396. // Arilux AL-LC06
  1397. // -----------------------------------------------------------------------------
  1398. #elif defined(ARILUX_AL_LC01)
  1399. // Info
  1400. #define MANUFACTURER "ARILUX"
  1401. #define DEVICE "AL_LC01"
  1402. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1403. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1404. #define DUMMY_RELAY_COUNT 1
  1405. // Light
  1406. #define LIGHT_CHANNELS 3
  1407. #define LIGHT_CH1_PIN 5 // RED
  1408. #define LIGHT_CH2_PIN 12 // GREEN
  1409. #define LIGHT_CH3_PIN 13 // BLUE
  1410. #define LIGHT_CH1_INVERSE 0
  1411. #define LIGHT_CH2_INVERSE 0
  1412. #define LIGHT_CH3_INVERSE 0
  1413. #elif defined(ARILUX_AL_LC02)
  1414. // Info
  1415. #define MANUFACTURER "ARILUX"
  1416. #define DEVICE "AL_LC02"
  1417. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1418. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1419. #define DUMMY_RELAY_COUNT 1
  1420. // Light
  1421. #define LIGHT_CHANNELS 4
  1422. #define LIGHT_CH1_PIN 12 // RED
  1423. #define LIGHT_CH2_PIN 5 // GREEN
  1424. #define LIGHT_CH3_PIN 13 // BLUE
  1425. #define LIGHT_CH4_PIN 15 // WHITE1
  1426. #define LIGHT_CH1_INVERSE 0
  1427. #define LIGHT_CH2_INVERSE 0
  1428. #define LIGHT_CH3_INVERSE 0
  1429. #define LIGHT_CH4_INVERSE 0
  1430. #elif defined(ARILUX_AL_LC02_V14)
  1431. // Info
  1432. #define MANUFACTURER "ARILUX"
  1433. #define DEVICE "AL_LC02_V14"
  1434. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1435. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1436. #define DUMMY_RELAY_COUNT 1
  1437. // Light
  1438. #define LIGHT_CHANNELS 4
  1439. #define LIGHT_CH1_PIN 14 // RED
  1440. #define LIGHT_CH2_PIN 5 // GREEN
  1441. #define LIGHT_CH3_PIN 12 // BLUE
  1442. #define LIGHT_CH4_PIN 13 // WHITE1
  1443. #define LIGHT_CH1_INVERSE 0
  1444. #define LIGHT_CH2_INVERSE 0
  1445. #define LIGHT_CH3_INVERSE 0
  1446. #define LIGHT_CH4_INVERSE 0
  1447. #elif defined(ARILUX_AL_LC06)
  1448. // Info
  1449. #define MANUFACTURER "ARILUX"
  1450. #define DEVICE "AL_LC06"
  1451. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1452. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1453. #define DUMMY_RELAY_COUNT 1
  1454. // Buttons
  1455. #define BUTTON1_PIN 0
  1456. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1457. #define BUTTON1_RELAY 1
  1458. // Light
  1459. #define LIGHT_CHANNELS 5
  1460. #define LIGHT_CH1_PIN 14 // RED
  1461. #define LIGHT_CH2_PIN 12 // GREEN
  1462. #define LIGHT_CH3_PIN 13 // BLUE
  1463. #define LIGHT_CH4_PIN 15 // WHITE1
  1464. #define LIGHT_CH5_PIN 5 // WHITE2
  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_AL_LC11)
  1471. // Info
  1472. #define MANUFACTURER "ARILUX"
  1473. #define DEVICE "AL_LC11"
  1474. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1475. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1476. #define DUMMY_RELAY_COUNT 1
  1477. // Light
  1478. #define LIGHT_CHANNELS 5
  1479. #define LIGHT_CH1_PIN 5 // RED
  1480. #define LIGHT_CH2_PIN 4 // GREEN
  1481. #define LIGHT_CH3_PIN 14 // BLUE
  1482. #define LIGHT_CH4_PIN 13 // WHITE1
  1483. #define LIGHT_CH5_PIN 12 // WHITE1
  1484. #define LIGHT_CH1_INVERSE 0
  1485. #define LIGHT_CH2_INVERSE 0
  1486. #define LIGHT_CH3_INVERSE 0
  1487. #define LIGHT_CH4_INVERSE 0
  1488. #define LIGHT_CH5_INVERSE 0
  1489. #elif defined(ARILUX_E27)
  1490. // Info
  1491. #define MANUFACTURER "ARILUX"
  1492. #define DEVICE "E27"
  1493. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1494. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1495. #define DUMMY_RELAY_COUNT 1
  1496. // Light
  1497. #define LIGHT_CHANNELS 4
  1498. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  1499. #define MY92XX_CHIPS 1
  1500. #define MY92XX_DI_PIN 13
  1501. #define MY92XX_DCKI_PIN 15
  1502. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1503. #define MY92XX_MAPPING 0, 1, 2, 3
  1504. // -----------------------------------------------------------------------------
  1505. // XENON SM-PW701U
  1506. // -----------------------------------------------------------------------------
  1507. #elif defined(XENON_SM_PW702U)
  1508. // Info
  1509. #define MANUFACTURER "XENON"
  1510. #define DEVICE "SM_PW702U"
  1511. // Buttons
  1512. #define BUTTON1_PIN 13
  1513. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1514. #define BUTTON1_RELAY 1
  1515. // Relays
  1516. #define RELAY1_PIN 12
  1517. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1518. // LEDs
  1519. #define LED1_PIN 4
  1520. #define LED1_PIN_INVERSE 1
  1521. // -----------------------------------------------------------------------------
  1522. // ISELECTOR SM-PW702
  1523. // -----------------------------------------------------------------------------
  1524. #elif defined(ISELECTOR_SM_PW702)
  1525. // Info
  1526. #define MANUFACTURER "ISELECTOR"
  1527. #define DEVICE "SM_PW702"
  1528. // Buttons
  1529. #define BUTTON1_PIN 13
  1530. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1531. #define BUTTON1_RELAY 1
  1532. // Relays
  1533. #define RELAY1_PIN 12
  1534. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1535. // LEDs
  1536. #define LED1_PIN 4 //BLUE
  1537. #define LED1_PIN_INVERSE 0
  1538. #define LED2_PIN 5 //RED
  1539. #define LED2_PIN_INVERSE 1
  1540. // -----------------------------------------------------------------------------
  1541. // AUTHOMETION LYT8266
  1542. // https://authometion.com/shop/en/home/13-lyt8266.html
  1543. // -----------------------------------------------------------------------------
  1544. #elif defined(AUTHOMETION_LYT8266)
  1545. // Info
  1546. #define MANUFACTURER "AUTHOMETION"
  1547. #define DEVICE "LYT8266"
  1548. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1549. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1550. #define DUMMY_RELAY_COUNT 1
  1551. // Light
  1552. #define LIGHT_CHANNELS 4
  1553. #define LIGHT_CH1_PIN 13 // RED
  1554. #define LIGHT_CH2_PIN 12 // GREEN
  1555. #define LIGHT_CH3_PIN 14 // BLUE
  1556. #define LIGHT_CH4_PIN 2 // WHITE
  1557. #define LIGHT_CH1_INVERSE 0
  1558. #define LIGHT_CH2_INVERSE 0
  1559. #define LIGHT_CH3_INVERSE 0
  1560. #define LIGHT_CH4_INVERSE 0
  1561. #define LIGHT_ENABLE_PIN 15
  1562. #elif defined(GIZWITS_WITTY_CLOUD)
  1563. // Info
  1564. #define MANUFACTURER "GIZWITS"
  1565. #define DEVICE "WITTY_CLOUD"
  1566. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1567. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1568. #define DUMMY_RELAY_COUNT 1
  1569. // Buttons
  1570. #define BUTTON1_PIN 4
  1571. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1572. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  1573. #define BUTTON1_CLICK BUTTON_MODE_NONE
  1574. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1575. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1576. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  1577. #define ANALOG_SUPPORT 1
  1578. // LEDs
  1579. #define LED1_PIN 2 // BLUE build-in
  1580. #define LED1_PIN_INVERSE 1
  1581. // Light
  1582. #define LIGHT_CHANNELS 3
  1583. #define LIGHT_CH1_PIN 15 // RED
  1584. #define LIGHT_CH2_PIN 12 // GREEN
  1585. #define LIGHT_CH3_PIN 13 // BLUE
  1586. #define LIGHT_CH1_INVERSE 0
  1587. #define LIGHT_CH2_INVERSE 0
  1588. #define LIGHT_CH3_INVERSE 0
  1589. // -----------------------------------------------------------------------------
  1590. // KMC 70011
  1591. // https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
  1592. // -----------------------------------------------------------------------------
  1593. #elif defined(KMC_70011)
  1594. // Info
  1595. #define MANUFACTURER "KMC"
  1596. #define DEVICE "70011"
  1597. // Buttons
  1598. #define BUTTON1_PIN 0
  1599. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1600. #define BUTTON1_RELAY 1
  1601. // Relays
  1602. #define RELAY1_PIN 14
  1603. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1604. // LEDs
  1605. #define LED1_PIN 13
  1606. #define LED1_PIN_INVERSE 1
  1607. // HLW8012
  1608. #ifndef HLW8012_SUPPORT
  1609. #define HLW8012_SUPPORT 1
  1610. #endif
  1611. #define HLW8012_SEL_PIN 12
  1612. #define HLW8012_CF1_PIN 5
  1613. #define HLW8012_CF_PIN 4
  1614. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1615. // -----------------------------------------------------------------------------
  1616. // Euromate (?) Wifi Stecker Schuko
  1617. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  1618. // Thanks to @Geitde
  1619. // -----------------------------------------------------------------------------
  1620. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  1621. // Info
  1622. #define MANUFACTURER "EUROMATE"
  1623. #define DEVICE "WIFI_STECKER_SCHUKO"
  1624. // Buttons
  1625. #define BUTTON1_PIN 14
  1626. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1627. #define BUTTON1_RELAY 1
  1628. // The relay in the device is not a bistable (latched) relay.
  1629. // The device is reported to have a flip-flop circuit to drive the relay
  1630. // So @Geitde hack is still the only possible
  1631. // Hack: drive GPIO12 low and use GPIO5 as normal relay pin:
  1632. #define RELAY1_PIN 5
  1633. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1634. #define LED2_PIN 12 /* DUMMY: exploit default off state for GPIO12=low */
  1635. #define LED2_PIN_INVERSE 0
  1636. // LEDs
  1637. #define LED1_PIN 4
  1638. #define LED1_PIN_INVERSE 0
  1639. // -----------------------------------------------------------------------------
  1640. // Euromate (?) Wifi Stecker Schuko Version 2
  1641. // This configuration is for the second generation of devices sold by OBI.
  1642. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko-weiss/p/4077806
  1643. // -----------------------------------------------------------------------------
  1644. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO_V2)
  1645. // Info
  1646. #define MANUFACTURER "EUROMATE"
  1647. #define DEVICE "WIFI_STECKER_SCHUKO_V2"
  1648. // Buttons
  1649. #define BUTTON1_PIN 5
  1650. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1651. #define BUTTON1_RELAY 1
  1652. // Relays
  1653. #define RELAY1_PIN 4
  1654. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1655. // Green
  1656. #define LED1_PIN 12
  1657. #define LED1_MODE LED_MODE_WIFI
  1658. #define LED1_PIN_INVERSE 0
  1659. // Red
  1660. #define LED2_PIN 13
  1661. #define LED2_MODE LED_MODE_RELAY
  1662. #define LED2_PIN_INVERSE 0
  1663. // -----------------------------------------------------------------------------
  1664. // Generic 8CH
  1665. // -----------------------------------------------------------------------------
  1666. #elif defined(GENERIC_8CH)
  1667. // Info
  1668. #define MANUFACTURER "GENERIC"
  1669. #define DEVICE "8CH"
  1670. // Relays
  1671. #define RELAY1_PIN 0
  1672. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1673. #define RELAY2_PIN 2
  1674. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1675. #define RELAY3_PIN 4
  1676. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1677. #define RELAY4_PIN 5
  1678. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1679. #define RELAY5_PIN 12
  1680. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1681. #define RELAY6_PIN 13
  1682. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  1683. #define RELAY7_PIN 14
  1684. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  1685. #define RELAY8_PIN 15
  1686. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  1687. // -----------------------------------------------------------------------------
  1688. // STM RELAY
  1689. // -----------------------------------------------------------------------------
  1690. #elif defined(STM_RELAY)
  1691. // Info
  1692. #define MANUFACTURER "STM_RELAY"
  1693. #define DEVICE "2CH"
  1694. // Relays
  1695. #define DUMMY_RELAY_COUNT 2
  1696. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  1697. // Remove UART noise on serial line
  1698. #define DEBUG_SERIAL_SUPPORT 0
  1699. // -----------------------------------------------------------------------------
  1700. // Tonbux Powerstrip02
  1701. // -----------------------------------------------------------------------------
  1702. #elif defined(TONBUX_POWERSTRIP02)
  1703. // Info
  1704. #define MANUFACTURER "TONBUX"
  1705. #define DEVICE "POWERSTRIP02"
  1706. // Buttons
  1707. #define BUTTON1_PIN 5
  1708. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1709. #define BUTTON1_RELAY 0
  1710. // Relays
  1711. #define RELAY1_PIN 4
  1712. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1713. #define RELAY2_PIN 13
  1714. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1715. #define RELAY3_PIN 12
  1716. #define RELAY3_TYPE RELAY_TYPE_INVERSE
  1717. #define RELAY4_PIN 14
  1718. #define RELAY4_TYPE RELAY_TYPE_INVERSE
  1719. // Not a relay. USB ports on/off
  1720. #define RELAY5_PIN 16
  1721. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1722. // LEDs
  1723. #define LED1_PIN 0 // 1 blue led
  1724. #define LED1_PIN_INVERSE 1
  1725. #define LED2_PIN 3 // 3 red leds
  1726. #define LED2_PIN_INVERSE 1
  1727. // -----------------------------------------------------------------------------
  1728. // Lingan SWA1
  1729. // -----------------------------------------------------------------------------
  1730. #elif defined(LINGAN_SWA1)
  1731. // Info
  1732. #define MANUFACTURER "LINGAN"
  1733. #define DEVICE "SWA1"
  1734. // Buttons
  1735. #define BUTTON1_PIN 13
  1736. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1737. #define BUTTON1_RELAY 1
  1738. // Relays
  1739. #define RELAY1_PIN 5
  1740. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1741. // LEDs
  1742. #define LED1_PIN 4
  1743. #define LED1_PIN_INVERSE 1
  1744. // -----------------------------------------------------------------------------
  1745. // HEYGO HY02
  1746. // -----------------------------------------------------------------------------
  1747. #elif defined(HEYGO_HY02)
  1748. // Info
  1749. #define MANUFACTURER "HEYGO"
  1750. #define DEVICE "HY02"
  1751. // Buttons
  1752. #define BUTTON1_PIN 13
  1753. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1754. #define BUTTON1_RELAY 1
  1755. // Relays
  1756. #define RELAY1_PIN 12
  1757. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1758. // LEDs
  1759. #define LED1_PIN 4
  1760. #define LED1_PIN_INVERSE 0
  1761. // -----------------------------------------------------------------------------
  1762. // Maxcio W-US002S
  1763. // -----------------------------------------------------------------------------
  1764. #elif defined(MAXCIO_WUS002S)
  1765. // Info
  1766. #define MANUFACTURER "MAXCIO"
  1767. #define DEVICE "WUS002S"
  1768. // Buttons
  1769. #define BUTTON1_PIN 2
  1770. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1771. #define BUTTON1_RELAY 1
  1772. // Relays
  1773. #define RELAY1_PIN 13
  1774. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1775. // LEDs
  1776. #define LED1_PIN 3
  1777. #define LED1_PIN_INVERSE 0
  1778. // HLW8012
  1779. #ifndef HLW8012_SUPPORT
  1780. #define HLW8012_SUPPORT 1
  1781. #endif
  1782. #define HLW8012_SEL_PIN 12
  1783. #define HLW8012_CF1_PIN 5
  1784. #define HLW8012_CF_PIN 4
  1785. #define HLW8012_CURRENT_R 0.002 // Current resistor
  1786. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1787. // LED1 on RX pin
  1788. #define DEBUG_SERIAL_SUPPORT 1
  1789. // -----------------------------------------------------------------------------
  1790. // Maxcio W-DE004
  1791. // -----------------------------------------------------------------------------
  1792. #elif defined(MAXCIO_WDE004)
  1793. // Info
  1794. #define MANUFACTURER "MAXCIO"
  1795. #define DEVICE "WDE004"
  1796. // Buttons
  1797. #define BUTTON1_PIN 1
  1798. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1799. #define BUTTON1_RELAY 1
  1800. // Relays
  1801. #define RELAY1_PIN 14
  1802. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1803. // LEDs
  1804. #define LED1_PIN 13
  1805. #define LED1_PIN_INVERSE 1
  1806. // -----------------------------------------------------------------------------
  1807. // Oukitel P1 Smart Plug
  1808. // 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
  1809. // -----------------------------------------------------------------------------
  1810. #elif defined(OUKITEL_P1)
  1811. // Info
  1812. #define MANUFACTURER "Oukitel"
  1813. #define DEVICE "P1"
  1814. // Buttons
  1815. #define BUTTON1_PIN 13
  1816. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1817. #define BUTTON1_RELAY 1
  1818. // Relays
  1819. // Right
  1820. #define RELAY1_PIN 12
  1821. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1822. // Left
  1823. #define RELAY2_PIN 15
  1824. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1825. // LEDs
  1826. #define LED1_PIN 0 // blue
  1827. #define LED1_PIN_INVERSE 1
  1828. #define LED1_MODE LED_MODE_WIFI
  1829. // -----------------------------------------------------------------------------
  1830. // YiDian XS-SSA05
  1831. // -----------------------------------------------------------------------------
  1832. #elif defined(YIDIAN_XSSSA05)
  1833. // Info
  1834. #define MANUFACTURER "YIDIAN"
  1835. #define DEVICE "XSSSA05"
  1836. // Buttons
  1837. #define BUTTON1_PIN 13
  1838. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1839. #define BUTTON1_RELAY 1
  1840. // Relays
  1841. #define RELAY1_PIN 12
  1842. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1843. // LEDs
  1844. #define LED1_PIN 0 // red
  1845. #define LED1_PIN_INVERSE 1
  1846. #define LED1_MODE LED_MODE_WIFI
  1847. #define LED2_PIN 15 // blue
  1848. #define LED2_PIN_INVERSE 1
  1849. #define LED2_MODE LED_MODE_RELAY
  1850. // HLW8012
  1851. #ifndef HLW8012_SUPPORT
  1852. #define HLW8012_SUPPORT 1
  1853. #endif
  1854. #define HLW8012_SEL_PIN 3
  1855. #define HLW8012_CF1_PIN 14
  1856. #define HLW8012_CF_PIN 5
  1857. #define HLW8012_SEL_CURRENT LOW
  1858. #define HLW8012_CURRENT_RATIO 25740
  1859. #define HLW8012_VOLTAGE_RATIO 313400
  1860. #define HLW8012_POWER_RATIO 3414290
  1861. #define HLW8012_INTERRUPT_ON FALLING
  1862. // -----------------------------------------------------------------------------
  1863. // TONBUX XS-SSA01
  1864. // -----------------------------------------------------------------------------
  1865. #elif defined(TONBUX_XSSSA01)
  1866. // Info
  1867. #define MANUFACTURER "TONBUX"
  1868. #define DEVICE "XSSSA01"
  1869. // Buttons
  1870. #define BUTTON1_PIN 4
  1871. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1872. #define BUTTON1_RELAY 1
  1873. // Relays
  1874. #define RELAY1_PIN 14
  1875. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1876. // LEDs
  1877. #define LED1_PIN 13
  1878. #define LED1_PIN_INVERSE 0
  1879. // -----------------------------------------------------------------------------
  1880. // TONBUX XS-SSA06
  1881. // -----------------------------------------------------------------------------
  1882. #elif defined(TONBUX_XSSSA06)
  1883. // Info
  1884. #define MANUFACTURER "TONBUX"
  1885. #define DEVICE "XSSSA06"
  1886. // Buttons
  1887. #define BUTTON1_PIN 13
  1888. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1889. #define BUTTON1_RELAY 1
  1890. // Relays
  1891. #define RELAY1_PIN 15
  1892. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1893. // LEDs
  1894. #define LED1_PIN 0 // R - 8 rgb led ring
  1895. #define LED1_PIN_INVERSE 0
  1896. #define LED2_PIN 5 // G
  1897. #define LED2_PIN_INVERSE 0
  1898. #define LED3_PIN 2 // B
  1899. #define LED3_PIN_INVERSE 0
  1900. // -----------------------------------------------------------------------------
  1901. // GREEN ESP8266 RELAY MODULE
  1902. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1903. // -----------------------------------------------------------------------------
  1904. #elif defined(GREEN_ESP8266RELAY)
  1905. // Info
  1906. #define MANUFACTURER "GREEN"
  1907. #define DEVICE "ESP8266RELAY"
  1908. // Buttons
  1909. // Not a button but input via Optocoupler
  1910. #define BUTTON1_PIN 5
  1911. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1912. #define BUTTON1_RELAY 1
  1913. // Relays
  1914. #define RELAY1_PIN 4
  1915. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1916. // LEDs
  1917. #define LED1_PIN 2
  1918. #define LED1_PIN_INVERSE 1
  1919. // -----------------------------------------------------------------------------
  1920. // Henrique Gravina ESPIKE
  1921. // https://github.com/Henriquegravina/Espike
  1922. // -----------------------------------------------------------------------------
  1923. #elif defined(IKE_ESPIKE)
  1924. #define MANUFACTURER "IKE"
  1925. #define DEVICE "ESPIKE"
  1926. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1927. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1928. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1929. #define BUTTON1_PIN 13
  1930. #define BUTTON1_RELAY 1
  1931. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1932. #define BUTTON2_PIN 12
  1933. #define BUTTON2_RELAY 2
  1934. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1935. #define BUTTON3_PIN 14
  1936. #define BUTTON3_RELAY 3
  1937. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1938. #define RELAY1_PIN 4
  1939. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1940. #define RELAY2_PIN 5
  1941. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1942. #define RELAY3_PIN 16
  1943. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1944. #define LED1_PIN 2
  1945. #define LED1_PIN_INVERSE 1
  1946. // -----------------------------------------------------------------------------
  1947. // SWIFITCH
  1948. // https://github.com/ArnieX/swifitch
  1949. // -----------------------------------------------------------------------------
  1950. #elif defined(ARNIEX_SWIFITCH)
  1951. // Info
  1952. #define MANUFACTURER "ARNIEX"
  1953. #define DEVICE "SWIFITCH"
  1954. // Buttons
  1955. #define BUTTON1_PIN 4 // D2
  1956. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1957. #define BUTTON1_RELAY 1
  1958. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1959. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1960. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1961. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1962. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1963. // Relays
  1964. #define RELAY1_PIN 5 // D1
  1965. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1966. // LEDs
  1967. #define LED1_PIN 12 // D6
  1968. #define LED1_PIN_INVERSE 1
  1969. // -----------------------------------------------------------------------------
  1970. // ESP-01S RELAY v4.0
  1971. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  1972. // -----------------------------------------------------------------------------
  1973. #elif defined(GENERIC_ESP01S_RELAY_V40)
  1974. // Info
  1975. #define MANUFACTURER "GENERIC"
  1976. #define DEVICE "ESP01S_RELAY_40"
  1977. // Relays
  1978. #define RELAY1_PIN 0
  1979. #ifndef RELAY1_TYPE
  1980. #define RELAY1_TYPE RELAY_TYPE_NORMAL // See #1504 and #1554
  1981. #endif
  1982. // LEDs
  1983. #define LED1_PIN 2
  1984. #define LED1_PIN_INVERSE 0
  1985. // -----------------------------------------------------------------------------
  1986. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  1987. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  1988. // -----------------------------------------------------------------------------
  1989. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  1990. // Info
  1991. #define MANUFACTURER "GENERIC"
  1992. #define DEVICE "ESP01S_RGBLED_10"
  1993. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  1994. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  1995. // Buttons
  1996. //#define BUTTON1_PIN 2
  1997. // Relays
  1998. //#define RELAY1_PIN 2
  1999. // LEDs
  2000. #define LED1_PIN 2
  2001. #define LED1_PIN_INVERSE 0
  2002. // -----------------------------------------------------------------------------
  2003. // ESP-01S DHT11 v1.0
  2004. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  2005. // -----------------------------------------------------------------------------
  2006. #elif defined(GENERIC_ESP01S_DHT11_V10)
  2007. // Info
  2008. #define MANUFACTURER "GENERIC"
  2009. #define DEVICE "ESP01S_DHT11_10"
  2010. // DHT11
  2011. #ifndef DHT_SUPPORT
  2012. #define DHT_SUPPORT 1
  2013. #endif
  2014. #define DHT_PIN 2
  2015. #define DHT_TYPE DHT_CHIP_DHT11
  2016. // -----------------------------------------------------------------------------
  2017. // ESP-01S DS18B20 v1.0
  2018. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  2019. // -----------------------------------------------------------------------------
  2020. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  2021. // Info
  2022. #define MANUFACTURER "GENERIC"
  2023. #define DEVICE "ESP01S_DS18B20_10"
  2024. // DB18B20
  2025. #ifndef DALLAS_SUPPORT
  2026. #define DALLAS_SUPPORT 1
  2027. #endif
  2028. #define DALLAS_PIN 2
  2029. // -----------------------------------------------------------------------------
  2030. // ESP-DIN relay board V1
  2031. // https://github.com/pilotak/esp_din
  2032. // -----------------------------------------------------------------------------
  2033. #elif defined(PILOTAK_ESP_DIN_V1)
  2034. // Info
  2035. #define MANUFACTURER "PILOTAK"
  2036. #define DEVICE "ESP_DIN_V1"
  2037. // Buttons
  2038. #define BUTTON1_PIN 0
  2039. #define BUTTON1_RELAY 1
  2040. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2041. // Relays
  2042. #define RELAY1_PIN 4
  2043. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2044. #define RELAY2_PIN 5
  2045. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2046. // LEDs
  2047. #define LED1_PIN 15
  2048. #define LED1_PIN_INVERSE 0
  2049. #define I2C_SDA_PIN 12
  2050. #define I2C_SCL_PIN 13
  2051. #ifndef DALLAS_SUPPORT
  2052. #define DALLAS_SUPPORT 1
  2053. #endif
  2054. #define DALLAS_PIN 2
  2055. #define RF_SUPPORT 1
  2056. #define RFB_DIRECT 1
  2057. #define RFB_RX_PIN 14
  2058. #ifndef DIGITAL_SUPPORT
  2059. #define DIGITAL_SUPPORT 1
  2060. #endif
  2061. #define DIGITAL1_PIN 16
  2062. #define DIGITAL1_PIN_MODE INPUT
  2063. #define DIGITAL1_DEFAULT_STATE 0
  2064. // -----------------------------------------------------------------------------
  2065. // Heltec Touch Relay
  2066. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  2067. // -----------------------------------------------------------------------------
  2068. #elif defined(HELTEC_TOUCHRELAY)
  2069. // Info
  2070. #define MANUFACTURER "HELTEC"
  2071. #define DEVICE "TOUCH_RELAY"
  2072. // Buttons
  2073. #define BUTTON1_PIN 14
  2074. #define BUTTON1_RELAY 1
  2075. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  2076. // Relays
  2077. #define RELAY1_PIN 12
  2078. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2079. // -----------------------------------------------------------------------------
  2080. // Zhilde ZLD-EU44-W
  2081. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  2082. // -----------------------------------------------------------------------------
  2083. #elif defined(ZHILDE_EU44_W)
  2084. // Info
  2085. #define MANUFACTURER "ZHILDE"
  2086. #define DEVICE "EU44_W"
  2087. // Based on the reporter, this product uses GPIO1 and 3 for the button
  2088. // and onboard LED, so hardware serial should be disabled...
  2089. #define DEBUG_SERIAL_SUPPORT 0
  2090. // Buttons
  2091. #define BUTTON1_PIN 3
  2092. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2093. // Relays
  2094. #define RELAY1_PIN 5
  2095. #define RELAY2_PIN 4
  2096. #define RELAY3_PIN 12
  2097. #define RELAY4_PIN 13
  2098. #define RELAY5_PIN 14
  2099. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2100. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2101. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2102. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2103. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  2104. // LEDs
  2105. #define LED1_PIN 1
  2106. #define LED1_PIN_INVERSE 1
  2107. // -----------------------------------------------------------------------------
  2108. // Allnet 4duino ESP8266-UP-Relais
  2109. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  2110. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  2111. // -----------------------------------------------------------------------------
  2112. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  2113. // Info
  2114. #define MANUFACTURER "ALLNET"
  2115. #define DEVICE "4DUINO_IOT_WLAN_RELAIS"
  2116. // Relays
  2117. #define RELAY1_PIN 14
  2118. #define RELAY1_RESET_PIN 12
  2119. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  2120. // LEDs
  2121. #define LED1_PIN 0
  2122. #define LED1_PIN_INVERSE 1
  2123. // Buttons
  2124. //#define BUTTON1_PIN 0
  2125. //#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2126. // Using pins labelled as SDA & SCL as buttons
  2127. #define BUTTON2_PIN 4
  2128. #define BUTTON2_MODE BUTTON_PUSHBUTTON
  2129. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  2130. #define BUTTON2_CLICK BUTTON_MODE_NONE
  2131. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  2132. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  2133. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  2134. #define BUTTON3_PIN 5
  2135. #define BUTTON3_MODE BUTTON_PUSHBUTTON
  2136. // Using pins labelled as SDA & SCL for I2C
  2137. //#define I2C_SDA_PIN 4
  2138. //#define I2C_SCL_PIN 5
  2139. // -----------------------------------------------------------------------------
  2140. // Luani HVIO
  2141. // https://luani.de/projekte/esp8266-hvio/
  2142. // https://luani.de/blog/esp8266-230v-io-modul/
  2143. // -----------------------------------------------------------------------------
  2144. #elif defined(LUANI_HVIO)
  2145. // Info
  2146. #define MANUFACTURER "LUANI"
  2147. #define DEVICE "HVIO"
  2148. // Buttons
  2149. #define BUTTON1_PIN 12
  2150. #define BUTTON1_RELAY 1
  2151. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  2152. #define BUTTON1_PRESS BUTTON_MODE_NONE
  2153. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  2154. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2155. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2156. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  2157. #define BUTTON2_PIN 13
  2158. #define BUTTON2_RELAY 2
  2159. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  2160. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  2161. // Relays
  2162. #define RELAY1_PIN 4
  2163. #define RELAY2_PIN 5
  2164. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2165. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2166. // LEDs
  2167. #define LED1_PIN 15
  2168. #define LED1_PIN_INVERSE 0
  2169. // -----------------------------------------------------------------------------
  2170. // Tonbux 50-100M Smart Mosquito Killer USB
  2171. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  2172. // -----------------------------------------------------------------------------
  2173. #elif defined(TONBUX_MOSQUITO_KILLER)
  2174. // Info
  2175. #define MANUFACTURER "TONBUX"
  2176. #define DEVICE "MOSQUITO_KILLER"
  2177. // Buttons
  2178. #define BUTTON1_PIN 2
  2179. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2180. #define BUTTON1_RELAY 1
  2181. // Relays
  2182. #define RELAY1_PIN 5 // not a relay, fan
  2183. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2184. // LEDs
  2185. #define LED1_PIN 15 // blue led
  2186. #define LED1_PIN_INVERSE 1
  2187. #define LED1_MODE LED_MODE_WIFI
  2188. #define LED2_PIN 14 // red led
  2189. #define LED2_PIN_INVERSE 1
  2190. #define LED2_MODE LED_MODE_RELAY
  2191. #define LED3_PIN 12 // UV leds (1-2-3-4-5-6-7-8)
  2192. #define LED3_PIN_INVERSE 0
  2193. #define LED3_RELAY 1
  2194. #define LED4_PIN 16 // UV leds (9-10-11)
  2195. #define LED4_PIN_INVERSE 0
  2196. #define LED4_RELAY 1
  2197. // -----------------------------------------------------------------------------
  2198. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  2199. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  2200. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  2201. // -----------------------------------------------------------------------------
  2202. #elif defined(NEO_COOLCAM_NAS_WR01W)
  2203. // Info
  2204. #define MANUFACTURER "NEO_COOLCAM"
  2205. #define DEVICE "NAS_WR01W"
  2206. // Buttons
  2207. #define BUTTON1_PIN 13
  2208. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2209. #define BUTTON1_RELAY 1
  2210. // Relays
  2211. #define RELAY1_PIN 12
  2212. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2213. // LEDs
  2214. #define LED1_PIN 4
  2215. #define LED1_PIN_INVERSE 1
  2216. // -----------------------------------------------------------------------------
  2217. // Deltaco SH_P01 Wifi Smart Power Plug
  2218. // -----------------------------------------------------------------------------
  2219. #elif defined(DELTACO_SH_P01)
  2220. // Info
  2221. #define MANUFACTURER "DELTACO"
  2222. #define DEVICE "SH_P01"
  2223. // Buttons
  2224. #define BUTTON1_PIN 13
  2225. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2226. #define BUTTON1_RELAY 1
  2227. // Relays
  2228. #define RELAY1_PIN 12
  2229. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2230. // LEDs
  2231. #define LED1_PIN 5
  2232. #define LED1_PIN_INVERSE 1
  2233. #define LED1_MODE LED_MODE_FINDME
  2234. // ------------------------------------------------------------------------------
  2235. // DELTACO_SH_P03USB Wifi Smart Power Plug
  2236. // -----------------------------------------------------------------------------
  2237. #elif defined(DELTACO_SH_P03USB)
  2238. // Info
  2239. #define MANUFACTURER "DELTACO"
  2240. #define DEVICE "SH_P03USB"
  2241. // Buttons
  2242. #define BUTTON1_PIN 13
  2243. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2244. #define BUTTON1_RELAY 2
  2245. // Relays
  2246. #define RELAY1_PIN 15 // USB power
  2247. #define RELAY2_PIN 12 // power plug 1
  2248. #define RELAY3_PIN 14 // power plug 2
  2249. #define RELAY4_PIN 5 // power plug 3
  2250. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2251. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2252. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2253. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2254. // LEDs
  2255. #define LED1_PIN 0 // power led
  2256. #define LED1_PIN_INVERSE 1
  2257. #define LED1_MODE LED_MODE_FINDME
  2258. // ------------------------------------------------------------------------------
  2259. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  2260. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  2261. // Also: Estink Wifi Power Strip
  2262. // -----------------------------------------------------------------------------
  2263. #elif defined(FORNORM_ZLD_34EU)
  2264. // Info
  2265. #define MANUFACTURER "FORNORM"
  2266. #define DEVICE "ZLD_34EU"
  2267. // Disable UART noise since this board uses GPIO3
  2268. #define DEBUG_SERIAL_SUPPORT 0
  2269. // Buttons
  2270. #define BUTTON1_PIN 16
  2271. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2272. #define BUTTON1_RELAY 4
  2273. // Relays
  2274. #define RELAY1_PIN 14 // USB power
  2275. #define RELAY2_PIN 13 // power plug 1
  2276. #define RELAY3_PIN 4 // power plug 2
  2277. #define RELAY4_PIN 15 // power plug 3
  2278. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2279. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2280. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2281. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2282. // LEDs
  2283. #define LED1_PIN 0 // power led
  2284. #define LED2_PIN 12 // power plug 1
  2285. #define LED3_PIN 3 // power plug 2
  2286. #define LED4_PIN 5 // power plug 3
  2287. #define LED1_PIN_INVERSE 1
  2288. #define LED2_PIN_INVERSE 1
  2289. #define LED3_PIN_INVERSE 1
  2290. #define LED4_PIN_INVERSE 1
  2291. #define LED1_MODE LED_MODE_FINDME
  2292. #define LED2_MODE LED_MODE_FOLLOW
  2293. #define LED3_MODE LED_MODE_FOLLOW
  2294. #define LED4_MODE LED_MODE_FOLLOW
  2295. #define LED2_RELAY 2
  2296. #define LED3_RELAY 3
  2297. #define LED4_RELAY 4
  2298. // -----------------------------------------------------------------------------
  2299. // Bruno Horta's OnOfre
  2300. // https://www.bhonofre.pt/
  2301. // https://github.com/brunohorta82/BH_OnOfre/
  2302. // -----------------------------------------------------------------------------
  2303. #elif defined(BH_ONOFRE)
  2304. // Info
  2305. #define MANUFACTURER "BH"
  2306. #define DEVICE "ONOFRE"
  2307. // Buttons
  2308. #define BUTTON1_PIN 12
  2309. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2310. #define BUTTON1_RELAY 1
  2311. #define BUTTON2_PIN 13
  2312. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2313. #define BUTTON2_RELAY 2
  2314. // Relays
  2315. #define RELAY1_PIN 4
  2316. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2317. #define RELAY2_PIN 5
  2318. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2319. // -----------------------------------------------------------------------------
  2320. // BlitzWolf SHP2 and SHP6
  2321. // Also several boards under different names uing a power chip labelled BL0937 or HJL-01
  2322. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  2323. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  2324. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  2325. // * Gosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  2326. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  2327. // * DIY Tech Smart Home (https://www.amazon.es/gp/product/B07HHKXYS9)
  2328. // -----------------------------------------------------------------------------
  2329. #elif defined(BLITZWOLF_BWSHPX)
  2330. // Info
  2331. #define MANUFACTURER "BLITZWOLF"
  2332. #define DEVICE "BWSHPX"
  2333. // Buttons
  2334. #define BUTTON1_PIN 13
  2335. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2336. #define BUTTON1_RELAY 1
  2337. // Relays
  2338. #define RELAY1_PIN 15
  2339. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2340. // LEDs
  2341. #define LED1_PIN 2
  2342. #define LED1_PIN_INVERSE 1
  2343. #define LED2_PIN 0
  2344. #define LED2_PIN_INVERSE 1
  2345. #define LED2_MODE LED_MODE_FINDME
  2346. #define LED2_RELAY 1
  2347. // HJL01 / BL0937
  2348. #ifndef HLW8012_SUPPORT
  2349. #define HLW8012_SUPPORT 1
  2350. #endif
  2351. #define HLW8012_SEL_PIN 12
  2352. #define HLW8012_CF1_PIN 14
  2353. #define HLW8012_CF_PIN 5
  2354. #define HLW8012_SEL_CURRENT LOW
  2355. #define HLW8012_CURRENT_RATIO 25740
  2356. #define HLW8012_VOLTAGE_RATIO 313400
  2357. #define HLW8012_POWER_RATIO 3414290
  2358. #define HLW8012_INTERRUPT_ON FALLING
  2359. // -----------------------------------------------------------------------------
  2360. // Same as the above but new board version marked V2.3
  2361. // BlitzWolf SHP2 V2.3
  2362. // Gosund SP1 V2.3
  2363. // -----------------------------------------------------------------------------
  2364. #elif defined(BLITZWOLF_BWSHPX_V23)
  2365. // Info
  2366. #define MANUFACTURER "BLITZWOLF"
  2367. #define DEVICE "BWSHPX_V23"
  2368. // Buttons
  2369. #define BUTTON1_PIN 3
  2370. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2371. #define BUTTON1_RELAY 1
  2372. // Relays
  2373. #define RELAY1_PIN 14
  2374. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2375. // LEDs
  2376. #define LED1_PIN 1
  2377. #define LED1_PIN_INVERSE 1
  2378. #define LED2_PIN 13
  2379. #define LED2_PIN_INVERSE 1
  2380. #define LED2_MODE LED_MODE_FINDME
  2381. #define LED2_RELAY 1
  2382. // HJL01 / BL0937
  2383. #ifndef HLW8012_SUPPORT
  2384. #define HLW8012_SUPPORT 1
  2385. #endif
  2386. #define HLW8012_SEL_PIN 12
  2387. #define HLW8012_CF1_PIN 5
  2388. #define HLW8012_CF_PIN 4
  2389. #define HLW8012_SEL_CURRENT LOW
  2390. #define HLW8012_CURRENT_RATIO 25740
  2391. #define HLW8012_VOLTAGE_RATIO 313400
  2392. #define HLW8012_POWER_RATIO 3414290
  2393. #define HLW8012_INTERRUPT_ON FALLING
  2394. // BUTTON1 and LED1 are using Serial pins
  2395. #define DEBUG_SERIAL_SUPPORT 0
  2396. // -----------------------------------------------------------------------------
  2397. // Similar to both devices above but also with switchable USB ports
  2398. // and other sensor (CSE7766).
  2399. // the pin layout is different to the above two versions
  2400. // BlitzWolf SHP5
  2401. // -----------------------------------------------------------------------------
  2402. #elif defined(BLITZWOLF_BWSHP5)
  2403. // Info
  2404. #define MANUFACTURER "BLITZWOLF"
  2405. #define DEVICE "BWSHP5"
  2406. // Buttons
  2407. #define BUTTON1_PIN 16
  2408. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2409. #define BUTTON1_RELAY 1
  2410. // Relays
  2411. // Power plug
  2412. #define RELAY1_PIN 14
  2413. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2414. // USB
  2415. #define RELAY2_PIN 5
  2416. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2417. // LEDs
  2418. #define LED1_PIN 2
  2419. #define LED1_PIN_INVERSE 1
  2420. #define LED2_PIN 0
  2421. #define LED2_PIN_INVERSE 1
  2422. #define LED2_MODE LED_MODE_FINDME
  2423. #define LED2_RELAY 1
  2424. // Disable UART noise
  2425. #define DEBUG_SERIAL_SUPPORT 0
  2426. // CSE7766
  2427. #ifndef CSE7766_SUPPORT
  2428. #define CSE7766_SUPPORT 1
  2429. #endif
  2430. #define CSE7766_PIN 1
  2431. // -----------------------------------------------------------------------------
  2432. // Teckin SP21
  2433. // -----------------------------------------------------------------------------
  2434. #elif defined(TECKIN_SP21)
  2435. // Info
  2436. #define MANUFACTURER "TECKIN"
  2437. #define DEVICE "SP21"
  2438. // Buttons
  2439. #define BUTTON1_PIN 13
  2440. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2441. #define BUTTON1_RELAY 1
  2442. // Relays
  2443. #define RELAY1_PIN 15
  2444. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2445. // LEDs
  2446. #define LED1_PIN 2
  2447. #define LED1_PIN_INVERSE 1
  2448. // -----------------------------------------------------------------------------
  2449. // Teckin SP22 v1.4 - v1.6
  2450. // -----------------------------------------------------------------------------
  2451. #elif defined(TECKIN_SP22_V14)
  2452. // Info
  2453. #define MANUFACTURER "TECKIN"
  2454. #define DEVICE "SP22_V14"
  2455. // Buttons
  2456. #define BUTTON1_PIN 1
  2457. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2458. #define BUTTON1_RELAY 1
  2459. // Relays
  2460. #define RELAY1_PIN 14
  2461. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2462. // LEDs
  2463. #define LED1_PIN 3
  2464. #define LED1_PIN_INVERSE 1
  2465. #define LED2_PIN 13
  2466. #define LED2_PIN_INVERSE 1
  2467. #define LED2_MODE LED_MODE_FINDME
  2468. #define LED2_RELAY 1
  2469. // HJL01 / BL0937
  2470. #ifndef HLW8012_SUPPORT
  2471. #define HLW8012_SUPPORT 1
  2472. #endif
  2473. #define HLW8012_SEL_PIN 12
  2474. #define HLW8012_CF1_PIN 5
  2475. #define HLW8012_CF_PIN 4
  2476. #define HLW8012_SEL_CURRENT LOW
  2477. #define HLW8012_CURRENT_RATIO 20730
  2478. #define HLW8012_VOLTAGE_RATIO 264935
  2479. #define HLW8012_POWER_RATIO 2533110
  2480. #define HLW8012_INTERRUPT_ON FALLING
  2481. // BUTTON1 and LED1 are using Serial pins
  2482. #define DEBUG_SERIAL_SUPPORT 0
  2483. // -----------------------------------------------------------------------------
  2484. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  2485. // Also model number KS-602S
  2486. // -----------------------------------------------------------------------------
  2487. #elif defined(GOSUND_WS1)
  2488. // Info
  2489. #define MANUFACTURER "GOSUND"
  2490. #define DEVICE "WS1"
  2491. // Buttons
  2492. #define BUTTON1_PIN 0
  2493. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2494. #define BUTTON1_RELAY 1
  2495. // Relays
  2496. #define RELAY1_PIN 14
  2497. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2498. // LEDs
  2499. #define LED1_PIN 1
  2500. #define LED1_PIN_INVERSE 1
  2501. // LED1 is using TX pin
  2502. #define DEBUG_SERIAL_SUPPORT 0
  2503. // ----------------------------------------------------------------------------------------
  2504. // Homecube 16A is similar but some pins differ and it also has RGB LEDs
  2505. // https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
  2506. // ----------------------------------------------------------------------------------------
  2507. #elif defined(HOMECUBE_16A)
  2508. // Info
  2509. #define MANUFACTURER "HOMECUBE"
  2510. #define DEVICE "16A"
  2511. // Buttons
  2512. #define BUTTON1_PIN 13
  2513. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2514. #define BUTTON1_RELAY 1
  2515. // Relays
  2516. #define RELAY1_PIN 15
  2517. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2518. // LEDs
  2519. //LED Pin 4 - ESP8266 onboard LED
  2520. //Red LED: 0
  2521. //Green LED: 12
  2522. //Blue LED: 2
  2523. // Blue
  2524. #define LED1_PIN 2
  2525. #define LED1_PIN_INVERSE 0
  2526. // Green
  2527. #define LED2_PIN 12
  2528. #define LED2_PIN_INVERSE 1
  2529. #define LED2_MODE LED_MODE_RELAY
  2530. // Red
  2531. #define LED3_PIN 0
  2532. #define LED3_PIN_INVERSE 0
  2533. #define LED3_MODE LED_MODE_OFF
  2534. // HJL01 / BL0937
  2535. #ifndef HLW8012_SUPPORT
  2536. #define HLW8012_SUPPORT 1
  2537. #endif
  2538. #define HLW8012_SEL_PIN 16
  2539. #define HLW8012_CF1_PIN 14
  2540. #define HLW8012_CF_PIN 5
  2541. #define HLW8012_SEL_CURRENT LOW
  2542. #define HLW8012_CURRENT_RATIO 25740
  2543. #define HLW8012_VOLTAGE_RATIO 313400
  2544. #define HLW8012_POWER_RATIO 3414290
  2545. #define HLW8012_INTERRUPT_ON FALLING
  2546. // -----------------------------------------------------------------------------
  2547. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  2548. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  2549. // -----------------------------------------------------------------------------
  2550. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  2551. // Info
  2552. #define MANUFACTURER "VANZAVANZU"
  2553. #define DEVICE "SMART_WIFI_PLUG_MINI"
  2554. // Buttons
  2555. #define BUTTON1_PIN 13
  2556. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2557. #define BUTTON1_RELAY 1
  2558. // Relays
  2559. #define RELAY1_PIN 15
  2560. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2561. // LEDs
  2562. #define LED1_PIN 2
  2563. #define LED1_PIN_INVERSE 1
  2564. #define LED2_PIN 0
  2565. #define LED2_PIN_INVERSE 1
  2566. #define LED2_MODE LED_MODE_FINDME
  2567. #define LED2_RELAY 1
  2568. // Disable UART noise
  2569. #define DEBUG_SERIAL_SUPPORT 0
  2570. // HJL01 / BL0937
  2571. #ifndef HLW8012_SUPPORT
  2572. #define HLW8012_SUPPORT 1
  2573. #endif
  2574. #define HLW8012_SEL_PIN 3
  2575. #define HLW8012_CF1_PIN 14
  2576. #define HLW8012_CF_PIN 5
  2577. #define HLW8012_SEL_CURRENT LOW
  2578. #define HLW8012_CURRENT_RATIO 25740
  2579. #define HLW8012_VOLTAGE_RATIO 313400
  2580. #define HLW8012_POWER_RATIO 3414290
  2581. #define HLW8012_INTERRUPT_ON FALLING
  2582. // -----------------------------------------------------------------------------
  2583. #elif defined(GENERIC_AG_L4)
  2584. // Info
  2585. #define MANUFACTURER "GENERIC"
  2586. #define DEVICE "AG_L4"
  2587. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2588. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2589. #define DUMMY_RELAY_COUNT 1
  2590. // button 1: "power" button
  2591. #define BUTTON1_PIN 4
  2592. #define BUTTON1_RELAY 1
  2593. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2594. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  2595. #define BUTTON1_CLICK BUTTON_MODE_NONE
  2596. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2597. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2598. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  2599. // button 2: "wifi" button
  2600. #define BUTTON2_PIN 2
  2601. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2602. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  2603. #define BUTTON2_CLICK BUTTON_MODE_NONE
  2604. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  2605. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  2606. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  2607. // LEDs
  2608. #define LED1_PIN 5 // red status led
  2609. #define LED1_PIN_INVERSE 0
  2610. #define LED2_PIN 16 // master light power
  2611. #define LED2_PIN_INVERSE 1
  2612. #define LED2_MODE LED_MODE_RELAY
  2613. // Light
  2614. #define LIGHT_CHANNELS 3
  2615. #define LIGHT_CH1_PIN 14 // RED
  2616. #define LIGHT_CH2_PIN 13 // GREEN
  2617. #define LIGHT_CH3_PIN 12 // BLUE
  2618. #define LIGHT_CH1_INVERSE 0
  2619. #define LIGHT_CH2_INVERSE 0
  2620. #define LIGHT_CH3_INVERSE 0
  2621. // -----------------------------------------------------------------------------
  2622. #elif defined(ALLTERCO_SHELLY1)
  2623. // Info
  2624. #define MANUFACTURER "ALLTERCO"
  2625. #define DEVICE "SHELLY1"
  2626. // Buttons
  2627. #define BUTTON1_PIN 5
  2628. #define BUTTON1_MODE BUTTON_SWITCH
  2629. #define BUTTON1_RELAY 1
  2630. // Relays
  2631. #define RELAY1_PIN 4
  2632. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2633. #elif defined(ALLTERCO_SHELLY2)
  2634. // Info
  2635. #define MANUFACTURER "ALLTERCO"
  2636. #define DEVICE "SHELLY2"
  2637. // Buttons
  2638. #define BUTTON1_PIN 12
  2639. #define BUTTON2_PIN 14
  2640. #define BUTTON1_MODE BUTTON_SWITCH
  2641. #define BUTTON2_MODE BUTTON_SWITCH
  2642. #define BUTTON1_RELAY 1
  2643. #define BUTTON2_RELAY 2
  2644. // Relays
  2645. #define RELAY1_PIN 4
  2646. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2647. #define RELAY2_PIN 5
  2648. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2649. #elif defined(ALLTERCO_SHELLY1PM)
  2650. // Info
  2651. #define MANUFACTURER "ALLTERCO"
  2652. #define DEVICE "SHELLY1PM"
  2653. // Buttons
  2654. #define BUTTON1_PIN 4
  2655. #define BUTTON1_MODE BUTTON_SWITCH
  2656. #define BUTTON1_RELAY 1
  2657. #define BUTTON2_PIN 2
  2658. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2659. #define BUTTON2_LNGCLICK BUTTON_MODE_RESET
  2660. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_FACTORY
  2661. // Relays
  2662. #define RELAY1_PIN 15
  2663. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2664. // Light
  2665. #define LED1_PIN 0
  2666. #define LED1_PIN_INVERSE 1
  2667. // HJL01 / BL0937
  2668. #define HLW8012_SUPPORT 1
  2669. #define HLW8012_SEL_PIN 12
  2670. #define HLW8012_CF1_PIN 13
  2671. #define HLW8012_CF_PIN 5
  2672. #define HLW8012_SEL_CURRENT LOW
  2673. #define HLW8012_CURRENT_RATIO 25740
  2674. #define HLW8012_VOLTAGE_RATIO 313400
  2675. #define HLW8012_POWER_RATIO 3414290
  2676. #define HLW8012_INTERRUPT_ON FALLING
  2677. //Temperature
  2678. #define NTC_SUPPORT 1
  2679. #define SENSOR_SUPPORT 1
  2680. #define NTC_BETA 3350
  2681. #define NTC_R_UP 10000
  2682. #define NTC_R_DOWN 0
  2683. #define NTC_R0 8000
  2684. #elif defined(ALLTERCO_SHELLY25)
  2685. // Info
  2686. #define MANUFACTURER "ALLTERCO"
  2687. #define DEVICE "SHELLY25"
  2688. // Buttons
  2689. #define BUTTON1_PIN 13
  2690. #define BUTTON1_MODE BUTTON_SWITCH
  2691. #define BUTTON1_RELAY 1
  2692. #define BUTTON2_PIN 5
  2693. #define BUTTON2_MODE BUTTON_SWITCH
  2694. #define BUTTON2_RELAY 2
  2695. #define BUTTON3_PIN 2
  2696. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2697. #define BUTTON3_LNGCLICK BUTTON_MODE_RESET
  2698. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_FACTORY
  2699. // Relays
  2700. #define RELAY1_PIN 4
  2701. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2702. #define RELAY2_PIN 15
  2703. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2704. // Light
  2705. #define LED1_PIN 0
  2706. #define LED1_PIN_INVERSE 1
  2707. //Temperature
  2708. #define NTC_SUPPORT 1
  2709. #define SENSOR_SUPPORT 1
  2710. #define NTC_BETA 3350
  2711. #define NTC_R_UP 10000
  2712. #define NTC_R_DOWN 0
  2713. #define NTC_R0 8000
  2714. //Current
  2715. #define ADE7953_SUPPORT 1
  2716. #define I2C_SDA_PIN 12
  2717. #define I2C_SCL_PIN 14
  2718. // -----------------------------------------------------------------------------
  2719. // also works with https://www.amazon.com/gp/product/B07TMY394G/
  2720. // see https://github.com/xoseperez/espurna/issues/2055
  2721. #elif defined(LOHAS_E27_9W)
  2722. // Info
  2723. #define MANUFACTURER "LOHAS"
  2724. #define DEVICE "E27_9W"
  2725. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2726. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2727. #define DUMMY_RELAY_COUNT 1
  2728. // Light
  2729. #define LIGHT_CHANNELS 5
  2730. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2731. #define MY92XX_CHIPS 2
  2732. #define MY92XX_DI_PIN 13
  2733. #define MY92XX_DCKI_PIN 15
  2734. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2735. #define MY92XX_MAPPING 0, 1, 2, 3, 4
  2736. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  2737. // https://www.amazon.com/gp/product/B07T7W7ZMW
  2738. #elif defined(LOHAS_E26_A19)
  2739. // Info
  2740. #define MANUFACTURER "LOHAS"
  2741. #define DEVICE "E26_A19"
  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 5
  2747. #define LIGHT_CH1_PIN 5 // RED
  2748. #define LIGHT_CH2_PIN 4 // GREEN
  2749. #define LIGHT_CH3_PIN 13 // BLUE
  2750. #define LIGHT_CH4_PIN 14 // WHITE1
  2751. #define LIGHT_CH5_PIN 12 // WHITE1
  2752. // -----------------------------------------------------------------------------
  2753. #elif defined(TECKIN_SB53)
  2754. // Info
  2755. #define MANUFACTURER "TECKIN"
  2756. #define DEVICE "SB53"
  2757. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2758. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2759. #define DUMMY_RELAY_COUNT 1
  2760. // Light
  2761. #define LIGHT_CHANNELS 5
  2762. #define LIGHT_CH1_PIN 4 // RED
  2763. #define LIGHT_CH2_PIN 12 // GREEN
  2764. #define LIGHT_CH3_PIN 14 // BLUE
  2765. #define LIGHT_CH4_PIN 13 // WARM WHITE
  2766. #define LIGHT_CH5_PIN 5 // COLD WHITE
  2767. // -----------------------------------------------------------------------------
  2768. #elif defined(XIAOMI_SMART_DESK_LAMP)
  2769. // Info
  2770. #define MANUFACTURER "XIAOMI"
  2771. #define DEVICE "SMART_DESK_LAMP"
  2772. // Buttons
  2773. #define BUTTON1_PIN 2
  2774. #define BUTTON2_PIN 14
  2775. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2776. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2777. // This button doubles as switch here and as encoder mode switch below
  2778. // Clicking it (for less than 500ms) will turn the light on and off
  2779. // Double and Long clicks will not work as these are used to modify the encoder action
  2780. #define BUTTON1_RELAY 1
  2781. #define BUTTON_LNGCLICK_DELAY 500
  2782. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2783. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2784. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  2785. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  2786. #define BUTTON2_DBLCLICK BUTTON_MODE_AP
  2787. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  2788. // Light
  2789. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2790. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2791. #define DUMMY_RELAY_COUNT 1
  2792. #define LIGHT_STEP 8
  2793. #define LIGHT_CHANNELS 2
  2794. #define LIGHT_CH1_PIN 5 // warm white
  2795. #define LIGHT_CH1_INVERSE 0
  2796. #define LIGHT_CH2_PIN 4 // cold white
  2797. #define LIGHT_CH2_INVERSE 0
  2798. // https://www.xiaomitoday.com/xiaomi-mijia-mjtd01yl-led-desk-lamp-review/
  2799. #define LIGHT_COLDWHITE_MIRED 153
  2800. #define LIGHT_WARMWHITE_MIRED 370
  2801. // Encoder
  2802. // If mode is ENCODER_MODE_RATIO, the value ratio between both channels is changed
  2803. // when the button is not pressed, and the overall brightness when pressed
  2804. // If mode is ENCODER_MODE_CHANNEL, the first channel value is changed
  2805. // when the button is not pressed, and the second channel when pressed
  2806. // If no ENCODERX_BUTTON_PIN defined it will only change the value of the first defined channel
  2807. #define ENCODER_SUPPORT 1
  2808. #define ENCODER1_PIN1 12
  2809. #define ENCODER1_PIN2 13
  2810. #define ENCODER1_BUTTON_PIN 2 // active low by default, with software pullup
  2811. #define ENCODER1_CHANNEL1 0 // please note this value is 0-based (LIGHT_CH1 above)
  2812. #define ENCODER1_CHANNEL2 1 // please note this value is 0-based (LIGHT_CH2 above)
  2813. #define ENCODER1_MODE ENCODER_MODE_RATIO
  2814. #elif defined(PHYX_ESP12_RGB)
  2815. // Info
  2816. #define MANUFACTURER "PHYX"
  2817. #define DEVICE "ESP12_RGB"
  2818. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2819. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2820. #define DUMMY_RELAY_COUNT 1
  2821. // Light
  2822. #define LIGHT_CHANNELS 3
  2823. #define LIGHT_CH1_PIN 4 // RED
  2824. #define LIGHT_CH2_PIN 14 // GREEN
  2825. #define LIGHT_CH3_PIN 12 // BLUE
  2826. #define LIGHT_CH1_INVERSE 0
  2827. #define LIGHT_CH2_INVERSE 0
  2828. #define LIGHT_CH3_INVERSE 0
  2829. // -----------------------------------------------------------------------------
  2830. // iWoole LED Table Lamp
  2831. // 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
  2832. // -----------------------------------------------------------------------------
  2833. #elif defined(IWOOLE_LED_TABLE_LAMP)
  2834. // Info
  2835. #define MANUFACTURER "IWOOLE"
  2836. #define DEVICE "LED_TABLE_LAMP"
  2837. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2838. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2839. #define DUMMY_RELAY_COUNT 1
  2840. // Light
  2841. #define LIGHT_CHANNELS 4
  2842. #define LIGHT_CH1_PIN 12 // RED
  2843. #define LIGHT_CH2_PIN 5 // GREEN
  2844. #define LIGHT_CH3_PIN 14 // BLUE
  2845. #define LIGHT_CH4_PIN 4 // WHITE
  2846. #define LIGHT_CH1_INVERSE 0
  2847. #define LIGHT_CH2_INVERSE 0
  2848. #define LIGHT_CH3_INVERSE 0
  2849. #define LIGHT_CH4_INVERSE 0
  2850. // -----------------------------------------------------------------------------
  2851. // Generic GU10
  2852. // https://www.ebay.com/itm/1-10PC-GU10-RGB-Smart-Bulb-Wireless-WiFi-App-Remote-Ctrl-Light-for-Alexa-Google/173724116351
  2853. // -----------------------------------------------------------------------------
  2854. #elif defined(GENERIC_GU10)
  2855. // Info
  2856. #define MANUFACTURER "GENERIC"
  2857. #define DEVICE "GU10"
  2858. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2859. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2860. #define DUMMY_RELAY_COUNT 1
  2861. // Light
  2862. #define LIGHT_CHANNELS 4
  2863. #define LIGHT_CH1_PIN 14 // RED
  2864. #define LIGHT_CH2_PIN 12 // GREEN
  2865. #define LIGHT_CH3_PIN 13 // BLUE
  2866. #define LIGHT_CH4_PIN 4 // WHITE
  2867. #define LIGHT_CH1_INVERSE 0
  2868. #define LIGHT_CH2_INVERSE 0
  2869. #define LIGHT_CH3_INVERSE 0
  2870. #define LIGHT_CH4_INVERSE 0
  2871. // -----------------------------------------------------------------------------
  2872. // Generic E14
  2873. // https://www.ebay.com/itm/LED-Bulb-Wifi-E14-4-5W-Candle-RGB-W-4in1-Dimmable-V-tac-Smart-VT-5114/163899840601
  2874. // -----------------------------------------------------------------------------
  2875. #elif defined(GENERIC_E14)
  2876. // Info
  2877. #define MANUFACTURER "GENERIC"
  2878. #define DEVICE "E14"
  2879. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2880. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2881. #define DUMMY_RELAY_COUNT 1
  2882. // Light
  2883. #define LIGHT_CHANNELS 4
  2884. #define LIGHT_CH1_PIN 4 // RED
  2885. #define LIGHT_CH2_PIN 12 // GREEN
  2886. #define LIGHT_CH3_PIN 14 // BLUE
  2887. #define LIGHT_CH4_PIN 5 // WHITE
  2888. #define LIGHT_CH1_INVERSE 0
  2889. #define LIGHT_CH2_INVERSE 0
  2890. #define LIGHT_CH3_INVERSE 0
  2891. #define LIGHT_CH4_INVERSE 0
  2892. // -----------------------------------------------------------------------------
  2893. // Deltaco white e14 (SH-LE14W) and e27 (SH-LE27W)
  2894. // -----------------------------------------------------------------------------
  2895. #elif defined(DELTACO_SH_LEXXW)
  2896. // Info
  2897. #define MANUFACTURER "DELTACO"
  2898. #define DEVICE "SH_LEXXW"
  2899. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2900. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2901. #define DUMMY_RELAY_COUNT 1
  2902. // Light
  2903. #define LIGHT_CHANNELS 2
  2904. #define LIGHT_CH1_PIN 12 // WARM WHITE
  2905. #define LIGHT_CH2_PIN 14 // COLD WHITE
  2906. #define LIGHT_CH1_INVERSE 0
  2907. #define LIGHT_CH2_INVERSE 0
  2908. // -----------------------------------------------------------------------------
  2909. // Deltaco rgbw e27 (SH-LE27RGB)
  2910. // -----------------------------------------------------------------------------
  2911. #elif defined(DELTACO_SH_LEXXRGB)
  2912. // Info
  2913. #define MANUFACTURER "DELTACO"
  2914. #define DEVICE "SH_LEXXRGB"
  2915. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2916. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2917. #define DUMMY_RELAY_COUNT 1
  2918. // Light
  2919. #define LIGHT_CHANNELS 5
  2920. #define LIGHT_CH1_PIN 5 // RED
  2921. #define LIGHT_CH2_PIN 4 // GREEN
  2922. #define LIGHT_CH3_PIN 13 // BLUE
  2923. #define LIGHT_CH4_PIN 14 // WARM WHITE
  2924. #define LIGHT_CH5_PIN 12 // COLD WHITE
  2925. #define LIGHT_CH1_INVERSE 0
  2926. #define LIGHT_CH2_INVERSE 0
  2927. #define LIGHT_CH3_INVERSE 0
  2928. #define LIGHT_CH4_INVERSE 0
  2929. #define LIGHT_CH5_INVERSE 0
  2930. // -----------------------------------------------------------------------------
  2931. // Nexete A19
  2932. // https://www.ebay.com/itm/Wifi-Smart-LED-light-Bulb-9W-60W-A19-850LM-RGBW-Dimmable-for-Alexa-Google-Home/283514779201
  2933. // -----------------------------------------------------------------------------
  2934. #elif defined(NEXETE_A19)
  2935. // Info
  2936. #define MANUFACTURER "NEXETE"
  2937. #define DEVICE "A19"
  2938. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2939. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2940. #define DUMMY_RELAY_COUNT 1
  2941. // Light
  2942. #define LIGHT_CHANNELS 4
  2943. #define LIGHT_CH1_PIN 12 // RED
  2944. #define LIGHT_CH2_PIN 15 // GREEN
  2945. #define LIGHT_CH3_PIN 14 // BLUE
  2946. #define LIGHT_CH4_PIN 5 // WHITE
  2947. #define LIGHT_CH1_INVERSE 0
  2948. #define LIGHT_CH2_INVERSE 0
  2949. #define LIGHT_CH3_INVERSE 0
  2950. #define LIGHT_CH4_INVERSE 0
  2951. // -----------------------------------------------------------------------------
  2952. // Lombex Lux Nova 2 Tunable White
  2953. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2954. // -----------------------------------------------------------------------------
  2955. #elif defined(LOMBEX_LUX_NOVA2_TUNABLE_WHITE)
  2956. // Info
  2957. #define MANUFACTURER "LOMBEX"
  2958. #define DEVICE "LUX_NOVA2_TUNABLE_WHITE"
  2959. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2960. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2961. #define DUMMY_RELAY_COUNT 1
  2962. // Light
  2963. #define LIGHT_CHANNELS 5
  2964. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2965. #define MY92XX_CHIPS 1
  2966. #define MY92XX_DI_PIN 4
  2967. #define MY92XX_DCKI_PIN 5
  2968. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2969. // No RGB on this bulb. Warm white on channel 0, cool white on channel 3
  2970. #define MY92XX_MAPPING 255, 255, 255, 3, 0
  2971. // -----------------------------------------------------------------------------
  2972. // Lombex Lux Nova 2 White and Color
  2973. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2974. // -----------------------------------------------------------------------------
  2975. #elif defined(LOMBEX_LUX_NOVA2_WHITE_COLOR)
  2976. // Info
  2977. #define MANUFACTURER "LOMBEX"
  2978. #define DEVICE "LUX_NOVA2_WHITE_COLOR"
  2979. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2980. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2981. #define DUMMY_RELAY_COUNT 1
  2982. // Light
  2983. #define LIGHT_CHANNELS 4
  2984. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2985. #define MY92XX_CHIPS 1
  2986. #define MY92XX_DI_PIN 4
  2987. #define MY92XX_DCKI_PIN 5
  2988. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2989. // RGB on channels 0/1/2, either cool or warm white on channel 3
  2990. // The bulb *should* have cool leds, but could also have warm leds as a common defect
  2991. #define MY92XX_MAPPING 0, 1, 2, 3
  2992. // -----------------------------------------------------------------------------
  2993. // Bestek Smart Plug with 2 USB ports
  2994. // https://www.bestekcorp.com/bestek-smart-plug-works-with-amazon-alexa-google-assistant-and-ifttt-with-2-usb
  2995. // -----------------------------------------------------------------------------
  2996. #elif defined(BESTEK_MRJ1011)
  2997. // Info
  2998. #define MANUFACTURER "BESTEK"
  2999. #define DEVICE "MRJ1011"
  3000. // Buttons
  3001. #define BUTTON1_PIN 13
  3002. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  3003. #define BUTTON1_RELAY 1
  3004. // Relay
  3005. #define RELAY1_PIN 12
  3006. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3007. // LED
  3008. #define LED1_PIN 4
  3009. #define LED1_PIN_INVERSE 1
  3010. // -----------------------------------------------------------------------------
  3011. // GBLIFE RGBW SOCKET
  3012. // -----------------------------------------------------------------------------
  3013. #elif defined(GBLIFE_RGBW_SOCKET)
  3014. // Info
  3015. #define MANUFACTURER "GBLIFE"
  3016. #define DEVICE "RGBW_SOCKET"
  3017. // Buttons
  3018. #define BUTTON1_PIN 13
  3019. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3020. #define BUTTON1_RELAY 1
  3021. // Relays
  3022. #define RELAY1_PIN 15
  3023. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3024. // Light RGBW
  3025. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3026. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3027. #define DUMMY_RELAY_COUNT 1
  3028. #define LIGHT_CHANNELS 4
  3029. #define LIGHT_CH1_PIN 5 // RED
  3030. #define LIGHT_CH2_PIN 14 // GREEN
  3031. #define LIGHT_CH3_PIN 12 // BLUE
  3032. #define LIGHT_CH4_PIN 4 // WHITE
  3033. #define LIGHT_CH1_INVERSE 0
  3034. #define LIGHT_CH2_INVERSE 0
  3035. #define LIGHT_CH3_INVERSE 0
  3036. #define LIGHT_CH4_INVERSE 0
  3037. // ----------------------------------------------------------------------------------------
  3038. // Smart life Mini Smart Socket is similar Homecube 16A but some GPIOs differ
  3039. // https://www.ebay.de/itm/Smart-Steckdose-WIFI-WLAN-Amazon-Alexa-Fernbedienung-Home-Socket-Zeitschaltuh-DE/123352026749?hash=item1cb85a8e7d:g:IasAAOSwk6dbj390
  3040. // Also labeled NETVIP
  3041. // https://www.amazon.es/Inteligente-NETVIP-Inal%C3%A1mbrico-Interruptor-Funciona/dp/B07KH8YWS5
  3042. // ----------------------------------------------------------------------------------------
  3043. #elif defined(SMARTLIFE_MINI_SMART_SOCKET)
  3044. // Info
  3045. #define MANUFACTURER "SMARTLIFE"
  3046. #define DEVICE "MINI_SMART_SOCKET"
  3047. // Buttons
  3048. #define BUTTON1_PIN 13
  3049. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3050. #define BUTTON1_RELAY 1
  3051. // Relays
  3052. #define RELAY1_PIN 15
  3053. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3054. // LEDs
  3055. //Red LED: 0
  3056. //Green LED: 4
  3057. //Blue LED: 2
  3058. // Light
  3059. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3060. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3061. #define DUMMY_RELAY_COUNT 1
  3062. #define LIGHT_CHANNELS 3
  3063. #define LIGHT_CH1_PIN 0 // RED
  3064. #define LIGHT_CH2_PIN 4 // GREEN
  3065. #define LIGHT_CH3_PIN 2 // BLUE
  3066. #define LIGHT_CH1_INVERSE 0
  3067. #define LIGHT_CH2_INVERSE 0
  3068. #define LIGHT_CH3_INVERSE 0
  3069. // HJL01 / BL0937
  3070. #ifndef HLW8012_SUPPORT
  3071. #define HLW8012_SUPPORT 1
  3072. #endif
  3073. #define HLW8012_SEL_PIN 12
  3074. #define HLW8012_CF1_PIN 14
  3075. #define HLW8012_CF_PIN 5
  3076. #define HLW8012_SEL_CURRENT LOW
  3077. #define HLW8012_CURRENT_RATIO 25740
  3078. #define HLW8012_VOLTAGE_RATIO 313400
  3079. #define HLW8012_POWER_RATIO 3414290
  3080. #define HLW8012_INTERRUPT_ON FALLING
  3081. // ----------------------------------------------------------------------------------------
  3082. // Hama WiFi Steckdose (00176533)
  3083. // https://at.hama.com/00176533/hama-wifi-steckdose-3500w-16a
  3084. // ----------------------------------------------------------------------------------------
  3085. #elif defined(HAMA_WIFI_STECKDOSE_00176533)
  3086. // Info
  3087. #define MANUFACTURER "HAMA"
  3088. #define DEVICE "WIFI_STECKDOSE_00176533"
  3089. // Buttons
  3090. #define BUTTON1_PIN 13
  3091. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  3092. #define BUTTON1_RELAY 1
  3093. // Relays
  3094. #define RELAY1_PIN 12
  3095. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3096. // LEDs
  3097. #define LED1_PIN 4
  3098. #define LED1_PIN_INVERSE 1
  3099. // -----------------------------------------------------------------------------
  3100. // Oxaoxe NX-SP202
  3101. // Digoo NX-SP202 (not tested)
  3102. // Digoo DG-SP202 (not tested)
  3103. // https://github.com/xoseperez/espurna/issues/1502
  3104. // -----------------------------------------------------------------------------
  3105. #elif defined(DIGOO_NX_SP202)
  3106. // Info
  3107. #define MANUFACTURER "DIGOO"
  3108. #define DEVICE "NX_SP202"
  3109. // Buttons
  3110. #define BUTTON1_PIN 0
  3111. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3112. #define BUTTON1_RELAY 1
  3113. #define BUTTON2_PIN 16
  3114. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  3115. #define BUTTON2_RELAY 2
  3116. // Relays
  3117. #define RELAY1_PIN 15
  3118. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3119. #define RELAY2_PIN 14
  3120. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3121. // LEDs
  3122. #define LED1_PIN 13
  3123. #define LED1_PIN_INVERSE 1
  3124. // HJL01 / BL0937
  3125. #ifndef HLW8012_SUPPORT
  3126. #define HLW8012_SUPPORT 1
  3127. #endif
  3128. #define HLW8012_SEL_PIN 12
  3129. #define HLW8012_CF1_PIN 5
  3130. #define HLW8012_CF_PIN 4
  3131. #define HLW8012_SEL_CURRENT LOW
  3132. #define HLW8012_CURRENT_RATIO 23296
  3133. #define HLW8012_VOLTAGE_RATIO 310085
  3134. #define HLW8012_POWER_RATIO 3368471
  3135. #define HLW8012_INTERRUPT_ON FALLING
  3136. // -----------------------------------------------------------------------------
  3137. // Foxel's LightFox dual
  3138. // https://github.com/foxel/esp-dual-rf-switch
  3139. // -----------------------------------------------------------------------------
  3140. #elif defined(FOXEL_LIGHTFOX_DUAL)
  3141. // Info
  3142. #define MANUFACTURER "FOXEL"
  3143. #define DEVICE "LIGHTFOX_DUAL"
  3144. #define SERIAL_BAUDRATE 19200
  3145. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  3146. #define DUMMY_RELAY_COUNT 2
  3147. #define DEBUG_SERIAL_SUPPORT 0
  3148. // Buttons
  3149. #define BUTTON1_RELAY 1
  3150. #define BUTTON2_RELAY 2
  3151. #define BUTTON3_RELAY 2
  3152. #define BUTTON4_RELAY 1
  3153. // -----------------------------------------------------------------------------
  3154. // Teckin SP20
  3155. // -----------------------------------------------------------------------------
  3156. #elif defined(TECKIN_SP20)
  3157. // Info
  3158. #define MANUFACTURER "TECKIN"
  3159. #define DEVICE "SP20"
  3160. // Buttons
  3161. #define BUTTON1_PIN 13
  3162. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3163. #define BUTTON1_RELAY 1
  3164. // Relays
  3165. #define RELAY1_PIN 4
  3166. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3167. // LEDs
  3168. #define LED1_PIN 2
  3169. #define LED1_PIN_INVERSE 1
  3170. #define LED2_PIN 0
  3171. #define LED2_PIN_INVERSE 1
  3172. #define LED2_MODE LED_MODE_FINDME
  3173. #define LED2_RELAY 0
  3174. // HJL01 / BL0937
  3175. #ifndef HLW8012_SUPPORT
  3176. #define HLW8012_SUPPORT 1
  3177. #endif
  3178. #define HLW8012_SEL_PIN 12
  3179. #define HLW8012_CF1_PIN 14
  3180. #define HLW8012_CF_PIN 5
  3181. #define HLW8012_SEL_CURRENT LOW
  3182. #define HLW8012_CURRENT_RATIO 25740
  3183. #define HLW8012_VOLTAGE_RATIO 313400
  3184. #define HLW8012_POWER_RATIO 3414290
  3185. #define HLW8012_INTERRUPT_ON FALLING
  3186. // -----------------------------------------------------------------------------
  3187. // Charging Essentials / LITESUN LA-WF3
  3188. // -----------------------------------------------------------------------------
  3189. #elif defined(LITESUN_LA_WF3)
  3190. // Info
  3191. #define MANUFACTURER "LITESUN"
  3192. #define DEVICE "LA_WF3"
  3193. // Buttons
  3194. #define BUTTON1_PIN 13
  3195. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3196. #define BUTTON1_RELAY 1
  3197. // Relays
  3198. #define RELAY1_PIN 12
  3199. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3200. // LEDs
  3201. #define LED1_PIN 4 // 4 blue led
  3202. #define LED1_MODE LED_MODE_WIFI
  3203. #define LED1_PIN_INVERSE 1
  3204. #define LED2_PIN 5 // 5 red led
  3205. #define LED2_MODE LED_MODE_RELAY
  3206. #define LED2_PIN_INVERSE 1
  3207. // -----------------------------------------------------------------------------
  3208. // PSH
  3209. // -----------------------------------------------------------------------------
  3210. #elif defined(PSH_WIFI_PLUG)
  3211. // Info
  3212. #define MANUFACTURER "PSH"
  3213. #define DEVICE "WIFI_PLUG"
  3214. // Relays
  3215. #define RELAY1_PIN 2
  3216. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3217. // LEDs
  3218. #define LED1_PIN 0
  3219. #define LED1_PIN_INVERSE 0
  3220. #elif defined(PSH_RGBW_CONTROLLER)
  3221. // Info
  3222. #define MANUFACTURER "PSH"
  3223. #define DEVICE "RGBW_CONTROLLER"
  3224. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3225. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3226. #define DUMMY_RELAY_COUNT 1
  3227. // LEDs
  3228. #define LED1_PIN 13
  3229. #define LED1_PIN_INVERSE 1
  3230. // Light
  3231. #define LIGHT_CHANNELS 4
  3232. #define LIGHT_CH1_PIN 5 // RED
  3233. #define LIGHT_CH2_PIN 4 // GREEN
  3234. #define LIGHT_CH3_PIN 12 // BLUE
  3235. #define LIGHT_CH4_PIN 14 // WHITE1
  3236. #define LIGHT_CH1_INVERSE 0
  3237. #define LIGHT_CH2_INVERSE 0
  3238. #define LIGHT_CH3_INVERSE 0
  3239. #define LIGHT_CH4_INVERSE 0
  3240. #elif defined(PSH_WIFI_SENSOR)
  3241. // Info
  3242. #define MANUFACTURER "PSH"
  3243. #define DEVICE "WIFI_SENSOR"
  3244. // DHT12 Sensor
  3245. #define DHT_SUPPORT 1
  3246. #define DHT_PIN 14
  3247. #define DHT_TYPE DHT_CHIP_DHT12
  3248. // LDR Sensor
  3249. #define LDR_SUPPORT 1
  3250. #define LDR_TYPE LDR_GL5528
  3251. #define LDR_ON_GROUND false
  3252. #define LDR_RESISTOR 10000
  3253. #elif defined(JINVOO_VALVE_SM_AW713)
  3254. // Reflashing from original Tuya firmware
  3255. // to thirdparty firmware like espurna by:
  3256. // https://github.com/ct-Open-Source/tuya-convert
  3257. // Info
  3258. #define MANUFACTURER "JINVOO"
  3259. #define DEVICE "VALVE_SM_AW713"
  3260. // Buttons
  3261. #define BUTTON1_PIN 13
  3262. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3263. #define BUTTON1_RELAY 1
  3264. // Relays
  3265. #define RELAY1_PIN 12
  3266. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3267. // LED
  3268. #define LED1_PIN 5 // 5 red led
  3269. #define LED1_PIN_INVERSE 0
  3270. #define LED1_RELAY 1
  3271. #define LED1_MODE LED_MODE_RELAY
  3272. #define LED2_PIN 4 // 4 blue led
  3273. #define LED2_PIN_INVERSE 0
  3274. #define LED2_RELAY 1
  3275. #define LED2_MODE LED_MODE_FINDME_WIFI
  3276. #elif defined(TUYA_GENERIC_DIMMER)
  3277. #define MANUFACTURER "TUYA"
  3278. #define DEVICE "GENERIC_DIMMER"
  3279. #define LIGHT_PROVIDER LIGHT_PROVIDER_TUYA
  3280. #define LIGHT_CHANNELS 0
  3281. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3282. #define DUMMY_RELAY_COUNT 0
  3283. // -----------------------------------------------------------------------------
  3284. // Etekcity ESW01-USA
  3285. // https://www.amazon.com/Etekcity-Voltson-Outlet-Monitoring-Required/dp/B01M3MYIFS
  3286. // -----------------------------------------------------------------------------
  3287. #elif defined(ETEKCITY_ESW01_USA)
  3288. // Info
  3289. #define MANUFACTURER "ETEKCITY"
  3290. #define DEVICE "ESW01-USA"
  3291. // Buttons
  3292. #define BUTTON1_PIN 14
  3293. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3294. #define BUTTON1_RELAY 1
  3295. // Relays
  3296. #define RELAY1_PIN 4
  3297. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3298. // LEDs
  3299. // Blue
  3300. #define LED1_PIN 5
  3301. #define LED1_PIN_INVERSE 0
  3302. #define LED1_MODE LED_MODE_WIFI
  3303. // Yellow
  3304. #define LED2_PIN 16
  3305. #define LED2_PIN_INVERSE 0
  3306. #define LED2_MODE LED_MODE_FOLLOW
  3307. #define LED2_RELAY 1
  3308. // HLW8012
  3309. #ifndef HLW8012_SUPPORT
  3310. #define HLW8012_SUPPORT 1
  3311. #endif
  3312. #define HLW8012_SEL_PIN 15
  3313. #define HLW8012_CF1_PIN 12
  3314. #define HLW8012_CF_PIN 13
  3315. #define HLW8012_SEL_CURRENT HIGH // SEL pin to HIGH to measure current
  3316. #define HLW8012_CURRENT_R 0.001 // Current resistor
  3317. #define HLW8012_VOLTAGE_R_UP ( 4 * 470000 ) // Upstream voltage resistor
  3318. #define HLW8012_VOLTAGE_R_DOWN ( 1000 ) // Downstream voltage resistor
  3319. #define HLW8012_INTERRUPT_ON CHANGE
  3320. // -----------------------------------------------------------------------------
  3321. // FS UAP1
  3322. // http://frank-schuetz.de/index.php/fhem/13-hoermann-torantrieb-mit-espeasy-in-fhem-einbinden
  3323. #elif defined(FS_UAP1)
  3324. // Info
  3325. #define MANUFACTURER "FS"
  3326. #define DEVICE "UAP1"
  3327. // Inputs
  3328. #define DIGITAL1_PIN 4
  3329. #define DIGITAL2_PIN 5
  3330. // Relays
  3331. #define RELAY1_PIN 12
  3332. #define RELAY2_PIN 13
  3333. #define RELAY3_PIN 14
  3334. #define RELAY4_PIN 15
  3335. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3336. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3337. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  3338. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  3339. // LEDs
  3340. #define LED1_PIN 2
  3341. #define LED1_PIN_INVERSE 0
  3342. // Disable UART noise
  3343. #define DEBUG_SERIAL_SUPPORT 0
  3344. // -----------------------------------------------------------------------------
  3345. // TFLAG NX-SM100 & NX-SM200
  3346. // -----------------------------------------------------------------------------
  3347. #elif defined(TFLAG_NX_SMX00)
  3348. // Info
  3349. #define MANUFACTURER "TFLAG"
  3350. #define DEVICE "NX_SMX00"
  3351. // Buttons
  3352. #define BUTTON1_PIN 13
  3353. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3354. #define BUTTON1_RELAY 1
  3355. // Relays
  3356. #define RELAY1_PIN 12
  3357. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3358. // LEDs
  3359. #define LED1_PIN 0
  3360. #define LED1_PIN_INVERSE 1
  3361. #define LED1_MODE LED_MODE_FOLLOW_INVERSE
  3362. #define LED1_RELAY 1
  3363. #define LED2_PIN 15
  3364. #define LED2_PIN_INVERSE 1
  3365. #define LED2_MODE LED_MODE_WIFI
  3366. // HJL01 / BL0937
  3367. #ifndef HLW8012_SUPPORT
  3368. #define HLW8012_SUPPORT 1
  3369. #endif
  3370. #define HLW8012_SEL_PIN 16
  3371. #define HLW8012_CF1_PIN 14
  3372. #define HLW8012_CF_PIN 5
  3373. #define HLW8012_SEL_CURRENT LOW
  3374. #define HLW8012_CURRENT_RATIO 632
  3375. #define HLW8012_VOLTAGE_RATIO 313400
  3376. #define HLW8012_POWER_RATIO 3711185
  3377. #define HLW8012_INTERRUPT_ON FALLING
  3378. // -----------------------------------------------------------------------------
  3379. // MUVIT_IO_MIOBULB001
  3380. // -----------------------------------------------------------------------------
  3381. #elif defined(MUVIT_IO_MIOBULB001)
  3382. // Info
  3383. #define MANUFACTURER "MUVIT_IO"
  3384. #define DEVICE "MIOBULB001"
  3385. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3386. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3387. #define DUMMY_RELAY_COUNT 1
  3388. // Light
  3389. #define LIGHT_CHANNELS 4
  3390. #define LIGHT_CH1_PIN 14 // RED
  3391. #define LIGHT_CH2_PIN 12 // GREEN
  3392. #define LIGHT_CH3_PIN 13 // BLUE
  3393. #define LIGHT_CH4_PIN 4 // WHITE
  3394. #define LIGHT_CH1_INVERSE 0
  3395. #define LIGHT_CH2_INVERSE 0
  3396. #define LIGHT_CH3_INVERSE 0
  3397. #define LIGHT_CH4_INVERSE 0
  3398. // -----------------------------------------------------------------------------
  3399. // Hykker Power Plug (Smart Home Series) available in Jerónimo Martins Polska (Biedronka)
  3400. // https://www.hykker.com/akcesoria/gniazdo-wi-fi-z-licznikiem-energii/
  3401. // Reflashing from original Tuya firmware
  3402. // to thirdparty firmware like espurna by:
  3403. // https://github.com/ct-Open-Source/tuya-convert
  3404. // -----------------------------------------------------------------------------
  3405. #elif defined(HYKKER_SMART_HOME_POWER_PLUG)
  3406. // Info
  3407. #define MANUFACTURER "HYKKER"
  3408. #define DEVICE "SMART_HOME_POWER_PLUG"
  3409. // Buttons
  3410. #define BUTTON1_PIN 0
  3411. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3412. #define BUTTON1_RELAY 1
  3413. // Relays
  3414. #define RELAY1_PIN 14
  3415. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3416. // LED
  3417. // Red
  3418. #define LED1_PIN 13
  3419. #define LED1_MODE LED_MODE_WIFI
  3420. #define LED1_PIN_INVERSE 1
  3421. // Blue connected to relay
  3422. // HLW8012
  3423. #ifndef HLW8012_SUPPORT
  3424. #define HLW8012_SUPPORT 1
  3425. #endif
  3426. #define HLW8012_SEL_PIN 12
  3427. #define HLW8012_CF1_PIN 5
  3428. #define HLW8012_CF_PIN 4
  3429. #define HLW8012_SEL_CURRENT LOW
  3430. #define HLW8012_CURRENT_RATIO 25740
  3431. #define HLW8012_VOLTAGE_RATIO 282060
  3432. #define HLW8012_POWER_RATIO 3414290
  3433. #define HLW8012_INTERRUPT_ON FALLING
  3434. #define SENSOR_ENERGY_UNITS ENERGY_KWH
  3435. #define SENSOR_POWER_UNITS POWER_WATTS
  3436. // -----------------------------------------------------------------------------
  3437. // Kogan Smarter Home Plug with Energy Meter (Australia)
  3438. // Product code: KASPEMHA
  3439. // https://www.kogan.com/au/buy/kogan-smarterhome-smart-plug-energy-meter/
  3440. // Reflashing from original Tuya firmware
  3441. // to thirdparty firmware like espurna by:
  3442. // https://github.com/ct-Open-Source/tuya-convert
  3443. // -----------------------------------------------------------------------------
  3444. #elif defined(KOGAN_SMARTER_HOME_PLUG_W_POW)
  3445. // Info
  3446. #define MANUFACTURER "KOGAN"
  3447. #define DEVICE "SMARTER_HOME_PLUG_W_POW"
  3448. // Buttons
  3449. #define BUTTON1_PIN 0
  3450. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  3451. #define BUTTON1_RELAY 1
  3452. // Relays
  3453. #define RELAY1_PIN 14
  3454. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3455. // LED
  3456. // Red
  3457. #define LED1_PIN 13
  3458. #define LED1_MODE LED_MODE_WIFI
  3459. #define LED1_PIN_INVERSE 1
  3460. // Blue connected to relay
  3461. // HLW8012
  3462. #ifndef HLW8012_SUPPORT
  3463. #define HLW8012_SUPPORT 1
  3464. #endif
  3465. #define HLW8012_SEL_PIN 12
  3466. #define HLW8012_CF1_PIN 5
  3467. #define HLW8012_CF_PIN 4
  3468. #define HLW8012_SEL_CURRENT LOW
  3469. #define HLW8012_CURRENT_RATIO 25740
  3470. #define HLW8012_VOLTAGE_RATIO 282060
  3471. #define HLW8012_POWER_RATIO 3414290
  3472. #define HLW8012_INTERRUPT_ON FALLING
  3473. #define SENSOR_ENERGY_UNITS ENERGY_KWH
  3474. #define SENSOR_POWER_UNITS POWER_WATTS
  3475. // -----------------------------------------------------------------------------
  3476. // LSC Smart LED Light Strip (Smart CXonnect Series) available ACTION (Germany)
  3477. // https://www.action.com/de-de/p/lsc-smart-connect-intelligenter-multicolor-led-strip-/
  3478. // Reflashing from original Tuya firmware
  3479. // to thirdparty firmware like espurna by:
  3480. // https://github.com/ct-Open-Source/tuya-convert
  3481. // -----------------------------------------------------------------------------
  3482. #elif defined(LSC_SMART_LED_LIGHT_STRIP)
  3483. // Info
  3484. #define MANUFACTURER "LSC"
  3485. #define DEVICE "SMART_LED_LIGHT_STRIP"
  3486. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3487. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3488. #define DUMMY_RELAY_COUNT 1
  3489. // Light RGBW
  3490. #define LIGHT_CHANNELS 4
  3491. #define LIGHT_CH1_PIN 4 // RED
  3492. #define LIGHT_CH2_PIN 12 // GREEN
  3493. #define LIGHT_CH3_PIN 14 // BLUE
  3494. #define LIGHT_CH4_PIN 13 // WHITE
  3495. // #define LIGHT_CH5_PIN 5 // CW (not connected, but circuit supports it)
  3496. #define LIGHT_CH1_INVERSE 0
  3497. #define LIGHT_CH2_INVERSE 0
  3498. #define LIGHT_CH3_INVERSE 0
  3499. #define LIGHT_CH4_INVERSE 0
  3500. // IR
  3501. #define IR_SUPPORT 1
  3502. #define IR_RX_PIN 0
  3503. #define IR_BUTTON_SET 5
  3504. // -----------------------------------------------------------------------------
  3505. // eHomeDIY WT02
  3506. // https://github.com/eHomeDIY/WT02-hardware
  3507. // -----------------------------------------------------------------------------
  3508. #elif defined(EHOMEDIY_WT02)
  3509. // Info
  3510. #define MANUFACTURER "EHOMEDIY"
  3511. #define DEVICE "WT02"
  3512. #define I2C_SDA_PIN 0
  3513. #define I2C_SCL_PIN 2
  3514. #define BMX280_SUPPORT 1
  3515. // #define SI7021_SUPPORT 1
  3516. // -----------------------------------------------------------------------------
  3517. // eHomeDIY WT03
  3518. // https://github.com/eHomeDIY/WT03-hardware
  3519. // -----------------------------------------------------------------------------
  3520. #elif defined(EHOMEDIY_WT03)
  3521. // Info
  3522. #define MANUFACTURER "EHOMEDIY"
  3523. #define DEVICE "WT03"
  3524. #define I2C_SDA_PIN 2
  3525. #define I2C_SCL_PIN 0
  3526. #define BMX280_SUPPORT 1
  3527. // #define SI7021_SUPPORT 1
  3528. // -----------------------------------------------------------------------------
  3529. // Linksprite R4
  3530. // http://linksprite.com/wiki/index.php?title=LinkNode_R4:_Arduino-compatible_WiFi_relay_controller
  3531. // -----------------------------------------------------------------------------
  3532. #elif defined(LINKSPRITE_LINKNODE_R4)
  3533. // Info
  3534. #define MANUFACTURER "LINKSPRITE"
  3535. #define DEVICE "LINKNODE_R4"
  3536. // Relays
  3537. #define RELAY1_PIN 12
  3538. #define RELAY2_PIN 13
  3539. #define RELAY3_PIN 14
  3540. #define RELAY4_PIN 16
  3541. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3542. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3543. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  3544. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  3545. // -----------------------------------------------------------------------------
  3546. #else
  3547. #error "UNSUPPORTED HARDWARE!!"
  3548. #endif