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.

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