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.

3540 lines
113 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. // Lyasi LED
  903. // -----------------------------------------------------------------------------
  904. #elif defined(LYASI_LIGHT)
  905. // Info
  906. #define MANUFACTURER "LYASI"
  907. #define DEVICE "RGB-LED"
  908. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  909. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  910. #define DUMMY_RELAY_COUNT 1
  911. // Light
  912. #define LIGHT_CHANNELS 4
  913. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  914. #define MY92XX_CHIPS 1
  915. #define MY92XX_DI_PIN 4
  916. #define MY92XX_DCKI_PIN 5
  917. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  918. #define MY92XX_MAPPING 0, 1, 2, 3
  919. // -----------------------------------------------------------------------------
  920. // LED Controller
  921. // -----------------------------------------------------------------------------
  922. #elif defined(MAGICHOME_LED_CONTROLLER)
  923. // Info
  924. #define MANUFACTURER "MAGICHOME"
  925. #define DEVICE "LED_CONTROLLER"
  926. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  927. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  928. #define DUMMY_RELAY_COUNT 1
  929. // LEDs
  930. #define LED1_PIN 2
  931. #define LED1_PIN_INVERSE 1
  932. // Light
  933. #define LIGHT_CHANNELS 4
  934. #define LIGHT_CH1_PIN 14 // RED
  935. #define LIGHT_CH2_PIN 5 // GREEN
  936. #define LIGHT_CH3_PIN 12 // BLUE
  937. #define LIGHT_CH4_PIN 13 // WHITE
  938. #define LIGHT_CH1_INVERSE 0
  939. #define LIGHT_CH2_INVERSE 0
  940. #define LIGHT_CH3_INVERSE 0
  941. #define LIGHT_CH4_INVERSE 0
  942. // IR
  943. #define IR_SUPPORT 1
  944. #define IR_RX_PIN 4
  945. #define IR_BUTTON_SET 1
  946. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  947. // Info
  948. #define MANUFACTURER "MAGICHOME"
  949. #define DEVICE "LED_CONTROLLER_20"
  950. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  951. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  952. #define DUMMY_RELAY_COUNT 1
  953. // LEDs
  954. #define LED1_PIN 2
  955. #define LED1_PIN_INVERSE 1
  956. // Light
  957. #define LIGHT_CHANNELS 4
  958. #define LIGHT_CH1_PIN 5 // RED
  959. #define LIGHT_CH2_PIN 12 // GREEN
  960. #define LIGHT_CH3_PIN 13 // BLUE
  961. #define LIGHT_CH4_PIN 15 // WHITE
  962. #define LIGHT_CH1_INVERSE 0
  963. #define LIGHT_CH2_INVERSE 0
  964. #define LIGHT_CH3_INVERSE 0
  965. #define LIGHT_CH4_INVERSE 0
  966. // IR
  967. #define IR_SUPPORT 1
  968. #define IR_RX_PIN 4
  969. #define IR_BUTTON_SET 1
  970. #elif defined(MAGICHOME_ZJ_WFMN_A_11)
  971. // Info
  972. #define MANUFACTURER "MAGICHOME"
  973. #define DEVICE "ZJ_WFMN_A_11"
  974. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  975. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  976. #define DUMMY_RELAY_COUNT 1
  977. // LEDs
  978. #define LED1_PIN 2
  979. #define LED1_PIN_INVERSE 1
  980. #define LED2_PIN 15
  981. #define LED2_PIN_INVERSE 1
  982. // Light
  983. #define LIGHT_CHANNELS 4
  984. #define LIGHT_CH1_PIN 12 // RED
  985. #define LIGHT_CH2_PIN 5 // GREEN
  986. #define LIGHT_CH3_PIN 13 // BLUE
  987. #define LIGHT_CH4_PIN 14 // WHITE
  988. #define LIGHT_CH1_INVERSE 0
  989. #define LIGHT_CH2_INVERSE 0
  990. #define LIGHT_CH3_INVERSE 0
  991. #define LIGHT_CH4_INVERSE 0
  992. // IR
  993. #define IR_SUPPORT 1
  994. #define IR_RX_PIN 4
  995. #define IR_BUTTON_SET 1
  996. #elif defined(MAGICHOME_ZJ_WFMN_B_11)
  997. // Info
  998. #define MANUFACTURER "MAGICHOME"
  999. #define DEVICE "ZJ_WFMN_B_11"
  1000. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1001. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1002. #define DUMMY_RELAY_COUNT 1
  1003. // LEDs
  1004. #define LED1_PIN 2
  1005. #define LED1_PIN_INVERSE 1
  1006. #define LED2_PIN 15
  1007. #define LED2_PIN_INVERSE 1
  1008. // Light
  1009. #define LIGHT_CHANNELS 4
  1010. #define LIGHT_CH1_PIN 14 // RED
  1011. #define LIGHT_CH2_PIN 5 // GREEN
  1012. #define LIGHT_CH3_PIN 12 // BLUE
  1013. #define LIGHT_CH4_PIN 13 // WHITE
  1014. #define LIGHT_CH1_INVERSE 0
  1015. #define LIGHT_CH2_INVERSE 0
  1016. #define LIGHT_CH3_INVERSE 0
  1017. #define LIGHT_CH4_INVERSE 0
  1018. // RF
  1019. #define RF_SUPPORT 1
  1020. #define RF_PIN 4
  1021. // -----------------------------------------------------------------------------
  1022. // HUACANXING H801 & H802
  1023. // -----------------------------------------------------------------------------
  1024. #elif defined(HUACANXING_H801)
  1025. // Info
  1026. #define MANUFACTURER "HUACANXING"
  1027. #define DEVICE "H801"
  1028. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1029. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1030. #define DUMMY_RELAY_COUNT 1
  1031. #define DEBUG_PORT Serial1
  1032. #define SERIAL_RX_ENABLED 1
  1033. // LEDs
  1034. #define LED1_PIN 5
  1035. #define LED1_PIN_INVERSE 1
  1036. // Light
  1037. #define LIGHT_CHANNELS 5
  1038. #define LIGHT_CH1_PIN 15 // RED
  1039. #define LIGHT_CH2_PIN 13 // GREEN
  1040. #define LIGHT_CH3_PIN 12 // BLUE
  1041. #define LIGHT_CH4_PIN 14 // WHITE1
  1042. #define LIGHT_CH5_PIN 4 // WHITE2
  1043. #define LIGHT_CH1_INVERSE 0
  1044. #define LIGHT_CH2_INVERSE 0
  1045. #define LIGHT_CH3_INVERSE 0
  1046. #define LIGHT_CH4_INVERSE 0
  1047. #define LIGHT_CH5_INVERSE 0
  1048. #elif defined(HUACANXING_H802)
  1049. // Info
  1050. #define MANUFACTURER "HUACANXING"
  1051. #define DEVICE "H802"
  1052. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1053. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1054. #define DUMMY_RELAY_COUNT 1
  1055. #define DEBUG_PORT Serial1
  1056. #define SERIAL_RX_ENABLED 1
  1057. // Light
  1058. #define LIGHT_CHANNELS 4
  1059. #define LIGHT_CH1_PIN 12 // RED
  1060. #define LIGHT_CH2_PIN 14 // GREEN
  1061. #define LIGHT_CH3_PIN 13 // BLUE
  1062. #define LIGHT_CH4_PIN 15 // WHITE
  1063. #define LIGHT_CH1_INVERSE 0
  1064. #define LIGHT_CH2_INVERSE 0
  1065. #define LIGHT_CH3_INVERSE 0
  1066. #define LIGHT_CH4_INVERSE 0
  1067. // -----------------------------------------------------------------------------
  1068. // Jan Goedeke Wifi Relay
  1069. // https://github.com/JanGoe/esp8266-wifi-relay
  1070. // -----------------------------------------------------------------------------
  1071. #elif defined(JANGOE_WIFI_RELAY_NC)
  1072. // Info
  1073. #define MANUFACTURER "JANGOE"
  1074. #define DEVICE "WIFI_RELAY_NC"
  1075. // Buttons
  1076. #define BUTTON1_PIN 12
  1077. #define BUTTON2_PIN 13
  1078. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1079. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1080. #define BUTTON1_RELAY 1
  1081. #define BUTTON2_RELAY 2
  1082. // Relays
  1083. #define RELAY1_PIN 2
  1084. #define RELAY2_PIN 14
  1085. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1086. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1087. #elif defined(JANGOE_WIFI_RELAY_NO)
  1088. // Info
  1089. #define MANUFACTURER "JANGOE"
  1090. #define DEVICE "WIFI_RELAY_NO"
  1091. // Buttons
  1092. #define BUTTON1_PIN 12
  1093. #define BUTTON2_PIN 13
  1094. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1095. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1096. #define BUTTON1_RELAY 1
  1097. #define BUTTON2_RELAY 2
  1098. // Relays
  1099. #define RELAY1_PIN 2
  1100. #define RELAY2_PIN 14
  1101. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1102. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1103. // -----------------------------------------------------------------------------
  1104. // Jorge García Wifi+Relays Board Kit
  1105. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  1106. // https://github.com/jorgegarciadev/wifikit
  1107. // -----------------------------------------------------------------------------
  1108. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  1109. // Info
  1110. #define MANUFACTURER "JORGEGARCIA"
  1111. #define DEVICE "WIFI_RELAYS"
  1112. // Relays
  1113. #define RELAY1_PIN 0
  1114. #define RELAY2_PIN 2
  1115. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1116. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1117. // -----------------------------------------------------------------------------
  1118. // WiFi MQTT Relay / Thermostat
  1119. // -----------------------------------------------------------------------------
  1120. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  1121. // Info
  1122. #define MANUFACTURER "OPENENERGYMONITOR"
  1123. #define DEVICE "MQTT_RELAY"
  1124. // Buttons
  1125. #define BUTTON1_PIN 0
  1126. #define BUTTON1_RELAY 1
  1127. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1128. // Relays
  1129. #define RELAY1_PIN 12
  1130. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1131. // LEDs
  1132. #define LED1_PIN 16
  1133. #define LED1_PIN_INVERSE 0
  1134. // -----------------------------------------------------------------------------
  1135. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  1136. // 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
  1137. // 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
  1138. // -----------------------------------------------------------------------------
  1139. #elif defined(WION_50055)
  1140. // Currently untested, does not support energy monitoring
  1141. // Info
  1142. #define MANUFACTURER "WION"
  1143. #define DEVICE "50055"
  1144. // Buttons
  1145. #define BUTTON1_PIN 13
  1146. #define BUTTON1_RELAY 1
  1147. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1148. // Relays
  1149. #define RELAY1_PIN 15
  1150. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1151. // LEDs
  1152. #define LED1_PIN 2
  1153. #define LED1_PIN_INVERSE 0
  1154. // -----------------------------------------------------------------------------
  1155. // EX-Store Wifi Relay v3.1
  1156. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  1157. // -----------------------------------------------------------------------------
  1158. #elif defined(EXS_WIFI_RELAY_V31)
  1159. // Untested
  1160. // Info
  1161. #define MANUFACTURER "EXS"
  1162. #define DEVICE "WIFI_RELAY_V31"
  1163. // Buttons
  1164. #define BUTTON1_PIN 0
  1165. #define BUTTON1_RELAY 1
  1166. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1167. // Relays
  1168. #define RELAY1_PIN 13
  1169. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1170. #define RELAY1_RESET_PIN 12
  1171. // -----------------------------------------------------------------------------
  1172. // EX-Store Wifi Relay v5.0
  1173. // -----------------------------------------------------------------------------
  1174. #elif defined(EXS_WIFI_RELAY_V50)
  1175. // Info
  1176. #define MANUFACTURER "EXS"
  1177. #define DEVICE "WIFI_RELAY_V50"
  1178. // Buttons
  1179. #define BUTTON1_PIN 5
  1180. #define BUTTON2_PIN 4
  1181. #define BUTTON1_RELAY 1
  1182. #define BUTTON2_RELAY 2
  1183. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1184. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1185. // Relays
  1186. #define RELAY1_PIN 14
  1187. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1188. #define RELAY1_RESET_PIN 16
  1189. #define RELAY2_PIN 13
  1190. #define RELAY2_TYPE RELAY_TYPE_LATCHED
  1191. #define RELAY2_RESET_PIN 12
  1192. // LEDs
  1193. #define LED1_PIN 15
  1194. #define LED1_PIN_INVERSE 0
  1195. // -----------------------------------------------------------------------------
  1196. // V9261F
  1197. // -----------------------------------------------------------------------------
  1198. #elif defined(GENERIC_V9261F)
  1199. // Info
  1200. #define MANUFACTURER "GENERIC"
  1201. #define DEVICE "V9261F"
  1202. #define ALEXA_SUPPORT 0
  1203. // V9261F
  1204. #define V9261F_SUPPORT 1
  1205. #define V9261F_PIN 2
  1206. #define V9261F_PIN_INVERSE 1
  1207. // -----------------------------------------------------------------------------
  1208. // ECH1560
  1209. // -----------------------------------------------------------------------------
  1210. #elif defined(GENERIC_ECH1560)
  1211. // Info
  1212. #define MANUFACTURER "GENERIC"
  1213. #define DEVICE "ECH1560"
  1214. #define ALEXA_SUPPORT 0
  1215. // ECH1560
  1216. #define ECH1560_SUPPORT 1
  1217. #define ECH1560_CLK_PIN 4
  1218. #define ECH1560_MISO_PIN 5
  1219. #define ECH1560_INVERTED 0
  1220. // -----------------------------------------------------------------------------
  1221. // ESPLive
  1222. // https://github.com/ManCaveMade/ESP-Live
  1223. // -----------------------------------------------------------------------------
  1224. #elif defined(MANCAVEMADE_ESPLIVE)
  1225. // Info
  1226. #define MANUFACTURER "MANCAVEMADE"
  1227. #define DEVICE "ESPLIVE"
  1228. // Buttons
  1229. #define BUTTON1_PIN 4
  1230. #define BUTTON2_PIN 5
  1231. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1232. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1233. #define BUTTON1_RELAY 1
  1234. #define BUTTON2_RELAY 2
  1235. // Relays
  1236. #define RELAY1_PIN 12
  1237. #define RELAY2_PIN 13
  1238. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1239. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1240. // DS18B20
  1241. #ifndef DALLAS_SUPPORT
  1242. #define DALLAS_SUPPORT 1
  1243. #endif
  1244. #define DALLAS_PIN 2
  1245. #define DALLAS_UPDATE_INTERVAL 5000
  1246. #define TEMPERATURE_MIN_CHANGE 1.0
  1247. // -----------------------------------------------------------------------------
  1248. // QuinLED
  1249. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  1250. // -----------------------------------------------------------------------------
  1251. #elif defined(INTERMITTECH_QUINLED)
  1252. // Info
  1253. #define MANUFACTURER "INTERMITTECH"
  1254. #define DEVICE "QUINLED"
  1255. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1256. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1257. #define DUMMY_RELAY_COUNT 1
  1258. // LEDs
  1259. #define LED1_PIN 5
  1260. #define LED1_PIN_INVERSE 1
  1261. // Light
  1262. #define LIGHT_CHANNELS 2
  1263. #define LIGHT_CH1_PIN 0
  1264. #define LIGHT_CH2_PIN 2
  1265. #define LIGHT_CH1_INVERSE 0
  1266. #define LIGHT_CH2_INVERSE 0
  1267. // -----------------------------------------------------------------------------
  1268. // Arilux AL-LC06
  1269. // -----------------------------------------------------------------------------
  1270. #elif defined(ARILUX_AL_LC01)
  1271. // Info
  1272. #define MANUFACTURER "ARILUX"
  1273. #define DEVICE "AL_LC01"
  1274. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1275. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1276. #define DUMMY_RELAY_COUNT 1
  1277. // Light
  1278. #define LIGHT_CHANNELS 3
  1279. #define LIGHT_CH1_PIN 5 // RED
  1280. #define LIGHT_CH2_PIN 12 // GREEN
  1281. #define LIGHT_CH3_PIN 13 // BLUE
  1282. #define LIGHT_CH1_INVERSE 0
  1283. #define LIGHT_CH2_INVERSE 0
  1284. #define LIGHT_CH3_INVERSE 0
  1285. #elif defined(ARILUX_AL_LC02)
  1286. // Info
  1287. #define MANUFACTURER "ARILUX"
  1288. #define DEVICE "AL_LC02"
  1289. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1290. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1291. #define DUMMY_RELAY_COUNT 1
  1292. // Light
  1293. #define LIGHT_CHANNELS 4
  1294. #define LIGHT_CH1_PIN 12 // RED
  1295. #define LIGHT_CH2_PIN 5 // GREEN
  1296. #define LIGHT_CH3_PIN 13 // BLUE
  1297. #define LIGHT_CH4_PIN 15 // WHITE1
  1298. #define LIGHT_CH1_INVERSE 0
  1299. #define LIGHT_CH2_INVERSE 0
  1300. #define LIGHT_CH3_INVERSE 0
  1301. #define LIGHT_CH4_INVERSE 0
  1302. #elif defined(ARILUX_AL_LC02_V14)
  1303. // Info
  1304. #define MANUFACTURER "ARILUX"
  1305. #define DEVICE "AL_LC02_V14"
  1306. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1307. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1308. #define DUMMY_RELAY_COUNT 1
  1309. // Light
  1310. #define LIGHT_CHANNELS 4
  1311. #define LIGHT_CH1_PIN 14 // RED
  1312. #define LIGHT_CH2_PIN 5 // GREEN
  1313. #define LIGHT_CH3_PIN 12 // BLUE
  1314. #define LIGHT_CH4_PIN 13 // WHITE1
  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. #elif defined(ARILUX_AL_LC06)
  1320. // Info
  1321. #define MANUFACTURER "ARILUX"
  1322. #define DEVICE "AL_LC06"
  1323. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1324. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1325. #define DUMMY_RELAY_COUNT 1
  1326. // Light
  1327. #define LIGHT_CHANNELS 5
  1328. #define LIGHT_CH1_PIN 14 // RED
  1329. #define LIGHT_CH2_PIN 12 // GREEN
  1330. #define LIGHT_CH3_PIN 13 // BLUE
  1331. #define LIGHT_CH4_PIN 15 // WHITE1
  1332. #define LIGHT_CH5_PIN 5 // WHITE2
  1333. #define LIGHT_CH1_INVERSE 0
  1334. #define LIGHT_CH2_INVERSE 0
  1335. #define LIGHT_CH3_INVERSE 0
  1336. #define LIGHT_CH4_INVERSE 0
  1337. #define LIGHT_CH5_INVERSE 0
  1338. #elif defined(ARILUX_AL_LC11)
  1339. // Info
  1340. #define MANUFACTURER "ARILUX"
  1341. #define DEVICE "AL_LC11"
  1342. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1343. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1344. #define DUMMY_RELAY_COUNT 1
  1345. // Light
  1346. #define LIGHT_CHANNELS 5
  1347. #define LIGHT_CH1_PIN 5 // RED
  1348. #define LIGHT_CH2_PIN 4 // GREEN
  1349. #define LIGHT_CH3_PIN 14 // BLUE
  1350. #define LIGHT_CH4_PIN 13 // WHITE1
  1351. #define LIGHT_CH5_PIN 12 // WHITE1
  1352. #define LIGHT_CH1_INVERSE 0
  1353. #define LIGHT_CH2_INVERSE 0
  1354. #define LIGHT_CH3_INVERSE 0
  1355. #define LIGHT_CH4_INVERSE 0
  1356. #define LIGHT_CH5_INVERSE 0
  1357. #elif defined(ARILUX_E27)
  1358. // Info
  1359. #define MANUFACTURER "ARILUX"
  1360. #define DEVICE "E27"
  1361. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1362. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1363. #define DUMMY_RELAY_COUNT 1
  1364. // Light
  1365. #define LIGHT_CHANNELS 4
  1366. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  1367. #define MY92XX_CHIPS 1
  1368. #define MY92XX_DI_PIN 13
  1369. #define MY92XX_DCKI_PIN 15
  1370. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1371. #define MY92XX_MAPPING 0, 1, 2, 3
  1372. // -----------------------------------------------------------------------------
  1373. // XENON SM-PW701U
  1374. // -----------------------------------------------------------------------------
  1375. #elif defined(XENON_SM_PW702U)
  1376. // Info
  1377. #define MANUFACTURER "XENON"
  1378. #define DEVICE "SM_PW702U"
  1379. // Buttons
  1380. #define BUTTON1_PIN 13
  1381. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1382. #define BUTTON1_RELAY 1
  1383. // Relays
  1384. #define RELAY1_PIN 12
  1385. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1386. // LEDs
  1387. #define LED1_PIN 4
  1388. #define LED1_PIN_INVERSE 1
  1389. // -----------------------------------------------------------------------------
  1390. // AUTHOMETION LYT8266
  1391. // https://authometion.com/shop/en/home/13-lyt8266.html
  1392. // -----------------------------------------------------------------------------
  1393. #elif defined(AUTHOMETION_LYT8266)
  1394. // Info
  1395. #define MANUFACTURER "AUTHOMETION"
  1396. #define DEVICE "LYT8266"
  1397. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1398. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1399. #define DUMMY_RELAY_COUNT 1
  1400. // Light
  1401. #define LIGHT_CHANNELS 4
  1402. #define LIGHT_CH1_PIN 13 // RED
  1403. #define LIGHT_CH2_PIN 12 // GREEN
  1404. #define LIGHT_CH3_PIN 14 // BLUE
  1405. #define LIGHT_CH4_PIN 2 // WHITE
  1406. #define LIGHT_CH1_INVERSE 0
  1407. #define LIGHT_CH2_INVERSE 0
  1408. #define LIGHT_CH3_INVERSE 0
  1409. #define LIGHT_CH4_INVERSE 0
  1410. #define LIGHT_ENABLE_PIN 15
  1411. #elif defined(GIZWITS_WITTY_CLOUD)
  1412. // Info
  1413. #define MANUFACTURER "GIZWITS"
  1414. #define DEVICE "WITTY_CLOUD"
  1415. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1416. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1417. #define DUMMY_RELAY_COUNT 1
  1418. // Buttons
  1419. #define BUTTON1_PIN 4
  1420. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1421. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  1422. #define BUTTON1_CLICK BUTTON_MODE_NONE
  1423. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1424. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1425. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  1426. #define ANALOG_SUPPORT 1
  1427. // LEDs
  1428. #define LED1_PIN 2 // BLUE build-in
  1429. #define LED1_PIN_INVERSE 1
  1430. // Light
  1431. #define LIGHT_CHANNELS 3
  1432. #define LIGHT_CH1_PIN 15 // RED
  1433. #define LIGHT_CH2_PIN 12 // GREEN
  1434. #define LIGHT_CH3_PIN 13 // BLUE
  1435. #define LIGHT_CH1_INVERSE 0
  1436. #define LIGHT_CH2_INVERSE 0
  1437. #define LIGHT_CH3_INVERSE 0
  1438. // -----------------------------------------------------------------------------
  1439. // KMC 70011
  1440. // https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
  1441. // -----------------------------------------------------------------------------
  1442. #elif defined(KMC_70011)
  1443. // Info
  1444. #define MANUFACTURER "KMC"
  1445. #define DEVICE "70011"
  1446. // Buttons
  1447. #define BUTTON1_PIN 0
  1448. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1449. #define BUTTON1_RELAY 1
  1450. // Relays
  1451. #define RELAY1_PIN 14
  1452. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1453. // LEDs
  1454. #define LED1_PIN 13
  1455. #define LED1_PIN_INVERSE 1
  1456. // HLW8012
  1457. #ifndef HLW8012_SUPPORT
  1458. #define HLW8012_SUPPORT 1
  1459. #endif
  1460. #define HLW8012_SEL_PIN 12
  1461. #define HLW8012_CF1_PIN 5
  1462. #define HLW8012_CF_PIN 4
  1463. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1464. // -----------------------------------------------------------------------------
  1465. // Euromate (?) Wifi Stecker Schuko
  1466. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  1467. // Thanks to @Geitde
  1468. // -----------------------------------------------------------------------------
  1469. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  1470. // Info
  1471. #define MANUFACTURER "EUROMATE"
  1472. #define DEVICE "WIFI_STECKER_SCHUKO"
  1473. // Buttons
  1474. #define BUTTON1_PIN 14
  1475. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1476. #define BUTTON1_RELAY 1
  1477. // The relay in the device is not a bistable (latched) relay.
  1478. // The device is reported to have a flip-flop circuit to drive the relay
  1479. // So @Geitde hack is still the only possible
  1480. // Hack: drive GPIO12 low and use GPIO5 as normal relay pin:
  1481. #define RELAY1_PIN 5
  1482. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1483. #define LED2_PIN 12 /* DUMMY: exploit default off state for GPIO12=low */
  1484. #define LED2_PIN_INVERSE 0
  1485. // LEDs
  1486. #define LED1_PIN 4
  1487. #define LED1_PIN_INVERSE 0
  1488. // -----------------------------------------------------------------------------
  1489. // Euromate (?) Wifi Stecker Schuko Version 2
  1490. // This configuration is for the second generation of devices sold by OBI.
  1491. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko-weiss/p/4077806
  1492. // -----------------------------------------------------------------------------
  1493. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO_V2)
  1494. // Info
  1495. #define MANUFACTURER "EUROMATE"
  1496. #define DEVICE "WIFI_STECKER_SCHUKO_V2"
  1497. // Buttons
  1498. #define BUTTON1_PIN 5
  1499. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1500. #define BUTTON1_RELAY 1
  1501. // Relays
  1502. #define RELAY1_PIN 4
  1503. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1504. // Green
  1505. #define LED1_PIN 12
  1506. #define LED1_MODE LED_MODE_WIFI
  1507. #define LED1_PIN_INVERSE 0
  1508. // Red
  1509. #define LED2_PIN 13
  1510. #define LED2_MODE LED_MODE_RELAY
  1511. #define LED2_PIN_INVERSE 0
  1512. // -----------------------------------------------------------------------------
  1513. // Generic 8CH
  1514. // -----------------------------------------------------------------------------
  1515. #elif defined(GENERIC_8CH)
  1516. // Info
  1517. #define MANUFACTURER "GENERIC"
  1518. #define DEVICE "8CH"
  1519. // Relays
  1520. #define RELAY1_PIN 0
  1521. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1522. #define RELAY2_PIN 2
  1523. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1524. #define RELAY3_PIN 4
  1525. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1526. #define RELAY4_PIN 5
  1527. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1528. #define RELAY5_PIN 12
  1529. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1530. #define RELAY6_PIN 13
  1531. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  1532. #define RELAY7_PIN 14
  1533. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  1534. #define RELAY8_PIN 15
  1535. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  1536. // -----------------------------------------------------------------------------
  1537. // STM RELAY
  1538. // -----------------------------------------------------------------------------
  1539. #elif defined(STM_RELAY)
  1540. // Info
  1541. #define MANUFACTURER "STM_RELAY"
  1542. #define DEVICE "2CH"
  1543. // Relays
  1544. #define DUMMY_RELAY_COUNT 2
  1545. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  1546. // Remove UART noise on serial line
  1547. #define DEBUG_SERIAL_SUPPORT 0
  1548. // -----------------------------------------------------------------------------
  1549. // Tonbux Powerstrip02
  1550. // -----------------------------------------------------------------------------
  1551. #elif defined(TONBUX_POWERSTRIP02)
  1552. // Info
  1553. #define MANUFACTURER "TONBUX"
  1554. #define DEVICE "POWERSTRIP02"
  1555. // Buttons
  1556. #define BUTTON1_PIN 5
  1557. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1558. #define BUTTON1_RELAY 0
  1559. // Relays
  1560. #define RELAY1_PIN 4
  1561. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1562. #define RELAY2_PIN 13
  1563. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1564. #define RELAY3_PIN 12
  1565. #define RELAY3_TYPE RELAY_TYPE_INVERSE
  1566. #define RELAY4_PIN 14
  1567. #define RELAY4_TYPE RELAY_TYPE_INVERSE
  1568. // Not a relay. USB ports on/off
  1569. #define RELAY5_PIN 16
  1570. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1571. // LEDs
  1572. #define LED1_PIN 0 // 1 blue led
  1573. #define LED1_PIN_INVERSE 1
  1574. #define LED2_PIN 3 // 3 red leds
  1575. #define LED2_PIN_INVERSE 1
  1576. // -----------------------------------------------------------------------------
  1577. // Lingan SWA1
  1578. // -----------------------------------------------------------------------------
  1579. #elif defined(LINGAN_SWA1)
  1580. // Info
  1581. #define MANUFACTURER "LINGAN"
  1582. #define DEVICE "SWA1"
  1583. // Buttons
  1584. #define BUTTON1_PIN 13
  1585. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1586. #define BUTTON1_RELAY 1
  1587. // Relays
  1588. #define RELAY1_PIN 5
  1589. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1590. // LEDs
  1591. #define LED1_PIN 4
  1592. #define LED1_PIN_INVERSE 1
  1593. // -----------------------------------------------------------------------------
  1594. // HEYGO HY02
  1595. // -----------------------------------------------------------------------------
  1596. #elif defined(HEYGO_HY02)
  1597. // Info
  1598. #define MANUFACTURER "HEYGO"
  1599. #define DEVICE "HY02"
  1600. // Buttons
  1601. #define BUTTON1_PIN 13
  1602. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1603. #define BUTTON1_RELAY 1
  1604. // Relays
  1605. #define RELAY1_PIN 12
  1606. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1607. // LEDs
  1608. #define LED1_PIN 4
  1609. #define LED1_PIN_INVERSE 0
  1610. // -----------------------------------------------------------------------------
  1611. // Maxcio W-US002S
  1612. // -----------------------------------------------------------------------------
  1613. #elif defined(MAXCIO_WUS002S)
  1614. // Info
  1615. #define MANUFACTURER "MAXCIO"
  1616. #define DEVICE "WUS002S"
  1617. // Buttons
  1618. #define BUTTON1_PIN 2
  1619. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1620. #define BUTTON1_RELAY 1
  1621. // Relays
  1622. #define RELAY1_PIN 13
  1623. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1624. // LEDs
  1625. #define LED1_PIN 3
  1626. #define LED1_PIN_INVERSE 0
  1627. // HLW8012
  1628. #ifndef HLW8012_SUPPORT
  1629. #define HLW8012_SUPPORT 1
  1630. #endif
  1631. #define HLW8012_SEL_PIN 12
  1632. #define HLW8012_CF1_PIN 5
  1633. #define HLW8012_CF_PIN 4
  1634. #define HLW8012_CURRENT_R 0.002 // Current resistor
  1635. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1636. // -----------------------------------------------------------------------------
  1637. // Maxcio W-DE004
  1638. // -----------------------------------------------------------------------------
  1639. #elif defined(MAXCIO_WDE004)
  1640. // Info
  1641. #define MANUFACTURER "MAXCIO"
  1642. #define DEVICE "WDE004"
  1643. // Buttons
  1644. #define BUTTON1_PIN 1
  1645. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1646. #define BUTTON1_RELAY 1
  1647. // Relays
  1648. #define RELAY1_PIN 14
  1649. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1650. // LEDs
  1651. #define LED1_PIN 13
  1652. #define LED1_PIN_INVERSE 1
  1653. // -----------------------------------------------------------------------------
  1654. // YiDian XS-SSA05
  1655. // -----------------------------------------------------------------------------
  1656. #elif defined(YIDIAN_XSSSA05)
  1657. // Info
  1658. #define MANUFACTURER "YIDIAN"
  1659. #define DEVICE "XSSSA05"
  1660. // Buttons
  1661. #define BUTTON1_PIN 13
  1662. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1663. #define BUTTON1_RELAY 1
  1664. // Relays
  1665. #define RELAY1_PIN 12
  1666. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1667. // LEDs
  1668. #define LED1_PIN 0 // red
  1669. #define LED1_PIN_INVERSE 1
  1670. #define LED1_MODE LED_MODE_WIFI
  1671. #define LED2_PIN 15 // blue
  1672. #define LED2_PIN_INVERSE 1
  1673. #define LED2_MODE LED_MODE_RELAY
  1674. // HLW8012
  1675. #ifndef HLW8012_SUPPORT
  1676. #define HLW8012_SUPPORT 1
  1677. #endif
  1678. #define HLW8012_SEL_PIN 3
  1679. #define HLW8012_CF1_PIN 14
  1680. #define HLW8012_CF_PIN 5
  1681. #define HLW8012_SEL_CURRENT LOW
  1682. #define HLW8012_CURRENT_RATIO 25740
  1683. #define HLW8012_VOLTAGE_RATIO 313400
  1684. #define HLW8012_POWER_RATIO 3414290
  1685. #define HLW8012_INTERRUPT_ON FALLING
  1686. // -----------------------------------------------------------------------------
  1687. // TONBUX XS-SSA01
  1688. // -----------------------------------------------------------------------------
  1689. #elif defined(TONBUX_XSSSA01)
  1690. // Info
  1691. #define MANUFACTURER "TONBUX"
  1692. #define DEVICE "XSSSA01"
  1693. // Buttons
  1694. #define BUTTON1_PIN 4
  1695. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1696. #define BUTTON1_RELAY 1
  1697. // Relays
  1698. #define RELAY1_PIN 14
  1699. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1700. // LEDs
  1701. #define LED1_PIN 13
  1702. #define LED1_PIN_INVERSE 0
  1703. // -----------------------------------------------------------------------------
  1704. // TONBUX XS-SSA06
  1705. // -----------------------------------------------------------------------------
  1706. #elif defined(TONBUX_XSSSA06)
  1707. // Info
  1708. #define MANUFACTURER "TONBUX"
  1709. #define DEVICE "XSSSA06"
  1710. // Buttons
  1711. #define BUTTON1_PIN 13
  1712. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1713. #define BUTTON1_RELAY 1
  1714. // Relays
  1715. #define RELAY1_PIN 15
  1716. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1717. // LEDs
  1718. #define LED1_PIN 0 // R - 8 rgb led ring
  1719. #define LED1_PIN_INVERSE 0
  1720. #define LED2_PIN 5 // G
  1721. #define LED2_PIN_INVERSE 0
  1722. #define LED3_PIN 2 // B
  1723. #define LED3_PIN_INVERSE 0
  1724. // -----------------------------------------------------------------------------
  1725. // GREEN ESP8266 RELAY MODULE
  1726. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1727. // -----------------------------------------------------------------------------
  1728. #elif defined(GREEN_ESP8266RELAY)
  1729. // Info
  1730. #define MANUFACTURER "GREEN"
  1731. #define DEVICE "ESP8266RELAY"
  1732. // Buttons
  1733. // Not a button but input via Optocoupler
  1734. #define BUTTON1_PIN 5
  1735. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1736. #define BUTTON1_RELAY 1
  1737. // Relays
  1738. #define RELAY1_PIN 4
  1739. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1740. // LEDs
  1741. #define LED1_PIN 2
  1742. #define LED1_PIN_INVERSE 1
  1743. // -----------------------------------------------------------------------------
  1744. // Henrique Gravina ESPIKE
  1745. // https://github.com/Henriquegravina/Espike
  1746. // -----------------------------------------------------------------------------
  1747. #elif defined(IKE_ESPIKE)
  1748. #define MANUFACTURER "IKE"
  1749. #define DEVICE "ESPIKE"
  1750. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1751. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1752. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1753. #define BUTTON1_PIN 13
  1754. #define BUTTON1_RELAY 1
  1755. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1756. #define BUTTON2_PIN 12
  1757. #define BUTTON2_RELAY 2
  1758. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1759. #define BUTTON3_PIN 14
  1760. #define BUTTON3_RELAY 3
  1761. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1762. #define RELAY1_PIN 4
  1763. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1764. #define RELAY2_PIN 5
  1765. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1766. #define RELAY3_PIN 16
  1767. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1768. #define LED1_PIN 2
  1769. #define LED1_PIN_INVERSE 1
  1770. // -----------------------------------------------------------------------------
  1771. // SWIFITCH
  1772. // https://github.com/ArnieX/swifitch
  1773. // -----------------------------------------------------------------------------
  1774. #elif defined(ARNIEX_SWIFITCH)
  1775. // Info
  1776. #define MANUFACTURER "ARNIEX"
  1777. #define DEVICE "SWIFITCH"
  1778. // Buttons
  1779. #define BUTTON1_PIN 4 // D2
  1780. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1781. #define BUTTON1_RELAY 1
  1782. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1783. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1784. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1785. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1786. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1787. // Relays
  1788. #define RELAY1_PIN 5 // D1
  1789. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1790. // LEDs
  1791. #define LED1_PIN 12 // D6
  1792. #define LED1_PIN_INVERSE 1
  1793. // -----------------------------------------------------------------------------
  1794. // ESP-01S RELAY v4.0
  1795. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  1796. // -----------------------------------------------------------------------------
  1797. #elif defined(GENERIC_ESP01S_RELAY_V40)
  1798. // Info
  1799. #define MANUFACTURER "GENERIC"
  1800. #define DEVICE "ESP01S_RELAY_40"
  1801. // Relays
  1802. #define RELAY1_PIN 0
  1803. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1804. // LEDs
  1805. #define LED1_PIN 2
  1806. #define LED1_PIN_INVERSE 0
  1807. // -----------------------------------------------------------------------------
  1808. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  1809. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  1810. // -----------------------------------------------------------------------------
  1811. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  1812. // Info
  1813. #define MANUFACTURER "GENERIC"
  1814. #define DEVICE "ESP01S_RGBLED_10"
  1815. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  1816. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  1817. // Buttons
  1818. //#define BUTTON1_PIN 2
  1819. // Relays
  1820. //#define RELAY1_PIN 2
  1821. // LEDs
  1822. #define LED1_PIN 2
  1823. #define LED1_PIN_INVERSE 0
  1824. // -----------------------------------------------------------------------------
  1825. // ESP-01S DHT11 v1.0
  1826. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  1827. // -----------------------------------------------------------------------------
  1828. #elif defined(GENERIC_ESP01S_DHT11_V10)
  1829. // Info
  1830. #define MANUFACTURER "GENERIC"
  1831. #define DEVICE "ESP01S_DHT11_10"
  1832. // DHT11
  1833. #ifndef DHT_SUPPORT
  1834. #define DHT_SUPPORT 1
  1835. #endif
  1836. #define DHT_PIN 2
  1837. #define DHT_TYPE DHT_CHIP_DHT11
  1838. // -----------------------------------------------------------------------------
  1839. // ESP-01S DS18B20 v1.0
  1840. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  1841. // -----------------------------------------------------------------------------
  1842. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  1843. // Info
  1844. #define MANUFACTURER "GENERIC"
  1845. #define DEVICE "ESP01S_DS18B20_10"
  1846. // DB18B20
  1847. #ifndef DALLAS_SUPPORT
  1848. #define DALLAS_SUPPORT 1
  1849. #endif
  1850. #define DALLAS_PIN 2
  1851. // -----------------------------------------------------------------------------
  1852. // ESP-DIN relay board V1
  1853. // https://github.com/pilotak/esp_din
  1854. // -----------------------------------------------------------------------------
  1855. #elif defined(PILOTAK_ESP_DIN_V1)
  1856. // Info
  1857. #define MANUFACTURER "PILOTAK"
  1858. #define DEVICE "ESP_DIN_V1"
  1859. // Buttons
  1860. #define BUTTON1_PIN 0
  1861. #define BUTTON1_RELAY 1
  1862. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1863. // Relays
  1864. #define RELAY1_PIN 4
  1865. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1866. #define RELAY2_PIN 5
  1867. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1868. // LEDs
  1869. #define LED1_PIN 15
  1870. #define LED1_PIN_INVERSE 0
  1871. #define I2C_SDA_PIN 12
  1872. #define I2C_SCL_PIN 13
  1873. #ifndef DALLAS_SUPPORT
  1874. #define DALLAS_SUPPORT 1
  1875. #endif
  1876. #define DALLAS_PIN 2
  1877. #ifndef RF_SUPPORT
  1878. #define RF_SUPPORT 1
  1879. #endif
  1880. #define RF_PIN 14
  1881. #ifndef DIGITAL_SUPPORT
  1882. #define DIGITAL_SUPPORT 1
  1883. #endif
  1884. #define DIGITAL_PIN 16
  1885. #define DIGITAL_PIN_MODE INPUT
  1886. // -----------------------------------------------------------------------------
  1887. // Heltec Touch Relay
  1888. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  1889. // -----------------------------------------------------------------------------
  1890. #elif defined(HELTEC_TOUCHRELAY)
  1891. // Info
  1892. #define MANUFACTURER "HELTEC"
  1893. #define DEVICE "TOUCH_RELAY"
  1894. // Buttons
  1895. #define BUTTON1_PIN 14
  1896. #define BUTTON1_RELAY 1
  1897. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1898. // Relays
  1899. #define RELAY1_PIN 12
  1900. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1901. // -----------------------------------------------------------------------------
  1902. // Zhilde ZLD-EU44-W
  1903. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  1904. // -----------------------------------------------------------------------------
  1905. #elif defined(ZHILDE_EU44_W)
  1906. // Info
  1907. #define MANUFACTURER "ZHILDE"
  1908. #define DEVICE "EU44_W"
  1909. // Based on the reporter, this product uses GPIO1 and 3 for the button
  1910. // and onboard LED, so hardware serial should be disabled...
  1911. #define DEBUG_SERIAL_SUPPORT 0
  1912. // Buttons
  1913. #define BUTTON1_PIN 3
  1914. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1915. // Relays
  1916. #define RELAY1_PIN 5
  1917. #define RELAY2_PIN 4
  1918. #define RELAY3_PIN 12
  1919. #define RELAY4_PIN 13
  1920. #define RELAY5_PIN 14
  1921. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1922. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1923. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1924. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1925. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1926. // LEDs
  1927. #define LED1_PIN 1
  1928. #define LED1_PIN_INVERSE 1
  1929. // -----------------------------------------------------------------------------
  1930. // Allnet 4duino ESP8266-UP-Relais
  1931. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  1932. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  1933. // -----------------------------------------------------------------------------
  1934. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  1935. // Info
  1936. #define MANUFACTURER "ALLNET"
  1937. #define DEVICE "4DUINO_IOT_WLAN_RELAIS"
  1938. // Relays
  1939. #define RELAY1_PIN 14
  1940. #define RELAY1_RESET_PIN 12
  1941. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1942. // LEDs
  1943. #define LED1_PIN 0
  1944. #define LED1_PIN_INVERSE 1
  1945. // Buttons
  1946. //#define BUTTON1_PIN 0
  1947. //#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1948. // Using pins labelled as SDA & SCL as buttons
  1949. #define BUTTON2_PIN 4
  1950. #define BUTTON2_MODE BUTTON_PUSHBUTTON
  1951. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  1952. #define BUTTON2_CLICK BUTTON_MODE_NONE
  1953. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  1954. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  1955. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  1956. #define BUTTON3_PIN 5
  1957. #define BUTTON3_MODE BUTTON_PUSHBUTTON
  1958. // Using pins labelled as SDA & SCL for I2C
  1959. //#define I2C_SDA_PIN 4
  1960. //#define I2C_SCL_PIN 5
  1961. // -----------------------------------------------------------------------------
  1962. // Luani HVIO
  1963. // https://luani.de/projekte/esp8266-hvio/
  1964. // https://luani.de/blog/esp8266-230v-io-modul/
  1965. // -----------------------------------------------------------------------------
  1966. #elif defined(LUANI_HVIO)
  1967. // Info
  1968. #define MANUFACTURER "LUANI"
  1969. #define DEVICE "HVIO"
  1970. // Buttons
  1971. #define BUTTON1_PIN 12
  1972. #define BUTTON1_RELAY 1
  1973. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  1974. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1975. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1976. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1977. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1978. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1979. #define BUTTON2_PIN 13
  1980. #define BUTTON2_RELAY 2
  1981. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  1982. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  1983. // Relays
  1984. #define RELAY1_PIN 4
  1985. #define RELAY2_PIN 5
  1986. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1987. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1988. // LEDs
  1989. #define LED1_PIN 15
  1990. #define LED1_PIN_INVERSE 0
  1991. // -----------------------------------------------------------------------------
  1992. // Tonbux 50-100M Smart Mosquito Killer USB
  1993. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  1994. // -----------------------------------------------------------------------------
  1995. #elif defined(TONBUX_MOSQUITO_KILLER)
  1996. // Info
  1997. #define MANUFACTURER "TONBUX"
  1998. #define DEVICE "MOSQUITO_KILLER"
  1999. // Buttons
  2000. #define BUTTON1_PIN 2
  2001. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2002. #define BUTTON1_RELAY 1
  2003. // Relays
  2004. #define RELAY1_PIN 5 // not a relay, fan
  2005. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2006. // LEDs
  2007. #define LED1_PIN 15 // blue led
  2008. #define LED1_PIN_INVERSE 1
  2009. #define LED1_MODE LED_MODE_WIFI
  2010. #define LED2_PIN 14 // red led
  2011. #define LED2_PIN_INVERSE 1
  2012. #define LED2_MODE LED_MODE_RELAY
  2013. #define LED3_PIN 12 // UV leds (1-2-3-4-5-6-7-8)
  2014. #define LED3_PIN_INVERSE 0
  2015. #define LED3_RELAY 1
  2016. #define LED4_PIN 16 // UV leds (9-10-11)
  2017. #define LED4_PIN_INVERSE 0
  2018. #define LED4_RELAY 1
  2019. // -----------------------------------------------------------------------------
  2020. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  2021. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  2022. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  2023. // -----------------------------------------------------------------------------
  2024. #elif defined(NEO_COOLCAM_NAS_WR01W)
  2025. // Info
  2026. #define MANUFACTURER "NEO_COOLCAM"
  2027. #define DEVICE "NAS_WR01W"
  2028. // Buttons
  2029. #define BUTTON1_PIN 13
  2030. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2031. #define BUTTON1_RELAY 1
  2032. // Relays
  2033. #define RELAY1_PIN 12
  2034. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2035. // LEDs
  2036. #define LED1_PIN 4
  2037. #define LED1_PIN_INVERSE 1
  2038. // ------------------------------------------------------------------------------
  2039. // Estink Wifi Power Strip
  2040. // https://www.amazon.de/Steckdosenleiste-Ladeger%C3%A4t-Sprachsteuerung-SmartphonesTablets-Android/dp/B0796W5FZY
  2041. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  2042. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  2043. // -----------------------------------------------------------------------------
  2044. #elif defined(ESTINK_WIFI_POWER_STRIP)
  2045. // Info
  2046. #define MANUFACTURER "ESTINK"
  2047. #define DEVICE "WIFI_POWER_STRIP"
  2048. // Disable UART noise since this board uses GPIO3
  2049. #define DEBUG_SERIAL_SUPPORT 0
  2050. // Buttons
  2051. #define BUTTON1_PIN 16
  2052. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2053. #define BUTTON1_RELAY 4
  2054. // Relays
  2055. #define RELAY1_PIN 14 // USB power
  2056. #define RELAY2_PIN 13 // power plug 1
  2057. #define RELAY3_PIN 4 // power plug 2
  2058. #define RELAY4_PIN 15 // power plug 3
  2059. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2060. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2061. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2062. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2063. // LEDs
  2064. #define LED1_PIN 0 // power led
  2065. #define LED2_PIN 12 // power plug 1
  2066. #define LED3_PIN 3 // power plug 2
  2067. #define LED4_PIN 5 // power plug 3
  2068. #define LED1_PIN_INVERSE 1
  2069. #define LED2_PIN_INVERSE 1
  2070. #define LED3_PIN_INVERSE 1
  2071. #define LED4_PIN_INVERSE 1
  2072. #define LED1_MODE LED_MODE_FINDME
  2073. #define LED2_MODE LED_MODE_FOLLOW
  2074. #define LED3_MODE LED_MODE_FOLLOW
  2075. #define LED4_MODE LED_MODE_FOLLOW
  2076. #define LED2_RELAY 2
  2077. #define LED3_RELAY 3
  2078. #define LED4_RELAY 4
  2079. // -----------------------------------------------------------------------------
  2080. // Bruno Horta's OnOfre
  2081. // https://www.bhonofre.pt/
  2082. // https://github.com/brunohorta82/BH_OnOfre/
  2083. // -----------------------------------------------------------------------------
  2084. #elif defined(BH_ONOFRE)
  2085. // Info
  2086. #define MANUFACTURER "BH"
  2087. #define DEVICE "ONOFRE"
  2088. // Buttons
  2089. #define BUTTON1_PIN 12
  2090. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2091. #define BUTTON1_RELAY 1
  2092. #define BUTTON2_PIN 13
  2093. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2094. #define BUTTON2_RELAY 2
  2095. // Relays
  2096. #define RELAY1_PIN 4
  2097. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2098. #define RELAY2_PIN 5
  2099. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2100. // -----------------------------------------------------------------------------
  2101. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  2102. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  2103. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  2104. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  2105. // * Gosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  2106. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  2107. // -----------------------------------------------------------------------------
  2108. #elif defined(BLITZWOLF_BWSHP2)
  2109. // Info
  2110. #define MANUFACTURER "BLITZWOLF"
  2111. #define DEVICE "BWSHP2"
  2112. // Buttons
  2113. #define BUTTON1_PIN 13
  2114. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2115. #define BUTTON1_RELAY 1
  2116. // Relays
  2117. #define RELAY1_PIN 15
  2118. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2119. // LEDs
  2120. #define LED1_PIN 2
  2121. #define LED1_PIN_INVERSE 1
  2122. #define LED2_PIN 0
  2123. #define LED2_PIN_INVERSE 1
  2124. #define LED2_MODE LED_MODE_FINDME
  2125. #define LED2_RELAY 1
  2126. // HJL01 / BL0937
  2127. #ifndef HLW8012_SUPPORT
  2128. #define HLW8012_SUPPORT 1
  2129. #endif
  2130. #define HLW8012_SEL_PIN 12
  2131. #define HLW8012_CF1_PIN 14
  2132. #define HLW8012_CF_PIN 5
  2133. #define HLW8012_SEL_CURRENT LOW
  2134. #define HLW8012_CURRENT_RATIO 25740
  2135. #define HLW8012_VOLTAGE_RATIO 313400
  2136. #define HLW8012_POWER_RATIO 3414290
  2137. #define HLW8012_INTERRUPT_ON FALLING
  2138. // -----------------------------------------------------------------------------
  2139. // Same as the above but new board version marked V2.3
  2140. // -----------------------------------------------------------------------------
  2141. #elif defined(BLITZWOLF_BWSHP2_V23)
  2142. // Info
  2143. #define MANUFACTURER "BLITZWOLF"
  2144. #define DEVICE "BWSHP2V2.3"
  2145. // Buttons
  2146. #define BUTTON1_PIN 3
  2147. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2148. #define BUTTON1_RELAY 1
  2149. // Relays
  2150. #define RELAY1_PIN 14
  2151. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2152. // LEDs
  2153. #define LED1_PIN 1
  2154. #define LED1_PIN_INVERSE 1
  2155. #define LED2_PIN 13
  2156. #define LED2_PIN_INVERSE 1
  2157. #define LED2_MODE LED_MODE_FINDME
  2158. #define LED2_RELAY 1
  2159. // HJL01 / BL0937
  2160. #ifndef HLW8012_SUPPORT
  2161. #define HLW8012_SUPPORT 1
  2162. #endif
  2163. #define HLW8012_SEL_PIN 12
  2164. #define HLW8012_CF1_PIN 5
  2165. #define HLW8012_CF_PIN 4
  2166. #define HLW8012_SEL_CURRENT LOW
  2167. #define HLW8012_CURRENT_RATIO 25740
  2168. #define HLW8012_VOLTAGE_RATIO 313400
  2169. #define HLW8012_POWER_RATIO 3414290
  2170. #define HLW8012_INTERRUPT_ON FALLING
  2171. // -----------------------------------------------------------------------------
  2172. // Teckin SP22 v1.4 - v1.6
  2173. // -----------------------------------------------------------------------------
  2174. #elif defined(TECKIN_SP22_V14)
  2175. // Info
  2176. #define MANUFACTURER "TECKIN"
  2177. #define DEVICE "SP22_V14"
  2178. // Buttons
  2179. #define BUTTON1_PIN 1
  2180. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2181. #define BUTTON1_RELAY 1
  2182. // Relays
  2183. #define RELAY1_PIN 14
  2184. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2185. // LEDs
  2186. #define LED1_PIN 3
  2187. #define LED1_PIN_INVERSE 1
  2188. #define LED2_PIN 13
  2189. #define LED2_PIN_INVERSE 1
  2190. #define LED2_MODE LED_MODE_FINDME
  2191. #define LED2_RELAY 1
  2192. // HJL01 / BL0937
  2193. #ifndef HLW8012_SUPPORT
  2194. #define HLW8012_SUPPORT 1
  2195. #endif
  2196. #define HLW8012_SEL_PIN 12
  2197. #define HLW8012_CF1_PIN 5
  2198. #define HLW8012_CF_PIN 4
  2199. #define HLW8012_SEL_CURRENT LOW
  2200. #define HLW8012_CURRENT_RATIO 20730
  2201. #define HLW8012_VOLTAGE_RATIO 264935
  2202. #define HLW8012_POWER_RATIO 2533110
  2203. #define HLW8012_INTERRUPT_ON FALLING
  2204. // -----------------------------------------------------------------------------
  2205. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  2206. // -----------------------------------------------------------------------------
  2207. #elif defined(GOSUND_WS1)
  2208. // Info
  2209. #define MANUFACTURER "GOSUND"
  2210. #define DEVICE "WS1"
  2211. // Buttons
  2212. #define BUTTON1_PIN 0
  2213. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2214. #define BUTTON1_RELAY 1
  2215. // Relays
  2216. #define RELAY1_PIN 14
  2217. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2218. // LEDs
  2219. #define LED1_PIN 1
  2220. #define LED1_PIN_INVERSE 1
  2221. #elif defined(GOSUND_SP1_V23)
  2222. // Info
  2223. #define MANUFACTURER "GOSUND"
  2224. #define DEVICE "SP1_v23"
  2225. // Buttons
  2226. #define BUTTON1_PIN 3
  2227. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2228. #define BUTTON1_RELAY 1
  2229. // Relays
  2230. #define RELAY1_PIN 14
  2231. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2232. // LEDs
  2233. #define LED1_PIN 1
  2234. #define LED1_PIN_INVERSE 1
  2235. #define LED2_PIN 13
  2236. #define LED2_PIN_INVERSE 0
  2237. #define LED2_MODE LED_MODE_FINDME
  2238. #define LED2_RELAY 1
  2239. // HJL01 / BL0937
  2240. #ifndef HLW8012_SUPPORT
  2241. #define HLW8012_SUPPORT 1
  2242. #endif
  2243. #define HLW8012_SEL_PIN 12
  2244. #define HLW8012_CF1_PIN 5
  2245. #define HLW8012_CF_PIN 4
  2246. #define HLW8012_SEL_CURRENT LOW
  2247. #define HLW8012_CURRENT_RATIO 25740
  2248. #define HLW8012_VOLTAGE_RATIO 313400
  2249. #define HLW8012_POWER_RATIO 3414290
  2250. #define HLW8012_INTERRUPT_ON FALLING
  2251. // ----------------------------------------------------------------------------------------
  2252. // Homecube 16A is similar but some pins differ and it also has RGB LEDs
  2253. // https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
  2254. // ----------------------------------------------------------------------------------------
  2255. #elif defined(HOMECUBE_16A)
  2256. // Info
  2257. #define MANUFACTURER "HOMECUBE"
  2258. #define DEVICE "16A"
  2259. // Buttons
  2260. #define BUTTON1_PIN 13
  2261. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2262. #define BUTTON1_RELAY 1
  2263. // Relays
  2264. #define RELAY1_PIN 15
  2265. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2266. // LEDs
  2267. //LED Pin 4 - ESP8266 onboard LED
  2268. //Red LED: 0
  2269. //Green LED: 12
  2270. //Blue LED: 2
  2271. // Blue
  2272. #define LED1_PIN 2
  2273. #define LED1_PIN_INVERSE 0
  2274. // Green
  2275. #define LED2_PIN 12
  2276. #define LED2_PIN_INVERSE 1
  2277. #define LED2_MODE LED_MODE_RELAY
  2278. // Red
  2279. #define LED3_PIN 0
  2280. #define LED3_PIN_INVERSE 0
  2281. #define LED3_MODE LED_MODE_OFF
  2282. // HJL01 / BL0937
  2283. #ifndef HLW8012_SUPPORT
  2284. #define HLW8012_SUPPORT 1
  2285. #endif
  2286. #define HLW8012_SEL_PIN 16
  2287. #define HLW8012_CF1_PIN 14
  2288. #define HLW8012_CF_PIN 5
  2289. #define HLW8012_SEL_CURRENT LOW
  2290. #define HLW8012_CURRENT_RATIO 25740
  2291. #define HLW8012_VOLTAGE_RATIO 313400
  2292. #define HLW8012_POWER_RATIO 3414290
  2293. #define HLW8012_INTERRUPT_ON FALLING
  2294. // -----------------------------------------------------------------------------
  2295. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  2296. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  2297. // -----------------------------------------------------------------------------
  2298. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  2299. // Info
  2300. #define MANUFACTURER "VANZAVANZU"
  2301. #define DEVICE "SMART_WIFI_PLUG_MINI"
  2302. // Buttons
  2303. #define BUTTON1_PIN 13
  2304. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2305. #define BUTTON1_RELAY 1
  2306. // Relays
  2307. #define RELAY1_PIN 15
  2308. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2309. // LEDs
  2310. #define LED1_PIN 2
  2311. #define LED1_PIN_INVERSE 1
  2312. #define LED2_PIN 0
  2313. #define LED2_PIN_INVERSE 1
  2314. #define LED2_MODE LED_MODE_FINDME
  2315. #define LED2_RELAY 1
  2316. // Disable UART noise
  2317. #define DEBUG_SERIAL_SUPPORT 0
  2318. // HJL01 / BL0937
  2319. #ifndef HLW8012_SUPPORT
  2320. #define HLW8012_SUPPORT 1
  2321. #endif
  2322. #define HLW8012_SEL_PIN 3
  2323. #define HLW8012_CF1_PIN 14
  2324. #define HLW8012_CF_PIN 5
  2325. #define HLW8012_SEL_CURRENT LOW
  2326. #define HLW8012_CURRENT_RATIO 25740
  2327. #define HLW8012_VOLTAGE_RATIO 313400
  2328. #define HLW8012_POWER_RATIO 3414290
  2329. #define HLW8012_INTERRUPT_ON FALLING
  2330. // -----------------------------------------------------------------------------
  2331. #elif defined(GENERIC_AG_L4)
  2332. // Info
  2333. #define MANUFACTURER "GENERIC"
  2334. #define DEVICE "AG_L4"
  2335. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2336. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2337. #define DUMMY_RELAY_COUNT 1
  2338. // button 1: "power" button
  2339. #define BUTTON1_PIN 4
  2340. #define BUTTON1_RELAY 1
  2341. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2342. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  2343. #define BUTTON1_CLICK BUTTON_MODE_NONE
  2344. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2345. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2346. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  2347. // button 2: "wifi" button
  2348. #define BUTTON2_PIN 2
  2349. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2350. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  2351. #define BUTTON2_CLICK BUTTON_MODE_NONE
  2352. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  2353. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  2354. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  2355. // LEDs
  2356. #define LED1_PIN 5 // red status led
  2357. #define LED1_PIN_INVERSE 0
  2358. #define LED2_PIN 16 // master light power
  2359. #define LED2_PIN_INVERSE 1
  2360. #define LED2_MODE LED_MODE_RELAY
  2361. // Light
  2362. #define LIGHT_CHANNELS 3
  2363. #define LIGHT_CH1_PIN 14 // RED
  2364. #define LIGHT_CH2_PIN 13 // GREEN
  2365. #define LIGHT_CH3_PIN 12 // BLUE
  2366. #define LIGHT_CH1_INVERSE 0
  2367. #define LIGHT_CH2_INVERSE 0
  2368. #define LIGHT_CH3_INVERSE 0
  2369. // -----------------------------------------------------------------------------
  2370. #elif defined(ALLTERCO_SHELLY1)
  2371. // Info
  2372. #define MANUFACTURER "ALLTERCO"
  2373. #define DEVICE "SHELLY1"
  2374. // Buttons
  2375. #define BUTTON1_PIN 5
  2376. #define BUTTON1_MODE BUTTON_SWITCH
  2377. #define BUTTON1_RELAY 1
  2378. // Relays
  2379. #define RELAY1_PIN 4
  2380. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2381. #elif defined(ALLTERCO_SHELLY2)
  2382. // Info
  2383. #define MANUFACTURER "ALLTERCO"
  2384. #define DEVICE "SHELLY2"
  2385. // Buttons
  2386. #define BUTTON1_PIN 12
  2387. #define BUTTON2_PIN 14
  2388. #define BUTTON1_MODE BUTTON_SWITCH
  2389. #define BUTTON2_MODE BUTTON_SWITCH
  2390. #define BUTTON1_RELAY 1
  2391. #define BUTTON2_RELAY 2
  2392. // Relays
  2393. #define RELAY1_PIN 4
  2394. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2395. #define RELAY2_PIN 5
  2396. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2397. // -----------------------------------------------------------------------------
  2398. #elif defined(LOHAS_9W)
  2399. // Info
  2400. #define MANUFACTURER "LOHAS"
  2401. #define DEVICE "E27_9W"
  2402. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2403. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2404. #define DUMMY_RELAY_COUNT 1
  2405. // Light
  2406. #define LIGHT_CHANNELS 5
  2407. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2408. #define MY92XX_CHIPS 2
  2409. #define MY92XX_DI_PIN 13
  2410. #define MY92XX_DCKI_PIN 15
  2411. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2412. #define MY92XX_MAPPING 0, 1, 2, 3, 4
  2413. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  2414. // -----------------------------------------------------------------------------
  2415. #elif defined(XIAOMI_SMART_DESK_LAMP)
  2416. // Info
  2417. #define MANUFACTURER "XIAOMI"
  2418. #define DEVICE "SMART_DESK_LAMP"
  2419. // Buttons
  2420. #define BUTTON1_PIN 2
  2421. #define BUTTON2_PIN 14
  2422. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2423. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2424. // This button doubles as switch here and as encoder mode switch below
  2425. // Clicking it (for less than 500ms) will turn the light on and off
  2426. // Double and Long clicks will not work as these are used to modify the encoder action
  2427. #define BUTTON1_RELAY 1
  2428. #define BUTTON_LNGCLICK_DELAY 500
  2429. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2430. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2431. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  2432. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  2433. #define BUTTON2_DBLCLICK BUTTON_MODE_AP
  2434. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  2435. // Light
  2436. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2437. #define DUMMY_RELAY_COUNT 1
  2438. #define LIGHT_STEP 8
  2439. #define LIGHT_CHANNELS 2
  2440. #define LIGHT_CH1_PIN 5 // warm white
  2441. #define LIGHT_CH1_INVERSE 0
  2442. #define LIGHT_CH2_PIN 4 // cold white
  2443. #define LIGHT_CH2_INVERSE 0
  2444. // Encoder
  2445. // If mode is ENCODER_MODE_RATIO, the value ratio between both channels is changed
  2446. // when the button is not pressed, and the overall brightness when pressed
  2447. // If mode is ENCODER_MODE_CHANNEL, the first channel value is changed
  2448. // when the button is not pressed, and the second channel when pressed
  2449. // If no ENCODERX_BUTTON_PIN defined it will only change the value of the first defined channel
  2450. #define ENCODER_SUPPORT 1
  2451. #define ENCODER1_PIN1 12
  2452. #define ENCODER1_PIN2 13
  2453. #define ENCODER1_BUTTON_PIN 2 // active low by default, with software pullup
  2454. #define ENCODER1_CHANNEL1 0 // please note this value is 0-based (LIGHT_CH1 above)
  2455. #define ENCODER1_CHANNEL2 1 // please note this value is 0-based (LIGHT_CH2 above)
  2456. #define ENCODER1_MODE ENCODER_MODE_RATIO
  2457. #elif defined(PHYX_ESP12_RGB)
  2458. // Info
  2459. #define MANUFACTURER "PHYX"
  2460. #define DEVICE "ESP12_RGB"
  2461. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2462. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2463. #define DUMMY_RELAY_COUNT 1
  2464. // Light
  2465. #define LIGHT_CHANNELS 3
  2466. #define LIGHT_CH1_PIN 4 // RED
  2467. #define LIGHT_CH2_PIN 14 // GREEN
  2468. #define LIGHT_CH3_PIN 12 // BLUE
  2469. #define LIGHT_CH1_INVERSE 0
  2470. #define LIGHT_CH2_INVERSE 0
  2471. #define LIGHT_CH3_INVERSE 0
  2472. // -----------------------------------------------------------------------------
  2473. // iWoole LED Table Lamp
  2474. // 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
  2475. // -----------------------------------------------------------------------------
  2476. #elif defined(IWOOLE_LED_TABLE_LAMP)
  2477. // Info
  2478. #define MANUFACTURER "IWOOLE"
  2479. #define DEVICE "LED_TABLE_LAMP"
  2480. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2481. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2482. #define DUMMY_RELAY_COUNT 1
  2483. // Light
  2484. #define LIGHT_CHANNELS 4
  2485. #define LIGHT_CH1_PIN 12 // RED
  2486. #define LIGHT_CH2_PIN 5 // GREEN
  2487. #define LIGHT_CH3_PIN 14 // BLUE
  2488. #define LIGHT_CH4_PIN 4 // WHITE
  2489. #define LIGHT_CH1_INVERSE 0
  2490. #define LIGHT_CH2_INVERSE 0
  2491. #define LIGHT_CH3_INVERSE 0
  2492. #define LIGHT_CH4_INVERSE 0
  2493. // -----------------------------------------------------------------------------
  2494. // Lombex Lux Nova 2 Tunable White
  2495. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2496. // -----------------------------------------------------------------------------
  2497. #elif defined(LOMBEX_LUX_NOVA2_TUNABLE_WHITE)
  2498. // Info
  2499. #define MANUFACTURER "LOMBEX"
  2500. #define DEVICE "LUX_NOVA2_TUNABLE_WHITE"
  2501. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2502. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2503. #define DUMMY_RELAY_COUNT 1
  2504. // Light
  2505. #define LIGHT_CHANNELS 5
  2506. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2507. #define MY92XX_CHIPS 1
  2508. #define MY92XX_DI_PIN 4
  2509. #define MY92XX_DCKI_PIN 5
  2510. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2511. // No RGB on this bulb. Warm white on channel 0, cool white on channel 3
  2512. #define MY92XX_MAPPING 255, 255, 255, 3, 0
  2513. // -----------------------------------------------------------------------------
  2514. // Lombex Lux Nova 2 White and Color
  2515. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2516. // -----------------------------------------------------------------------------
  2517. #elif defined(LOMBEX_LUX_NOVA2_WHITE_COLOR)
  2518. // Info
  2519. #define MANUFACTURER "LOMBEX"
  2520. #define DEVICE "LUX_NOVA2_WHITE_COLOR"
  2521. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2522. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2523. #define DUMMY_RELAY_COUNT 1
  2524. // Light
  2525. #define LIGHT_CHANNELS 4
  2526. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2527. #define MY92XX_CHIPS 1
  2528. #define MY92XX_DI_PIN 4
  2529. #define MY92XX_DCKI_PIN 5
  2530. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2531. // RGB on channels 0/1/2, either cool or warm white on channel 3
  2532. // The bulb *should* have cool leds, but could also have warm leds as a common defect
  2533. #define MY92XX_MAPPING 0, 1, 2, 3
  2534. // -----------------------------------------------------------------------------
  2535. // Bestek Smart Plug with 2 USB ports
  2536. // https://www.bestekcorp.com/bestek-smart-plug-works-with-amazon-alexa-google-assistant-and-ifttt-with-2-usb
  2537. // -----------------------------------------------------------------------------
  2538. #elif defined(BESTEK_MRJ1011)
  2539. // Info
  2540. #define MANUFACTURER "BESTEK"
  2541. #define DEVICE "MRJ1011"
  2542. // Buttons
  2543. #define BUTTON1_PIN 13
  2544. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2545. #define BUTTON1_RELAY 1
  2546. // Relay
  2547. #define RELAY1_PIN 12
  2548. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2549. // LED
  2550. #define LED1_PIN 4
  2551. #define LED1_PIN_INVERSE 1
  2552. // -----------------------------------------------------------------------------
  2553. // GBLIFE RGBW SOCKET
  2554. // -----------------------------------------------------------------------------
  2555. #elif defined(GBLIFE_RGBW_SOCKET)
  2556. // Info
  2557. #define MANUFACTURER "GBLIFE"
  2558. #define DEVICE "RGBW_SOCKET"
  2559. // Buttons
  2560. #define BUTTON1_PIN 13
  2561. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2562. #define BUTTON1_RELAY 1
  2563. // Relays
  2564. #define RELAY1_PIN 15
  2565. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2566. // Light RGBW
  2567. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2568. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2569. #define DUMMY_RELAY_COUNT 1
  2570. #define LIGHT_CHANNELS 4
  2571. #define LIGHT_CH1_PIN 5 // RED
  2572. #define LIGHT_CH2_PIN 14 // GREEN
  2573. #define LIGHT_CH3_PIN 12 // BLUE
  2574. #define LIGHT_CH4_PIN 4 // WHITE
  2575. #define LIGHT_CH1_INVERSE 0
  2576. #define LIGHT_CH2_INVERSE 0
  2577. #define LIGHT_CH3_INVERSE 0
  2578. #define LIGHT_CH4_INVERSE 0
  2579. // ----------------------------------------------------------------------------------------
  2580. // Smart life Mini Smart Socket is similar Homecube 16A but some GPIOs differ
  2581. // https://www.ebay.de/itm/Smart-Steckdose-WIFI-WLAN-Amazon-Alexa-Fernbedienung-Home-Socket-Zeitschaltuh-DE/123352026749?hash=item1cb85a8e7d:g:IasAAOSwk6dbj390
  2582. // ----------------------------------------------------------------------------------------
  2583. #elif defined(SMARTLIFE_MINI_SMART_SOCKET)
  2584. // Info
  2585. #define MANUFACTURER "SMARTLIFE"
  2586. #define DEVICE "MINI_SMART_SOCKET"
  2587. // Buttons
  2588. #define BUTTON1_PIN 13
  2589. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2590. #define BUTTON1_RELAY 1
  2591. // Relays
  2592. #define RELAY1_PIN 15
  2593. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2594. // LEDs
  2595. //Red LED: 0
  2596. //Green LED: 4
  2597. //Blue LED: 2
  2598. // Light
  2599. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2600. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2601. #define DUMMY_RELAY_COUNT 1
  2602. #define LIGHT_CHANNELS 3
  2603. #define LIGHT_CH1_PIN 0 // RED
  2604. #define LIGHT_CH2_PIN 4 // GREEN
  2605. #define LIGHT_CH3_PIN 2 // BLUE
  2606. #define LIGHT_CH1_INVERSE 0
  2607. #define LIGHT_CH2_INVERSE 0
  2608. #define LIGHT_CH3_INVERSE 0
  2609. // HJL01 / BL0937
  2610. #ifndef HLW8012_SUPPORT
  2611. #define HLW8012_SUPPORT 1
  2612. #endif
  2613. #define HLW8012_SEL_PIN 12
  2614. #define HLW8012_CF1_PIN 14
  2615. #define HLW8012_CF_PIN 5
  2616. #define HLW8012_SEL_CURRENT LOW
  2617. #define HLW8012_CURRENT_RATIO 25740
  2618. #define HLW8012_VOLTAGE_RATIO 313400
  2619. #define HLW8012_POWER_RATIO 3414290
  2620. #define HLW8012_INTERRUPT_ON FALLING
  2621. // -----------------------------------------------------------------------------
  2622. // TEST boards (do not use!!)
  2623. // -----------------------------------------------------------------------------
  2624. #elif defined(TRAVIS01)
  2625. // Info
  2626. #define MANUFACTURER "TravisCI"
  2627. #define DEVICE "Virtual board 01"
  2628. // Some buttons - pin 0
  2629. #define BUTTON1_PIN 0
  2630. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2631. #define BUTTON1_RELAY 1
  2632. // Some relays - pin 1
  2633. #define RELAY1_PIN 1
  2634. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2635. // Some LEDs - pin 2
  2636. #define LED1_PIN 2
  2637. #define LED1_PIN_INVERSE 1
  2638. // A bit of I2C - pins 3,4
  2639. #define I2C_SDA_PIN 3
  2640. #define I2C_SCL_PIN 4
  2641. // And, as they say in "From Dusk till Dawn":
  2642. // This is a sensor blow out!
  2643. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  2644. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  2645. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  2646. // C'mon, you want sensor, come on in sensor lovers!
  2647. // If we don’t got it, you don't want it!
  2648. #define AM2320_SUPPORT 1
  2649. #define BH1750_SUPPORT 1
  2650. #define BMP180_SUPPORT 1
  2651. #define BMX280_SUPPORT 1
  2652. #define SHT3X_I2C_SUPPORT 1
  2653. #define EMON_ADC121_SUPPORT 1
  2654. #define EMON_ADS1X15_SUPPORT 1
  2655. #define SHT3X_I2C_SUPPORT 1
  2656. #define SI7021_SUPPORT 1
  2657. #define PMSX003_SUPPORT 1
  2658. #define SENSEAIR_SUPPORT 1
  2659. #define VL53L1X_SUPPORT 1
  2660. #define MAX6675_SUPPORT 1
  2661. // A bit of lights - pin 5
  2662. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2663. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2664. #define DUMMY_RELAY_COUNT 1
  2665. #define LIGHT_CHANNELS 1
  2666. #define LIGHT_CH1_PIN 5
  2667. #define LIGHT_CH1_INVERSE 0
  2668. // A bit of HLW8012 - pins 6,7,8
  2669. #ifndef HLW8012_SUPPORT
  2670. #define HLW8012_SUPPORT 1
  2671. #endif
  2672. #define HLW8012_SEL_PIN 6
  2673. #define HLW8012_CF1_PIN 7
  2674. #define HLW8012_CF_PIN 8
  2675. // A bit of Dallas - pin 9
  2676. #ifndef DALLAS_SUPPORT
  2677. #define DALLAS_SUPPORT 1
  2678. #endif
  2679. #define DALLAS_PIN 9
  2680. // A bit of ECH1560 - pins 10,11, 12
  2681. #ifndef ECH1560_SUPPORT
  2682. #define ECH1560_SUPPORT 1
  2683. #endif
  2684. #define ECH1560_CLK_PIN 10
  2685. #define ECH1560_MISO_PIN 11
  2686. #define ECH1560_INVERTED 12
  2687. // MICS-2710 & MICS-5525 test
  2688. #define MICS2710_SUPPORT 1
  2689. #define MICS5525_SUPPORT 1
  2690. // MAX6675 14 11 10
  2691. #ifndef MAX6675_SUPPORT
  2692. #define MAX6675_SUPPORT 1
  2693. #endif
  2694. #define MAX6675_CS_PIN 14
  2695. #define MAX6675_SO_PIN 11
  2696. #define MAX6675_SCK_PIN 10
  2697. #elif defined(TRAVIS02)
  2698. // Relay provider dual
  2699. #define MANUFACTURER "TravisCI"
  2700. #define DEVICE "Virtual board 02"
  2701. // Some buttons - pin 0
  2702. #define BUTTON1_PIN 0
  2703. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2704. #define BUTTON1_RELAY 1
  2705. // A bit of CSE7766 - pin 1
  2706. #ifndef CSE7766_SUPPORT
  2707. #define CSE7766_SUPPORT 1
  2708. #endif
  2709. #define CSE7766_PIN 1
  2710. // Relay type dual - pins 2,3
  2711. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  2712. #define RELAY1_PIN 2
  2713. #define RELAY2_PIN 3
  2714. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2715. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2716. // IR - pin 4
  2717. #define IR_SUPPORT 1
  2718. #define IR_RX_PIN 4
  2719. #define IR_BUTTON_SET 1
  2720. // A bit of DHT - pin 5
  2721. #ifndef DHT_SUPPORT
  2722. #define DHT_SUPPORT 1
  2723. #endif
  2724. #define DHT_PIN 5
  2725. // A bit of TMP3X (analog)
  2726. #define TMP3X_SUPPORT 1
  2727. // A bit of EVENTS - pin 10
  2728. #define EVENTS_SUPPORT 1
  2729. #define EVENTS_PIN 6
  2730. // Sonar
  2731. #define SONAR_SUPPORT 1
  2732. #define SONAR_TRIGGER 7
  2733. #define SONAR_ECHO 8
  2734. // MHZ19
  2735. #define MHZ19_SUPPORT 1
  2736. #define MHZ19_RX_PIN 9
  2737. #define MHZ19_TX_PIN 10
  2738. // PZEM004T
  2739. #define PZEM004T_SUPPORT 1
  2740. #define PZEM004T_RX_PIN 11
  2741. #define PZEM004T_TX_PIN 12
  2742. // V9261F
  2743. #define V9261F_SUPPORT 1
  2744. #define V9261F_PIN 13
  2745. // GUVAS12SD
  2746. #define GUVAS12SD_SUPPORT 1
  2747. #define GUVAS12SD_PIN 14
  2748. // Test non-default modules
  2749. #define MDNS_CLIENT_SUPPORT 1
  2750. #define NOFUSS_SUPPORT 1
  2751. #define UART_MQTT_SUPPORT 1
  2752. #define INFLUXDB_SUPPORT 1
  2753. #define IR_SUPPORT 1
  2754. #elif defined(TRAVIS03)
  2755. // Relay provider light/my92XX
  2756. #define MANUFACTURER "TravisCI"
  2757. #define DEVICE "Virtual board 03"
  2758. // Some buttons - pin 0
  2759. #define BUTTON1_PIN 0
  2760. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2761. #define BUTTON1_RELAY 1
  2762. // MY9231 Light - pins 1,2
  2763. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2764. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2765. #define DUMMY_RELAY_COUNT 1
  2766. #define LIGHT_CHANNELS 5
  2767. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2768. #define MY92XX_CHIPS 2
  2769. #define MY92XX_DI_PIN 1
  2770. #define MY92XX_DCKI_PIN 2
  2771. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2772. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  2773. // A bit of Analog EMON (analog)
  2774. #ifndef EMON_ANALOG_SUPPORT
  2775. #define EMON_ANALOG_SUPPORT 1
  2776. #endif
  2777. #define PULSEMETER_SUPPORT 1
  2778. // Test non-default modules
  2779. #define LLMNR_SUPPORT 1
  2780. #define NETBIOS_SUPPORT 1
  2781. #define SSDP_SUPPORT 1
  2782. #define RF_SUPPORT 1
  2783. #endif
  2784. // -----------------------------------------------------------------------------
  2785. // Check definitions
  2786. // -----------------------------------------------------------------------------
  2787. #if not defined(MANUFACTURER) || not defined(DEVICE)
  2788. #error "UNSUPPORTED HARDWARE!!"
  2789. #endif