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.

3572 lines
114 KiB

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