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.

4147 lines
132 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 4
  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 SP21
  2284. // -----------------------------------------------------------------------------
  2285. #elif defined(TECKIN_SP21)
  2286. // Info
  2287. #define MANUFACTURER "TECKIN"
  2288. #define DEVICE "SP21"
  2289. // Buttons
  2290. #define BUTTON1_PIN 13
  2291. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2292. #define BUTTON1_RELAY 1
  2293. // Relays
  2294. #define RELAY1_PIN 15
  2295. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2296. // LEDs
  2297. #define LED1_PIN 2
  2298. #define LED1_PIN_INVERSE 1
  2299. // -----------------------------------------------------------------------------
  2300. // Teckin SP22 v1.4 - v1.6
  2301. // -----------------------------------------------------------------------------
  2302. #elif defined(TECKIN_SP22_V14)
  2303. // Info
  2304. #define MANUFACTURER "TECKIN"
  2305. #define DEVICE "SP22_V14"
  2306. // Buttons
  2307. #define BUTTON1_PIN 1
  2308. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2309. #define BUTTON1_RELAY 1
  2310. // Relays
  2311. #define RELAY1_PIN 14
  2312. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2313. // LEDs
  2314. #define LED1_PIN 3
  2315. #define LED1_PIN_INVERSE 1
  2316. #define LED2_PIN 13
  2317. #define LED2_PIN_INVERSE 1
  2318. #define LED2_MODE LED_MODE_FINDME
  2319. #define LED2_RELAY 1
  2320. // HJL01 / BL0937
  2321. #ifndef HLW8012_SUPPORT
  2322. #define HLW8012_SUPPORT 1
  2323. #endif
  2324. #define HLW8012_SEL_PIN 12
  2325. #define HLW8012_CF1_PIN 5
  2326. #define HLW8012_CF_PIN 4
  2327. #define HLW8012_SEL_CURRENT LOW
  2328. #define HLW8012_CURRENT_RATIO 20730
  2329. #define HLW8012_VOLTAGE_RATIO 264935
  2330. #define HLW8012_POWER_RATIO 2533110
  2331. #define HLW8012_INTERRUPT_ON FALLING
  2332. // BUTTON1 and LED1 are using Serial pins
  2333. #define DEBUG_SERIAL_SUPPORT 0
  2334. // -----------------------------------------------------------------------------
  2335. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  2336. // Also model number KS-602S
  2337. // -----------------------------------------------------------------------------
  2338. #elif defined(GOSUND_WS1)
  2339. // Info
  2340. #define MANUFACTURER "GOSUND"
  2341. #define DEVICE "WS1"
  2342. // Buttons
  2343. #define BUTTON1_PIN 0
  2344. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2345. #define BUTTON1_RELAY 1
  2346. // Relays
  2347. #define RELAY1_PIN 14
  2348. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2349. // LEDs
  2350. #define LED1_PIN 1
  2351. #define LED1_PIN_INVERSE 1
  2352. // LED1 is using TX pin
  2353. #define DEBUG_SERIAL_SUPPORT 0
  2354. // ----------------------------------------------------------------------------------------
  2355. // Homecube 16A is similar but some pins differ and it also has RGB LEDs
  2356. // https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
  2357. // ----------------------------------------------------------------------------------------
  2358. #elif defined(HOMECUBE_16A)
  2359. // Info
  2360. #define MANUFACTURER "HOMECUBE"
  2361. #define DEVICE "16A"
  2362. // Buttons
  2363. #define BUTTON1_PIN 13
  2364. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2365. #define BUTTON1_RELAY 1
  2366. // Relays
  2367. #define RELAY1_PIN 15
  2368. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2369. // LEDs
  2370. //LED Pin 4 - ESP8266 onboard LED
  2371. //Red LED: 0
  2372. //Green LED: 12
  2373. //Blue LED: 2
  2374. // Blue
  2375. #define LED1_PIN 2
  2376. #define LED1_PIN_INVERSE 0
  2377. // Green
  2378. #define LED2_PIN 12
  2379. #define LED2_PIN_INVERSE 1
  2380. #define LED2_MODE LED_MODE_RELAY
  2381. // Red
  2382. #define LED3_PIN 0
  2383. #define LED3_PIN_INVERSE 0
  2384. #define LED3_MODE LED_MODE_OFF
  2385. // HJL01 / BL0937
  2386. #ifndef HLW8012_SUPPORT
  2387. #define HLW8012_SUPPORT 1
  2388. #endif
  2389. #define HLW8012_SEL_PIN 16
  2390. #define HLW8012_CF1_PIN 14
  2391. #define HLW8012_CF_PIN 5
  2392. #define HLW8012_SEL_CURRENT LOW
  2393. #define HLW8012_CURRENT_RATIO 25740
  2394. #define HLW8012_VOLTAGE_RATIO 313400
  2395. #define HLW8012_POWER_RATIO 3414290
  2396. #define HLW8012_INTERRUPT_ON FALLING
  2397. // -----------------------------------------------------------------------------
  2398. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  2399. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  2400. // -----------------------------------------------------------------------------
  2401. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  2402. // Info
  2403. #define MANUFACTURER "VANZAVANZU"
  2404. #define DEVICE "SMART_WIFI_PLUG_MINI"
  2405. // Buttons
  2406. #define BUTTON1_PIN 13
  2407. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2408. #define BUTTON1_RELAY 1
  2409. // Relays
  2410. #define RELAY1_PIN 15
  2411. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2412. // LEDs
  2413. #define LED1_PIN 2
  2414. #define LED1_PIN_INVERSE 1
  2415. #define LED2_PIN 0
  2416. #define LED2_PIN_INVERSE 1
  2417. #define LED2_MODE LED_MODE_FINDME
  2418. #define LED2_RELAY 1
  2419. // Disable UART noise
  2420. #define DEBUG_SERIAL_SUPPORT 0
  2421. // HJL01 / BL0937
  2422. #ifndef HLW8012_SUPPORT
  2423. #define HLW8012_SUPPORT 1
  2424. #endif
  2425. #define HLW8012_SEL_PIN 3
  2426. #define HLW8012_CF1_PIN 14
  2427. #define HLW8012_CF_PIN 5
  2428. #define HLW8012_SEL_CURRENT LOW
  2429. #define HLW8012_CURRENT_RATIO 25740
  2430. #define HLW8012_VOLTAGE_RATIO 313400
  2431. #define HLW8012_POWER_RATIO 3414290
  2432. #define HLW8012_INTERRUPT_ON FALLING
  2433. // -----------------------------------------------------------------------------
  2434. #elif defined(GENERIC_AG_L4)
  2435. // Info
  2436. #define MANUFACTURER "GENERIC"
  2437. #define DEVICE "AG_L4"
  2438. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2439. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2440. #define DUMMY_RELAY_COUNT 1
  2441. // button 1: "power" button
  2442. #define BUTTON1_PIN 4
  2443. #define BUTTON1_RELAY 1
  2444. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2445. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  2446. #define BUTTON1_CLICK BUTTON_MODE_NONE
  2447. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2448. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2449. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  2450. // button 2: "wifi" button
  2451. #define BUTTON2_PIN 2
  2452. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2453. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  2454. #define BUTTON2_CLICK BUTTON_MODE_NONE
  2455. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  2456. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  2457. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  2458. // LEDs
  2459. #define LED1_PIN 5 // red status led
  2460. #define LED1_PIN_INVERSE 0
  2461. #define LED2_PIN 16 // master light power
  2462. #define LED2_PIN_INVERSE 1
  2463. #define LED2_MODE LED_MODE_RELAY
  2464. // Light
  2465. #define LIGHT_CHANNELS 3
  2466. #define LIGHT_CH1_PIN 14 // RED
  2467. #define LIGHT_CH2_PIN 13 // GREEN
  2468. #define LIGHT_CH3_PIN 12 // BLUE
  2469. #define LIGHT_CH1_INVERSE 0
  2470. #define LIGHT_CH2_INVERSE 0
  2471. #define LIGHT_CH3_INVERSE 0
  2472. // -----------------------------------------------------------------------------
  2473. #elif defined(ALLTERCO_SHELLY1)
  2474. // Info
  2475. #define MANUFACTURER "ALLTERCO"
  2476. #define DEVICE "SHELLY1"
  2477. // Buttons
  2478. #define BUTTON1_PIN 5
  2479. #define BUTTON1_MODE BUTTON_SWITCH
  2480. #define BUTTON1_RELAY 1
  2481. // Relays
  2482. #define RELAY1_PIN 4
  2483. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2484. #elif defined(ALLTERCO_SHELLY2)
  2485. // Info
  2486. #define MANUFACTURER "ALLTERCO"
  2487. #define DEVICE "SHELLY2"
  2488. // Buttons
  2489. #define BUTTON1_PIN 12
  2490. #define BUTTON2_PIN 14
  2491. #define BUTTON1_MODE BUTTON_SWITCH
  2492. #define BUTTON2_MODE BUTTON_SWITCH
  2493. #define BUTTON1_RELAY 1
  2494. #define BUTTON2_RELAY 2
  2495. // Relays
  2496. #define RELAY1_PIN 4
  2497. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2498. #define RELAY2_PIN 5
  2499. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2500. #elif defined(ALLTERCO_SHELLY1PM)
  2501. // Info
  2502. #define MANUFACTURER "ALLTERCO"
  2503. #define DEVICE "SHELLY1PM"
  2504. // Buttons
  2505. #define BUTTON1_PIN 4
  2506. #define BUTTON1_MODE BUTTON_SWITCH
  2507. #define BUTTON1_RELAY 1
  2508. #define BUTTON2_PIN 2
  2509. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2510. #define BUTTON2_LNGCLICK BUTTON_MODE_RESET
  2511. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_FACTORY
  2512. // Relays
  2513. #define RELAY1_PIN 15
  2514. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2515. // Light
  2516. #define LED1_PIN 0
  2517. #define LED1_PIN_INVERSE 1
  2518. // HJL01 / BL0937
  2519. #define HLW8012_SUPPORT 1
  2520. #define HLW8012_SEL_PIN 12
  2521. #define HLW8012_CF1_PIN 13
  2522. #define HLW8012_CF_PIN 5
  2523. #define HLW8012_SEL_CURRENT LOW
  2524. #define HLW8012_CURRENT_RATIO 25740
  2525. #define HLW8012_VOLTAGE_RATIO 313400
  2526. #define HLW8012_POWER_RATIO 3414290
  2527. #define HLW8012_INTERRUPT_ON FALLING
  2528. //Temperature
  2529. #define NTC_SUPPORT 1
  2530. #define SENSOR_SUPPORT 1
  2531. #define NTC_BETA 3350
  2532. #define NTC_R_UP 10000
  2533. #define NTC_R_DOWN 0
  2534. #define NTC_R0 8000
  2535. #elif defined(ALLTERCO_SHELLY25)
  2536. // Info
  2537. #define MANUFACTURER "ALLTERCO"
  2538. #define DEVICE "SHELLY25"
  2539. // Buttons
  2540. #define BUTTON1_PIN 13
  2541. #define BUTTON1_MODE BUTTON_SWITCH
  2542. #define BUTTON1_RELAY 1
  2543. #define BUTTON2_PIN 5
  2544. #define BUTTON2_MODE BUTTON_SWITCH
  2545. #define BUTTON2_RELAY 2
  2546. #define BUTTON3_PIN 2
  2547. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2548. #define BUTTON3_LNGCLICK BUTTON_MODE_RESET
  2549. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_FACTORY
  2550. // Relays
  2551. #define RELAY1_PIN 4
  2552. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2553. #define RELAY2_PIN 15
  2554. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2555. // Light
  2556. #define LED1_PIN 0
  2557. #define LED1_PIN_INVERSE 1
  2558. //Temperature
  2559. #define NTC_SUPPORT 1
  2560. #define SENSOR_SUPPORT 1
  2561. #define NTC_BETA 3350
  2562. #define NTC_R_UP 10000
  2563. #define NTC_R_DOWN 0
  2564. #define NTC_R0 8000
  2565. //Current
  2566. #define ADE7953_SUPPORT 1
  2567. #define I2C_SDA_PIN 12
  2568. #define I2C_SCL_PIN 14
  2569. // -----------------------------------------------------------------------------
  2570. #elif defined(LOHAS_9W)
  2571. // Info
  2572. #define MANUFACTURER "LOHAS"
  2573. #define DEVICE "E27_9W"
  2574. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2575. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2576. #define DUMMY_RELAY_COUNT 1
  2577. // Light
  2578. #define LIGHT_CHANNELS 5
  2579. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2580. #define MY92XX_CHIPS 2
  2581. #define MY92XX_DI_PIN 13
  2582. #define MY92XX_DCKI_PIN 15
  2583. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2584. #define MY92XX_MAPPING 0, 1, 2, 3, 4
  2585. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  2586. // -----------------------------------------------------------------------------
  2587. #elif defined(XIAOMI_SMART_DESK_LAMP)
  2588. // Info
  2589. #define MANUFACTURER "XIAOMI"
  2590. #define DEVICE "SMART_DESK_LAMP"
  2591. // Buttons
  2592. #define BUTTON1_PIN 2
  2593. #define BUTTON2_PIN 14
  2594. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2595. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2596. // This button doubles as switch here and as encoder mode switch below
  2597. // Clicking it (for less than 500ms) will turn the light on and off
  2598. // Double and Long clicks will not work as these are used to modify the encoder action
  2599. #define BUTTON1_RELAY 1
  2600. #define BUTTON_LNGCLICK_DELAY 500
  2601. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2602. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2603. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  2604. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  2605. #define BUTTON2_DBLCLICK BUTTON_MODE_AP
  2606. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  2607. // Light
  2608. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2609. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2610. #define DUMMY_RELAY_COUNT 1
  2611. #define LIGHT_STEP 8
  2612. #define LIGHT_CHANNELS 2
  2613. #define LIGHT_CH1_PIN 5 // warm white
  2614. #define LIGHT_CH1_INVERSE 0
  2615. #define LIGHT_CH2_PIN 4 // cold white
  2616. #define LIGHT_CH2_INVERSE 0
  2617. // Encoder
  2618. // If mode is ENCODER_MODE_RATIO, the value ratio between both channels is changed
  2619. // when the button is not pressed, and the overall brightness when pressed
  2620. // If mode is ENCODER_MODE_CHANNEL, the first channel value is changed
  2621. // when the button is not pressed, and the second channel when pressed
  2622. // If no ENCODERX_BUTTON_PIN defined it will only change the value of the first defined channel
  2623. #define ENCODER_SUPPORT 1
  2624. #define ENCODER1_PIN1 12
  2625. #define ENCODER1_PIN2 13
  2626. #define ENCODER1_BUTTON_PIN 2 // active low by default, with software pullup
  2627. #define ENCODER1_CHANNEL1 0 // please note this value is 0-based (LIGHT_CH1 above)
  2628. #define ENCODER1_CHANNEL2 1 // please note this value is 0-based (LIGHT_CH2 above)
  2629. #define ENCODER1_MODE ENCODER_MODE_RATIO
  2630. #elif defined(PHYX_ESP12_RGB)
  2631. // Info
  2632. #define MANUFACTURER "PHYX"
  2633. #define DEVICE "ESP12_RGB"
  2634. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2635. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2636. #define DUMMY_RELAY_COUNT 1
  2637. // Light
  2638. #define LIGHT_CHANNELS 3
  2639. #define LIGHT_CH1_PIN 4 // RED
  2640. #define LIGHT_CH2_PIN 14 // GREEN
  2641. #define LIGHT_CH3_PIN 12 // BLUE
  2642. #define LIGHT_CH1_INVERSE 0
  2643. #define LIGHT_CH2_INVERSE 0
  2644. #define LIGHT_CH3_INVERSE 0
  2645. // -----------------------------------------------------------------------------
  2646. // iWoole LED Table Lamp
  2647. // 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
  2648. // -----------------------------------------------------------------------------
  2649. #elif defined(IWOOLE_LED_TABLE_LAMP)
  2650. // Info
  2651. #define MANUFACTURER "IWOOLE"
  2652. #define DEVICE "LED_TABLE_LAMP"
  2653. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2654. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2655. #define DUMMY_RELAY_COUNT 1
  2656. // Light
  2657. #define LIGHT_CHANNELS 4
  2658. #define LIGHT_CH1_PIN 12 // RED
  2659. #define LIGHT_CH2_PIN 5 // GREEN
  2660. #define LIGHT_CH3_PIN 14 // BLUE
  2661. #define LIGHT_CH4_PIN 4 // WHITE
  2662. #define LIGHT_CH1_INVERSE 0
  2663. #define LIGHT_CH2_INVERSE 0
  2664. #define LIGHT_CH3_INVERSE 0
  2665. #define LIGHT_CH4_INVERSE 0
  2666. // -----------------------------------------------------------------------------
  2667. // Generic GU10
  2668. // https://www.ebay.com/itm/1-10PC-GU10-RGB-Smart-Bulb-Wireless-WiFi-App-Remote-Ctrl-Light-for-Alexa-Google/173724116351
  2669. // -----------------------------------------------------------------------------
  2670. #elif defined(GENERIC_GU10)
  2671. // Info
  2672. #define MANUFACTURER "GENERIC"
  2673. #define DEVICE "GU10"
  2674. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2675. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2676. #define DUMMY_RELAY_COUNT 1
  2677. // Light
  2678. #define LIGHT_CHANNELS 4
  2679. #define LIGHT_CH1_PIN 14 // RED
  2680. #define LIGHT_CH2_PIN 12 // GREEN
  2681. #define LIGHT_CH3_PIN 13 // BLUE
  2682. #define LIGHT_CH4_PIN 4 // WHITE
  2683. #define LIGHT_CH1_INVERSE 0
  2684. #define LIGHT_CH2_INVERSE 0
  2685. #define LIGHT_CH3_INVERSE 0
  2686. #define LIGHT_CH4_INVERSE 0
  2687. // -----------------------------------------------------------------------------
  2688. // Nexete A19
  2689. // https://www.ebay.com/itm/Wifi-Smart-LED-light-Bulb-9W-60W-A19-850LM-RGBW-Dimmable-for-Alexa-Google-Home/283514779201
  2690. // -----------------------------------------------------------------------------
  2691. #elif defined(NEXETE_A19)
  2692. // Info
  2693. #define MANUFACTURER "NEXETE"
  2694. #define DEVICE "A19"
  2695. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2696. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2697. #define DUMMY_RELAY_COUNT 1
  2698. // Light
  2699. #define LIGHT_CHANNELS 4
  2700. #define LIGHT_CH1_PIN 12 // RED
  2701. #define LIGHT_CH2_PIN 15 // GREEN
  2702. #define LIGHT_CH3_PIN 14 // BLUE
  2703. #define LIGHT_CH4_PIN 5 // WHITE
  2704. #define LIGHT_CH1_INVERSE 0
  2705. #define LIGHT_CH2_INVERSE 0
  2706. #define LIGHT_CH3_INVERSE 0
  2707. #define LIGHT_CH4_INVERSE 0
  2708. // -----------------------------------------------------------------------------
  2709. // Lombex Lux Nova 2 Tunable White
  2710. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2711. // -----------------------------------------------------------------------------
  2712. #elif defined(LOMBEX_LUX_NOVA2_TUNABLE_WHITE)
  2713. // Info
  2714. #define MANUFACTURER "LOMBEX"
  2715. #define DEVICE "LUX_NOVA2_TUNABLE_WHITE"
  2716. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2717. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2718. #define DUMMY_RELAY_COUNT 1
  2719. // Light
  2720. #define LIGHT_CHANNELS 5
  2721. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2722. #define MY92XX_CHIPS 1
  2723. #define MY92XX_DI_PIN 4
  2724. #define MY92XX_DCKI_PIN 5
  2725. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2726. // No RGB on this bulb. Warm white on channel 0, cool white on channel 3
  2727. #define MY92XX_MAPPING 255, 255, 255, 3, 0
  2728. // -----------------------------------------------------------------------------
  2729. // Lombex Lux Nova 2 White and Color
  2730. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2731. // -----------------------------------------------------------------------------
  2732. #elif defined(LOMBEX_LUX_NOVA2_WHITE_COLOR)
  2733. // Info
  2734. #define MANUFACTURER "LOMBEX"
  2735. #define DEVICE "LUX_NOVA2_WHITE_COLOR"
  2736. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2737. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2738. #define DUMMY_RELAY_COUNT 1
  2739. // Light
  2740. #define LIGHT_CHANNELS 4
  2741. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2742. #define MY92XX_CHIPS 1
  2743. #define MY92XX_DI_PIN 4
  2744. #define MY92XX_DCKI_PIN 5
  2745. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2746. // RGB on channels 0/1/2, either cool or warm white on channel 3
  2747. // The bulb *should* have cool leds, but could also have warm leds as a common defect
  2748. #define MY92XX_MAPPING 0, 1, 2, 3
  2749. // -----------------------------------------------------------------------------
  2750. // Bestek Smart Plug with 2 USB ports
  2751. // https://www.bestekcorp.com/bestek-smart-plug-works-with-amazon-alexa-google-assistant-and-ifttt-with-2-usb
  2752. // -----------------------------------------------------------------------------
  2753. #elif defined(BESTEK_MRJ1011)
  2754. // Info
  2755. #define MANUFACTURER "BESTEK"
  2756. #define DEVICE "MRJ1011"
  2757. // Buttons
  2758. #define BUTTON1_PIN 13
  2759. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2760. #define BUTTON1_RELAY 1
  2761. // Relay
  2762. #define RELAY1_PIN 12
  2763. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2764. // LED
  2765. #define LED1_PIN 4
  2766. #define LED1_PIN_INVERSE 1
  2767. // -----------------------------------------------------------------------------
  2768. // GBLIFE RGBW SOCKET
  2769. // -----------------------------------------------------------------------------
  2770. #elif defined(GBLIFE_RGBW_SOCKET)
  2771. // Info
  2772. #define MANUFACTURER "GBLIFE"
  2773. #define DEVICE "RGBW_SOCKET"
  2774. // Buttons
  2775. #define BUTTON1_PIN 13
  2776. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2777. #define BUTTON1_RELAY 1
  2778. // Relays
  2779. #define RELAY1_PIN 15
  2780. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2781. // Light RGBW
  2782. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2783. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2784. #define DUMMY_RELAY_COUNT 1
  2785. #define LIGHT_CHANNELS 4
  2786. #define LIGHT_CH1_PIN 5 // RED
  2787. #define LIGHT_CH2_PIN 14 // GREEN
  2788. #define LIGHT_CH3_PIN 12 // BLUE
  2789. #define LIGHT_CH4_PIN 4 // WHITE
  2790. #define LIGHT_CH1_INVERSE 0
  2791. #define LIGHT_CH2_INVERSE 0
  2792. #define LIGHT_CH3_INVERSE 0
  2793. #define LIGHT_CH4_INVERSE 0
  2794. // ----------------------------------------------------------------------------------------
  2795. // Smart life Mini Smart Socket is similar Homecube 16A but some GPIOs differ
  2796. // https://www.ebay.de/itm/Smart-Steckdose-WIFI-WLAN-Amazon-Alexa-Fernbedienung-Home-Socket-Zeitschaltuh-DE/123352026749?hash=item1cb85a8e7d:g:IasAAOSwk6dbj390
  2797. // Also labeled NETVIP
  2798. // https://www.amazon.es/Inteligente-NETVIP-Inal%C3%A1mbrico-Interruptor-Funciona/dp/B07KH8YWS5
  2799. // ----------------------------------------------------------------------------------------
  2800. #elif defined(SMARTLIFE_MINI_SMART_SOCKET)
  2801. // Info
  2802. #define MANUFACTURER "SMARTLIFE"
  2803. #define DEVICE "MINI_SMART_SOCKET"
  2804. // Buttons
  2805. #define BUTTON1_PIN 13
  2806. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2807. #define BUTTON1_RELAY 1
  2808. // Relays
  2809. #define RELAY1_PIN 15
  2810. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2811. // LEDs
  2812. //Red LED: 0
  2813. //Green LED: 4
  2814. //Blue LED: 2
  2815. // Light
  2816. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2817. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2818. #define DUMMY_RELAY_COUNT 1
  2819. #define LIGHT_CHANNELS 3
  2820. #define LIGHT_CH1_PIN 0 // RED
  2821. #define LIGHT_CH2_PIN 4 // GREEN
  2822. #define LIGHT_CH3_PIN 2 // BLUE
  2823. #define LIGHT_CH1_INVERSE 0
  2824. #define LIGHT_CH2_INVERSE 0
  2825. #define LIGHT_CH3_INVERSE 0
  2826. // HJL01 / BL0937
  2827. #ifndef HLW8012_SUPPORT
  2828. #define HLW8012_SUPPORT 1
  2829. #endif
  2830. #define HLW8012_SEL_PIN 12
  2831. #define HLW8012_CF1_PIN 14
  2832. #define HLW8012_CF_PIN 5
  2833. #define HLW8012_SEL_CURRENT LOW
  2834. #define HLW8012_CURRENT_RATIO 25740
  2835. #define HLW8012_VOLTAGE_RATIO 313400
  2836. #define HLW8012_POWER_RATIO 3414290
  2837. #define HLW8012_INTERRUPT_ON FALLING
  2838. // ----------------------------------------------------------------------------------------
  2839. // Hama WiFi Steckdose (00176533)
  2840. // https://at.hama.com/00176533/hama-wifi-steckdose-3500w-16a
  2841. // ----------------------------------------------------------------------------------------
  2842. #elif defined(HAMA_WIFI_STECKDOSE_00176533)
  2843. // Info
  2844. #define MANUFACTURER "HAMA"
  2845. #define DEVICE "WIFI_STECKDOSE_00176533"
  2846. // Buttons
  2847. #define BUTTON1_PIN 13
  2848. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2849. #define BUTTON1_RELAY 1
  2850. // Relays
  2851. #define RELAY1_PIN 12
  2852. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2853. // LEDs
  2854. #define LED1_PIN 4
  2855. #define LED1_PIN_INVERSE 1
  2856. // -----------------------------------------------------------------------------
  2857. // Oxaoxe NX-SP202
  2858. // Digoo NX-SP202 (not tested)
  2859. // Digoo DG-SP202 (not tested)
  2860. // https://github.com/xoseperez/espurna/issues/1502
  2861. // -----------------------------------------------------------------------------
  2862. #elif defined(DIGOO_NX_SP202)
  2863. // Info
  2864. #define MANUFACTURER "DIGOO"
  2865. #define DEVICE "NX_SP202"
  2866. // Buttons
  2867. #define BUTTON1_PIN 0
  2868. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2869. #define BUTTON1_RELAY 1
  2870. #define BUTTON2_PIN 16
  2871. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2872. #define BUTTON2_RELAY 2
  2873. // Relays
  2874. #define RELAY1_PIN 15
  2875. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2876. #define RELAY2_PIN 14
  2877. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2878. // LEDs
  2879. #define LED1_PIN 13
  2880. #define LED1_PIN_INVERSE 1
  2881. // HJL01 / BL0937
  2882. #ifndef HLW8012_SUPPORT
  2883. #define HLW8012_SUPPORT 1
  2884. #endif
  2885. #define HLW8012_SEL_PIN 12
  2886. #define HLW8012_CF1_PIN 5
  2887. #define HLW8012_CF_PIN 4
  2888. #define HLW8012_SEL_CURRENT LOW
  2889. #define HLW8012_CURRENT_RATIO 23296
  2890. #define HLW8012_VOLTAGE_RATIO 310085
  2891. #define HLW8012_POWER_RATIO 3368471
  2892. #define HLW8012_INTERRUPT_ON FALLING
  2893. // -----------------------------------------------------------------------------
  2894. // Foxel's LightFox dual
  2895. // https://github.com/foxel/esp-dual-rf-switch
  2896. // -----------------------------------------------------------------------------
  2897. #elif defined(FOXEL_LIGHTFOX_DUAL)
  2898. // Info
  2899. #define MANUFACTURER "FOXEL"
  2900. #define DEVICE "LIGHTFOX_DUAL"
  2901. #define SERIAL_BAUDRATE 19200
  2902. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  2903. #define DUMMY_RELAY_COUNT 2
  2904. #define DEBUG_SERIAL_SUPPORT 0
  2905. // Buttons
  2906. #define BUTTON1_RELAY 1
  2907. #define BUTTON2_RELAY 2
  2908. #define BUTTON3_RELAY 2
  2909. #define BUTTON4_RELAY 1
  2910. // -----------------------------------------------------------------------------
  2911. // Teckin SP20
  2912. // -----------------------------------------------------------------------------
  2913. #elif defined(TECKIN_SP20)
  2914. // Info
  2915. #define MANUFACTURER "TECKIN"
  2916. #define DEVICE "SP20"
  2917. // Buttons
  2918. #define BUTTON1_PIN 13
  2919. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2920. #define BUTTON1_RELAY 1
  2921. // Relays
  2922. #define RELAY1_PIN 4
  2923. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2924. // LEDs
  2925. #define LED1_PIN 2
  2926. #define LED1_PIN_INVERSE 1
  2927. #define LED2_PIN 0
  2928. #define LED2_PIN_INVERSE 1
  2929. #define LED2_MODE LED_MODE_FINDME
  2930. #define LED2_RELAY 0
  2931. // HJL01 / BL0937
  2932. #ifndef HLW8012_SUPPORT
  2933. #define HLW8012_SUPPORT 1
  2934. #endif
  2935. #define HLW8012_SEL_PIN 12
  2936. #define HLW8012_CF1_PIN 14
  2937. #define HLW8012_CF_PIN 5
  2938. #define HLW8012_SEL_CURRENT LOW
  2939. #define HLW8012_CURRENT_RATIO 25740
  2940. #define HLW8012_VOLTAGE_RATIO 313400
  2941. #define HLW8012_POWER_RATIO 3414290
  2942. #define HLW8012_INTERRUPT_ON FALLING
  2943. // -----------------------------------------------------------------------------
  2944. // Charging Essentials / LITESUN LA-WF3
  2945. // -----------------------------------------------------------------------------
  2946. #elif defined(LITESUN_LA_WF3)
  2947. // Info
  2948. #define MANUFACTURER "LITESUN"
  2949. #define DEVICE "LA_WF3"
  2950. // Buttons
  2951. #define BUTTON1_PIN 13
  2952. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2953. #define BUTTON1_RELAY 1
  2954. // Relays
  2955. #define RELAY1_PIN 12
  2956. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2957. // LEDs
  2958. #define LED1_PIN 4 // 4 blue led
  2959. #define LED1_MODE LED_MODE_WIFI
  2960. #define LED1_PIN_INVERSE 1
  2961. #define LED2_PIN 5 // 5 red led
  2962. #define LED2_MODE LED_MODE_RELAY
  2963. #define LED2_PIN_INVERSE 1
  2964. // -----------------------------------------------------------------------------
  2965. // PSH
  2966. // -----------------------------------------------------------------------------
  2967. #elif defined(PSH_WIFI_PLUG)
  2968. // Info
  2969. #define MANUFACTURER "PSH"
  2970. #define DEVICE "WIFI_PLUG"
  2971. // Relays
  2972. #define RELAY1_PIN 2
  2973. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2974. // LEDs
  2975. #define LED1_PIN 0
  2976. #define LED1_PIN_INVERSE 0
  2977. #elif defined(PSH_RGBW_CONTROLLER)
  2978. // Info
  2979. #define MANUFACTURER "PSH"
  2980. #define DEVICE "RGBW_CONTROLLER"
  2981. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2982. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2983. #define DUMMY_RELAY_COUNT 1
  2984. // LEDs
  2985. #define LED1_PIN 13
  2986. #define LED1_PIN_INVERSE 1
  2987. // Light
  2988. #define LIGHT_CHANNELS 4
  2989. #define LIGHT_CH1_PIN 5 // RED
  2990. #define LIGHT_CH2_PIN 4 // GREEN
  2991. #define LIGHT_CH3_PIN 12 // BLUE
  2992. #define LIGHT_CH4_PIN 14 // WHITE1
  2993. #define LIGHT_CH1_INVERSE 0
  2994. #define LIGHT_CH2_INVERSE 0
  2995. #define LIGHT_CH3_INVERSE 0
  2996. #define LIGHT_CH4_INVERSE 0
  2997. #elif defined(PSH_WIFI_SENSOR)
  2998. // Info
  2999. #define MANUFACTURER "PSH"
  3000. #define DEVICE "WIFI_SENSOR"
  3001. // DHT12 Sensor
  3002. #define DHT_SUPPORT 1
  3003. #define DHT_PIN 14
  3004. #define DHT_TYPE DHT_CHIP_DHT12
  3005. // LDR Sensor
  3006. #define LDR_SUPPORT 1
  3007. #define LDR_TYPE LDR_GL5528
  3008. #define LDR_ON_GROUND false
  3009. #define LDR_RESISTOR 10000
  3010. #elif defined(JINVOO_VALVE_SM_AW713)
  3011. // Reflashing from original Tuya firmware
  3012. // to thirdparty firmware like espurna by:
  3013. // https://github.com/ct-Open-Source/tuya-convert
  3014. // Info
  3015. #define MANUFACTURER "JINVOO"
  3016. #define DEVICE "VALVE_SM_AW713"
  3017. // Buttons
  3018. #define BUTTON1_PIN 13
  3019. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3020. #define BUTTON1_RELAY 1
  3021. // Relays
  3022. #define RELAY1_PIN 12
  3023. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3024. // LED
  3025. #define LED1_PIN 5 // 5 red led
  3026. #define LED1_PIN_INVERSE 0
  3027. #define LED1_RELAY 1
  3028. #define LED1_MODE LED_MODE_RELAY
  3029. #define LED2_PIN 4 // 4 blue led
  3030. #define LED2_PIN_INVERSE 0
  3031. #define LED2_RELAY 1
  3032. #define LED2_MODE LED_MODE_FINDME_WIFI
  3033. // -----------------------------------------------------------------------------
  3034. // Etekcity ESW01-USA
  3035. // https://www.amazon.com/Etekcity-Voltson-Outlet-Monitoring-Required/dp/B01M3MYIFS
  3036. // -----------------------------------------------------------------------------
  3037. #elif defined(ETEKCITY_ESW01_USA)
  3038. // Info
  3039. #define MANUFACTURER "ETEKCITY"
  3040. #define DEVICE "ESW01-USA"
  3041. // Buttons
  3042. #define BUTTON1_PIN 14
  3043. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3044. #define BUTTON1_RELAY 1
  3045. // Relays
  3046. #define RELAY1_PIN 4
  3047. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3048. // LEDs
  3049. // Blue
  3050. #define LED1_PIN 5
  3051. #define LED1_PIN_INVERSE 0
  3052. #define LED1_MODE LED_MODE_WIFI
  3053. // Yellow
  3054. #define LED2_PIN 16
  3055. #define LED2_PIN_INVERSE 0
  3056. #define LED2_MODE LED_MODE_FOLLOW
  3057. #define LED2_RELAY 1
  3058. // HLW8012
  3059. #ifndef HLW8012_SUPPORT
  3060. #define HLW8012_SUPPORT 1
  3061. #endif
  3062. #define HLW8012_SEL_PIN 15
  3063. #define HLW8012_CF1_PIN 12
  3064. #define HLW8012_CF_PIN 13
  3065. #define HLW8012_SEL_CURRENT HIGH // SEL pin to HIGH to measure current
  3066. #define HLW8012_CURRENT_R 0.001 // Current resistor
  3067. #define HLW8012_VOLTAGE_R_UP ( 4 * 470000 ) // Upstream voltage resistor
  3068. #define HLW8012_VOLTAGE_R_DOWN ( 1000 ) // Downstream voltage resistor
  3069. #define HLW8012_INTERRUPT_ON CHANGE
  3070. // -----------------------------------------------------------------------------
  3071. // FS UAP1
  3072. // http://frank-schuetz.de/index.php/fhem/13-hoermann-torantrieb-mit-espeasy-in-fhem-einbinden
  3073. #elif defined(FS_UAP1)
  3074. // Info
  3075. #define MANUFACTURER "FS"
  3076. #define DEVICE "UAP1"
  3077. // Inputs
  3078. #define DIGITAL1_PIN 4
  3079. #define DIGITAL2_PIN 5
  3080. // Relays
  3081. #define RELAY1_PIN 12
  3082. #define RELAY2_PIN 13
  3083. #define RELAY3_PIN 14
  3084. #define RELAY4_PIN 15
  3085. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3086. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3087. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  3088. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  3089. // LEDs
  3090. #define LED1_PIN 2
  3091. #define LED1_PIN_INVERSE 0
  3092. // Disable UART noise
  3093. #define DEBUG_SERIAL_SUPPORT 0
  3094. // -----------------------------------------------------------------------------
  3095. // -----------------------------------------------------------------------------
  3096. // TEST boards (do not use!!)
  3097. // -----------------------------------------------------------------------------
  3098. #elif defined(TRAVIS01)
  3099. // Info
  3100. #define MANUFACTURER "TravisCI"
  3101. #define DEVICE "Virtual board 01"
  3102. // Some buttons - pin 0
  3103. #define BUTTON1_PIN 0
  3104. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3105. #define BUTTON1_RELAY 1
  3106. // Some relays - pin 1
  3107. #define RELAY1_PIN 1
  3108. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3109. // Some LEDs - pin 2
  3110. #define LED1_PIN 2
  3111. #define LED1_PIN_INVERSE 1
  3112. // A bit of I2C - pins 3,4
  3113. #define I2C_SDA_PIN 3
  3114. #define I2C_SCL_PIN 4
  3115. // And, as they say in "From Dusk till Dawn":
  3116. // This is a sensor blow out!
  3117. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  3118. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  3119. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  3120. // C'mon, you want sensor, come on in sensor lovers!
  3121. // If we don’t got it, you don't want it!
  3122. #define AM2320_SUPPORT 1
  3123. #define BH1750_SUPPORT 1
  3124. #define BMP180_SUPPORT 1
  3125. #define BMX280_SUPPORT 1
  3126. #define SHT3X_I2C_SUPPORT 1
  3127. #define EMON_ADC121_SUPPORT 1
  3128. #define EMON_ADS1X15_SUPPORT 1
  3129. #define SHT3X_I2C_SUPPORT 1
  3130. #define SI7021_SUPPORT 1
  3131. #define PMSX003_SUPPORT 1
  3132. #define SENSEAIR_SUPPORT 1
  3133. #define VL53L1X_SUPPORT 1
  3134. #define MAX6675_SUPPORT 1
  3135. // A bit of lights - pin 5
  3136. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3137. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3138. #define DUMMY_RELAY_COUNT 1
  3139. #define LIGHT_CHANNELS 1
  3140. #define LIGHT_CH1_PIN 5
  3141. #define LIGHT_CH1_INVERSE 0
  3142. #define ENCODER_SUPPORT 1
  3143. // A bit of HLW8012 - pins 6,7,8
  3144. #ifndef HLW8012_SUPPORT
  3145. #define HLW8012_SUPPORT 1
  3146. #endif
  3147. #define HLW8012_SEL_PIN 6
  3148. #define HLW8012_CF1_PIN 7
  3149. #define HLW8012_CF_PIN 8
  3150. // A bit of Dallas - pin 9
  3151. #ifndef DALLAS_SUPPORT
  3152. #define DALLAS_SUPPORT 1
  3153. #endif
  3154. #define DALLAS_PIN 9
  3155. // A bit of ECH1560 - pins 10,11, 12
  3156. #ifndef ECH1560_SUPPORT
  3157. #define ECH1560_SUPPORT 1
  3158. #endif
  3159. #define ECH1560_CLK_PIN 10
  3160. #define ECH1560_MISO_PIN 11
  3161. #define ECH1560_INVERTED 12
  3162. // MICS-2710 & MICS-5525 test
  3163. #define MICS2710_SUPPORT 1
  3164. #define MICS5525_SUPPORT 1
  3165. // MAX6675 14 11 10
  3166. #ifndef MAX6675_SUPPORT
  3167. #define MAX6675_SUPPORT 1
  3168. #endif
  3169. #define MAX6675_CS_PIN 14
  3170. #define MAX6675_SO_PIN 11
  3171. #define MAX6675_SCK_PIN 10
  3172. #elif defined(TRAVIS02)
  3173. // Relay provider dual
  3174. #define MANUFACTURER "TravisCI"
  3175. #define DEVICE "Virtual board 02"
  3176. // Some buttons - pin 0
  3177. #define BUTTON1_PIN 0
  3178. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3179. #define BUTTON1_RELAY 1
  3180. // A bit of CSE7766 - pin 1
  3181. #ifndef CSE7766_SUPPORT
  3182. #define CSE7766_SUPPORT 1
  3183. #endif
  3184. #define CSE7766_PIN 1
  3185. // Relay type dual - pins 2,3
  3186. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  3187. #define RELAY1_PIN 2
  3188. #define RELAY2_PIN 3
  3189. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3190. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3191. // IR - pin 4
  3192. #define IR_SUPPORT 1
  3193. #define IR_RX_PIN 4
  3194. #define IR_BUTTON_SET 1
  3195. // A bit of DHT - pin 5
  3196. #ifndef DHT_SUPPORT
  3197. #define DHT_SUPPORT 1
  3198. #endif
  3199. #define DHT_PIN 5
  3200. // A bit of TMP3X (analog)
  3201. #define TMP3X_SUPPORT 1
  3202. // A bit of EVENTS - pin 10
  3203. #define EVENTS_SUPPORT 1
  3204. #define EVENTS1_PIN 6
  3205. // Sonar
  3206. #define SONAR_SUPPORT 1
  3207. #define SONAR_TRIGGER 7
  3208. #define SONAR_ECHO 8
  3209. // MHZ19
  3210. #define MHZ19_SUPPORT 1
  3211. #define MHZ19_RX_PIN 9
  3212. #define MHZ19_TX_PIN 10
  3213. // PZEM004T
  3214. #define PZEM004T_SUPPORT 1
  3215. #define PZEM004T_RX_PIN 11
  3216. #define PZEM004T_TX_PIN 12
  3217. // V9261F
  3218. #define V9261F_SUPPORT 1
  3219. #define V9261F_PIN 13
  3220. // GUVAS12SD
  3221. #define GUVAS12SD_SUPPORT 1
  3222. #define GUVAS12SD_PIN 14
  3223. // Test non-default modules
  3224. #define MDNS_CLIENT_SUPPORT 1
  3225. #define NOFUSS_SUPPORT 1
  3226. #define UART_MQTT_SUPPORT 1
  3227. #define INFLUXDB_SUPPORT 1
  3228. #define IR_SUPPORT 1
  3229. #define RF_SUPPORT 1
  3230. #define OTA_MQTT_SUPPORT 1
  3231. #define RFB_DIRECT 1
  3232. #define RFB_RX_PIN 4
  3233. #elif defined(TRAVIS03)
  3234. // Relay provider light/my92XX
  3235. #define MANUFACTURER "TravisCI"
  3236. #define DEVICE "Virtual board 03"
  3237. // Some buttons - pin 0
  3238. #define BUTTON1_PIN 0
  3239. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3240. #define BUTTON1_RELAY 1
  3241. // MY9231 Light - pins 1,2
  3242. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3243. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  3244. #define DUMMY_RELAY_COUNT 1
  3245. #define LIGHT_CHANNELS 5
  3246. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  3247. #define MY92XX_CHIPS 2
  3248. #define MY92XX_DI_PIN 1
  3249. #define MY92XX_DCKI_PIN 2
  3250. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  3251. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  3252. // A bit of analog,
  3253. // will not work on real life since they all share GPIO
  3254. // but it's OK to test build
  3255. #define EMON_ANALOG_SUPPORT 1
  3256. #define NTC_SUPPORT 1
  3257. #define LDR_SUPPORT 1
  3258. #define PULSEMETER_SUPPORT 1
  3259. // Test non-default modules
  3260. #define LLMNR_SUPPORT 1
  3261. #define NETBIOS_SUPPORT 1
  3262. #define SSDP_SUPPORT 1
  3263. #define RF_SUPPORT 1
  3264. #else
  3265. #error "UNSUPPORTED HARDWARE!!"
  3266. #endif