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.

4176 lines
134 KiB

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