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.

4089 lines
130 KiB

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