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.

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