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.

3724 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. // LED
  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 Smart Plug
  1656. // 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
  1657. // -----------------------------------------------------------------------------
  1658. #elif defined(OUKITEL_P1)
  1659. // Info
  1660. #define MANUFACTURER "Oukitel"
  1661. #define DEVICE "P1"
  1662. // Buttons
  1663. #define BUTTON1_PIN 13
  1664. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1665. #define BUTTON1_RELAY 1
  1666. // Relays
  1667. // Right
  1668. #define RELAY1_PIN 12
  1669. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1670. // Left
  1671. #define RELAY2_PIN 15
  1672. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1673. // LEDs
  1674. #define LED1_PIN 0 // blue
  1675. #define LED1_PIN_INVERSE 1
  1676. #define LED1_MODE LED_MODE_WIFI
  1677. // -----------------------------------------------------------------------------
  1678. // YiDian XS-SSA05
  1679. // -----------------------------------------------------------------------------
  1680. #elif defined(YIDIAN_XSSSA05)
  1681. // Info
  1682. #define MANUFACTURER "YIDIAN"
  1683. #define DEVICE "XSSSA05"
  1684. // Buttons
  1685. #define BUTTON1_PIN 13
  1686. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1687. #define BUTTON1_RELAY 1
  1688. // Relays
  1689. #define RELAY1_PIN 12
  1690. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1691. // LEDs
  1692. #define LED1_PIN 0 // red
  1693. #define LED1_PIN_INVERSE 1
  1694. #define LED1_MODE LED_MODE_WIFI
  1695. #define LED2_PIN 15 // blue
  1696. #define LED2_PIN_INVERSE 1
  1697. #define LED2_MODE LED_MODE_RELAY
  1698. // HLW8012
  1699. #ifndef HLW8012_SUPPORT
  1700. #define HLW8012_SUPPORT 1
  1701. #endif
  1702. #define HLW8012_SEL_PIN 3
  1703. #define HLW8012_CF1_PIN 14
  1704. #define HLW8012_CF_PIN 5
  1705. #define HLW8012_SEL_CURRENT LOW
  1706. #define HLW8012_CURRENT_RATIO 25740
  1707. #define HLW8012_VOLTAGE_RATIO 313400
  1708. #define HLW8012_POWER_RATIO 3414290
  1709. #define HLW8012_INTERRUPT_ON FALLING
  1710. // -----------------------------------------------------------------------------
  1711. // TONBUX XS-SSA01
  1712. // -----------------------------------------------------------------------------
  1713. #elif defined(TONBUX_XSSSA01)
  1714. // Info
  1715. #define MANUFACTURER "TONBUX"
  1716. #define DEVICE "XSSSA01"
  1717. // Buttons
  1718. #define BUTTON1_PIN 4
  1719. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1720. #define BUTTON1_RELAY 1
  1721. // Relays
  1722. #define RELAY1_PIN 14
  1723. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1724. // LEDs
  1725. #define LED1_PIN 13
  1726. #define LED1_PIN_INVERSE 0
  1727. // -----------------------------------------------------------------------------
  1728. // TONBUX XS-SSA06
  1729. // -----------------------------------------------------------------------------
  1730. #elif defined(TONBUX_XSSSA06)
  1731. // Info
  1732. #define MANUFACTURER "TONBUX"
  1733. #define DEVICE "XSSSA06"
  1734. // Buttons
  1735. #define BUTTON1_PIN 13
  1736. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1737. #define BUTTON1_RELAY 1
  1738. // Relays
  1739. #define RELAY1_PIN 15
  1740. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1741. // LEDs
  1742. #define LED1_PIN 0 // R - 8 rgb led ring
  1743. #define LED1_PIN_INVERSE 0
  1744. #define LED2_PIN 5 // G
  1745. #define LED2_PIN_INVERSE 0
  1746. #define LED3_PIN 2 // B
  1747. #define LED3_PIN_INVERSE 0
  1748. // -----------------------------------------------------------------------------
  1749. // GREEN ESP8266 RELAY MODULE
  1750. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1751. // -----------------------------------------------------------------------------
  1752. #elif defined(GREEN_ESP8266RELAY)
  1753. // Info
  1754. #define MANUFACTURER "GREEN"
  1755. #define DEVICE "ESP8266RELAY"
  1756. // Buttons
  1757. // Not a button but input via Optocoupler
  1758. #define BUTTON1_PIN 5
  1759. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1760. #define BUTTON1_RELAY 1
  1761. // Relays
  1762. #define RELAY1_PIN 4
  1763. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1764. // LEDs
  1765. #define LED1_PIN 2
  1766. #define LED1_PIN_INVERSE 1
  1767. // -----------------------------------------------------------------------------
  1768. // Henrique Gravina ESPIKE
  1769. // https://github.com/Henriquegravina/Espike
  1770. // -----------------------------------------------------------------------------
  1771. #elif defined(IKE_ESPIKE)
  1772. #define MANUFACTURER "IKE"
  1773. #define DEVICE "ESPIKE"
  1774. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1775. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1776. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1777. #define BUTTON1_PIN 13
  1778. #define BUTTON1_RELAY 1
  1779. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1780. #define BUTTON2_PIN 12
  1781. #define BUTTON2_RELAY 2
  1782. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1783. #define BUTTON3_PIN 14
  1784. #define BUTTON3_RELAY 3
  1785. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1786. #define RELAY1_PIN 4
  1787. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1788. #define RELAY2_PIN 5
  1789. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1790. #define RELAY3_PIN 16
  1791. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1792. #define LED1_PIN 2
  1793. #define LED1_PIN_INVERSE 1
  1794. // -----------------------------------------------------------------------------
  1795. // SWIFITCH
  1796. // https://github.com/ArnieX/swifitch
  1797. // -----------------------------------------------------------------------------
  1798. #elif defined(ARNIEX_SWIFITCH)
  1799. // Info
  1800. #define MANUFACTURER "ARNIEX"
  1801. #define DEVICE "SWIFITCH"
  1802. // Buttons
  1803. #define BUTTON1_PIN 4 // D2
  1804. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1805. #define BUTTON1_RELAY 1
  1806. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1807. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1808. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1809. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1810. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1811. // Relays
  1812. #define RELAY1_PIN 5 // D1
  1813. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1814. // LEDs
  1815. #define LED1_PIN 12 // D6
  1816. #define LED1_PIN_INVERSE 1
  1817. // -----------------------------------------------------------------------------
  1818. // ESP-01S RELAY v4.0
  1819. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  1820. // -----------------------------------------------------------------------------
  1821. #elif defined(GENERIC_ESP01S_RELAY_V40)
  1822. // Info
  1823. #define MANUFACTURER "GENERIC"
  1824. #define DEVICE "ESP01S_RELAY_40"
  1825. // Relays
  1826. #define RELAY1_PIN 0
  1827. #ifndef RELAY1_TYPE
  1828. #define RELAY1_TYPE RELAY_TYPE_NORMAL // See #1504 and #1554
  1829. #endif
  1830. // LEDs
  1831. #define LED1_PIN 2
  1832. #define LED1_PIN_INVERSE 0
  1833. // -----------------------------------------------------------------------------
  1834. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  1835. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  1836. // -----------------------------------------------------------------------------
  1837. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  1838. // Info
  1839. #define MANUFACTURER "GENERIC"
  1840. #define DEVICE "ESP01S_RGBLED_10"
  1841. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  1842. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  1843. // Buttons
  1844. //#define BUTTON1_PIN 2
  1845. // Relays
  1846. //#define RELAY1_PIN 2
  1847. // LEDs
  1848. #define LED1_PIN 2
  1849. #define LED1_PIN_INVERSE 0
  1850. // -----------------------------------------------------------------------------
  1851. // ESP-01S DHT11 v1.0
  1852. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  1853. // -----------------------------------------------------------------------------
  1854. #elif defined(GENERIC_ESP01S_DHT11_V10)
  1855. // Info
  1856. #define MANUFACTURER "GENERIC"
  1857. #define DEVICE "ESP01S_DHT11_10"
  1858. // DHT11
  1859. #ifndef DHT_SUPPORT
  1860. #define DHT_SUPPORT 1
  1861. #endif
  1862. #define DHT_PIN 2
  1863. #define DHT_TYPE DHT_CHIP_DHT11
  1864. // -----------------------------------------------------------------------------
  1865. // ESP-01S DS18B20 v1.0
  1866. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  1867. // -----------------------------------------------------------------------------
  1868. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  1869. // Info
  1870. #define MANUFACTURER "GENERIC"
  1871. #define DEVICE "ESP01S_DS18B20_10"
  1872. // DB18B20
  1873. #ifndef DALLAS_SUPPORT
  1874. #define DALLAS_SUPPORT 1
  1875. #endif
  1876. #define DALLAS_PIN 2
  1877. // -----------------------------------------------------------------------------
  1878. // ESP-DIN relay board V1
  1879. // https://github.com/pilotak/esp_din
  1880. // -----------------------------------------------------------------------------
  1881. #elif defined(PILOTAK_ESP_DIN_V1)
  1882. // Info
  1883. #define MANUFACTURER "PILOTAK"
  1884. #define DEVICE "ESP_DIN_V1"
  1885. // Buttons
  1886. #define BUTTON1_PIN 0
  1887. #define BUTTON1_RELAY 1
  1888. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1889. // Relays
  1890. #define RELAY1_PIN 4
  1891. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1892. #define RELAY2_PIN 5
  1893. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1894. // LEDs
  1895. #define LED1_PIN 15
  1896. #define LED1_PIN_INVERSE 0
  1897. #define I2C_SDA_PIN 12
  1898. #define I2C_SCL_PIN 13
  1899. #ifndef DALLAS_SUPPORT
  1900. #define DALLAS_SUPPORT 1
  1901. #endif
  1902. #define DALLAS_PIN 2
  1903. #ifndef RF_SUPPORT
  1904. #define RF_SUPPORT 1
  1905. #endif
  1906. #define RF_PIN 14
  1907. #ifndef DIGITAL_SUPPORT
  1908. #define DIGITAL_SUPPORT 1
  1909. #endif
  1910. #define DIGITAL_PIN 16
  1911. #define DIGITAL_PIN_MODE INPUT
  1912. // -----------------------------------------------------------------------------
  1913. // Heltec Touch Relay
  1914. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  1915. // -----------------------------------------------------------------------------
  1916. #elif defined(HELTEC_TOUCHRELAY)
  1917. // Info
  1918. #define MANUFACTURER "HELTEC"
  1919. #define DEVICE "TOUCH_RELAY"
  1920. // Buttons
  1921. #define BUTTON1_PIN 14
  1922. #define BUTTON1_RELAY 1
  1923. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1924. // Relays
  1925. #define RELAY1_PIN 12
  1926. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1927. // -----------------------------------------------------------------------------
  1928. // Zhilde ZLD-EU44-W
  1929. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  1930. // -----------------------------------------------------------------------------
  1931. #elif defined(ZHILDE_EU44_W)
  1932. // Info
  1933. #define MANUFACTURER "ZHILDE"
  1934. #define DEVICE "EU44_W"
  1935. // Based on the reporter, this product uses GPIO1 and 3 for the button
  1936. // and onboard LED, so hardware serial should be disabled...
  1937. #define DEBUG_SERIAL_SUPPORT 0
  1938. // Buttons
  1939. #define BUTTON1_PIN 3
  1940. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1941. // Relays
  1942. #define RELAY1_PIN 5
  1943. #define RELAY2_PIN 4
  1944. #define RELAY3_PIN 12
  1945. #define RELAY4_PIN 13
  1946. #define RELAY5_PIN 14
  1947. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1948. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1949. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1950. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1951. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1952. // LEDs
  1953. #define LED1_PIN 1
  1954. #define LED1_PIN_INVERSE 1
  1955. // -----------------------------------------------------------------------------
  1956. // Allnet 4duino ESP8266-UP-Relais
  1957. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  1958. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  1959. // -----------------------------------------------------------------------------
  1960. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  1961. // Info
  1962. #define MANUFACTURER "ALLNET"
  1963. #define DEVICE "4DUINO_IOT_WLAN_RELAIS"
  1964. // Relays
  1965. #define RELAY1_PIN 14
  1966. #define RELAY1_RESET_PIN 12
  1967. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1968. // LEDs
  1969. #define LED1_PIN 0
  1970. #define LED1_PIN_INVERSE 1
  1971. // Buttons
  1972. //#define BUTTON1_PIN 0
  1973. //#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1974. // Using pins labelled as SDA & SCL as buttons
  1975. #define BUTTON2_PIN 4
  1976. #define BUTTON2_MODE BUTTON_PUSHBUTTON
  1977. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  1978. #define BUTTON2_CLICK BUTTON_MODE_NONE
  1979. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  1980. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  1981. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  1982. #define BUTTON3_PIN 5
  1983. #define BUTTON3_MODE BUTTON_PUSHBUTTON
  1984. // Using pins labelled as SDA & SCL for I2C
  1985. //#define I2C_SDA_PIN 4
  1986. //#define I2C_SCL_PIN 5
  1987. // -----------------------------------------------------------------------------
  1988. // Luani HVIO
  1989. // https://luani.de/projekte/esp8266-hvio/
  1990. // https://luani.de/blog/esp8266-230v-io-modul/
  1991. // -----------------------------------------------------------------------------
  1992. #elif defined(LUANI_HVIO)
  1993. // Info
  1994. #define MANUFACTURER "LUANI"
  1995. #define DEVICE "HVIO"
  1996. // Buttons
  1997. #define BUTTON1_PIN 12
  1998. #define BUTTON1_RELAY 1
  1999. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  2000. #define BUTTON1_PRESS BUTTON_MODE_NONE
  2001. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  2002. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2003. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2004. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  2005. #define BUTTON2_PIN 13
  2006. #define BUTTON2_RELAY 2
  2007. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  2008. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  2009. // Relays
  2010. #define RELAY1_PIN 4
  2011. #define RELAY2_PIN 5
  2012. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2013. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2014. // LEDs
  2015. #define LED1_PIN 15
  2016. #define LED1_PIN_INVERSE 0
  2017. // -----------------------------------------------------------------------------
  2018. // Tonbux 50-100M Smart Mosquito Killer USB
  2019. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  2020. // -----------------------------------------------------------------------------
  2021. #elif defined(TONBUX_MOSQUITO_KILLER)
  2022. // Info
  2023. #define MANUFACTURER "TONBUX"
  2024. #define DEVICE "MOSQUITO_KILLER"
  2025. // Buttons
  2026. #define BUTTON1_PIN 2
  2027. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2028. #define BUTTON1_RELAY 1
  2029. // Relays
  2030. #define RELAY1_PIN 5 // not a relay, fan
  2031. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2032. // LEDs
  2033. #define LED1_PIN 15 // blue led
  2034. #define LED1_PIN_INVERSE 1
  2035. #define LED1_MODE LED_MODE_WIFI
  2036. #define LED2_PIN 14 // red led
  2037. #define LED2_PIN_INVERSE 1
  2038. #define LED2_MODE LED_MODE_RELAY
  2039. #define LED3_PIN 12 // UV leds (1-2-3-4-5-6-7-8)
  2040. #define LED3_PIN_INVERSE 0
  2041. #define LED3_RELAY 1
  2042. #define LED4_PIN 16 // UV leds (9-10-11)
  2043. #define LED4_PIN_INVERSE 0
  2044. #define LED4_RELAY 1
  2045. // -----------------------------------------------------------------------------
  2046. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  2047. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  2048. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  2049. // -----------------------------------------------------------------------------
  2050. #elif defined(NEO_COOLCAM_NAS_WR01W)
  2051. // Info
  2052. #define MANUFACTURER "NEO_COOLCAM"
  2053. #define DEVICE "NAS_WR01W"
  2054. // Buttons
  2055. #define BUTTON1_PIN 13
  2056. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2057. #define BUTTON1_RELAY 1
  2058. // Relays
  2059. #define RELAY1_PIN 12
  2060. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2061. // LEDs
  2062. #define LED1_PIN 4
  2063. #define LED1_PIN_INVERSE 1
  2064. // ------------------------------------------------------------------------------
  2065. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  2066. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  2067. // Also: Estink Wifi Power Strip
  2068. // -----------------------------------------------------------------------------
  2069. #elif defined(FORNORM_ZLD_34EU)
  2070. // Info
  2071. #define MANUFACTURER "FORNORM"
  2072. #define DEVICE "ZLD_34EU"
  2073. // Disable UART noise since this board uses GPIO3
  2074. #define DEBUG_SERIAL_SUPPORT 0
  2075. // Buttons
  2076. #define BUTTON1_PIN 16
  2077. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2078. #define BUTTON1_RELAY 4
  2079. // Relays
  2080. #define RELAY1_PIN 14 // USB power
  2081. #define RELAY2_PIN 13 // power plug 1
  2082. #define RELAY3_PIN 4 // power plug 2
  2083. #define RELAY4_PIN 15 // power plug 3
  2084. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2085. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2086. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2087. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2088. // LEDs
  2089. #define LED1_PIN 0 // power led
  2090. #define LED2_PIN 12 // power plug 1
  2091. #define LED3_PIN 3 // power plug 2
  2092. #define LED4_PIN 5 // power plug 3
  2093. #define LED1_PIN_INVERSE 1
  2094. #define LED2_PIN_INVERSE 1
  2095. #define LED3_PIN_INVERSE 1
  2096. #define LED4_PIN_INVERSE 1
  2097. #define LED1_MODE LED_MODE_FINDME
  2098. #define LED2_MODE LED_MODE_FOLLOW
  2099. #define LED3_MODE LED_MODE_FOLLOW
  2100. #define LED4_MODE LED_MODE_FOLLOW
  2101. #define LED2_RELAY 2
  2102. #define LED3_RELAY 3
  2103. #define LED4_RELAY 4
  2104. // -----------------------------------------------------------------------------
  2105. // Bruno Horta's OnOfre
  2106. // https://www.bhonofre.pt/
  2107. // https://github.com/brunohorta82/BH_OnOfre/
  2108. // -----------------------------------------------------------------------------
  2109. #elif defined(BH_ONOFRE)
  2110. // Info
  2111. #define MANUFACTURER "BH"
  2112. #define DEVICE "ONOFRE"
  2113. // Buttons
  2114. #define BUTTON1_PIN 12
  2115. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2116. #define BUTTON1_RELAY 1
  2117. #define BUTTON2_PIN 13
  2118. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2119. #define BUTTON2_RELAY 2
  2120. // Relays
  2121. #define RELAY1_PIN 4
  2122. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2123. #define RELAY2_PIN 5
  2124. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2125. // -----------------------------------------------------------------------------
  2126. // BlitzWolf SHP2 and SHP6
  2127. // Also several boards under different names uing a power chip labelled BL0937 or HJL-01
  2128. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  2129. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  2130. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  2131. // * Gosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  2132. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  2133. // -----------------------------------------------------------------------------
  2134. #elif defined(BLITZWOLF_BWSHPX)
  2135. // Info
  2136. #define MANUFACTURER "BLITZWOLF"
  2137. #define DEVICE "BWSHPX"
  2138. // Buttons
  2139. #define BUTTON1_PIN 13
  2140. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2141. #define BUTTON1_RELAY 1
  2142. // Relays
  2143. #define RELAY1_PIN 15
  2144. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2145. // LEDs
  2146. #define LED1_PIN 2
  2147. #define LED1_PIN_INVERSE 1
  2148. #define LED2_PIN 0
  2149. #define LED2_PIN_INVERSE 1
  2150. #define LED2_MODE LED_MODE_FINDME
  2151. #define LED2_RELAY 1
  2152. // HJL01 / BL0937
  2153. #ifndef HLW8012_SUPPORT
  2154. #define HLW8012_SUPPORT 1
  2155. #endif
  2156. #define HLW8012_SEL_PIN 12
  2157. #define HLW8012_CF1_PIN 14
  2158. #define HLW8012_CF_PIN 5
  2159. #define HLW8012_SEL_CURRENT LOW
  2160. #define HLW8012_CURRENT_RATIO 25740
  2161. #define HLW8012_VOLTAGE_RATIO 313400
  2162. #define HLW8012_POWER_RATIO 3414290
  2163. #define HLW8012_INTERRUPT_ON FALLING
  2164. // -----------------------------------------------------------------------------
  2165. // Same as the above but new board version marked V2.3
  2166. // BlitzWolf SHP2 V2.3
  2167. // Gosund SP1 V2.3
  2168. // -----------------------------------------------------------------------------
  2169. #elif defined(BLITZWOLF_BWSHPX_V23)
  2170. // Info
  2171. #define MANUFACTURER "BLITZWOLF"
  2172. #define DEVICE "BWSHPX_V23"
  2173. // Buttons
  2174. #define BUTTON1_PIN 3
  2175. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2176. #define BUTTON1_RELAY 1
  2177. // Relays
  2178. #define RELAY1_PIN 14
  2179. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2180. // LEDs
  2181. #define LED1_PIN 1
  2182. #define LED1_PIN_INVERSE 1
  2183. #define LED2_PIN 13
  2184. #define LED2_PIN_INVERSE 1
  2185. #define LED2_MODE LED_MODE_FINDME
  2186. #define LED2_RELAY 1
  2187. // HJL01 / BL0937
  2188. #ifndef HLW8012_SUPPORT
  2189. #define HLW8012_SUPPORT 1
  2190. #endif
  2191. #define HLW8012_SEL_PIN 12
  2192. #define HLW8012_CF1_PIN 5
  2193. #define HLW8012_CF_PIN 4
  2194. #define HLW8012_SEL_CURRENT LOW
  2195. #define HLW8012_CURRENT_RATIO 25740
  2196. #define HLW8012_VOLTAGE_RATIO 313400
  2197. #define HLW8012_POWER_RATIO 3414290
  2198. #define HLW8012_INTERRUPT_ON FALLING
  2199. // -----------------------------------------------------------------------------
  2200. // Teckin SP22 v1.4 - v1.6
  2201. // -----------------------------------------------------------------------------
  2202. #elif defined(TECKIN_SP22_V14)
  2203. // Info
  2204. #define MANUFACTURER "TECKIN"
  2205. #define DEVICE "SP22_V14"
  2206. // Buttons
  2207. #define BUTTON1_PIN 1
  2208. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2209. #define BUTTON1_RELAY 1
  2210. // Relays
  2211. #define RELAY1_PIN 14
  2212. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2213. // LEDs
  2214. #define LED1_PIN 3
  2215. #define LED1_PIN_INVERSE 1
  2216. #define LED2_PIN 13
  2217. #define LED2_PIN_INVERSE 1
  2218. #define LED2_MODE LED_MODE_FINDME
  2219. #define LED2_RELAY 1
  2220. // HJL01 / BL0937
  2221. #ifndef HLW8012_SUPPORT
  2222. #define HLW8012_SUPPORT 1
  2223. #endif
  2224. #define HLW8012_SEL_PIN 12
  2225. #define HLW8012_CF1_PIN 5
  2226. #define HLW8012_CF_PIN 4
  2227. #define HLW8012_SEL_CURRENT LOW
  2228. #define HLW8012_CURRENT_RATIO 20730
  2229. #define HLW8012_VOLTAGE_RATIO 264935
  2230. #define HLW8012_POWER_RATIO 2533110
  2231. #define HLW8012_INTERRUPT_ON FALLING
  2232. // -----------------------------------------------------------------------------
  2233. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  2234. // Also model number KS-602S
  2235. // -----------------------------------------------------------------------------
  2236. #elif defined(GOSUND_WS1)
  2237. // Info
  2238. #define MANUFACTURER "GOSUND"
  2239. #define DEVICE "WS1"
  2240. // Buttons
  2241. #define BUTTON1_PIN 0
  2242. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2243. #define BUTTON1_RELAY 1
  2244. // Relays
  2245. #define RELAY1_PIN 14
  2246. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2247. // LEDs
  2248. #define LED1_PIN 1
  2249. #define LED1_PIN_INVERSE 1
  2250. // ----------------------------------------------------------------------------------------
  2251. // Homecube 16A is similar but some pins differ and it also has RGB LEDs
  2252. // https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
  2253. // ----------------------------------------------------------------------------------------
  2254. #elif defined(HOMECUBE_16A)
  2255. // Info
  2256. #define MANUFACTURER "HOMECUBE"
  2257. #define DEVICE "16A"
  2258. // Buttons
  2259. #define BUTTON1_PIN 13
  2260. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2261. #define BUTTON1_RELAY 1
  2262. // Relays
  2263. #define RELAY1_PIN 15
  2264. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2265. // LEDs
  2266. //LED Pin 4 - ESP8266 onboard LED
  2267. //Red LED: 0
  2268. //Green LED: 12
  2269. //Blue LED: 2
  2270. // Blue
  2271. #define LED1_PIN 2
  2272. #define LED1_PIN_INVERSE 0
  2273. // Green
  2274. #define LED2_PIN 12
  2275. #define LED2_PIN_INVERSE 1
  2276. #define LED2_MODE LED_MODE_RELAY
  2277. // Red
  2278. #define LED3_PIN 0
  2279. #define LED3_PIN_INVERSE 0
  2280. #define LED3_MODE LED_MODE_OFF
  2281. // HJL01 / BL0937
  2282. #ifndef HLW8012_SUPPORT
  2283. #define HLW8012_SUPPORT 1
  2284. #endif
  2285. #define HLW8012_SEL_PIN 16
  2286. #define HLW8012_CF1_PIN 14
  2287. #define HLW8012_CF_PIN 5
  2288. #define HLW8012_SEL_CURRENT LOW
  2289. #define HLW8012_CURRENT_RATIO 25740
  2290. #define HLW8012_VOLTAGE_RATIO 313400
  2291. #define HLW8012_POWER_RATIO 3414290
  2292. #define HLW8012_INTERRUPT_ON FALLING
  2293. // -----------------------------------------------------------------------------
  2294. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  2295. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  2296. // -----------------------------------------------------------------------------
  2297. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  2298. // Info
  2299. #define MANUFACTURER "VANZAVANZU"
  2300. #define DEVICE "SMART_WIFI_PLUG_MINI"
  2301. // Buttons
  2302. #define BUTTON1_PIN 13
  2303. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2304. #define BUTTON1_RELAY 1
  2305. // Relays
  2306. #define RELAY1_PIN 15
  2307. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2308. // LEDs
  2309. #define LED1_PIN 2
  2310. #define LED1_PIN_INVERSE 1
  2311. #define LED2_PIN 0
  2312. #define LED2_PIN_INVERSE 1
  2313. #define LED2_MODE LED_MODE_FINDME
  2314. #define LED2_RELAY 1
  2315. // Disable UART noise
  2316. #define DEBUG_SERIAL_SUPPORT 0
  2317. // HJL01 / BL0937
  2318. #ifndef HLW8012_SUPPORT
  2319. #define HLW8012_SUPPORT 1
  2320. #endif
  2321. #define HLW8012_SEL_PIN 3
  2322. #define HLW8012_CF1_PIN 14
  2323. #define HLW8012_CF_PIN 5
  2324. #define HLW8012_SEL_CURRENT LOW
  2325. #define HLW8012_CURRENT_RATIO 25740
  2326. #define HLW8012_VOLTAGE_RATIO 313400
  2327. #define HLW8012_POWER_RATIO 3414290
  2328. #define HLW8012_INTERRUPT_ON FALLING
  2329. // -----------------------------------------------------------------------------
  2330. #elif defined(GENERIC_AG_L4)
  2331. // Info
  2332. #define MANUFACTURER "GENERIC"
  2333. #define DEVICE "AG_L4"
  2334. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2335. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2336. #define DUMMY_RELAY_COUNT 1
  2337. // button 1: "power" button
  2338. #define BUTTON1_PIN 4
  2339. #define BUTTON1_RELAY 1
  2340. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2341. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  2342. #define BUTTON1_CLICK BUTTON_MODE_NONE
  2343. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2344. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2345. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  2346. // button 2: "wifi" button
  2347. #define BUTTON2_PIN 2
  2348. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2349. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  2350. #define BUTTON2_CLICK BUTTON_MODE_NONE
  2351. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  2352. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  2353. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  2354. // LEDs
  2355. #define LED1_PIN 5 // red status led
  2356. #define LED1_PIN_INVERSE 0
  2357. #define LED2_PIN 16 // master light power
  2358. #define LED2_PIN_INVERSE 1
  2359. #define LED2_MODE LED_MODE_RELAY
  2360. // Light
  2361. #define LIGHT_CHANNELS 3
  2362. #define LIGHT_CH1_PIN 14 // RED
  2363. #define LIGHT_CH2_PIN 13 // GREEN
  2364. #define LIGHT_CH3_PIN 12 // BLUE
  2365. #define LIGHT_CH1_INVERSE 0
  2366. #define LIGHT_CH2_INVERSE 0
  2367. #define LIGHT_CH3_INVERSE 0
  2368. // -----------------------------------------------------------------------------
  2369. #elif defined(ALLTERCO_SHELLY1)
  2370. // Info
  2371. #define MANUFACTURER "ALLTERCO"
  2372. #define DEVICE "SHELLY1"
  2373. // Buttons
  2374. #define BUTTON1_PIN 5
  2375. #define BUTTON1_MODE BUTTON_SWITCH
  2376. #define BUTTON1_RELAY 1
  2377. // Relays
  2378. #define RELAY1_PIN 4
  2379. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2380. #elif defined(ALLTERCO_SHELLY2)
  2381. // Info
  2382. #define MANUFACTURER "ALLTERCO"
  2383. #define DEVICE "SHELLY2"
  2384. // Buttons
  2385. #define BUTTON1_PIN 12
  2386. #define BUTTON2_PIN 14
  2387. #define BUTTON1_MODE BUTTON_SWITCH
  2388. #define BUTTON2_MODE BUTTON_SWITCH
  2389. #define BUTTON1_RELAY 1
  2390. #define BUTTON2_RELAY 2
  2391. // Relays
  2392. #define RELAY1_PIN 4
  2393. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2394. #define RELAY2_PIN 5
  2395. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2396. // -----------------------------------------------------------------------------
  2397. #elif defined(LOHAS_9W)
  2398. // Info
  2399. #define MANUFACTURER "LOHAS"
  2400. #define DEVICE "E27_9W"
  2401. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2402. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2403. #define DUMMY_RELAY_COUNT 1
  2404. // Light
  2405. #define LIGHT_CHANNELS 5
  2406. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2407. #define MY92XX_CHIPS 2
  2408. #define MY92XX_DI_PIN 13
  2409. #define MY92XX_DCKI_PIN 15
  2410. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2411. #define MY92XX_MAPPING 0, 1, 2, 3, 4
  2412. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  2413. // -----------------------------------------------------------------------------
  2414. #elif defined(XIAOMI_SMART_DESK_LAMP)
  2415. // Info
  2416. #define MANUFACTURER "XIAOMI"
  2417. #define DEVICE "SMART_DESK_LAMP"
  2418. // Buttons
  2419. #define BUTTON1_PIN 2
  2420. #define BUTTON2_PIN 14
  2421. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2422. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2423. // This button doubles as switch here and as encoder mode switch below
  2424. // Clicking it (for less than 500ms) will turn the light on and off
  2425. // Double and Long clicks will not work as these are used to modify the encoder action
  2426. #define BUTTON1_RELAY 1
  2427. #define BUTTON_LNGCLICK_DELAY 500
  2428. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2429. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2430. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  2431. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  2432. #define BUTTON2_DBLCLICK BUTTON_MODE_AP
  2433. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  2434. // Light
  2435. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2436. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2437. #define DUMMY_RELAY_COUNT 1
  2438. #define LIGHT_STEP 8
  2439. #define LIGHT_CHANNELS 2
  2440. #define LIGHT_CH1_PIN 5 // warm white
  2441. #define LIGHT_CH1_INVERSE 0
  2442. #define LIGHT_CH2_PIN 4 // cold white
  2443. #define LIGHT_CH2_INVERSE 0
  2444. // Encoder
  2445. // If mode is ENCODER_MODE_RATIO, the value ratio between both channels is changed
  2446. // when the button is not pressed, and the overall brightness when pressed
  2447. // If mode is ENCODER_MODE_CHANNEL, the first channel value is changed
  2448. // when the button is not pressed, and the second channel when pressed
  2449. // If no ENCODERX_BUTTON_PIN defined it will only change the value of the first defined channel
  2450. #define ENCODER_SUPPORT 1
  2451. #define ENCODER1_PIN1 12
  2452. #define ENCODER1_PIN2 13
  2453. #define ENCODER1_BUTTON_PIN 2 // active low by default, with software pullup
  2454. #define ENCODER1_CHANNEL1 0 // please note this value is 0-based (LIGHT_CH1 above)
  2455. #define ENCODER1_CHANNEL2 1 // please note this value is 0-based (LIGHT_CH2 above)
  2456. #define ENCODER1_MODE ENCODER_MODE_RATIO
  2457. #elif defined(PHYX_ESP12_RGB)
  2458. // Info
  2459. #define MANUFACTURER "PHYX"
  2460. #define DEVICE "ESP12_RGB"
  2461. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2462. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2463. #define DUMMY_RELAY_COUNT 1
  2464. // Light
  2465. #define LIGHT_CHANNELS 3
  2466. #define LIGHT_CH1_PIN 4 // RED
  2467. #define LIGHT_CH2_PIN 14 // GREEN
  2468. #define LIGHT_CH3_PIN 12 // BLUE
  2469. #define LIGHT_CH1_INVERSE 0
  2470. #define LIGHT_CH2_INVERSE 0
  2471. #define LIGHT_CH3_INVERSE 0
  2472. // -----------------------------------------------------------------------------
  2473. // iWoole LED Table Lamp
  2474. // 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
  2475. // -----------------------------------------------------------------------------
  2476. #elif defined(IWOOLE_LED_TABLE_LAMP)
  2477. // Info
  2478. #define MANUFACTURER "IWOOLE"
  2479. #define DEVICE "LED_TABLE_LAMP"
  2480. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2481. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2482. #define DUMMY_RELAY_COUNT 1
  2483. // Light
  2484. #define LIGHT_CHANNELS 4
  2485. #define LIGHT_CH1_PIN 12 // RED
  2486. #define LIGHT_CH2_PIN 5 // GREEN
  2487. #define LIGHT_CH3_PIN 14 // BLUE
  2488. #define LIGHT_CH4_PIN 4 // WHITE
  2489. #define LIGHT_CH1_INVERSE 0
  2490. #define LIGHT_CH2_INVERSE 0
  2491. #define LIGHT_CH3_INVERSE 0
  2492. #define LIGHT_CH4_INVERSE 0
  2493. // -----------------------------------------------------------------------------
  2494. // Generic GU10
  2495. // https://www.ebay.com/itm/1-10PC-GU10-RGB-Smart-Bulb-Wireless-WiFi-App-Remote-Ctrl-Light-for-Alexa-Google/173724116351
  2496. // -----------------------------------------------------------------------------
  2497. #elif defined(GENERIC_GU10)
  2498. // Info
  2499. #define MANUFACTURER "GENERIC"
  2500. #define DEVICE "GU10"
  2501. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2502. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2503. #define DUMMY_RELAY_COUNT 1
  2504. // Light
  2505. #define LIGHT_CHANNELS 4
  2506. #define LIGHT_CH1_PIN 14 // RED
  2507. #define LIGHT_CH2_PIN 12 // GREEN
  2508. #define LIGHT_CH3_PIN 13 // BLUE
  2509. #define LIGHT_CH4_PIN 4 // WHITE
  2510. #define LIGHT_CH1_INVERSE 0
  2511. #define LIGHT_CH2_INVERSE 0
  2512. #define LIGHT_CH3_INVERSE 0
  2513. #define LIGHT_CH4_INVERSE 0
  2514. // -----------------------------------------------------------------------------
  2515. // Lombex Lux Nova 2 Tunable White
  2516. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2517. // -----------------------------------------------------------------------------
  2518. #elif defined(LOMBEX_LUX_NOVA2_TUNABLE_WHITE)
  2519. // Info
  2520. #define MANUFACTURER "LOMBEX"
  2521. #define DEVICE "LUX_NOVA2_TUNABLE_WHITE"
  2522. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2523. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2524. #define DUMMY_RELAY_COUNT 1
  2525. // Light
  2526. #define LIGHT_CHANNELS 5
  2527. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2528. #define MY92XX_CHIPS 1
  2529. #define MY92XX_DI_PIN 4
  2530. #define MY92XX_DCKI_PIN 5
  2531. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2532. // No RGB on this bulb. Warm white on channel 0, cool white on channel 3
  2533. #define MY92XX_MAPPING 255, 255, 255, 3, 0
  2534. // -----------------------------------------------------------------------------
  2535. // Lombex Lux Nova 2 White and Color
  2536. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2537. // -----------------------------------------------------------------------------
  2538. #elif defined(LOMBEX_LUX_NOVA2_WHITE_COLOR)
  2539. // Info
  2540. #define MANUFACTURER "LOMBEX"
  2541. #define DEVICE "LUX_NOVA2_WHITE_COLOR"
  2542. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2543. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2544. #define DUMMY_RELAY_COUNT 1
  2545. // Light
  2546. #define LIGHT_CHANNELS 4
  2547. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2548. #define MY92XX_CHIPS 1
  2549. #define MY92XX_DI_PIN 4
  2550. #define MY92XX_DCKI_PIN 5
  2551. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2552. // RGB on channels 0/1/2, either cool or warm white on channel 3
  2553. // The bulb *should* have cool leds, but could also have warm leds as a common defect
  2554. #define MY92XX_MAPPING 0, 1, 2, 3
  2555. // -----------------------------------------------------------------------------
  2556. // Bestek Smart Plug with 2 USB ports
  2557. // https://www.bestekcorp.com/bestek-smart-plug-works-with-amazon-alexa-google-assistant-and-ifttt-with-2-usb
  2558. // -----------------------------------------------------------------------------
  2559. #elif defined(BESTEK_MRJ1011)
  2560. // Info
  2561. #define MANUFACTURER "BESTEK"
  2562. #define DEVICE "MRJ1011"
  2563. // Buttons
  2564. #define BUTTON1_PIN 13
  2565. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2566. #define BUTTON1_RELAY 1
  2567. // Relay
  2568. #define RELAY1_PIN 12
  2569. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2570. // LED
  2571. #define LED1_PIN 4
  2572. #define LED1_PIN_INVERSE 1
  2573. // -----------------------------------------------------------------------------
  2574. // GBLIFE RGBW SOCKET
  2575. // -----------------------------------------------------------------------------
  2576. #elif defined(GBLIFE_RGBW_SOCKET)
  2577. // Info
  2578. #define MANUFACTURER "GBLIFE"
  2579. #define DEVICE "RGBW_SOCKET"
  2580. // Buttons
  2581. #define BUTTON1_PIN 13
  2582. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2583. #define BUTTON1_RELAY 1
  2584. // Relays
  2585. #define RELAY1_PIN 15
  2586. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2587. // Light RGBW
  2588. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2589. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2590. #define DUMMY_RELAY_COUNT 1
  2591. #define LIGHT_CHANNELS 4
  2592. #define LIGHT_CH1_PIN 5 // RED
  2593. #define LIGHT_CH2_PIN 14 // GREEN
  2594. #define LIGHT_CH3_PIN 12 // BLUE
  2595. #define LIGHT_CH4_PIN 4 // WHITE
  2596. #define LIGHT_CH1_INVERSE 0
  2597. #define LIGHT_CH2_INVERSE 0
  2598. #define LIGHT_CH3_INVERSE 0
  2599. #define LIGHT_CH4_INVERSE 0
  2600. // ----------------------------------------------------------------------------------------
  2601. // Smart life Mini Smart Socket is similar Homecube 16A but some GPIOs differ
  2602. // https://www.ebay.de/itm/Smart-Steckdose-WIFI-WLAN-Amazon-Alexa-Fernbedienung-Home-Socket-Zeitschaltuh-DE/123352026749?hash=item1cb85a8e7d:g:IasAAOSwk6dbj390
  2603. // Also labeled NETVIP
  2604. // https://www.amazon.es/Inteligente-NETVIP-Inal%C3%A1mbrico-Interruptor-Funciona/dp/B07KH8YWS5
  2605. // ----------------------------------------------------------------------------------------
  2606. #elif defined(SMARTLIFE_MINI_SMART_SOCKET)
  2607. // Info
  2608. #define MANUFACTURER "SMARTLIFE"
  2609. #define DEVICE "MINI_SMART_SOCKET"
  2610. // Buttons
  2611. #define BUTTON1_PIN 13
  2612. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2613. #define BUTTON1_RELAY 1
  2614. // Relays
  2615. #define RELAY1_PIN 15
  2616. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2617. // LEDs
  2618. //Red LED: 0
  2619. //Green LED: 4
  2620. //Blue LED: 2
  2621. // Light
  2622. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2623. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2624. #define DUMMY_RELAY_COUNT 1
  2625. #define LIGHT_CHANNELS 3
  2626. #define LIGHT_CH1_PIN 0 // RED
  2627. #define LIGHT_CH2_PIN 4 // GREEN
  2628. #define LIGHT_CH3_PIN 2 // BLUE
  2629. #define LIGHT_CH1_INVERSE 0
  2630. #define LIGHT_CH2_INVERSE 0
  2631. #define LIGHT_CH3_INVERSE 0
  2632. // HJL01 / BL0937
  2633. #ifndef HLW8012_SUPPORT
  2634. #define HLW8012_SUPPORT 1
  2635. #endif
  2636. #define HLW8012_SEL_PIN 12
  2637. #define HLW8012_CF1_PIN 14
  2638. #define HLW8012_CF_PIN 5
  2639. #define HLW8012_SEL_CURRENT LOW
  2640. #define HLW8012_CURRENT_RATIO 25740
  2641. #define HLW8012_VOLTAGE_RATIO 313400
  2642. #define HLW8012_POWER_RATIO 3414290
  2643. #define HLW8012_INTERRUPT_ON FALLING
  2644. // ----------------------------------------------------------------------------------------
  2645. // Hama WiFi Steckdose (00176533)
  2646. // https://at.hama.com/00176533/hama-wifi-steckdose-3500w-16a
  2647. // ----------------------------------------------------------------------------------------
  2648. #elif defined(HAMA_WIFI_STECKDOSE_00176533)
  2649. // Info
  2650. #define MANUFACTURER "HAMA"
  2651. #define DEVICE "WIFI_STECKDOSE_00176533"
  2652. // Buttons
  2653. #define BUTTON1_PIN 13
  2654. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2655. #define BUTTON1_RELAY 1
  2656. // Relays
  2657. #define RELAY1_PIN 12
  2658. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2659. // LEDs
  2660. #define LED1_PIN 4
  2661. #define LED1_PIN_INVERSE 1
  2662. // -----------------------------------------------------------------------------
  2663. // Oxaoxe NX-SP202
  2664. // Digoo NX-SP202 (not tested)
  2665. // Digoo DG-SP202 (not tested)
  2666. // https://github.com/xoseperez/espurna/issues/1502
  2667. // -----------------------------------------------------------------------------
  2668. #elif defined(DIGOO_NX_SP202)
  2669. // Info
  2670. #define MANUFACTURER "DIGOO"
  2671. #define DEVICE "NX_SP202"
  2672. // Buttons
  2673. #define BUTTON1_PIN 0
  2674. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2675. #define BUTTON1_RELAY 1
  2676. #define BUTTON2_PIN 16
  2677. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2678. #define BUTTON2_RELAY 2
  2679. // Relays
  2680. #define RELAY1_PIN 15
  2681. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2682. #define RELAY2_PIN 14
  2683. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2684. // LEDs
  2685. #define LED1_PIN 13
  2686. #define LED1_PIN_INVERSE 1
  2687. // HJL01 / BL0937
  2688. #ifndef HLW8012_SUPPORT
  2689. #define HLW8012_SUPPORT 1
  2690. #endif
  2691. #define HLW8012_SEL_PIN 12
  2692. #define HLW8012_CF1_PIN 5
  2693. #define HLW8012_CF_PIN 4
  2694. #define HLW8012_SEL_CURRENT LOW
  2695. #define HLW8012_CURRENT_RATIO 23296
  2696. #define HLW8012_VOLTAGE_RATIO 310085
  2697. #define HLW8012_POWER_RATIO 3368471
  2698. #define HLW8012_INTERRUPT_ON FALLING
  2699. // -----------------------------------------------------------------------------
  2700. // Foxel's LightFox dual
  2701. // https://github.com/foxel/esp-dual-rf-switch
  2702. // -----------------------------------------------------------------------------
  2703. #elif defined(FOXEL_LIGHTFOX_DUAL)
  2704. // Info
  2705. #define MANUFACTURER "FOXEL"
  2706. #define DEVICE "LIGHTFOX_DUAL"
  2707. #define SERIAL_BAUDRATE 19200
  2708. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  2709. #define DUMMY_RELAY_COUNT 2
  2710. #define DEBUG_SERIAL_SUPPORT 0
  2711. // Buttons
  2712. #define BUTTON1_RELAY 1
  2713. #define BUTTON2_RELAY 2
  2714. #define BUTTON3_RELAY 2
  2715. #define BUTTON4_RELAY 1
  2716. // -----------------------------------------------------------------------------
  2717. // Teckin SP20
  2718. // -----------------------------------------------------------------------------
  2719. #elif defined(TECKIN_SP20)
  2720. // Info
  2721. #define MANUFACTURER "TECKIN"
  2722. #define DEVICE "SP20"
  2723. // Buttons
  2724. #define BUTTON1_PIN 13
  2725. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2726. #define BUTTON1_RELAY 1
  2727. // Relays
  2728. #define RELAY1_PIN 4
  2729. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2730. // LEDs
  2731. #define LED1_PIN 2
  2732. #define LED1_PIN_INVERSE 1
  2733. #define LED2_PIN 0
  2734. #define LED2_PIN_INVERSE 1
  2735. #define LED2_MODE LED_MODE_FINDME
  2736. #define LED2_RELAY 0
  2737. // HJL01 / BL0937
  2738. #ifndef HLW8012_SUPPORT
  2739. #define HLW8012_SUPPORT 1
  2740. #endif
  2741. #define HLW8012_SEL_PIN 12
  2742. #define HLW8012_CF1_PIN 14
  2743. #define HLW8012_CF_PIN 5
  2744. #define HLW8012_SEL_CURRENT LOW
  2745. #define HLW8012_CURRENT_RATIO 25740
  2746. #define HLW8012_VOLTAGE_RATIO 313400
  2747. #define HLW8012_POWER_RATIO 3414290
  2748. #define HLW8012_INTERRUPT_ON FALLING
  2749. // -----------------------------------------------------------------------------
  2750. // Charging Essentials / LITESUN LA-WF3
  2751. // -----------------------------------------------------------------------------
  2752. #elif defined(LITESUN_LA_WF3)
  2753. // Info
  2754. #define MANUFACTURER "LITESUN"
  2755. #define DEVICE "LA_WF3"
  2756. // Buttons
  2757. #define BUTTON1_PIN 13
  2758. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2759. #define BUTTON1_RELAY 1
  2760. // Relays
  2761. #define RELAY1_PIN 12
  2762. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2763. // LEDs
  2764. #define LED1_PIN 4 // 4 blue led
  2765. #define LED1_MODE LED_MODE_WIFI
  2766. #define LED1_PIN_INVERSE 1
  2767. #define LED2_PIN 5 // 5 red led
  2768. #define LED2_MODE LED_MODE_RELAY
  2769. #define LED2_PIN_INVERSE 1
  2770. // -----------------------------------------------------------------------------
  2771. // TEST boards (do not use!!)
  2772. // -----------------------------------------------------------------------------
  2773. #elif defined(TRAVIS01)
  2774. // Info
  2775. #define MANUFACTURER "TravisCI"
  2776. #define DEVICE "Virtual board 01"
  2777. // Some buttons - pin 0
  2778. #define BUTTON1_PIN 0
  2779. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2780. #define BUTTON1_RELAY 1
  2781. // Some relays - pin 1
  2782. #define RELAY1_PIN 1
  2783. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2784. // Some LEDs - pin 2
  2785. #define LED1_PIN 2
  2786. #define LED1_PIN_INVERSE 1
  2787. // A bit of I2C - pins 3,4
  2788. #define I2C_SDA_PIN 3
  2789. #define I2C_SCL_PIN 4
  2790. // And, as they say in "From Dusk till Dawn":
  2791. // This is a sensor blow out!
  2792. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  2793. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  2794. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  2795. // C'mon, you want sensor, come on in sensor lovers!
  2796. // If we don’t got it, you don't want it!
  2797. #define AM2320_SUPPORT 1
  2798. #define BH1750_SUPPORT 1
  2799. #define BMP180_SUPPORT 1
  2800. #define BMX280_SUPPORT 1
  2801. #define SHT3X_I2C_SUPPORT 1
  2802. #define EMON_ADC121_SUPPORT 1
  2803. #define EMON_ADS1X15_SUPPORT 1
  2804. #define SHT3X_I2C_SUPPORT 1
  2805. #define SI7021_SUPPORT 1
  2806. #define PMSX003_SUPPORT 1
  2807. #define SENSEAIR_SUPPORT 1
  2808. #define VL53L1X_SUPPORT 1
  2809. #define MAX6675_SUPPORT 1
  2810. // A bit of lights - pin 5
  2811. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2812. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2813. #define DUMMY_RELAY_COUNT 1
  2814. #define LIGHT_CHANNELS 1
  2815. #define LIGHT_CH1_PIN 5
  2816. #define LIGHT_CH1_INVERSE 0
  2817. // A bit of HLW8012 - pins 6,7,8
  2818. #ifndef HLW8012_SUPPORT
  2819. #define HLW8012_SUPPORT 1
  2820. #endif
  2821. #define HLW8012_SEL_PIN 6
  2822. #define HLW8012_CF1_PIN 7
  2823. #define HLW8012_CF_PIN 8
  2824. // A bit of Dallas - pin 9
  2825. #ifndef DALLAS_SUPPORT
  2826. #define DALLAS_SUPPORT 1
  2827. #endif
  2828. #define DALLAS_PIN 9
  2829. // A bit of ECH1560 - pins 10,11, 12
  2830. #ifndef ECH1560_SUPPORT
  2831. #define ECH1560_SUPPORT 1
  2832. #endif
  2833. #define ECH1560_CLK_PIN 10
  2834. #define ECH1560_MISO_PIN 11
  2835. #define ECH1560_INVERTED 12
  2836. // MICS-2710 & MICS-5525 test
  2837. #define MICS2710_SUPPORT 1
  2838. #define MICS5525_SUPPORT 1
  2839. // MAX6675 14 11 10
  2840. #ifndef MAX6675_SUPPORT
  2841. #define MAX6675_SUPPORT 1
  2842. #endif
  2843. #define MAX6675_CS_PIN 14
  2844. #define MAX6675_SO_PIN 11
  2845. #define MAX6675_SCK_PIN 10
  2846. #elif defined(TRAVIS02)
  2847. // Relay provider dual
  2848. #define MANUFACTURER "TravisCI"
  2849. #define DEVICE "Virtual board 02"
  2850. // Some buttons - pin 0
  2851. #define BUTTON1_PIN 0
  2852. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2853. #define BUTTON1_RELAY 1
  2854. // A bit of CSE7766 - pin 1
  2855. #ifndef CSE7766_SUPPORT
  2856. #define CSE7766_SUPPORT 1
  2857. #endif
  2858. #define CSE7766_PIN 1
  2859. // Relay type dual - pins 2,3
  2860. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  2861. #define RELAY1_PIN 2
  2862. #define RELAY2_PIN 3
  2863. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2864. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2865. // IR - pin 4
  2866. #define IR_SUPPORT 1
  2867. #define IR_RX_PIN 4
  2868. #define IR_BUTTON_SET 1
  2869. // A bit of DHT - pin 5
  2870. #ifndef DHT_SUPPORT
  2871. #define DHT_SUPPORT 1
  2872. #endif
  2873. #define DHT_PIN 5
  2874. // A bit of TMP3X (analog)
  2875. #define TMP3X_SUPPORT 1
  2876. // A bit of EVENTS - pin 10
  2877. #define EVENTS_SUPPORT 1
  2878. #define EVENTS_PIN 6
  2879. // Sonar
  2880. #define SONAR_SUPPORT 1
  2881. #define SONAR_TRIGGER 7
  2882. #define SONAR_ECHO 8
  2883. // MHZ19
  2884. #define MHZ19_SUPPORT 1
  2885. #define MHZ19_RX_PIN 9
  2886. #define MHZ19_TX_PIN 10
  2887. // PZEM004T
  2888. #define PZEM004T_SUPPORT 1
  2889. #define PZEM004T_RX_PIN 11
  2890. #define PZEM004T_TX_PIN 12
  2891. // V9261F
  2892. #define V9261F_SUPPORT 1
  2893. #define V9261F_PIN 13
  2894. // GUVAS12SD
  2895. #define GUVAS12SD_SUPPORT 1
  2896. #define GUVAS12SD_PIN 14
  2897. // Test non-default modules
  2898. #define MDNS_CLIENT_SUPPORT 1
  2899. #define NOFUSS_SUPPORT 1
  2900. #define UART_MQTT_SUPPORT 1
  2901. #define INFLUXDB_SUPPORT 1
  2902. #define IR_SUPPORT 1
  2903. #elif defined(TRAVIS03)
  2904. // Relay provider light/my92XX
  2905. #define MANUFACTURER "TravisCI"
  2906. #define DEVICE "Virtual board 03"
  2907. // Some buttons - pin 0
  2908. #define BUTTON1_PIN 0
  2909. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2910. #define BUTTON1_RELAY 1
  2911. // MY9231 Light - pins 1,2
  2912. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2913. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2914. #define DUMMY_RELAY_COUNT 1
  2915. #define LIGHT_CHANNELS 5
  2916. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2917. #define MY92XX_CHIPS 2
  2918. #define MY92XX_DI_PIN 1
  2919. #define MY92XX_DCKI_PIN 2
  2920. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2921. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  2922. // A bit of Analog EMON (analog)
  2923. #ifndef EMON_ANALOG_SUPPORT
  2924. #define EMON_ANALOG_SUPPORT 1
  2925. #endif
  2926. #define PULSEMETER_SUPPORT 1
  2927. // Test non-default modules
  2928. #define LLMNR_SUPPORT 1
  2929. #define NETBIOS_SUPPORT 1
  2930. #define SSDP_SUPPORT 1
  2931. #define RF_SUPPORT 1
  2932. #endif
  2933. // -----------------------------------------------------------------------------
  2934. // Check definitions
  2935. // -----------------------------------------------------------------------------
  2936. #if not defined(MANUFACTURER) || not defined(DEVICE)
  2937. #error "UNSUPPORTED HARDWARE!!"
  2938. #endif