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.

3043 lines
97 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
  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. // LEDs
  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. // YJZK
  735. // -----------------------------------------------------------------------------
  736. #elif defined(YJZK_SWITCH_1CH)
  737. // Info
  738. #define MANUFACTURER "YJZK"
  739. #define DEVICE "SWITCH_1CH"
  740. // Buttons
  741. #define BUTTON1_PIN 0
  742. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  743. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  744. #define BUTTON1_CLICK BUTTON_MODE_NONE
  745. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  746. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  747. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  748. #define BUTTON1_RELAY 1
  749. // Relays
  750. #define RELAY1_PIN 12
  751. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  752. // LEDs
  753. #define LED1_PIN 13
  754. #define LED1_PIN_INVERSE 0
  755. #elif defined(YJZK_SWITCH_2CH)
  756. // Info
  757. #define MANUFACTURER "YJZK"
  758. #define DEVICE "SWITCH_2CH"
  759. // Buttons
  760. #define BUTTON1_PIN 0
  761. #define BUTTON2_PIN 9
  762. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  763. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  764. #define BUTTON1_CLICK BUTTON_MODE_NONE
  765. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  766. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  767. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  768. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  769. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  770. #define BUTTON2_CLICK BUTTON_MODE_NONE
  771. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  772. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  773. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  774. #define BUTTON1_RELAY 1
  775. #define BUTTON2_RELAY 2
  776. // Relays
  777. #define RELAY1_PIN 12
  778. #define RELAY2_PIN 5
  779. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  780. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  781. // LEDs
  782. #define LED1_PIN 13
  783. #define LED1_PIN_INVERSE 0
  784. // YJZK 3CH switch
  785. // Also Lixin Touch Wifi 3M
  786. #elif defined(YJZK_SWITCH_3CH)
  787. // Info
  788. #define MANUFACTURER "YJZK"
  789. #define DEVICE "SWITCH_3CH"
  790. // Buttons
  791. #define BUTTON1_PIN 0
  792. #define BUTTON2_PIN 9
  793. #define BUTTON3_PIN 10
  794. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  795. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  796. #define BUTTON1_CLICK BUTTON_MODE_NONE
  797. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  798. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  799. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  800. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  801. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  802. #define BUTTON2_CLICK BUTTON_MODE_NONE
  803. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  804. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  805. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  806. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  807. #define BUTTON3_PRESS BUTTON_MODE_TOGGLE
  808. #define BUTTON3_CLICK BUTTON_MODE_NONE
  809. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  810. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  811. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_RESET
  812. #define BUTTON1_RELAY 1
  813. #define BUTTON2_RELAY 2
  814. #define BUTTON3_RELAY 3
  815. // Relays
  816. #define RELAY1_PIN 12
  817. #define RELAY2_PIN 5
  818. #define RELAY3_PIN 4
  819. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  820. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  821. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  822. // LEDs
  823. #define LED1_PIN 13
  824. #define LED1_PIN_INVERSE 0
  825. // -----------------------------------------------------------------------------
  826. // Electrodragon boards
  827. // -----------------------------------------------------------------------------
  828. #elif defined(ELECTRODRAGON_WIFI_IOT)
  829. // Info
  830. #define MANUFACTURER "ELECTRODRAGON"
  831. #define DEVICE "WIFI_IOT"
  832. // Buttons
  833. #define BUTTON1_PIN 0
  834. #define BUTTON2_PIN 2
  835. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  836. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  837. #define BUTTON1_RELAY 1
  838. #define BUTTON2_RELAY 2
  839. // Relays
  840. #define RELAY1_PIN 12
  841. #define RELAY2_PIN 13
  842. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  843. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  844. // LEDs
  845. #define LED1_PIN 16
  846. #define LED1_PIN_INVERSE 0
  847. // -----------------------------------------------------------------------------
  848. // WorkChoice ecoPlug
  849. // -----------------------------------------------------------------------------
  850. #elif defined(WORKCHOICE_ECOPLUG)
  851. // Info
  852. #define MANUFACTURER "WORKCHOICE"
  853. #define DEVICE "ECOPLUG"
  854. // Buttons
  855. #define BUTTON1_PIN 13
  856. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  857. #define BUTTON1_RELAY 1
  858. // Relays
  859. #define RELAY1_PIN 15
  860. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  861. // LEDs
  862. #define LED1_PIN 2
  863. #define LED1_PIN_INVERSE 0
  864. // -----------------------------------------------------------------------------
  865. // AI Thinker
  866. // -----------------------------------------------------------------------------
  867. #elif defined(AITHINKER_AI_LIGHT)
  868. // Info
  869. #define MANUFACTURER "AITHINKER"
  870. #define DEVICE "AI_LIGHT"
  871. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  872. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  873. #define DUMMY_RELAY_COUNT 1
  874. // Light
  875. #define LIGHT_CHANNELS 4
  876. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  877. #define MY92XX_CHIPS 1
  878. #define MY92XX_DI_PIN 13
  879. #define MY92XX_DCKI_PIN 15
  880. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  881. #define MY92XX_MAPPING 0, 1, 2, 3
  882. // -----------------------------------------------------------------------------
  883. // LED Controller
  884. // -----------------------------------------------------------------------------
  885. #elif defined(MAGICHOME_LED_CONTROLLER)
  886. // Info
  887. #define MANUFACTURER "MAGICHOME"
  888. #define DEVICE "LED_CONTROLLER"
  889. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  890. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  891. #define DUMMY_RELAY_COUNT 1
  892. // LEDs
  893. #define LED1_PIN 2
  894. #define LED1_PIN_INVERSE 1
  895. // Light
  896. #define LIGHT_CHANNELS 4
  897. #define LIGHT_CH1_PIN 14 // RED
  898. #define LIGHT_CH2_PIN 5 // GREEN
  899. #define LIGHT_CH3_PIN 12 // BLUE
  900. #define LIGHT_CH4_PIN 13 // WHITE
  901. #define LIGHT_CH1_INVERSE 0
  902. #define LIGHT_CH2_INVERSE 0
  903. #define LIGHT_CH3_INVERSE 0
  904. #define LIGHT_CH4_INVERSE 0
  905. // IR
  906. #define IR_SUPPORT 1
  907. #define IR_RX_PIN 4
  908. #define IR_BUTTON_SET 1
  909. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  910. // Info
  911. #define MANUFACTURER "MAGICHOME"
  912. #define DEVICE "LED_CONTROLLER_20"
  913. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  914. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  915. #define DUMMY_RELAY_COUNT 1
  916. // LEDs
  917. #define LED1_PIN 2
  918. #define LED1_PIN_INVERSE 1
  919. // Light
  920. #define LIGHT_CHANNELS 4
  921. #define LIGHT_CH1_PIN 5 // RED
  922. #define LIGHT_CH2_PIN 12 // GREEN
  923. #define LIGHT_CH3_PIN 13 // BLUE
  924. #define LIGHT_CH4_PIN 15 // WHITE
  925. #define LIGHT_CH1_INVERSE 0
  926. #define LIGHT_CH2_INVERSE 0
  927. #define LIGHT_CH3_INVERSE 0
  928. #define LIGHT_CH4_INVERSE 0
  929. // IR
  930. #define IR_SUPPORT 1
  931. #define IR_RX_PIN 4
  932. #define IR_BUTTON_SET 1
  933. // -----------------------------------------------------------------------------
  934. // HUACANXING H801 & H802
  935. // -----------------------------------------------------------------------------
  936. #elif defined(HUACANXING_H801)
  937. // Info
  938. #define MANUFACTURER "HUACANXING"
  939. #define DEVICE "H801"
  940. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  941. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  942. #define DUMMY_RELAY_COUNT 1
  943. #define DEBUG_PORT Serial1
  944. #define SERIAL_RX_ENABLED 1
  945. // LEDs
  946. #define LED1_PIN 5
  947. #define LED1_PIN_INVERSE 1
  948. // Light
  949. #define LIGHT_CHANNELS 5
  950. #define LIGHT_CH1_PIN 15 // RED
  951. #define LIGHT_CH2_PIN 13 // GREEN
  952. #define LIGHT_CH3_PIN 12 // BLUE
  953. #define LIGHT_CH4_PIN 14 // WHITE1
  954. #define LIGHT_CH5_PIN 4 // WHITE2
  955. #define LIGHT_CH1_INVERSE 0
  956. #define LIGHT_CH2_INVERSE 0
  957. #define LIGHT_CH3_INVERSE 0
  958. #define LIGHT_CH4_INVERSE 0
  959. #define LIGHT_CH5_INVERSE 0
  960. #elif defined(HUACANXING_H802)
  961. // Info
  962. #define MANUFACTURER "HUACANXING"
  963. #define DEVICE "H802"
  964. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  965. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  966. #define DUMMY_RELAY_COUNT 1
  967. #define DEBUG_PORT Serial1
  968. #define SERIAL_RX_ENABLED 1
  969. // Light
  970. #define LIGHT_CHANNELS 4
  971. #define LIGHT_CH1_PIN 12 // RED
  972. #define LIGHT_CH2_PIN 14 // GREEN
  973. #define LIGHT_CH3_PIN 13 // BLUE
  974. #define LIGHT_CH4_PIN 15 // WHITE
  975. #define LIGHT_CH1_INVERSE 0
  976. #define LIGHT_CH2_INVERSE 0
  977. #define LIGHT_CH3_INVERSE 0
  978. #define LIGHT_CH4_INVERSE 0
  979. // -----------------------------------------------------------------------------
  980. // Jan Goedeke Wifi Relay
  981. // https://github.com/JanGoe/esp8266-wifi-relay
  982. // -----------------------------------------------------------------------------
  983. #elif defined(JANGOE_WIFI_RELAY_NC)
  984. // Info
  985. #define MANUFACTURER "JANGOE"
  986. #define DEVICE "WIFI_RELAY_NC"
  987. // Buttons
  988. #define BUTTON1_PIN 12
  989. #define BUTTON2_PIN 13
  990. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  991. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  992. #define BUTTON1_RELAY 1
  993. #define BUTTON2_RELAY 2
  994. // Relays
  995. #define RELAY1_PIN 2
  996. #define RELAY2_PIN 14
  997. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  998. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  999. #elif defined(JANGOE_WIFI_RELAY_NO)
  1000. // Info
  1001. #define MANUFACTURER "JANGOE"
  1002. #define DEVICE "WIFI_RELAY_NO"
  1003. // Buttons
  1004. #define BUTTON1_PIN 12
  1005. #define BUTTON2_PIN 13
  1006. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1007. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1008. #define BUTTON1_RELAY 1
  1009. #define BUTTON2_RELAY 2
  1010. // Relays
  1011. #define RELAY1_PIN 2
  1012. #define RELAY2_PIN 14
  1013. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1014. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1015. // -----------------------------------------------------------------------------
  1016. // Jorge García Wifi+Relays Board Kit
  1017. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  1018. // https://github.com/jorgegarciadev/wifikit
  1019. // -----------------------------------------------------------------------------
  1020. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  1021. // Info
  1022. #define MANUFACTURER "JORGEGARCIA"
  1023. #define DEVICE "WIFI_RELAYS"
  1024. // Relays
  1025. #define RELAY1_PIN 0
  1026. #define RELAY2_PIN 2
  1027. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1028. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1029. // -----------------------------------------------------------------------------
  1030. // WiFi MQTT Relay / Thermostat
  1031. // -----------------------------------------------------------------------------
  1032. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  1033. // Info
  1034. #define MANUFACTURER "OPENENERGYMONITOR"
  1035. #define DEVICE "MQTT_RELAY"
  1036. // Buttons
  1037. #define BUTTON1_PIN 0
  1038. #define BUTTON1_RELAY 1
  1039. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1040. // Relays
  1041. #define RELAY1_PIN 12
  1042. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1043. // LEDs
  1044. #define LED1_PIN 16
  1045. #define LED1_PIN_INVERSE 0
  1046. // -----------------------------------------------------------------------------
  1047. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  1048. // 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
  1049. // 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
  1050. // -----------------------------------------------------------------------------
  1051. #elif defined(WION_50055)
  1052. // Currently untested, does not support energy monitoring
  1053. // Info
  1054. #define MANUFACTURER "WION"
  1055. #define DEVICE "50055"
  1056. // Buttons
  1057. #define BUTTON1_PIN 13
  1058. #define BUTTON1_RELAY 1
  1059. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1060. // Relays
  1061. #define RELAY1_PIN 15
  1062. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1063. // LEDs
  1064. #define LED1_PIN 2
  1065. #define LED1_PIN_INVERSE 0
  1066. // -----------------------------------------------------------------------------
  1067. // EX-Store Wifi Relay v3.1
  1068. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  1069. // -----------------------------------------------------------------------------
  1070. #elif defined(EXS_WIFI_RELAY_V31)
  1071. // Untested
  1072. // Info
  1073. #define MANUFACTURER "EXS"
  1074. #define DEVICE "WIFI_RELAY_V31"
  1075. // Buttons
  1076. #define BUTTON1_PIN 0
  1077. #define BUTTON1_RELAY 1
  1078. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1079. // Relays
  1080. #define RELAY1_PIN 13
  1081. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1082. #define RELAY1_RESET_PIN 12
  1083. // -----------------------------------------------------------------------------
  1084. // EX-Store Wifi Relay v5.0
  1085. // -----------------------------------------------------------------------------
  1086. #elif defined(EXS_WIFI_RELAY_V50)
  1087. // Info
  1088. #define MANUFACTURER "EXS"
  1089. #define DEVICE "WIFI_RELAY_V50"
  1090. // Buttons
  1091. #define BUTTON1_PIN 5
  1092. #define BUTTON2_PIN 4
  1093. #define BUTTON1_RELAY 1
  1094. #define BUTTON2_RELAY 2
  1095. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1096. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1097. // Relays
  1098. #define RELAY1_PIN 14
  1099. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1100. #define RELAY1_RESET_PIN 16
  1101. #define RELAY2_PIN 13
  1102. #define RELAY2_TYPE RELAY_TYPE_LATCHED
  1103. #define RELAY2_RESET_PIN 12
  1104. // LEDs
  1105. #define LED1_PIN 15
  1106. #define LED1_PIN_INVERSE 0
  1107. // -----------------------------------------------------------------------------
  1108. // V9261F
  1109. // -----------------------------------------------------------------------------
  1110. #elif defined(GENERIC_V9261F)
  1111. // Info
  1112. #define MANUFACTURER "GENERIC"
  1113. #define DEVICE "V9261F"
  1114. #define ALEXA_SUPPORT 0
  1115. // V9261F
  1116. #define V9261F_SUPPORT 1
  1117. #define V9261F_PIN 2
  1118. #define V9261F_PIN_INVERSE 1
  1119. // -----------------------------------------------------------------------------
  1120. // ECH1560
  1121. // -----------------------------------------------------------------------------
  1122. #elif defined(GENERIC_ECH1560)
  1123. // Info
  1124. #define MANUFACTURER "GENERIC"
  1125. #define DEVICE "ECH1560"
  1126. #define ALEXA_SUPPORT 0
  1127. // ECH1560
  1128. #define ECH1560_SUPPORT 1
  1129. #define ECH1560_CLK_PIN 4
  1130. #define ECH1560_MISO_PIN 5
  1131. #define ECH1560_INVERTED 0
  1132. // -----------------------------------------------------------------------------
  1133. // ESPLive
  1134. // https://github.com/ManCaveMade/ESP-Live
  1135. // -----------------------------------------------------------------------------
  1136. #elif defined(MANCAVEMADE_ESPLIVE)
  1137. // Info
  1138. #define MANUFACTURER "MANCAVEMADE"
  1139. #define DEVICE "ESPLIVE"
  1140. // Buttons
  1141. #define BUTTON1_PIN 4
  1142. #define BUTTON2_PIN 5
  1143. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1144. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1145. #define BUTTON1_RELAY 1
  1146. #define BUTTON2_RELAY 2
  1147. // Relays
  1148. #define RELAY1_PIN 12
  1149. #define RELAY2_PIN 13
  1150. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1151. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1152. // DS18B20
  1153. #ifndef DALLAS_SUPPORT
  1154. #define DALLAS_SUPPORT 1
  1155. #endif
  1156. #define DALLAS_PIN 2
  1157. #define DALLAS_UPDATE_INTERVAL 5000
  1158. #define TEMPERATURE_MIN_CHANGE 1.0
  1159. // -----------------------------------------------------------------------------
  1160. // QuinLED
  1161. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  1162. // -----------------------------------------------------------------------------
  1163. #elif defined(INTERMITTECH_QUINLED)
  1164. // Info
  1165. #define MANUFACTURER "INTERMITTECH"
  1166. #define DEVICE "QUINLED"
  1167. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1168. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1169. #define DUMMY_RELAY_COUNT 1
  1170. // LEDs
  1171. #define LED1_PIN 5
  1172. #define LED1_PIN_INVERSE 1
  1173. // Light
  1174. #define LIGHT_CHANNELS 2
  1175. #define LIGHT_CH1_PIN 0
  1176. #define LIGHT_CH2_PIN 2
  1177. #define LIGHT_CH1_INVERSE 0
  1178. #define LIGHT_CH2_INVERSE 0
  1179. // -----------------------------------------------------------------------------
  1180. // Arilux AL-LC06
  1181. // -----------------------------------------------------------------------------
  1182. #elif defined(ARILUX_AL_LC01)
  1183. // Info
  1184. #define MANUFACTURER "ARILUX"
  1185. #define DEVICE "AL_LC01"
  1186. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1187. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1188. #define DUMMY_RELAY_COUNT 1
  1189. // Light
  1190. #define LIGHT_CHANNELS 3
  1191. #define LIGHT_CH1_PIN 5 // RED
  1192. #define LIGHT_CH2_PIN 12 // GREEN
  1193. #define LIGHT_CH3_PIN 13 // BLUE
  1194. #define LIGHT_CH1_INVERSE 0
  1195. #define LIGHT_CH2_INVERSE 0
  1196. #define LIGHT_CH3_INVERSE 0
  1197. #elif defined(ARILUX_AL_LC02)
  1198. // Info
  1199. #define MANUFACTURER "ARILUX"
  1200. #define DEVICE "AL_LC02"
  1201. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1202. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1203. #define DUMMY_RELAY_COUNT 1
  1204. // Light
  1205. #define LIGHT_CHANNELS 4
  1206. #define LIGHT_CH1_PIN 12 // RED
  1207. #define LIGHT_CH2_PIN 5 // GREEN
  1208. #define LIGHT_CH3_PIN 13 // BLUE
  1209. #define LIGHT_CH4_PIN 15 // WHITE1
  1210. #define LIGHT_CH1_INVERSE 0
  1211. #define LIGHT_CH2_INVERSE 0
  1212. #define LIGHT_CH3_INVERSE 0
  1213. #define LIGHT_CH4_INVERSE 0
  1214. #elif defined(ARILUX_AL_LC06)
  1215. // Info
  1216. #define MANUFACTURER "ARILUX"
  1217. #define DEVICE "AL_LC06"
  1218. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1219. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1220. #define DUMMY_RELAY_COUNT 1
  1221. // Light
  1222. #define LIGHT_CHANNELS 5
  1223. #define LIGHT_CH1_PIN 14 // RED
  1224. #define LIGHT_CH2_PIN 12 // GREEN
  1225. #define LIGHT_CH3_PIN 13 // BLUE
  1226. #define LIGHT_CH4_PIN 15 // WHITE1
  1227. #define LIGHT_CH5_PIN 5 // WHITE2
  1228. #define LIGHT_CH1_INVERSE 0
  1229. #define LIGHT_CH2_INVERSE 0
  1230. #define LIGHT_CH3_INVERSE 0
  1231. #define LIGHT_CH4_INVERSE 0
  1232. #define LIGHT_CH5_INVERSE 0
  1233. #elif defined(ARILUX_AL_LC11)
  1234. // Info
  1235. #define MANUFACTURER "ARILUX"
  1236. #define DEVICE "AL_LC11"
  1237. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1238. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1239. #define DUMMY_RELAY_COUNT 1
  1240. // Light
  1241. #define LIGHT_CHANNELS 5
  1242. #define LIGHT_CH1_PIN 5 // RED
  1243. #define LIGHT_CH2_PIN 4 // GREEN
  1244. #define LIGHT_CH3_PIN 14 // BLUE
  1245. #define LIGHT_CH4_PIN 13 // WHITE1
  1246. #define LIGHT_CH5_PIN 12 // WHITE1
  1247. #define LIGHT_CH1_INVERSE 0
  1248. #define LIGHT_CH2_INVERSE 0
  1249. #define LIGHT_CH3_INVERSE 0
  1250. #define LIGHT_CH4_INVERSE 0
  1251. #define LIGHT_CH5_INVERSE 0
  1252. #elif defined(ARILUX_E27)
  1253. // Info
  1254. #define MANUFACTURER "ARILUX"
  1255. #define DEVICE "E27"
  1256. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1257. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1258. #define DUMMY_RELAY_COUNT 1
  1259. // Light
  1260. #define LIGHT_CHANNELS 4
  1261. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  1262. #define MY92XX_CHIPS 1
  1263. #define MY92XX_DI_PIN 13
  1264. #define MY92XX_DCKI_PIN 15
  1265. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1266. #define MY92XX_MAPPING 0, 1, 2, 3
  1267. // -----------------------------------------------------------------------------
  1268. // XENON SM-PW701U
  1269. // -----------------------------------------------------------------------------
  1270. #elif defined(XENON_SM_PW702U)
  1271. // Info
  1272. #define MANUFACTURER "XENON"
  1273. #define DEVICE "SM_PW702U"
  1274. // Buttons
  1275. #define BUTTON1_PIN 13
  1276. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1277. #define BUTTON1_RELAY 1
  1278. // Relays
  1279. #define RELAY1_PIN 12
  1280. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1281. // LEDs
  1282. #define LED1_PIN 4
  1283. #define LED1_PIN_INVERSE 1
  1284. // -----------------------------------------------------------------------------
  1285. // AUTHOMETION LYT8266
  1286. // https://authometion.com/shop/en/home/13-lyt8266.html
  1287. // -----------------------------------------------------------------------------
  1288. #elif defined(AUTHOMETION_LYT8266)
  1289. // Info
  1290. #define MANUFACTURER "AUTHOMETION"
  1291. #define DEVICE "LYT8266"
  1292. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1293. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1294. #define DUMMY_RELAY_COUNT 1
  1295. // Light
  1296. #define LIGHT_CHANNELS 4
  1297. #define LIGHT_CH1_PIN 13 // RED
  1298. #define LIGHT_CH2_PIN 12 // GREEN
  1299. #define LIGHT_CH3_PIN 14 // BLUE
  1300. #define LIGHT_CH4_PIN 2 // WHITE
  1301. #define LIGHT_CH1_INVERSE 0
  1302. #define LIGHT_CH2_INVERSE 0
  1303. #define LIGHT_CH3_INVERSE 0
  1304. #define LIGHT_CH4_INVERSE 0
  1305. #define LIGHT_ENABLE_PIN 15
  1306. #elif defined(GIZWITS_WITTY_CLOUD)
  1307. // Info
  1308. #define MANUFACTURER "GIZWITS"
  1309. #define DEVICE "WITTY_CLOUD"
  1310. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1311. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1312. #define DUMMY_RELAY_COUNT 1
  1313. // Buttons
  1314. #define BUTTON1_PIN 4
  1315. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1316. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  1317. #define BUTTON1_CLICK BUTTON_MODE_NONE
  1318. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1319. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1320. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  1321. #define ANALOG_SUPPORT 1
  1322. // LEDs
  1323. #define LED1_PIN 2 // BLUE build-in
  1324. #define LED1_PIN_INVERSE 1
  1325. // Light
  1326. #define LIGHT_CHANNELS 3
  1327. #define LIGHT_CH1_PIN 15 // RED
  1328. #define LIGHT_CH2_PIN 12 // GREEN
  1329. #define LIGHT_CH3_PIN 13 // BLUE
  1330. #define LIGHT_CH1_INVERSE 0
  1331. #define LIGHT_CH2_INVERSE 0
  1332. #define LIGHT_CH3_INVERSE 0
  1333. // -----------------------------------------------------------------------------
  1334. // KMC 70011
  1335. // https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
  1336. // -----------------------------------------------------------------------------
  1337. #elif defined(KMC_70011)
  1338. // Info
  1339. #define MANUFACTURER "KMC"
  1340. #define DEVICE "70011"
  1341. // Buttons
  1342. #define BUTTON1_PIN 0
  1343. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1344. #define BUTTON1_RELAY 1
  1345. // Relays
  1346. #define RELAY1_PIN 14
  1347. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1348. // LEDs
  1349. #define LED1_PIN 13
  1350. #define LED1_PIN_INVERSE 1
  1351. // HLW8012
  1352. #ifndef HLW8012_SUPPORT
  1353. #define HLW8012_SUPPORT 1
  1354. #endif
  1355. #define HLW8012_SEL_PIN 12
  1356. #define HLW8012_CF1_PIN 5
  1357. #define HLW8012_CF_PIN 4
  1358. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1359. // -----------------------------------------------------------------------------
  1360. // Euromate (?) Wifi Stecker Shuko
  1361. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  1362. // Thanks to @Geitde
  1363. // -----------------------------------------------------------------------------
  1364. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  1365. // Info
  1366. #define MANUFACTURER "EUROMATE"
  1367. #define DEVICE "WIFI_STECKER_SCHUKO"
  1368. // Buttons
  1369. #define BUTTON1_PIN 14
  1370. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1371. #define BUTTON1_RELAY 1
  1372. // The relay in the device is not a bistable (latched) relay.
  1373. // The device is reported to have a flip-flop circuit to drive the relay
  1374. // So @Geitde hack is still the only possible
  1375. // Hack: drive GPIO12 low and use GPIO5 as normal relay pin:
  1376. #define RELAY1_PIN 5
  1377. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1378. #define LED2_PIN 12 /* DUMMY: exploit default off state for GPIO12=low */
  1379. #define LED2_PIN_INVERSE 0
  1380. // LEDs
  1381. #define LED1_PIN 4
  1382. #define LED1_PIN_INVERSE 0
  1383. // -----------------------------------------------------------------------------
  1384. // Generic 8CH
  1385. // -----------------------------------------------------------------------------
  1386. #elif defined(GENERIC_8CH)
  1387. // Info
  1388. #define MANUFACTURER "GENERIC"
  1389. #define DEVICE "8CH"
  1390. // Relays
  1391. #define RELAY1_PIN 0
  1392. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1393. #define RELAY2_PIN 2
  1394. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1395. #define RELAY3_PIN 4
  1396. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1397. #define RELAY4_PIN 5
  1398. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1399. #define RELAY5_PIN 12
  1400. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1401. #define RELAY6_PIN 13
  1402. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  1403. #define RELAY7_PIN 14
  1404. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  1405. #define RELAY8_PIN 15
  1406. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  1407. // -----------------------------------------------------------------------------
  1408. // STM RELAY
  1409. // -----------------------------------------------------------------------------
  1410. #elif defined(STM_RELAY)
  1411. // Info
  1412. #define MANUFACTURER "STM_RELAY"
  1413. #define DEVICE "2CH"
  1414. // Relays
  1415. #define DUMMY_RELAY_COUNT 2
  1416. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  1417. // Remove UART noise on serial line
  1418. #define DEBUG_SERIAL_SUPPORT 0
  1419. // -----------------------------------------------------------------------------
  1420. // Tonbux Powerstrip02
  1421. // -----------------------------------------------------------------------------
  1422. #elif defined(TONBUX_POWERSTRIP02)
  1423. // Info
  1424. #define MANUFACTURER "TONBUX"
  1425. #define DEVICE "POWERSTRIP02"
  1426. // Buttons
  1427. #define BUTTON1_PIN 5
  1428. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1429. #define BUTTON1_RELAY 0
  1430. // Relays
  1431. #define RELAY1_PIN 4
  1432. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1433. #define RELAY2_PIN 13
  1434. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1435. #define RELAY3_PIN 12
  1436. #define RELAY3_TYPE RELAY_TYPE_INVERSE
  1437. #define RELAY4_PIN 14
  1438. #define RELAY4_TYPE RELAY_TYPE_INVERSE
  1439. // Not a relay. USB ports on/off
  1440. #define RELAY5_PIN 16
  1441. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1442. // LEDs
  1443. #define LED1_PIN 0 // 1 blue led
  1444. #define LED1_PIN_INVERSE 1
  1445. #define LED2_PIN 3 // 3 red leds
  1446. #define LED2_PIN_INVERSE 1
  1447. // -----------------------------------------------------------------------------
  1448. // Lingan SWA1
  1449. // -----------------------------------------------------------------------------
  1450. #elif defined(LINGAN_SWA1)
  1451. // Info
  1452. #define MANUFACTURER "LINGAN"
  1453. #define DEVICE "SWA1"
  1454. // Buttons
  1455. #define BUTTON1_PIN 13
  1456. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1457. #define BUTTON1_RELAY 1
  1458. // Relays
  1459. #define RELAY1_PIN 5
  1460. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1461. // LEDs
  1462. #define LED1_PIN 4
  1463. #define LED1_PIN_INVERSE 1
  1464. // -----------------------------------------------------------------------------
  1465. // HEYGO HY02
  1466. // -----------------------------------------------------------------------------
  1467. #elif defined(HEYGO_HY02)
  1468. // Info
  1469. #define MANUFACTURER "HEYGO"
  1470. #define DEVICE "HY02"
  1471. // Buttons
  1472. #define BUTTON1_PIN 13
  1473. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1474. #define BUTTON1_RELAY 1
  1475. // Relays
  1476. #define RELAY1_PIN 12
  1477. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1478. // LEDs
  1479. #define LED1_PIN 4
  1480. #define LED1_PIN_INVERSE 0
  1481. // -----------------------------------------------------------------------------
  1482. // Maxcio W-US002S
  1483. // -----------------------------------------------------------------------------
  1484. #elif defined(MAXCIO_WUS002S)
  1485. // Info
  1486. #define MANUFACTURER "MAXCIO"
  1487. #define DEVICE "WUS002S"
  1488. // Buttons
  1489. #define BUTTON1_PIN 2
  1490. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1491. #define BUTTON1_RELAY 1
  1492. // Relays
  1493. #define RELAY1_PIN 13
  1494. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1495. // LEDs
  1496. #define LED1_PIN 3
  1497. #define LED1_PIN_INVERSE 0
  1498. // HLW8012
  1499. #ifndef HLW8012_SUPPORT
  1500. #define HLW8012_SUPPORT 1
  1501. #endif
  1502. #define HLW8012_SEL_PIN 12
  1503. #define HLW8012_CF1_PIN 5
  1504. #define HLW8012_CF_PIN 4
  1505. #define HLW8012_CURRENT_R 0.002 // Current resistor
  1506. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1507. // -----------------------------------------------------------------------------
  1508. // YiDian XS-SSA05
  1509. // -----------------------------------------------------------------------------
  1510. #elif defined(YIDIAN_XSSSA05)
  1511. // Info
  1512. #define MANUFACTURER "YIDIAN"
  1513. #define DEVICE "XSSSA05"
  1514. // Buttons
  1515. #define BUTTON1_PIN 13
  1516. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1517. #define BUTTON1_RELAY 1
  1518. // Relays
  1519. #define RELAY1_PIN 12
  1520. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1521. // LEDs
  1522. #define LED1_PIN 0 // red
  1523. #define LED1_PIN_INVERSE 1
  1524. #define LED1_MODE LED_MODE_WIFI
  1525. #define LED2_PIN 15 // blue
  1526. #define LED2_PIN_INVERSE 1
  1527. #define LED2_MODE LED_MODE_RELAY
  1528. // HLW8012
  1529. #ifndef HLW8012_SUPPORT
  1530. #define HLW8012_SUPPORT 1
  1531. #endif
  1532. #define HLW8012_SEL_PIN 3
  1533. #define HLW8012_CF1_PIN 14
  1534. #define HLW8012_CF_PIN 5
  1535. #define HLW8012_CURRENT_R 0.001 // Current resistor
  1536. #define HLW8012_VOLTAGE_R_UP ( 2 * 1200000 ) // Upstream voltage resistor
  1537. #define HLW8012_SEL_CURRENT LOW
  1538. #define HLW8012_INTERRUPT_ON FALLING
  1539. // -----------------------------------------------------------------------------
  1540. // TONBUX XS-SSA06
  1541. // -----------------------------------------------------------------------------
  1542. #elif defined(TONBUX_XSSSA06)
  1543. // Info
  1544. #define MANUFACTURER "TONBUX"
  1545. #define DEVICE "XSSSA06"
  1546. // Buttons
  1547. #define BUTTON1_PIN 13
  1548. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1549. #define BUTTON1_RELAY 1
  1550. // Relays
  1551. #define RELAY1_PIN 15
  1552. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1553. // LEDs
  1554. #define LED1_PIN 0 // R - 8 rgb led ring
  1555. #define LED1_PIN_INVERSE 0
  1556. #define LED2_PIN 5 // G
  1557. #define LED2_PIN_INVERSE 0
  1558. #define LED3_PIN 2 // B
  1559. #define LED3_PIN_INVERSE 0
  1560. // -----------------------------------------------------------------------------
  1561. // GREEN ESP8266 RELAY MODULE
  1562. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1563. // -----------------------------------------------------------------------------
  1564. #elif defined(GREEN_ESP8266RELAY)
  1565. // Info
  1566. #define MANUFACTURER "GREEN"
  1567. #define DEVICE "ESP8266RELAY"
  1568. // Buttons
  1569. // Not a button but input via Optocoupler
  1570. #define BUTTON1_PIN 5
  1571. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1572. #define BUTTON1_RELAY 1
  1573. // Relays
  1574. #define RELAY1_PIN 4
  1575. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1576. // LEDs
  1577. #define LED1_PIN 2
  1578. #define LED1_PIN_INVERSE 1
  1579. // -----------------------------------------------------------------------------
  1580. // Henrique Gravina ESPIKE
  1581. // https://github.com/Henriquegravina/Espike
  1582. // -----------------------------------------------------------------------------
  1583. #elif defined(IKE_ESPIKE)
  1584. #define MANUFACTURER "IKE"
  1585. #define DEVICE "ESPIKE"
  1586. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1587. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1588. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1589. #define BUTTON1_PIN 13
  1590. #define BUTTON1_RELAY 1
  1591. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1592. #define BUTTON2_PIN 12
  1593. #define BUTTON2_RELAY 2
  1594. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1595. #define BUTTON3_PIN 14
  1596. #define BUTTON3_RELAY 3
  1597. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1598. #define RELAY1_PIN 4
  1599. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1600. #define RELAY2_PIN 5
  1601. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1602. #define RELAY3_PIN 16
  1603. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1604. #define LED1_PIN 2
  1605. #define LED1_PIN_INVERSE 1
  1606. // -----------------------------------------------------------------------------
  1607. // SWIFITCH
  1608. // https://github.com/ArnieX/swifitch
  1609. // -----------------------------------------------------------------------------
  1610. #elif defined(ARNIEX_SWIFITCH)
  1611. // Info
  1612. #define MANUFACTURER "ARNIEX"
  1613. #define DEVICE "SWIFITCH"
  1614. // Buttons
  1615. #define BUTTON1_PIN 4 // D2
  1616. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1617. #define BUTTON1_RELAY 1
  1618. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1619. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1620. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1621. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1622. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1623. // Relays
  1624. #define RELAY1_PIN 5 // D1
  1625. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1626. // LEDs
  1627. #define LED1_PIN 12 // D6
  1628. #define LED1_PIN_INVERSE 1
  1629. // -----------------------------------------------------------------------------
  1630. // ESP-01S RELAY v4.0
  1631. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  1632. // -----------------------------------------------------------------------------
  1633. #elif defined(GENERIC_ESP01S_RELAY_V40)
  1634. // Info
  1635. #define MANUFACTURER "GENERIC"
  1636. #define DEVICE "ESP01S_RELAY_40"
  1637. // Relays
  1638. #define RELAY1_PIN 0
  1639. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1640. // LEDs
  1641. #define LED1_PIN 2
  1642. #define LED1_PIN_INVERSE 0
  1643. // -----------------------------------------------------------------------------
  1644. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  1645. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  1646. // -----------------------------------------------------------------------------
  1647. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  1648. // Info
  1649. #define MANUFACTURER "GENERIC"
  1650. #define DEVICE "ESP01S_RGBLED_10"
  1651. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  1652. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  1653. // Buttons
  1654. //#define BUTTON1_PIN 2
  1655. // Relays
  1656. //#define RELAY1_PIN 2
  1657. // LEDs
  1658. #define LED1_PIN 2
  1659. #define LED1_PIN_INVERSE 0
  1660. // -----------------------------------------------------------------------------
  1661. // ESP-01S DHT11 v1.0
  1662. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  1663. // -----------------------------------------------------------------------------
  1664. #elif defined(GENERIC_ESP01S_DHT11_V10)
  1665. // Info
  1666. #define MANUFACTURER "GENERIC"
  1667. #define DEVICE "ESP01S_DHT11_10"
  1668. // DHT11
  1669. #ifndef DHT_SUPPORT
  1670. #define DHT_SUPPORT 1
  1671. #endif
  1672. #define DHT_PIN 2
  1673. #define DHT_TYPE DHT_CHIP_DHT11
  1674. // -----------------------------------------------------------------------------
  1675. // ESP-01S DS18B20 v1.0
  1676. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  1677. // -----------------------------------------------------------------------------
  1678. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  1679. // Info
  1680. #define MANUFACTURER "GENERIC"
  1681. #define DEVICE "ESP01S_DS18B20_10"
  1682. // DB18B20
  1683. #ifndef DALLAS_SUPPORT
  1684. #define DALLAS_SUPPORT 1
  1685. #endif
  1686. #define DALLAS_PIN 2
  1687. // -----------------------------------------------------------------------------
  1688. // ESP-DIN relay board V1
  1689. // https://github.com/pilotak/esp_din
  1690. // -----------------------------------------------------------------------------
  1691. #elif defined(PILOTAK_ESP_DIN_V1)
  1692. // Info
  1693. #define MANUFACTURER "PILOTAK"
  1694. #define DEVICE "ESP_DIN_V1"
  1695. // Buttons
  1696. #define BUTTON1_PIN 0
  1697. #define BUTTON1_RELAY 1
  1698. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1699. // Relays
  1700. #define RELAY1_PIN 4
  1701. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1702. #define RELAY2_PIN 5
  1703. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1704. // LEDs
  1705. #define LED1_PIN 15
  1706. #define LED1_PIN_INVERSE 0
  1707. #define I2C_SDA_PIN 12
  1708. #define I2C_SCL_PIN 13
  1709. #ifndef DALLAS_SUPPORT
  1710. #define DALLAS_SUPPORT 1
  1711. #endif
  1712. #define DALLAS_PIN 2
  1713. #ifndef RF_SUPPORT
  1714. #define RF_SUPPORT 1
  1715. #endif
  1716. #define RF_PIN 14
  1717. #ifndef DIGITAL_SUPPORT
  1718. #define DIGITAL_SUPPORT 1
  1719. #endif
  1720. #define DIGITAL_PIN 16
  1721. #define DIGITAL_PIN_MODE INPUT
  1722. // -----------------------------------------------------------------------------
  1723. // Heltec Touch Relay
  1724. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  1725. // -----------------------------------------------------------------------------
  1726. #elif defined(HELTEC_TOUCHRELAY)
  1727. // Info
  1728. #define MANUFACTURER "HELTEC"
  1729. #define DEVICE "TOUCH_RELAY"
  1730. // Buttons
  1731. #define BUTTON1_PIN 14
  1732. #define BUTTON1_RELAY 1
  1733. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1734. // Relays
  1735. #define RELAY1_PIN 12
  1736. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1737. // -----------------------------------------------------------------------------
  1738. // Zhilde ZLD-EU44-W
  1739. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  1740. // -----------------------------------------------------------------------------
  1741. #elif defined(ZHILDE_EU44_W)
  1742. // Info
  1743. #define MANUFACTURER "ZHILDE"
  1744. #define DEVICE "EU44_W"
  1745. // Based on the reporter, this product uses GPIO1 and 3 for the button
  1746. // and onboard LED, so hardware serial should be disabled...
  1747. #define DEBUG_SERIAL_SUPPORT 0
  1748. // Buttons
  1749. #define BUTTON1_PIN 3
  1750. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1751. // Relays
  1752. #define RELAY1_PIN 5
  1753. #define RELAY2_PIN 4
  1754. #define RELAY3_PIN 12
  1755. #define RELAY4_PIN 13
  1756. #define RELAY5_PIN 14
  1757. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1758. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1759. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1760. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1761. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1762. // LEDs
  1763. #define LED1_PIN 1
  1764. #define LED1_PIN_INVERSE 1
  1765. // -----------------------------------------------------------------------------
  1766. // Allnet 4duino ESP8266-UP-Relais
  1767. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  1768. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  1769. // -----------------------------------------------------------------------------
  1770. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  1771. // Info
  1772. #define MANUFACTURER "ALLNET"
  1773. #define DEVICE "4DUINO_IOT_WLAN_RELAIS"
  1774. // Relays
  1775. #define RELAY1_PIN 14
  1776. #define RELAY1_RESET_PIN 12
  1777. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1778. // LEDs
  1779. #define LED1_PIN 0
  1780. #define LED1_PIN_INVERSE 1
  1781. // Buttons
  1782. //#define BUTTON1_PIN 0
  1783. //#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1784. // Using pins labelled as SDA & SCL as buttons
  1785. #define BUTTON2_PIN 4
  1786. #define BUTTON2_MODE BUTTON_PUSHBUTTON
  1787. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  1788. #define BUTTON2_CLICK BUTTON_MODE_NONE
  1789. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  1790. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  1791. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  1792. #define BUTTON3_PIN 5
  1793. #define BUTTON3_MODE BUTTON_PUSHBUTTON
  1794. // Using pins labelled as SDA & SCL for I2C
  1795. //#define I2C_SDA_PIN 4
  1796. //#define I2C_SCL_PIN 5
  1797. // -----------------------------------------------------------------------------
  1798. // Luani HVIO
  1799. // https://luani.de/projekte/esp8266-hvio/
  1800. // https://luani.de/blog/esp8266-230v-io-modul/
  1801. // -----------------------------------------------------------------------------
  1802. #elif defined(LUANI_HVIO)
  1803. // Info
  1804. #define MANUFACTURER "LUANI"
  1805. #define DEVICE "HVIO"
  1806. // Buttons
  1807. #define BUTTON1_PIN 12
  1808. #define BUTTON1_RELAY 1
  1809. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  1810. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1811. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1812. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1813. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1814. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1815. #define BUTTON2_PIN 13
  1816. #define BUTTON2_RELAY 2
  1817. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  1818. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  1819. // Relays
  1820. #define RELAY1_PIN 4
  1821. #define RELAY2_PIN 5
  1822. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1823. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1824. // LEDs
  1825. #define LED1_PIN 15
  1826. #define LED1_PIN_INVERSE 0
  1827. // -----------------------------------------------------------------------------
  1828. // Tonbux 50-100M Smart Mosquito Killer USB
  1829. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  1830. // -----------------------------------------------------------------------------
  1831. #elif defined(TONBUX_MOSQUITO_KILLER)
  1832. // Info
  1833. #define MANUFACTURER "TONBUX"
  1834. #define DEVICE "MOSQUITO_KILLER"
  1835. // Buttons
  1836. #define BUTTON1_PIN 2
  1837. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1838. #define BUTTON1_RELAY 1
  1839. // Relays
  1840. #define RELAY1_PIN 5 // not a relay, fan
  1841. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1842. // LEDs
  1843. #define LED1_PIN 15 // blue led
  1844. #define LED1_PIN_INVERSE 1
  1845. #define LED1_MODE LED_MODE_WIFI
  1846. #define LED2_PIN 14 // red led
  1847. #define LED2_PIN_INVERSE 1
  1848. #define LED2_MODE LED_MODE_RELAY
  1849. #define LED3_PIN 12 // UV leds (1-2-3-4-5-6-7-8)
  1850. #define LED3_PIN_INVERSE 0
  1851. #define LED3_RELAY 1
  1852. #define LED4_PIN 16 // UV leds (9-10-11)
  1853. #define LED4_PIN_INVERSE 0
  1854. #define LED4_RELAY 1
  1855. // -----------------------------------------------------------------------------
  1856. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  1857. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  1858. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  1859. // -----------------------------------------------------------------------------
  1860. #elif defined(NEO_COOLCAM_NAS_WR01W)
  1861. // Info
  1862. #define MANUFACTURER "NEO_COOLCAM"
  1863. #define DEVICE "NAS_WR01W"
  1864. // Buttons
  1865. #define BUTTON1_PIN 13
  1866. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1867. #define BUTTON1_RELAY 1
  1868. // Relays
  1869. #define RELAY1_PIN 12
  1870. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1871. // LEDs
  1872. #define LED1_PIN 4
  1873. #define LED1_PIN_INVERSE 1
  1874. // ------------------------------------------------------------------------------
  1875. // Estink Wifi Power Strip
  1876. // https://www.amazon.de/Steckdosenleiste-Ladeger%C3%A4t-Sprachsteuerung-SmartphonesTablets-Android/dp/B0796W5FZY
  1877. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  1878. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  1879. // -----------------------------------------------------------------------------
  1880. #elif defined(ESTINK_WIFI_POWER_STRIP)
  1881. // Info
  1882. #define MANUFACTURER "ESTINK"
  1883. #define DEVICE "WIFI_POWER_STRIP"
  1884. // Disable UART noise since this board uses GPIO3
  1885. #define DEBUG_SERIAL_SUPPORT 0
  1886. // Buttons
  1887. #define BUTTON1_PIN 16
  1888. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1889. #define BUTTON1_RELAY 4
  1890. // Relays
  1891. #define RELAY1_PIN 14 // USB power
  1892. #define RELAY2_PIN 13 // power plug 1
  1893. #define RELAY3_PIN 4 // power plug 2
  1894. #define RELAY4_PIN 15 // power plug 3
  1895. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1896. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1897. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1898. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1899. // LEDs
  1900. #define LED1_PIN 0 // power led
  1901. #define LED2_PIN 12 // power plug 1
  1902. #define LED3_PIN 3 // power plug 2
  1903. #define LED4_PIN 5 // power plug 3
  1904. #define LED1_PIN_INVERSE 1
  1905. #define LED2_PIN_INVERSE 1
  1906. #define LED3_PIN_INVERSE 1
  1907. #define LED4_PIN_INVERSE 1
  1908. #define LED1_MODE LED_MODE_FINDME
  1909. #define LED2_MODE LED_MODE_FOLLOW
  1910. #define LED3_MODE LED_MODE_FOLLOW
  1911. #define LED4_MODE LED_MODE_FOLLOW
  1912. #define LED2_RELAY 2
  1913. #define LED3_RELAY 3
  1914. #define LED4_RELAY 4
  1915. // -----------------------------------------------------------------------------
  1916. // Bruno Horta's OnOfre
  1917. // https://www.bhonofre.pt/
  1918. // https://github.com/brunohorta82/BH_OnOfre/
  1919. // -----------------------------------------------------------------------------
  1920. #elif defined(BH_ONOFRE)
  1921. // Info
  1922. #define MANUFACTURER "BH"
  1923. #define DEVICE "ONOFRE"
  1924. // Buttons
  1925. #define BUTTON1_PIN 12
  1926. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1927. #define BUTTON1_RELAY 1
  1928. #define BUTTON2_PIN 13
  1929. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1930. #define BUTTON2_RELAY 2
  1931. // Relays
  1932. #define RELAY1_PIN 4
  1933. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1934. #define RELAY2_PIN 5
  1935. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1936. // -----------------------------------------------------------------------------
  1937. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  1938. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  1939. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  1940. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  1941. // * Goosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  1942. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  1943. // -----------------------------------------------------------------------------
  1944. #elif defined(BLITZWOLF_BWSHP2)
  1945. // Info
  1946. #define MANUFACTURER "BLITZWOLF"
  1947. #define DEVICE "BWSHP2"
  1948. // Buttons
  1949. #define BUTTON1_PIN 13
  1950. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1951. #define BUTTON1_RELAY 1
  1952. // Relays
  1953. #define RELAY1_PIN 15
  1954. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1955. // LEDs
  1956. #define LED1_PIN 2
  1957. #define LED1_PIN_INVERSE 1
  1958. #define LED2_PIN 0
  1959. #define LED2_PIN_INVERSE 1
  1960. #define LED2_MODE LED_MODE_FINDME
  1961. #define LED2_RELAY 1
  1962. // HJL01 / BL0937
  1963. #ifndef HLW8012_SUPPORT
  1964. #define HLW8012_SUPPORT 1
  1965. #endif
  1966. #define HLW8012_SEL_PIN 12
  1967. #define HLW8012_CF1_PIN 14
  1968. #define HLW8012_CF_PIN 5
  1969. #define HLW8012_SEL_CURRENT LOW
  1970. #define HLW8012_CURRENT_RATIO 25740
  1971. #define HLW8012_VOLTAGE_RATIO 313400
  1972. #define HLW8012_POWER_RATIO 3414290
  1973. #define HLW8012_INTERRUPT_ON FALLING
  1974. // ----------------------------------------------------------------------------------------
  1975. // Homecube 16A is similar but some pins differ and it also has RGB LEDs
  1976. // https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
  1977. // ----------------------------------------------------------------------------------------
  1978. #elif defined(HOMECUBE_16A)
  1979. // Info
  1980. #define MANUFACTURER "HOMECUBE"
  1981. #define DEVICE "16A"
  1982. // Buttons
  1983. #define BUTTON1_PIN 13
  1984. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1985. #define BUTTON1_RELAY 1
  1986. // Relays
  1987. #define RELAY1_PIN 15
  1988. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1989. // LEDs
  1990. //LED Pin 4 - ESP8266 onboard LED
  1991. //Red LED: 0
  1992. //Green LED: 12
  1993. //Blue LED: 2
  1994. // Blue
  1995. #define LED1_PIN 2
  1996. #define LED1_PIN_INVERSE 0
  1997. // Green
  1998. #define LED2_PIN 12
  1999. #define LED2_PIN_INVERSE 1
  2000. #define LED2_MODE LED_MODE_RELAY
  2001. // Red
  2002. #define LED3_PIN 0
  2003. #define LED3_PIN_INVERSE 0
  2004. #define LED3_MODE LED_MODE_OFF
  2005. // HJL01 / BL0937
  2006. #ifndef HLW8012_SUPPORT
  2007. #define HLW8012_SUPPORT 1
  2008. #endif
  2009. #define HLW8012_SEL_PIN 16
  2010. #define HLW8012_CF1_PIN 14
  2011. #define HLW8012_CF_PIN 5
  2012. #define HLW8012_SEL_CURRENT LOW
  2013. #define HLW8012_CURRENT_RATIO 25740
  2014. #define HLW8012_VOLTAGE_RATIO 313400
  2015. #define HLW8012_POWER_RATIO 3414290
  2016. #define HLW8012_INTERRUPT_ON FALLING
  2017. // -----------------------------------------------------------------------------
  2018. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  2019. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  2020. // -----------------------------------------------------------------------------
  2021. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  2022. // Info
  2023. #define MANUFACTURER "VANZAVANZU"
  2024. #define DEVICE "SMART_WIFI_PLUG_MINI"
  2025. // Buttons
  2026. #define BUTTON1_PIN 13
  2027. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2028. #define BUTTON1_RELAY 1
  2029. // Relays
  2030. #define RELAY1_PIN 15
  2031. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2032. // LEDs
  2033. #define LED1_PIN 2
  2034. #define LED1_PIN_INVERSE 1
  2035. #define LED2_PIN 0
  2036. #define LED2_PIN_INVERSE 1
  2037. #define LED2_MODE LED_MODE_FINDME
  2038. #define LED2_RELAY 1
  2039. // Disable UART noise
  2040. #define DEBUG_SERIAL_SUPPORT 0
  2041. // HJL01 / BL0937
  2042. #ifndef HLW8012_SUPPORT
  2043. #define HLW8012_SUPPORT 1
  2044. #endif
  2045. #define HLW8012_SEL_PIN 3
  2046. #define HLW8012_CF1_PIN 14
  2047. #define HLW8012_CF_PIN 5
  2048. #define HLW8012_SEL_CURRENT LOW
  2049. #define HLW8012_CURRENT_RATIO 25740
  2050. #define HLW8012_VOLTAGE_RATIO 313400
  2051. #define HLW8012_POWER_RATIO 3414290
  2052. #define HLW8012_INTERRUPT_ON FALLING
  2053. // -----------------------------------------------------------------------------
  2054. #elif defined(GENERIC_AG_L4)
  2055. // Info
  2056. #define MANUFACTURER "GENERIC"
  2057. #define DEVICE "AG_L4"
  2058. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2059. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2060. #define DUMMY_RELAY_COUNT 1
  2061. // button 1: "power" button
  2062. #define BUTTON1_PIN 4
  2063. #define BUTTON1_RELAY 1
  2064. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2065. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  2066. #define BUTTON1_CLICK BUTTON_MODE_NONE
  2067. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2068. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2069. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  2070. // button 2: "wifi" button
  2071. #define BUTTON2_PIN 2
  2072. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2073. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  2074. #define BUTTON2_CLICK BUTTON_MODE_NONE
  2075. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  2076. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  2077. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  2078. // LEDs
  2079. #define LED1_PIN 5 // red status led
  2080. #define LED1_PIN_INVERSE 0
  2081. #define LED2_PIN 16 // master light power
  2082. #define LED2_PIN_INVERSE 1
  2083. #define LED2_MODE LED_MODE_RELAY
  2084. // Light
  2085. #define LIGHT_CHANNELS 3
  2086. #define LIGHT_CH1_PIN 14 // RED
  2087. #define LIGHT_CH2_PIN 13 // GREEN
  2088. #define LIGHT_CH3_PIN 12 // BLUE
  2089. #define LIGHT_CH1_INVERSE 0
  2090. #define LIGHT_CH2_INVERSE 0
  2091. #define LIGHT_CH3_INVERSE 0
  2092. // -----------------------------------------------------------------------------
  2093. #elif defined(ALLTERCO_SHELLY1)
  2094. // Info
  2095. #define MANUFACTURER "ALLTERCO"
  2096. #define DEVICE "SHELLY1"
  2097. // Buttons
  2098. #define BUTTON1_PIN 5
  2099. #define BUTTON1_MODE BUTTON_SWITCH
  2100. #define BUTTON1_RELAY 1
  2101. // Relays
  2102. #define RELAY1_PIN 4
  2103. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2104. #elif defined(ALLTERCO_SHELLY2)
  2105. // Info
  2106. #define MANUFACTURER "ALLTERCO"
  2107. #define DEVICE "SHELLY2"
  2108. // Buttons
  2109. #define BUTTON1_PIN 12
  2110. #define BUTTON2_PIN 14
  2111. #define BUTTON1_MODE BUTTON_SWITCH
  2112. #define BUTTON2_MODE BUTTON_SWITCH
  2113. #define BUTTON1_RELAY 1
  2114. #define BUTTON2_RELAY 2
  2115. // Relays
  2116. #define RELAY1_PIN 4
  2117. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2118. #define RELAY2_PIN 5
  2119. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2120. // -----------------------------------------------------------------------------
  2121. #elif defined(LOHAS_9W)
  2122. // Info
  2123. #define MANUFACTURER "LOHAS"
  2124. #define DEVICE "E27_9W"
  2125. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2126. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2127. #define DUMMY_RELAY_COUNT 1
  2128. // Light
  2129. #define LIGHT_CHANNELS 5
  2130. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2131. #define MY92XX_CHIPS 2
  2132. #define MY92XX_DI_PIN 13
  2133. #define MY92XX_DCKI_PIN 15
  2134. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2135. #define MY92XX_MAPPING 0, 1, 2, 3, 4
  2136. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  2137. // -----------------------------------------------------------------------------
  2138. #elif defined(XIAOMI_SMART_DESK_LAMP)
  2139. // Info
  2140. #define MANUFACTURER "XIAOMI"
  2141. #define DEVICE "SMART_DESK_LAMP"
  2142. // Buttons
  2143. #define BUTTON1_PIN 2
  2144. #define BUTTON2_PIN 14
  2145. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2146. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2147. // This button doubles as switch here and as encoder mode switch below
  2148. // Clicking it (for less than 500ms) will turn the light on and off
  2149. // Double and Long clicks will not work as these are used to modify the encoder action
  2150. #define BUTTON1_RELAY 1
  2151. #define BUTTON_LNGCLICK_DELAY 500
  2152. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2153. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2154. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  2155. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  2156. #define BUTTON2_DBLCLICK BUTTON_MODE_AP
  2157. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  2158. // Light
  2159. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2160. #define DUMMY_RELAY_COUNT 1
  2161. #define LIGHT_STEP 8
  2162. #define LIGHT_CHANNELS 2
  2163. #define LIGHT_CH1_PIN 5 // warm white
  2164. #define LIGHT_CH1_INVERSE 0
  2165. #define LIGHT_CH2_PIN 4 // cold white
  2166. #define LIGHT_CH2_INVERSE 0
  2167. // Encoder
  2168. // If mode is ENCODER_MODE_RATIO, the value ratio between both channels is changed
  2169. // when the button is not pressed, and the overall brightness when pressed
  2170. // If mode is ENCODER_MODE_CHANNEL, the first channel value is changed
  2171. // when the button is not pressed, and the second channel when pressed
  2172. // If no ENCODERX_BUTTON_PIN defined it will only change the value of the first defined channel
  2173. #define ENCODER_SUPPORT 1
  2174. #define ENCODER1_PIN1 12
  2175. #define ENCODER1_PIN2 13
  2176. #define ENCODER1_BUTTON_PIN 2 // active low by default, with software pullup
  2177. #define ENCODER1_CHANNEL1 0 // please note this value is 0-based (LIGHT_CH1 above)
  2178. #define ENCODER1_CHANNEL2 1 // please note this value is 0-based (LIGHT_CH2 above)
  2179. #define ENCODER1_MODE ENCODER_MODE_RATIO
  2180. #elif defined(PHYX_ESP12_RGB)
  2181. // Info
  2182. #define MANUFACTURER "PHYX"
  2183. #define DEVICE "ESP12_RGB"
  2184. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2185. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2186. #define DUMMY_RELAY_COUNT 1
  2187. // Light
  2188. #define LIGHT_CHANNELS 3
  2189. #define LIGHT_CH1_PIN 4 // RED
  2190. #define LIGHT_CH2_PIN 14 // GREEN
  2191. #define LIGHT_CH3_PIN 12 // BLUE
  2192. #define LIGHT_CH1_INVERSE 0
  2193. #define LIGHT_CH2_INVERSE 0
  2194. #define LIGHT_CH3_INVERSE 0
  2195. // -----------------------------------------------------------------------------
  2196. // iWoole LED Table Lamp
  2197. // 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
  2198. // -----------------------------------------------------------------------------
  2199. #elif defined(IWOOLE_LED_TABLE_LAMP)
  2200. // Info
  2201. #define MANUFACTURER "IWOOLE"
  2202. #define DEVICE "LED_TABLE_LAMP"
  2203. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2204. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2205. #define DUMMY_RELAY_COUNT 1
  2206. // Light
  2207. #define LIGHT_CHANNELS 4
  2208. #define LIGHT_CH1_PIN 12 // RED
  2209. #define LIGHT_CH2_PIN 5 // GREEN
  2210. #define LIGHT_CH3_PIN 14 // BLUE
  2211. #define LIGHT_CH4_PIN 4 // WHITE
  2212. #define LIGHT_CH1_INVERSE 0
  2213. #define LIGHT_CH2_INVERSE 0
  2214. #define LIGHT_CH3_INVERSE 0
  2215. #define LIGHT_CH4_INVERSE 0
  2216. // -----------------------------------------------------------------------------
  2217. // Bestek Smart Plug with 2 USB ports
  2218. // https://www.bestekcorp.com/bestek-smart-plug-works-with-amazon-alexa-google-assistant-and-ifttt-with-2-usb
  2219. // -----------------------------------------------------------------------------
  2220. #elif defined(BESTEK_MRJ1011)
  2221. // Info
  2222. #define MANUFACTURER "BESTEK"
  2223. #define DEVICE "MRJ1011"
  2224. // Buttons
  2225. #define BUTTON1_PIN 13
  2226. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2227. #define BUTTON1_RELAY 1
  2228. // Relay
  2229. #define RELAY1_PIN 12
  2230. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2231. // LED
  2232. #define LED1_PIN 4
  2233. #define LED1_PIN_INVERSE 1
  2234. // -----------------------------------------------------------------------------
  2235. // TEST boards (do not use!!)
  2236. // -----------------------------------------------------------------------------
  2237. #elif defined(TRAVIS01)
  2238. // Info
  2239. #define MANUFACTURER "TravisCI"
  2240. #define DEVICE "Virtual board 01"
  2241. // Some buttons - pin 0
  2242. #define BUTTON1_PIN 0
  2243. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2244. #define BUTTON1_RELAY 1
  2245. // Some relays - pin 1
  2246. #define RELAY1_PIN 1
  2247. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2248. // Some LEDs - pin 2
  2249. #define LED1_PIN 2
  2250. #define LED1_PIN_INVERSE 1
  2251. // A bit of I2C - pins 3,4
  2252. #define I2C_SDA_PIN 3
  2253. #define I2C_SCL_PIN 4
  2254. // And, as they say in "From Dusk till Dawn":
  2255. // This is a sensor blow out!
  2256. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  2257. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  2258. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  2259. // C'mon, you want sensor, come on in sensor lovers!
  2260. // If we don’t got it, you don't want it!
  2261. #define AM2320_SUPPORT 1
  2262. #define BH1750_SUPPORT 1
  2263. #define BMX280_SUPPORT 1
  2264. #define SHT3X_I2C_SUPPORT 1
  2265. #define EMON_ADC121_SUPPORT 1
  2266. #define EMON_ADS1X15_SUPPORT 1
  2267. #define SHT3X_I2C_SUPPORT 1
  2268. #define SI7021_SUPPORT 1
  2269. #define PMSX003_SUPPORT 1
  2270. #define SENSEAIR_SUPPORT1
  2271. // A bit of lights - pin 5
  2272. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2273. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2274. #define DUMMY_RELAY_COUNT 1
  2275. #define LIGHT_CHANNELS 1
  2276. #define LIGHT_CH1_PIN 5
  2277. #define LIGHT_CH1_INVERSE 0
  2278. // A bit of HLW8012 - pins 6,7,8
  2279. #ifndef HLW8012_SUPPORT
  2280. #define HLW8012_SUPPORT 1
  2281. #endif
  2282. #define HLW8012_SEL_PIN 6
  2283. #define HLW8012_CF1_PIN 7
  2284. #define HLW8012_CF_PIN 8
  2285. // A bit of Dallas - pin 9
  2286. #ifndef DALLAS_SUPPORT
  2287. #define DALLAS_SUPPORT 1
  2288. #endif
  2289. #define DALLAS_PIN 9
  2290. // A bit of ECH1560 - pins 10,11, 12
  2291. #ifndef ECH1560_SUPPORT
  2292. #define ECH1560_SUPPORT 1
  2293. #endif
  2294. #define ECH1560_CLK_PIN 10
  2295. #define ECH1560_MISO_PIN 11
  2296. #define ECH1560_INVERTED 12
  2297. #elif defined(TRAVIS02)
  2298. // Relay provider dual
  2299. #define MANUFACTURER "TravisCI"
  2300. #define DEVICE "Virtual board 02"
  2301. // Some buttons - pin 0
  2302. #define BUTTON1_PIN 0
  2303. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2304. #define BUTTON1_RELAY 1
  2305. // A bit of CSE7766 - pin 1
  2306. #ifndef CSE7766_SUPPORT
  2307. #define CSE7766_SUPPORT 1
  2308. #endif
  2309. #define CSE7766_PIN 1
  2310. // Relay type dual - pins 2,3
  2311. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  2312. #define RELAY1_PIN 2
  2313. #define RELAY2_PIN 3
  2314. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2315. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2316. // IR - pin 4
  2317. #define IR_SUPPORT 1
  2318. #define IR_RX_PIN 4
  2319. #define IR_BUTTON_SET 1
  2320. // A bit of DHT - pin 5
  2321. #ifndef DHT_SUPPORT
  2322. #define DHT_SUPPORT 1
  2323. #endif
  2324. #define DHT_PIN 5
  2325. // A bit of TMP3X (analog)
  2326. #define TMP3X_SUPPORT 1
  2327. // A bit of EVENTS - pin 10
  2328. #define EVENTS_SUPPORT 1
  2329. #define EVENTS_PIN 6
  2330. // Sonar
  2331. #define SONAR_SUPPORT 1
  2332. #define SONAR_TRIGGER 7
  2333. #define SONAR_ECHO 8
  2334. // MHZ19
  2335. #define MHZ19_SUPPORT 1
  2336. #define MHZ19_RX_PIN 9
  2337. #define MHZ19_TX_PIN 10
  2338. // PZEM004T
  2339. #define PZEM004T_SUPPORT 1
  2340. #define PZEM004T_RX_PIN 11
  2341. #define PZEM004T_TX_PIN 12
  2342. // V9261F
  2343. #define V9261F_SUPPORT 1
  2344. #define V9261F_PIN 13
  2345. // GUVAS12SD
  2346. #define GUVAS12SD_SUPPORT 1
  2347. #define GUVAS12SD_PIN 14
  2348. // Test non-default modules
  2349. #define MDNS_CLIENT_SUPPORT 1
  2350. #define NOFUSS_SUPPORT 1
  2351. #define UART_MQTT_SUPPORT 1
  2352. #define INFLUXDB_SUPPORT 1
  2353. #define IR_SUPPORT 1
  2354. #elif defined(TRAVIS03)
  2355. // Relay provider light/my92XX
  2356. #define MANUFACTURER "TravisCI"
  2357. #define DEVICE "Virtual board 03"
  2358. // Some buttons - pin 0
  2359. #define BUTTON1_PIN 0
  2360. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2361. #define BUTTON1_RELAY 1
  2362. // MY9231 Light - pins 1,2
  2363. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2364. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2365. #define DUMMY_RELAY_COUNT 1
  2366. #define LIGHT_CHANNELS 5
  2367. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2368. #define MY92XX_CHIPS 2
  2369. #define MY92XX_DI_PIN 1
  2370. #define MY92XX_DCKI_PIN 2
  2371. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2372. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  2373. // A bit of Analog EMON (analog)
  2374. #ifndef EMON_ANALOG_SUPPORT
  2375. #define EMON_ANALOG_SUPPORT 1
  2376. #endif
  2377. // Test non-default modules
  2378. #define LLMNR_SUPPORT 1
  2379. #define NETBIOS_SUPPORT 1
  2380. #define SSDP_SUPPORT 1
  2381. #endif
  2382. // -----------------------------------------------------------------------------
  2383. // Check definitions
  2384. // -----------------------------------------------------------------------------
  2385. #if not defined(MANUFACTURER) || not defined(DEVICE)
  2386. #error "UNSUPPORTED HARDWARE!!"
  2387. #endif