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.

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