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.

3498 lines
112 KiB

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