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.

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