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.

3578 lines
114 KiB

6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
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. // Oukitel - P1
  1655. // -----------------------------------------------------------------------------
  1656. #elif defined(OUKITEL_P1)
  1657. // -----------------------------------------------------------------------------
  1658. // Oukitel P1 Smart Plug
  1659. // https://www.amazon.com/Docooler-OUKITEL-Control-Wireless-Adaptor/dp/B07J3BYFJX/ref=sr_1_fkmrnull_2?keywords=oukitel+p1+smart+switch&qid=1550424399&s=gateway&sr=8-2-fkmrnull
  1660. // -----------------------------------------------------------------------------
  1661. // Info
  1662. #define MANUFACTURER "Oukitel"
  1663. #define DEVICE "P1"
  1664. // Buttons
  1665. #define BUTTON1_PIN 13
  1666. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1667. #define BUTTON1_RELAY 1
  1668. // Relays
  1669. // Right
  1670. #define RELAY1_PIN 12
  1671. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1672. // Left
  1673. #define RELAY2_PIN 15
  1674. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1675. // LEDs
  1676. #define LED1_PIN 0 // blue
  1677. #define LED1_PIN_INVERSE 1
  1678. #define LED1_MODE LED_MODE_WIFI
  1679. // -----------------------------------------------------------------------------
  1680. // YiDian XS-SSA05
  1681. // -----------------------------------------------------------------------------
  1682. #elif defined(YIDIAN_XSSSA05)
  1683. // Info
  1684. #define MANUFACTURER "YIDIAN"
  1685. #define DEVICE "XSSSA05"
  1686. // Buttons
  1687. #define BUTTON1_PIN 13
  1688. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1689. #define BUTTON1_RELAY 1
  1690. // Relays
  1691. #define RELAY1_PIN 12
  1692. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1693. // LEDs
  1694. #define LED1_PIN 0 // red
  1695. #define LED1_PIN_INVERSE 1
  1696. #define LED1_MODE LED_MODE_WIFI
  1697. #define LED2_PIN 15 // blue
  1698. #define LED2_PIN_INVERSE 1
  1699. #define LED2_MODE LED_MODE_RELAY
  1700. // HLW8012
  1701. #ifndef HLW8012_SUPPORT
  1702. #define HLW8012_SUPPORT 1
  1703. #endif
  1704. #define HLW8012_SEL_PIN 3
  1705. #define HLW8012_CF1_PIN 14
  1706. #define HLW8012_CF_PIN 5
  1707. #define HLW8012_SEL_CURRENT LOW
  1708. #define HLW8012_CURRENT_RATIO 25740
  1709. #define HLW8012_VOLTAGE_RATIO 313400
  1710. #define HLW8012_POWER_RATIO 3414290
  1711. #define HLW8012_INTERRUPT_ON FALLING
  1712. // -----------------------------------------------------------------------------
  1713. // TONBUX XS-SSA01
  1714. // -----------------------------------------------------------------------------
  1715. #elif defined(TONBUX_XSSSA01)
  1716. // Info
  1717. #define MANUFACTURER "TONBUX"
  1718. #define DEVICE "XSSSA01"
  1719. // Buttons
  1720. #define BUTTON1_PIN 4
  1721. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1722. #define BUTTON1_RELAY 1
  1723. // Relays
  1724. #define RELAY1_PIN 14
  1725. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1726. // LEDs
  1727. #define LED1_PIN 13
  1728. #define LED1_PIN_INVERSE 0
  1729. // -----------------------------------------------------------------------------
  1730. // TONBUX XS-SSA06
  1731. // -----------------------------------------------------------------------------
  1732. #elif defined(TONBUX_XSSSA06)
  1733. // Info
  1734. #define MANUFACTURER "TONBUX"
  1735. #define DEVICE "XSSSA06"
  1736. // Buttons
  1737. #define BUTTON1_PIN 13
  1738. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1739. #define BUTTON1_RELAY 1
  1740. // Relays
  1741. #define RELAY1_PIN 15
  1742. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1743. // LEDs
  1744. #define LED1_PIN 0 // R - 8 rgb led ring
  1745. #define LED1_PIN_INVERSE 0
  1746. #define LED2_PIN 5 // G
  1747. #define LED2_PIN_INVERSE 0
  1748. #define LED3_PIN 2 // B
  1749. #define LED3_PIN_INVERSE 0
  1750. // -----------------------------------------------------------------------------
  1751. // GREEN ESP8266 RELAY MODULE
  1752. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1753. // -----------------------------------------------------------------------------
  1754. #elif defined(GREEN_ESP8266RELAY)
  1755. // Info
  1756. #define MANUFACTURER "GREEN"
  1757. #define DEVICE "ESP8266RELAY"
  1758. // Buttons
  1759. // Not a button but input via Optocoupler
  1760. #define BUTTON1_PIN 5
  1761. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1762. #define BUTTON1_RELAY 1
  1763. // Relays
  1764. #define RELAY1_PIN 4
  1765. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1766. // LEDs
  1767. #define LED1_PIN 2
  1768. #define LED1_PIN_INVERSE 1
  1769. // -----------------------------------------------------------------------------
  1770. // Henrique Gravina ESPIKE
  1771. // https://github.com/Henriquegravina/Espike
  1772. // -----------------------------------------------------------------------------
  1773. #elif defined(IKE_ESPIKE)
  1774. #define MANUFACTURER "IKE"
  1775. #define DEVICE "ESPIKE"
  1776. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1777. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1778. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1779. #define BUTTON1_PIN 13
  1780. #define BUTTON1_RELAY 1
  1781. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1782. #define BUTTON2_PIN 12
  1783. #define BUTTON2_RELAY 2
  1784. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1785. #define BUTTON3_PIN 14
  1786. #define BUTTON3_RELAY 3
  1787. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1788. #define RELAY1_PIN 4
  1789. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1790. #define RELAY2_PIN 5
  1791. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1792. #define RELAY3_PIN 16
  1793. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1794. #define LED1_PIN 2
  1795. #define LED1_PIN_INVERSE 1
  1796. // -----------------------------------------------------------------------------
  1797. // SWIFITCH
  1798. // https://github.com/ArnieX/swifitch
  1799. // -----------------------------------------------------------------------------
  1800. #elif defined(ARNIEX_SWIFITCH)
  1801. // Info
  1802. #define MANUFACTURER "ARNIEX"
  1803. #define DEVICE "SWIFITCH"
  1804. // Buttons
  1805. #define BUTTON1_PIN 4 // D2
  1806. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1807. #define BUTTON1_RELAY 1
  1808. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1809. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1810. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1811. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1812. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1813. // Relays
  1814. #define RELAY1_PIN 5 // D1
  1815. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1816. // LEDs
  1817. #define LED1_PIN 12 // D6
  1818. #define LED1_PIN_INVERSE 1
  1819. // -----------------------------------------------------------------------------
  1820. // ESP-01S RELAY v4.0
  1821. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  1822. // -----------------------------------------------------------------------------
  1823. #elif defined(GENERIC_ESP01S_RELAY_V40)
  1824. // Info
  1825. #define MANUFACTURER "GENERIC"
  1826. #define DEVICE "ESP01S_RELAY_40"
  1827. // Relays
  1828. #define RELAY1_PIN 0
  1829. #ifndef RELAY1_TYPE
  1830. #define RELAY1_TYPE RELAY_TYPE_NORMAL // See #1504 and #1554
  1831. #endif
  1832. // LEDs
  1833. #define LED1_PIN 2
  1834. #define LED1_PIN_INVERSE 0
  1835. // -----------------------------------------------------------------------------
  1836. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  1837. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  1838. // -----------------------------------------------------------------------------
  1839. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  1840. // Info
  1841. #define MANUFACTURER "GENERIC"
  1842. #define DEVICE "ESP01S_RGBLED_10"
  1843. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  1844. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  1845. // Buttons
  1846. //#define BUTTON1_PIN 2
  1847. // Relays
  1848. //#define RELAY1_PIN 2
  1849. // LEDs
  1850. #define LED1_PIN 2
  1851. #define LED1_PIN_INVERSE 0
  1852. // -----------------------------------------------------------------------------
  1853. // ESP-01S DHT11 v1.0
  1854. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  1855. // -----------------------------------------------------------------------------
  1856. #elif defined(GENERIC_ESP01S_DHT11_V10)
  1857. // Info
  1858. #define MANUFACTURER "GENERIC"
  1859. #define DEVICE "ESP01S_DHT11_10"
  1860. // DHT11
  1861. #ifndef DHT_SUPPORT
  1862. #define DHT_SUPPORT 1
  1863. #endif
  1864. #define DHT_PIN 2
  1865. #define DHT_TYPE DHT_CHIP_DHT11
  1866. // -----------------------------------------------------------------------------
  1867. // ESP-01S DS18B20 v1.0
  1868. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  1869. // -----------------------------------------------------------------------------
  1870. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  1871. // Info
  1872. #define MANUFACTURER "GENERIC"
  1873. #define DEVICE "ESP01S_DS18B20_10"
  1874. // DB18B20
  1875. #ifndef DALLAS_SUPPORT
  1876. #define DALLAS_SUPPORT 1
  1877. #endif
  1878. #define DALLAS_PIN 2
  1879. // -----------------------------------------------------------------------------
  1880. // ESP-DIN relay board V1
  1881. // https://github.com/pilotak/esp_din
  1882. // -----------------------------------------------------------------------------
  1883. #elif defined(PILOTAK_ESP_DIN_V1)
  1884. // Info
  1885. #define MANUFACTURER "PILOTAK"
  1886. #define DEVICE "ESP_DIN_V1"
  1887. // Buttons
  1888. #define BUTTON1_PIN 0
  1889. #define BUTTON1_RELAY 1
  1890. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1891. // Relays
  1892. #define RELAY1_PIN 4
  1893. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1894. #define RELAY2_PIN 5
  1895. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1896. // LEDs
  1897. #define LED1_PIN 15
  1898. #define LED1_PIN_INVERSE 0
  1899. #define I2C_SDA_PIN 12
  1900. #define I2C_SCL_PIN 13
  1901. #ifndef DALLAS_SUPPORT
  1902. #define DALLAS_SUPPORT 1
  1903. #endif
  1904. #define DALLAS_PIN 2
  1905. #ifndef RF_SUPPORT
  1906. #define RF_SUPPORT 1
  1907. #endif
  1908. #define RF_PIN 14
  1909. #ifndef DIGITAL_SUPPORT
  1910. #define DIGITAL_SUPPORT 1
  1911. #endif
  1912. #define DIGITAL_PIN 16
  1913. #define DIGITAL_PIN_MODE INPUT
  1914. // -----------------------------------------------------------------------------
  1915. // Heltec Touch Relay
  1916. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  1917. // -----------------------------------------------------------------------------
  1918. #elif defined(HELTEC_TOUCHRELAY)
  1919. // Info
  1920. #define MANUFACTURER "HELTEC"
  1921. #define DEVICE "TOUCH_RELAY"
  1922. // Buttons
  1923. #define BUTTON1_PIN 14
  1924. #define BUTTON1_RELAY 1
  1925. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1926. // Relays
  1927. #define RELAY1_PIN 12
  1928. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1929. // -----------------------------------------------------------------------------
  1930. // Zhilde ZLD-EU44-W
  1931. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  1932. // -----------------------------------------------------------------------------
  1933. #elif defined(ZHILDE_EU44_W)
  1934. // Info
  1935. #define MANUFACTURER "ZHILDE"
  1936. #define DEVICE "EU44_W"
  1937. // Based on the reporter, this product uses GPIO1 and 3 for the button
  1938. // and onboard LED, so hardware serial should be disabled...
  1939. #define DEBUG_SERIAL_SUPPORT 0
  1940. // Buttons
  1941. #define BUTTON1_PIN 3
  1942. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1943. // Relays
  1944. #define RELAY1_PIN 5
  1945. #define RELAY2_PIN 4
  1946. #define RELAY3_PIN 12
  1947. #define RELAY4_PIN 13
  1948. #define RELAY5_PIN 14
  1949. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1950. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1951. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1952. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1953. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1954. // LEDs
  1955. #define LED1_PIN 1
  1956. #define LED1_PIN_INVERSE 1
  1957. // -----------------------------------------------------------------------------
  1958. // Allnet 4duino ESP8266-UP-Relais
  1959. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  1960. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  1961. // -----------------------------------------------------------------------------
  1962. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  1963. // Info
  1964. #define MANUFACTURER "ALLNET"
  1965. #define DEVICE "4DUINO_IOT_WLAN_RELAIS"
  1966. // Relays
  1967. #define RELAY1_PIN 14
  1968. #define RELAY1_RESET_PIN 12
  1969. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1970. // LEDs
  1971. #define LED1_PIN 0
  1972. #define LED1_PIN_INVERSE 1
  1973. // Buttons
  1974. //#define BUTTON1_PIN 0
  1975. //#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1976. // Using pins labelled as SDA & SCL as buttons
  1977. #define BUTTON2_PIN 4
  1978. #define BUTTON2_MODE BUTTON_PUSHBUTTON
  1979. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  1980. #define BUTTON2_CLICK BUTTON_MODE_NONE
  1981. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  1982. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  1983. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  1984. #define BUTTON3_PIN 5
  1985. #define BUTTON3_MODE BUTTON_PUSHBUTTON
  1986. // Using pins labelled as SDA & SCL for I2C
  1987. //#define I2C_SDA_PIN 4
  1988. //#define I2C_SCL_PIN 5
  1989. // -----------------------------------------------------------------------------
  1990. // Luani HVIO
  1991. // https://luani.de/projekte/esp8266-hvio/
  1992. // https://luani.de/blog/esp8266-230v-io-modul/
  1993. // -----------------------------------------------------------------------------
  1994. #elif defined(LUANI_HVIO)
  1995. // Info
  1996. #define MANUFACTURER "LUANI"
  1997. #define DEVICE "HVIO"
  1998. // Buttons
  1999. #define BUTTON1_PIN 12
  2000. #define BUTTON1_RELAY 1
  2001. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  2002. #define BUTTON1_PRESS BUTTON_MODE_NONE
  2003. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  2004. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2005. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2006. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  2007. #define BUTTON2_PIN 13
  2008. #define BUTTON2_RELAY 2
  2009. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  2010. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  2011. // Relays
  2012. #define RELAY1_PIN 4
  2013. #define RELAY2_PIN 5
  2014. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2015. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2016. // LEDs
  2017. #define LED1_PIN 15
  2018. #define LED1_PIN_INVERSE 0
  2019. // -----------------------------------------------------------------------------
  2020. // Tonbux 50-100M Smart Mosquito Killer USB
  2021. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  2022. // -----------------------------------------------------------------------------
  2023. #elif defined(TONBUX_MOSQUITO_KILLER)
  2024. // Info
  2025. #define MANUFACTURER "TONBUX"
  2026. #define DEVICE "MOSQUITO_KILLER"
  2027. // Buttons
  2028. #define BUTTON1_PIN 2
  2029. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2030. #define BUTTON1_RELAY 1
  2031. // Relays
  2032. #define RELAY1_PIN 5 // not a relay, fan
  2033. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2034. // LEDs
  2035. #define LED1_PIN 15 // blue led
  2036. #define LED1_PIN_INVERSE 1
  2037. #define LED1_MODE LED_MODE_WIFI
  2038. #define LED2_PIN 14 // red led
  2039. #define LED2_PIN_INVERSE 1
  2040. #define LED2_MODE LED_MODE_RELAY
  2041. #define LED3_PIN 12 // UV leds (1-2-3-4-5-6-7-8)
  2042. #define LED3_PIN_INVERSE 0
  2043. #define LED3_RELAY 1
  2044. #define LED4_PIN 16 // UV leds (9-10-11)
  2045. #define LED4_PIN_INVERSE 0
  2046. #define LED4_RELAY 1
  2047. // -----------------------------------------------------------------------------
  2048. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  2049. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  2050. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  2051. // -----------------------------------------------------------------------------
  2052. #elif defined(NEO_COOLCAM_NAS_WR01W)
  2053. // Info
  2054. #define MANUFACTURER "NEO_COOLCAM"
  2055. #define DEVICE "NAS_WR01W"
  2056. // Buttons
  2057. #define BUTTON1_PIN 13
  2058. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2059. #define BUTTON1_RELAY 1
  2060. // Relays
  2061. #define RELAY1_PIN 12
  2062. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2063. // LEDs
  2064. #define LED1_PIN 4
  2065. #define LED1_PIN_INVERSE 1
  2066. // ------------------------------------------------------------------------------
  2067. // Estink Wifi Power Strip
  2068. // https://www.amazon.de/Steckdosenleiste-Ladeger%C3%A4t-Sprachsteuerung-SmartphonesTablets-Android/dp/B0796W5FZY
  2069. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  2070. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  2071. // -----------------------------------------------------------------------------
  2072. #elif defined(ESTINK_WIFI_POWER_STRIP)
  2073. // Info
  2074. #define MANUFACTURER "ESTINK"
  2075. #define DEVICE "WIFI_POWER_STRIP"
  2076. // Disable UART noise since this board uses GPIO3
  2077. #define DEBUG_SERIAL_SUPPORT 0
  2078. // Buttons
  2079. #define BUTTON1_PIN 16
  2080. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2081. #define BUTTON1_RELAY 4
  2082. // Relays
  2083. #define RELAY1_PIN 14 // USB power
  2084. #define RELAY2_PIN 13 // power plug 1
  2085. #define RELAY3_PIN 4 // power plug 2
  2086. #define RELAY4_PIN 15 // power plug 3
  2087. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2088. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2089. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2090. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2091. // LEDs
  2092. #define LED1_PIN 0 // power led
  2093. #define LED2_PIN 12 // power plug 1
  2094. #define LED3_PIN 3 // power plug 2
  2095. #define LED4_PIN 5 // power plug 3
  2096. #define LED1_PIN_INVERSE 1
  2097. #define LED2_PIN_INVERSE 1
  2098. #define LED3_PIN_INVERSE 1
  2099. #define LED4_PIN_INVERSE 1
  2100. #define LED1_MODE LED_MODE_FINDME
  2101. #define LED2_MODE LED_MODE_FOLLOW
  2102. #define LED3_MODE LED_MODE_FOLLOW
  2103. #define LED4_MODE LED_MODE_FOLLOW
  2104. #define LED2_RELAY 2
  2105. #define LED3_RELAY 3
  2106. #define LED4_RELAY 4
  2107. // -----------------------------------------------------------------------------
  2108. // Bruno Horta's OnOfre
  2109. // https://www.bhonofre.pt/
  2110. // https://github.com/brunohorta82/BH_OnOfre/
  2111. // -----------------------------------------------------------------------------
  2112. #elif defined(BH_ONOFRE)
  2113. // Info
  2114. #define MANUFACTURER "BH"
  2115. #define DEVICE "ONOFRE"
  2116. // Buttons
  2117. #define BUTTON1_PIN 12
  2118. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2119. #define BUTTON1_RELAY 1
  2120. #define BUTTON2_PIN 13
  2121. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2122. #define BUTTON2_RELAY 2
  2123. // Relays
  2124. #define RELAY1_PIN 4
  2125. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2126. #define RELAY2_PIN 5
  2127. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2128. // -----------------------------------------------------------------------------
  2129. // BlitzWolf SHP2 and SHP6
  2130. // Also several boards under different names uing a power chip labelled BL0937 or HJL-01
  2131. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  2132. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  2133. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  2134. // * Gosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  2135. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  2136. // -----------------------------------------------------------------------------
  2137. #elif defined(BLITZWOLF_BWSHPX)
  2138. // Info
  2139. #define MANUFACTURER "BLITZWOLF"
  2140. #define DEVICE "BWSHPX"
  2141. // Buttons
  2142. #define BUTTON1_PIN 13
  2143. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2144. #define BUTTON1_RELAY 1
  2145. // Relays
  2146. #define RELAY1_PIN 15
  2147. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2148. // LEDs
  2149. #define LED1_PIN 2
  2150. #define LED1_PIN_INVERSE 1
  2151. #define LED2_PIN 0
  2152. #define LED2_PIN_INVERSE 1
  2153. #define LED2_MODE LED_MODE_FINDME
  2154. #define LED2_RELAY 1
  2155. // HJL01 / BL0937
  2156. #ifndef HLW8012_SUPPORT
  2157. #define HLW8012_SUPPORT 1
  2158. #endif
  2159. #define HLW8012_SEL_PIN 12
  2160. #define HLW8012_CF1_PIN 14
  2161. #define HLW8012_CF_PIN 5
  2162. #define HLW8012_SEL_CURRENT LOW
  2163. #define HLW8012_CURRENT_RATIO 25740
  2164. #define HLW8012_VOLTAGE_RATIO 313400
  2165. #define HLW8012_POWER_RATIO 3414290
  2166. #define HLW8012_INTERRUPT_ON FALLING
  2167. // -----------------------------------------------------------------------------
  2168. // Same as the above but new board version marked V2.3
  2169. // BlitzWolf SHP2 V2.3
  2170. // Gosund SP1 V2.3
  2171. // -----------------------------------------------------------------------------
  2172. #elif defined(BLITZWOLF_BWSHPX_V23)
  2173. // Info
  2174. #define MANUFACTURER "BLITZWOLF"
  2175. #define DEVICE "BWSHPX_V23"
  2176. // Buttons
  2177. #define BUTTON1_PIN 3
  2178. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2179. #define BUTTON1_RELAY 1
  2180. // Relays
  2181. #define RELAY1_PIN 14
  2182. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2183. // LEDs
  2184. #define LED1_PIN 1
  2185. #define LED1_PIN_INVERSE 1
  2186. #define LED2_PIN 13
  2187. #define LED2_PIN_INVERSE 1
  2188. #define LED2_MODE LED_MODE_FINDME
  2189. #define LED2_RELAY 1
  2190. // HJL01 / BL0937
  2191. #ifndef HLW8012_SUPPORT
  2192. #define HLW8012_SUPPORT 1
  2193. #endif
  2194. #define HLW8012_SEL_PIN 12
  2195. #define HLW8012_CF1_PIN 5
  2196. #define HLW8012_CF_PIN 4
  2197. #define HLW8012_SEL_CURRENT LOW
  2198. #define HLW8012_CURRENT_RATIO 25740
  2199. #define HLW8012_VOLTAGE_RATIO 313400
  2200. #define HLW8012_POWER_RATIO 3414290
  2201. #define HLW8012_INTERRUPT_ON FALLING
  2202. // -----------------------------------------------------------------------------
  2203. // Teckin SP22 v1.4 - v1.6
  2204. // -----------------------------------------------------------------------------
  2205. #elif defined(TECKIN_SP22_V14)
  2206. // Info
  2207. #define MANUFACTURER "TECKIN"
  2208. #define DEVICE "SP22_V14"
  2209. // Buttons
  2210. #define BUTTON1_PIN 1
  2211. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2212. #define BUTTON1_RELAY 1
  2213. // Relays
  2214. #define RELAY1_PIN 14
  2215. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2216. // LEDs
  2217. #define LED1_PIN 3
  2218. #define LED1_PIN_INVERSE 1
  2219. #define LED2_PIN 13
  2220. #define LED2_PIN_INVERSE 1
  2221. #define LED2_MODE LED_MODE_FINDME
  2222. #define LED2_RELAY 1
  2223. // HJL01 / BL0937
  2224. #ifndef HLW8012_SUPPORT
  2225. #define HLW8012_SUPPORT 1
  2226. #endif
  2227. #define HLW8012_SEL_PIN 12
  2228. #define HLW8012_CF1_PIN 5
  2229. #define HLW8012_CF_PIN 4
  2230. #define HLW8012_SEL_CURRENT LOW
  2231. #define HLW8012_CURRENT_RATIO 20730
  2232. #define HLW8012_VOLTAGE_RATIO 264935
  2233. #define HLW8012_POWER_RATIO 2533110
  2234. #define HLW8012_INTERRUPT_ON FALLING
  2235. // -----------------------------------------------------------------------------
  2236. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  2237. // -----------------------------------------------------------------------------
  2238. #elif defined(GOSUND_WS1)
  2239. // Info
  2240. #define MANUFACTURER "GOSUND"
  2241. #define DEVICE "WS1"
  2242. // Buttons
  2243. #define BUTTON1_PIN 0
  2244. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2245. #define BUTTON1_RELAY 1
  2246. // Relays
  2247. #define RELAY1_PIN 14
  2248. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2249. // LEDs
  2250. #define LED1_PIN 1
  2251. #define LED1_PIN_INVERSE 1
  2252. // This one is the same as the BLITZWOLF_BWSHPX_V23
  2253. #elif defined(GOSUND_SP1_V23)
  2254. // Info
  2255. #define MANUFACTURER "GOSUND"
  2256. #define DEVICE "SP1_v23"
  2257. // Buttons
  2258. #define BUTTON1_PIN 3
  2259. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2260. #define BUTTON1_RELAY 1
  2261. // Relays
  2262. #define RELAY1_PIN 14
  2263. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2264. // LEDs
  2265. #define LED1_PIN 1
  2266. #define LED1_PIN_INVERSE 1
  2267. #define LED2_PIN 13
  2268. #define LED2_PIN_INVERSE 0
  2269. #define LED2_MODE LED_MODE_FINDME
  2270. #define LED2_RELAY 1
  2271. // HJL01 / BL0937
  2272. #ifndef HLW8012_SUPPORT
  2273. #define HLW8012_SUPPORT 1
  2274. #endif
  2275. #define HLW8012_SEL_PIN 12
  2276. #define HLW8012_CF1_PIN 5
  2277. #define HLW8012_CF_PIN 4
  2278. #define HLW8012_SEL_CURRENT LOW
  2279. #define HLW8012_CURRENT_RATIO 25740
  2280. #define HLW8012_VOLTAGE_RATIO 313400
  2281. #define HLW8012_POWER_RATIO 3414290
  2282. #define HLW8012_INTERRUPT_ON FALLING
  2283. // ----------------------------------------------------------------------------------------
  2284. // Homecube 16A is similar but some pins differ and it also has RGB LEDs
  2285. // https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
  2286. // ----------------------------------------------------------------------------------------
  2287. #elif defined(HOMECUBE_16A)
  2288. // Info
  2289. #define MANUFACTURER "HOMECUBE"
  2290. #define DEVICE "16A"
  2291. // Buttons
  2292. #define BUTTON1_PIN 13
  2293. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2294. #define BUTTON1_RELAY 1
  2295. // Relays
  2296. #define RELAY1_PIN 15
  2297. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2298. // LEDs
  2299. //LED Pin 4 - ESP8266 onboard LED
  2300. //Red LED: 0
  2301. //Green LED: 12
  2302. //Blue LED: 2
  2303. // Blue
  2304. #define LED1_PIN 2
  2305. #define LED1_PIN_INVERSE 0
  2306. // Green
  2307. #define LED2_PIN 12
  2308. #define LED2_PIN_INVERSE 1
  2309. #define LED2_MODE LED_MODE_RELAY
  2310. // Red
  2311. #define LED3_PIN 0
  2312. #define LED3_PIN_INVERSE 0
  2313. #define LED3_MODE LED_MODE_OFF
  2314. // HJL01 / BL0937
  2315. #ifndef HLW8012_SUPPORT
  2316. #define HLW8012_SUPPORT 1
  2317. #endif
  2318. #define HLW8012_SEL_PIN 16
  2319. #define HLW8012_CF1_PIN 14
  2320. #define HLW8012_CF_PIN 5
  2321. #define HLW8012_SEL_CURRENT LOW
  2322. #define HLW8012_CURRENT_RATIO 25740
  2323. #define HLW8012_VOLTAGE_RATIO 313400
  2324. #define HLW8012_POWER_RATIO 3414290
  2325. #define HLW8012_INTERRUPT_ON FALLING
  2326. // -----------------------------------------------------------------------------
  2327. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  2328. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  2329. // -----------------------------------------------------------------------------
  2330. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  2331. // Info
  2332. #define MANUFACTURER "VANZAVANZU"
  2333. #define DEVICE "SMART_WIFI_PLUG_MINI"
  2334. // Buttons
  2335. #define BUTTON1_PIN 13
  2336. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2337. #define BUTTON1_RELAY 1
  2338. // Relays
  2339. #define RELAY1_PIN 15
  2340. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2341. // LEDs
  2342. #define LED1_PIN 2
  2343. #define LED1_PIN_INVERSE 1
  2344. #define LED2_PIN 0
  2345. #define LED2_PIN_INVERSE 1
  2346. #define LED2_MODE LED_MODE_FINDME
  2347. #define LED2_RELAY 1
  2348. // Disable UART noise
  2349. #define DEBUG_SERIAL_SUPPORT 0
  2350. // HJL01 / BL0937
  2351. #ifndef HLW8012_SUPPORT
  2352. #define HLW8012_SUPPORT 1
  2353. #endif
  2354. #define HLW8012_SEL_PIN 3
  2355. #define HLW8012_CF1_PIN 14
  2356. #define HLW8012_CF_PIN 5
  2357. #define HLW8012_SEL_CURRENT LOW
  2358. #define HLW8012_CURRENT_RATIO 25740
  2359. #define HLW8012_VOLTAGE_RATIO 313400
  2360. #define HLW8012_POWER_RATIO 3414290
  2361. #define HLW8012_INTERRUPT_ON FALLING
  2362. // -----------------------------------------------------------------------------
  2363. #elif defined(GENERIC_AG_L4)
  2364. // Info
  2365. #define MANUFACTURER "GENERIC"
  2366. #define DEVICE "AG_L4"
  2367. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2368. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2369. #define DUMMY_RELAY_COUNT 1
  2370. // button 1: "power" button
  2371. #define BUTTON1_PIN 4
  2372. #define BUTTON1_RELAY 1
  2373. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2374. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  2375. #define BUTTON1_CLICK BUTTON_MODE_NONE
  2376. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2377. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2378. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  2379. // button 2: "wifi" button
  2380. #define BUTTON2_PIN 2
  2381. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2382. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  2383. #define BUTTON2_CLICK BUTTON_MODE_NONE
  2384. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  2385. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  2386. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  2387. // LEDs
  2388. #define LED1_PIN 5 // red status led
  2389. #define LED1_PIN_INVERSE 0
  2390. #define LED2_PIN 16 // master light power
  2391. #define LED2_PIN_INVERSE 1
  2392. #define LED2_MODE LED_MODE_RELAY
  2393. // Light
  2394. #define LIGHT_CHANNELS 3
  2395. #define LIGHT_CH1_PIN 14 // RED
  2396. #define LIGHT_CH2_PIN 13 // GREEN
  2397. #define LIGHT_CH3_PIN 12 // BLUE
  2398. #define LIGHT_CH1_INVERSE 0
  2399. #define LIGHT_CH2_INVERSE 0
  2400. #define LIGHT_CH3_INVERSE 0
  2401. // -----------------------------------------------------------------------------
  2402. #elif defined(ALLTERCO_SHELLY1)
  2403. // Info
  2404. #define MANUFACTURER "ALLTERCO"
  2405. #define DEVICE "SHELLY1"
  2406. // Buttons
  2407. #define BUTTON1_PIN 5
  2408. #define BUTTON1_MODE BUTTON_SWITCH
  2409. #define BUTTON1_RELAY 1
  2410. // Relays
  2411. #define RELAY1_PIN 4
  2412. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2413. #elif defined(ALLTERCO_SHELLY2)
  2414. // Info
  2415. #define MANUFACTURER "ALLTERCO"
  2416. #define DEVICE "SHELLY2"
  2417. // Buttons
  2418. #define BUTTON1_PIN 12
  2419. #define BUTTON2_PIN 14
  2420. #define BUTTON1_MODE BUTTON_SWITCH
  2421. #define BUTTON2_MODE BUTTON_SWITCH
  2422. #define BUTTON1_RELAY 1
  2423. #define BUTTON2_RELAY 2
  2424. // Relays
  2425. #define RELAY1_PIN 4
  2426. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2427. #define RELAY2_PIN 5
  2428. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2429. // -----------------------------------------------------------------------------
  2430. #elif defined(LOHAS_9W)
  2431. // Info
  2432. #define MANUFACTURER "LOHAS"
  2433. #define DEVICE "E27_9W"
  2434. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2435. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2436. #define DUMMY_RELAY_COUNT 1
  2437. // Light
  2438. #define LIGHT_CHANNELS 5
  2439. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2440. #define MY92XX_CHIPS 2
  2441. #define MY92XX_DI_PIN 13
  2442. #define MY92XX_DCKI_PIN 15
  2443. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2444. #define MY92XX_MAPPING 0, 1, 2, 3, 4
  2445. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  2446. // -----------------------------------------------------------------------------
  2447. #elif defined(XIAOMI_SMART_DESK_LAMP)
  2448. // Info
  2449. #define MANUFACTURER "XIAOMI"
  2450. #define DEVICE "SMART_DESK_LAMP"
  2451. // Buttons
  2452. #define BUTTON1_PIN 2
  2453. #define BUTTON2_PIN 14
  2454. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2455. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2456. // This button doubles as switch here and as encoder mode switch below
  2457. // Clicking it (for less than 500ms) will turn the light on and off
  2458. // Double and Long clicks will not work as these are used to modify the encoder action
  2459. #define BUTTON1_RELAY 1
  2460. #define BUTTON_LNGCLICK_DELAY 500
  2461. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2462. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2463. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  2464. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  2465. #define BUTTON2_DBLCLICK BUTTON_MODE_AP
  2466. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  2467. // Light
  2468. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2469. #define DUMMY_RELAY_COUNT 1
  2470. #define LIGHT_STEP 8
  2471. #define LIGHT_CHANNELS 2
  2472. #define LIGHT_CH1_PIN 5 // warm white
  2473. #define LIGHT_CH1_INVERSE 0
  2474. #define LIGHT_CH2_PIN 4 // cold white
  2475. #define LIGHT_CH2_INVERSE 0
  2476. // Encoder
  2477. // If mode is ENCODER_MODE_RATIO, the value ratio between both channels is changed
  2478. // when the button is not pressed, and the overall brightness when pressed
  2479. // If mode is ENCODER_MODE_CHANNEL, the first channel value is changed
  2480. // when the button is not pressed, and the second channel when pressed
  2481. // If no ENCODERX_BUTTON_PIN defined it will only change the value of the first defined channel
  2482. #define ENCODER_SUPPORT 1
  2483. #define ENCODER1_PIN1 12
  2484. #define ENCODER1_PIN2 13
  2485. #define ENCODER1_BUTTON_PIN 2 // active low by default, with software pullup
  2486. #define ENCODER1_CHANNEL1 0 // please note this value is 0-based (LIGHT_CH1 above)
  2487. #define ENCODER1_CHANNEL2 1 // please note this value is 0-based (LIGHT_CH2 above)
  2488. #define ENCODER1_MODE ENCODER_MODE_RATIO
  2489. #elif defined(PHYX_ESP12_RGB)
  2490. // Info
  2491. #define MANUFACTURER "PHYX"
  2492. #define DEVICE "ESP12_RGB"
  2493. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2494. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2495. #define DUMMY_RELAY_COUNT 1
  2496. // Light
  2497. #define LIGHT_CHANNELS 3
  2498. #define LIGHT_CH1_PIN 4 // RED
  2499. #define LIGHT_CH2_PIN 14 // GREEN
  2500. #define LIGHT_CH3_PIN 12 // BLUE
  2501. #define LIGHT_CH1_INVERSE 0
  2502. #define LIGHT_CH2_INVERSE 0
  2503. #define LIGHT_CH3_INVERSE 0
  2504. // -----------------------------------------------------------------------------
  2505. // iWoole LED Table Lamp
  2506. // 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
  2507. // -----------------------------------------------------------------------------
  2508. #elif defined(IWOOLE_LED_TABLE_LAMP)
  2509. // Info
  2510. #define MANUFACTURER "IWOOLE"
  2511. #define DEVICE "LED_TABLE_LAMP"
  2512. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2513. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2514. #define DUMMY_RELAY_COUNT 1
  2515. // Light
  2516. #define LIGHT_CHANNELS 4
  2517. #define LIGHT_CH1_PIN 12 // RED
  2518. #define LIGHT_CH2_PIN 5 // GREEN
  2519. #define LIGHT_CH3_PIN 14 // BLUE
  2520. #define LIGHT_CH4_PIN 4 // WHITE
  2521. #define LIGHT_CH1_INVERSE 0
  2522. #define LIGHT_CH2_INVERSE 0
  2523. #define LIGHT_CH3_INVERSE 0
  2524. #define LIGHT_CH4_INVERSE 0
  2525. // -----------------------------------------------------------------------------
  2526. // Lombex Lux Nova 2 Tunable White
  2527. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2528. // -----------------------------------------------------------------------------
  2529. #elif defined(LOMBEX_LUX_NOVA2_TUNABLE_WHITE)
  2530. // Info
  2531. #define MANUFACTURER "LOMBEX"
  2532. #define DEVICE "LUX_NOVA2_TUNABLE_WHITE"
  2533. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2534. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2535. #define DUMMY_RELAY_COUNT 1
  2536. // Light
  2537. #define LIGHT_CHANNELS 5
  2538. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2539. #define MY92XX_CHIPS 1
  2540. #define MY92XX_DI_PIN 4
  2541. #define MY92XX_DCKI_PIN 5
  2542. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2543. // No RGB on this bulb. Warm white on channel 0, cool white on channel 3
  2544. #define MY92XX_MAPPING 255, 255, 255, 3, 0
  2545. // -----------------------------------------------------------------------------
  2546. // Lombex Lux Nova 2 White and Color
  2547. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2548. // -----------------------------------------------------------------------------
  2549. #elif defined(LOMBEX_LUX_NOVA2_WHITE_COLOR)
  2550. // Info
  2551. #define MANUFACTURER "LOMBEX"
  2552. #define DEVICE "LUX_NOVA2_WHITE_COLOR"
  2553. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2554. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2555. #define DUMMY_RELAY_COUNT 1
  2556. // Light
  2557. #define LIGHT_CHANNELS 4
  2558. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2559. #define MY92XX_CHIPS 1
  2560. #define MY92XX_DI_PIN 4
  2561. #define MY92XX_DCKI_PIN 5
  2562. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2563. // RGB on channels 0/1/2, either cool or warm white on channel 3
  2564. // The bulb *should* have cool leds, but could also have warm leds as a common defect
  2565. #define MY92XX_MAPPING 0, 1, 2, 3
  2566. // -----------------------------------------------------------------------------
  2567. // Bestek Smart Plug with 2 USB ports
  2568. // https://www.bestekcorp.com/bestek-smart-plug-works-with-amazon-alexa-google-assistant-and-ifttt-with-2-usb
  2569. // -----------------------------------------------------------------------------
  2570. #elif defined(BESTEK_MRJ1011)
  2571. // Info
  2572. #define MANUFACTURER "BESTEK"
  2573. #define DEVICE "MRJ1011"
  2574. // Buttons
  2575. #define BUTTON1_PIN 13
  2576. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2577. #define BUTTON1_RELAY 1
  2578. // Relay
  2579. #define RELAY1_PIN 12
  2580. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2581. // LED
  2582. #define LED1_PIN 4
  2583. #define LED1_PIN_INVERSE 1
  2584. // -----------------------------------------------------------------------------
  2585. // GBLIFE RGBW SOCKET
  2586. // -----------------------------------------------------------------------------
  2587. #elif defined(GBLIFE_RGBW_SOCKET)
  2588. // Info
  2589. #define MANUFACTURER "GBLIFE"
  2590. #define DEVICE "RGBW_SOCKET"
  2591. // Buttons
  2592. #define BUTTON1_PIN 13
  2593. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2594. #define BUTTON1_RELAY 1
  2595. // Relays
  2596. #define RELAY1_PIN 15
  2597. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2598. // Light RGBW
  2599. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2600. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2601. #define DUMMY_RELAY_COUNT 1
  2602. #define LIGHT_CHANNELS 4
  2603. #define LIGHT_CH1_PIN 5 // RED
  2604. #define LIGHT_CH2_PIN 14 // GREEN
  2605. #define LIGHT_CH3_PIN 12 // BLUE
  2606. #define LIGHT_CH4_PIN 4 // WHITE
  2607. #define LIGHT_CH1_INVERSE 0
  2608. #define LIGHT_CH2_INVERSE 0
  2609. #define LIGHT_CH3_INVERSE 0
  2610. #define LIGHT_CH4_INVERSE 0
  2611. // ----------------------------------------------------------------------------------------
  2612. // Smart life Mini Smart Socket is similar Homecube 16A but some GPIOs differ
  2613. // https://www.ebay.de/itm/Smart-Steckdose-WIFI-WLAN-Amazon-Alexa-Fernbedienung-Home-Socket-Zeitschaltuh-DE/123352026749?hash=item1cb85a8e7d:g:IasAAOSwk6dbj390
  2614. // ----------------------------------------------------------------------------------------
  2615. #elif defined(SMARTLIFE_MINI_SMART_SOCKET)
  2616. // Info
  2617. #define MANUFACTURER "SMARTLIFE"
  2618. #define DEVICE "MINI_SMART_SOCKET"
  2619. // Buttons
  2620. #define BUTTON1_PIN 13
  2621. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2622. #define BUTTON1_RELAY 1
  2623. // Relays
  2624. #define RELAY1_PIN 15
  2625. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2626. // LEDs
  2627. //Red LED: 0
  2628. //Green LED: 4
  2629. //Blue LED: 2
  2630. // Light
  2631. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2632. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2633. #define DUMMY_RELAY_COUNT 1
  2634. #define LIGHT_CHANNELS 3
  2635. #define LIGHT_CH1_PIN 0 // RED
  2636. #define LIGHT_CH2_PIN 4 // GREEN
  2637. #define LIGHT_CH3_PIN 2 // BLUE
  2638. #define LIGHT_CH1_INVERSE 0
  2639. #define LIGHT_CH2_INVERSE 0
  2640. #define LIGHT_CH3_INVERSE 0
  2641. // HJL01 / BL0937
  2642. #ifndef HLW8012_SUPPORT
  2643. #define HLW8012_SUPPORT 1
  2644. #endif
  2645. #define HLW8012_SEL_PIN 12
  2646. #define HLW8012_CF1_PIN 14
  2647. #define HLW8012_CF_PIN 5
  2648. #define HLW8012_SEL_CURRENT LOW
  2649. #define HLW8012_CURRENT_RATIO 25740
  2650. #define HLW8012_VOLTAGE_RATIO 313400
  2651. #define HLW8012_POWER_RATIO 3414290
  2652. #define HLW8012_INTERRUPT_ON FALLING
  2653. // -----------------------------------------------------------------------------
  2654. // TEST boards (do not use!!)
  2655. // -----------------------------------------------------------------------------
  2656. #elif defined(TRAVIS01)
  2657. // Info
  2658. #define MANUFACTURER "TravisCI"
  2659. #define DEVICE "Virtual board 01"
  2660. // Some buttons - pin 0
  2661. #define BUTTON1_PIN 0
  2662. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2663. #define BUTTON1_RELAY 1
  2664. // Some relays - pin 1
  2665. #define RELAY1_PIN 1
  2666. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2667. // Some LEDs - pin 2
  2668. #define LED1_PIN 2
  2669. #define LED1_PIN_INVERSE 1
  2670. // A bit of I2C - pins 3,4
  2671. #define I2C_SDA_PIN 3
  2672. #define I2C_SCL_PIN 4
  2673. // And, as they say in "From Dusk till Dawn":
  2674. // This is a sensor blow out!
  2675. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  2676. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  2677. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  2678. // C'mon, you want sensor, come on in sensor lovers!
  2679. // If we don’t got it, you don't want it!
  2680. #define AM2320_SUPPORT 1
  2681. #define BH1750_SUPPORT 1
  2682. #define BMP180_SUPPORT 1
  2683. #define BMX280_SUPPORT 1
  2684. #define SHT3X_I2C_SUPPORT 1
  2685. #define EMON_ADC121_SUPPORT 1
  2686. #define EMON_ADS1X15_SUPPORT 1
  2687. #define SHT3X_I2C_SUPPORT 1
  2688. #define SI7021_SUPPORT 1
  2689. #define PMSX003_SUPPORT 1
  2690. #define SENSEAIR_SUPPORT 1
  2691. #define VL53L1X_SUPPORT 1
  2692. #define MAX6675_SUPPORT 1
  2693. // A bit of lights - pin 5
  2694. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2695. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2696. #define DUMMY_RELAY_COUNT 1
  2697. #define LIGHT_CHANNELS 1
  2698. #define LIGHT_CH1_PIN 5
  2699. #define LIGHT_CH1_INVERSE 0
  2700. // A bit of HLW8012 - pins 6,7,8
  2701. #ifndef HLW8012_SUPPORT
  2702. #define HLW8012_SUPPORT 1
  2703. #endif
  2704. #define HLW8012_SEL_PIN 6
  2705. #define HLW8012_CF1_PIN 7
  2706. #define HLW8012_CF_PIN 8
  2707. // A bit of Dallas - pin 9
  2708. #ifndef DALLAS_SUPPORT
  2709. #define DALLAS_SUPPORT 1
  2710. #endif
  2711. #define DALLAS_PIN 9
  2712. // A bit of ECH1560 - pins 10,11, 12
  2713. #ifndef ECH1560_SUPPORT
  2714. #define ECH1560_SUPPORT 1
  2715. #endif
  2716. #define ECH1560_CLK_PIN 10
  2717. #define ECH1560_MISO_PIN 11
  2718. #define ECH1560_INVERTED 12
  2719. // MICS-2710 & MICS-5525 test
  2720. #define MICS2710_SUPPORT 1
  2721. #define MICS5525_SUPPORT 1
  2722. // MAX6675 14 11 10
  2723. #ifndef MAX6675_SUPPORT
  2724. #define MAX6675_SUPPORT 1
  2725. #endif
  2726. #define MAX6675_CS_PIN 14
  2727. #define MAX6675_SO_PIN 11
  2728. #define MAX6675_SCK_PIN 10
  2729. #elif defined(TRAVIS02)
  2730. // Relay provider dual
  2731. #define MANUFACTURER "TravisCI"
  2732. #define DEVICE "Virtual board 02"
  2733. // Some buttons - pin 0
  2734. #define BUTTON1_PIN 0
  2735. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2736. #define BUTTON1_RELAY 1
  2737. // A bit of CSE7766 - pin 1
  2738. #ifndef CSE7766_SUPPORT
  2739. #define CSE7766_SUPPORT 1
  2740. #endif
  2741. #define CSE7766_PIN 1
  2742. // Relay type dual - pins 2,3
  2743. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  2744. #define RELAY1_PIN 2
  2745. #define RELAY2_PIN 3
  2746. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2747. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2748. // IR - pin 4
  2749. #define IR_SUPPORT 1
  2750. #define IR_RX_PIN 4
  2751. #define IR_BUTTON_SET 1
  2752. // A bit of DHT - pin 5
  2753. #ifndef DHT_SUPPORT
  2754. #define DHT_SUPPORT 1
  2755. #endif
  2756. #define DHT_PIN 5
  2757. // A bit of TMP3X (analog)
  2758. #define TMP3X_SUPPORT 1
  2759. // A bit of EVENTS - pin 10
  2760. #define EVENTS_SUPPORT 1
  2761. #define EVENTS_PIN 6
  2762. // Sonar
  2763. #define SONAR_SUPPORT 1
  2764. #define SONAR_TRIGGER 7
  2765. #define SONAR_ECHO 8
  2766. // MHZ19
  2767. #define MHZ19_SUPPORT 1
  2768. #define MHZ19_RX_PIN 9
  2769. #define MHZ19_TX_PIN 10
  2770. // PZEM004T
  2771. #define PZEM004T_SUPPORT 1
  2772. #define PZEM004T_RX_PIN 11
  2773. #define PZEM004T_TX_PIN 12
  2774. // V9261F
  2775. #define V9261F_SUPPORT 1
  2776. #define V9261F_PIN 13
  2777. // GUVAS12SD
  2778. #define GUVAS12SD_SUPPORT 1
  2779. #define GUVAS12SD_PIN 14
  2780. // Test non-default modules
  2781. #define MDNS_CLIENT_SUPPORT 1
  2782. #define NOFUSS_SUPPORT 1
  2783. #define UART_MQTT_SUPPORT 1
  2784. #define INFLUXDB_SUPPORT 1
  2785. #define IR_SUPPORT 1
  2786. #elif defined(TRAVIS03)
  2787. // Relay provider light/my92XX
  2788. #define MANUFACTURER "TravisCI"
  2789. #define DEVICE "Virtual board 03"
  2790. // Some buttons - pin 0
  2791. #define BUTTON1_PIN 0
  2792. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2793. #define BUTTON1_RELAY 1
  2794. // MY9231 Light - pins 1,2
  2795. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2796. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2797. #define DUMMY_RELAY_COUNT 1
  2798. #define LIGHT_CHANNELS 5
  2799. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2800. #define MY92XX_CHIPS 2
  2801. #define MY92XX_DI_PIN 1
  2802. #define MY92XX_DCKI_PIN 2
  2803. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2804. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  2805. // A bit of Analog EMON (analog)
  2806. #ifndef EMON_ANALOG_SUPPORT
  2807. #define EMON_ANALOG_SUPPORT 1
  2808. #endif
  2809. #define PULSEMETER_SUPPORT 1
  2810. // Test non-default modules
  2811. #define LLMNR_SUPPORT 1
  2812. #define NETBIOS_SUPPORT 1
  2813. #define SSDP_SUPPORT 1
  2814. #define RF_SUPPORT 1
  2815. #endif
  2816. // -----------------------------------------------------------------------------
  2817. // Check definitions
  2818. // -----------------------------------------------------------------------------
  2819. #if not defined(MANUFACTURER) || not defined(DEVICE)
  2820. #error "UNSUPPORTED HARDWARE!!"
  2821. #endif