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.

4097 lines
130 KiB

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