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.

3048 lines
97 KiB

6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. // -----------------------------------------------------------------------------
  2. // Configuration HELP
  3. // -----------------------------------------------------------------------------
  4. //
  5. // MANUFACTURER: Name of the manufacturer of the board ("string")
  6. // DEVICE: Name of the device ("string")
  7. // BUTTON#_PIN: GPIO for the n-th button (1-based, up to 4 buttons)
  8. // BUTTON#_RELAY: Relay number that will be bind to the n-th button (1-based)
  9. // BUTTON#_MODE: A mask of options (BUTTON_PUSHBUTTON and BUTTON_SWITCH cannot be together)
  10. // - BUTTON_PUSHBUTTON: button event is fired when released
  11. // - BUTTON_SWITCH: button event is fired when pressed or released
  12. // - BUTTON_DEFAULT_HIGH: there is a pull up in place
  13. // - BUTTON_SET_PULLUP: set pullup by software
  14. // RELAY#_PIN: GPIO for the n-th relay (1-based, up to 8 relays)
  15. // RELAY#_TYPE: Relay can be RELAY_TYPE_NORMAL, RELAY_TYPE_INVERSE, RELAY_TYPE_LATCHED or RELAY_TYPE_LATCHED_INVERSE
  16. // LED#_PIN: GPIO for the n-th LED (1-based, up to 8 LEDs)
  17. // LED#_PIN_INVERSE: LED has inversed logic (lit when pulled down)
  18. // LED#_MODE: Check types.h for LED_MODE_%
  19. // LED#_RELAY: Linked relay (1-based)
  20. //
  21. // Besides, other hardware specific information should be stated here
  22. // -----------------------------------------------------------------------------
  23. // ESPurna Core
  24. // -----------------------------------------------------------------------------
  25. #if defined(ESPURNA_CORE)
  26. // This is a special device targeted to generate a light-weight binary image
  27. // meant to be able to do two-step-updates:
  28. // https://github.com/xoseperez/espurna/wiki/TwoStepUpdates
  29. // Info
  30. #define MANUFACTURER "ESPRESSIF"
  31. #define DEVICE "ESPURNA_CORE"
  32. // Disable non-core modules
  33. #define ALEXA_SUPPORT 0
  34. #define BROKER_SUPPORT 0
  35. #define BUTTON_SUPPORT 0
  36. #define DOMOTICZ_SUPPORT 0
  37. #define HOMEASSISTANT_SUPPORT 0
  38. #define I2C_SUPPORT 0
  39. #define MDNS_SERVER_SUPPORT 0
  40. #define MQTT_SUPPORT 0
  41. #define NTP_SUPPORT 0
  42. #define SCHEDULER_SUPPORT 0
  43. #define SENSOR_SUPPORT 0
  44. #define THINGSPEAK_SUPPORT 0
  45. #define WEB_SUPPORT 0
  46. // Extra light-weight image
  47. //#define DEBUG_SERIAL_SUPPORT 0
  48. //#define DEBUG_TELNET_SUPPORT 0
  49. //#define DEBUG_WEB_SUPPORT 0
  50. //#define LED_SUPPORT 0
  51. //#define TELNET_SUPPORT 0
  52. //#define TERMINAL_SUPPORT 0
  53. // -----------------------------------------------------------------------------
  54. // Development boards
  55. // -----------------------------------------------------------------------------
  56. #elif defined(NODEMCU_LOLIN)
  57. // Info
  58. #define MANUFACTURER "NODEMCU"
  59. #define DEVICE "LOLIN"
  60. // Buttons
  61. #define BUTTON1_PIN 0
  62. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  63. #define BUTTON1_RELAY 1
  64. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  65. #define RELAY1_PIN 12
  66. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  67. // Light
  68. #define LED1_PIN 2
  69. #define LED1_PIN_INVERSE 1
  70. #elif defined(NODEMCU_BASIC)
  71. // Info
  72. // Generic NodeMCU Board without any buttons or relays connected.
  73. #define MANUFACTURER "NODEMCU"
  74. #define DEVICE "BASIC"
  75. #elif defined(WEMOS_D1_MINI)
  76. // Info
  77. #define MANUFACTURER "WEMOS"
  78. #define DEVICE "D1_MINI"
  79. // Buttons
  80. // No buttons on the D1 MINI alone, but defining it without adding a button doen't create problems
  81. #define BUTTON1_PIN 0 // Connect a pushbutton between D3 and GND,
  82. // it's the same as using a Wemos one button shield
  83. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  84. #define BUTTON1_RELAY 1
  85. // LEDs
  86. #define LED1_PIN 2
  87. #define LED1_PIN_INVERSE 1
  88. #define I2C_SDA_PIN 4 // D2
  89. #define I2C_SCL_PIN 5 // D1
  90. #elif defined(WEMOS_D1_MINI_RELAYSHIELD)
  91. // Info
  92. #define MANUFACTURER "WEMOS"
  93. #define DEVICE "D1_MINI_RELAYSHIELD"
  94. // Buttons
  95. // No buttons on the D1 MINI alone, but defining it without adding a button doen't create problems
  96. #define BUTTON1_PIN 0 // Connect a pushbutton between D3 and GND,
  97. // it's the same as using a Wemos one button shield
  98. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  99. #define BUTTON1_RELAY 1
  100. // Relays
  101. #define RELAY1_PIN 5
  102. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  103. // 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_SEL_CURRENT LOW
  1536. #define HLW8012_CURRENT_RATIO 25740
  1537. #define HLW8012_VOLTAGE_RATIO 313400
  1538. #define HLW8012_POWER_RATIO 3414290
  1539. #define HLW8012_INTERRUPT_ON FALLING
  1540. // -----------------------------------------------------------------------------
  1541. // TONBUX XS-SSA06
  1542. // -----------------------------------------------------------------------------
  1543. #elif defined(TONBUX_XSSSA06)
  1544. // Info
  1545. #define MANUFACTURER "TONBUX"
  1546. #define DEVICE "XSSSA06"
  1547. // Buttons
  1548. #define BUTTON1_PIN 13
  1549. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1550. #define BUTTON1_RELAY 1
  1551. // Relays
  1552. #define RELAY1_PIN 15
  1553. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1554. // LEDs
  1555. #define LED1_PIN 0 // R - 8 rgb led ring
  1556. #define LED1_PIN_INVERSE 0
  1557. #define LED2_PIN 5 // G
  1558. #define LED2_PIN_INVERSE 0
  1559. #define LED3_PIN 2 // B
  1560. #define LED3_PIN_INVERSE 0
  1561. // -----------------------------------------------------------------------------
  1562. // GREEN ESP8266 RELAY MODULE
  1563. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1564. // -----------------------------------------------------------------------------
  1565. #elif defined(GREEN_ESP8266RELAY)
  1566. // Info
  1567. #define MANUFACTURER "GREEN"
  1568. #define DEVICE "ESP8266RELAY"
  1569. // Buttons
  1570. // Not a button but input via Optocoupler
  1571. #define BUTTON1_PIN 5
  1572. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1573. #define BUTTON1_RELAY 1
  1574. // Relays
  1575. #define RELAY1_PIN 4
  1576. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1577. // LEDs
  1578. #define LED1_PIN 2
  1579. #define LED1_PIN_INVERSE 1
  1580. // -----------------------------------------------------------------------------
  1581. // Henrique Gravina ESPIKE
  1582. // https://github.com/Henriquegravina/Espike
  1583. // -----------------------------------------------------------------------------
  1584. #elif defined(IKE_ESPIKE)
  1585. #define MANUFACTURER "IKE"
  1586. #define DEVICE "ESPIKE"
  1587. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1588. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1589. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1590. #define BUTTON1_PIN 13
  1591. #define BUTTON1_RELAY 1
  1592. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1593. #define BUTTON2_PIN 12
  1594. #define BUTTON2_RELAY 2
  1595. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1596. #define BUTTON3_PIN 14
  1597. #define BUTTON3_RELAY 3
  1598. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1599. #define RELAY1_PIN 4
  1600. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1601. #define RELAY2_PIN 5
  1602. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1603. #define RELAY3_PIN 16
  1604. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1605. #define LED1_PIN 2
  1606. #define LED1_PIN_INVERSE 1
  1607. // -----------------------------------------------------------------------------
  1608. // SWIFITCH
  1609. // https://github.com/ArnieX/swifitch
  1610. // -----------------------------------------------------------------------------
  1611. #elif defined(ARNIEX_SWIFITCH)
  1612. // Info
  1613. #define MANUFACTURER "ARNIEX"
  1614. #define DEVICE "SWIFITCH"
  1615. // Buttons
  1616. #define BUTTON1_PIN 4 // D2
  1617. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1618. #define BUTTON1_RELAY 1
  1619. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1620. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1621. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1622. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1623. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1624. // Relays
  1625. #define RELAY1_PIN 5 // D1
  1626. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1627. // LEDs
  1628. #define LED1_PIN 12 // D6
  1629. #define LED1_PIN_INVERSE 1
  1630. // -----------------------------------------------------------------------------
  1631. // ESP-01S RELAY v4.0
  1632. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  1633. // -----------------------------------------------------------------------------
  1634. #elif defined(GENERIC_ESP01S_RELAY_V40)
  1635. // Info
  1636. #define MANUFACTURER "GENERIC"
  1637. #define DEVICE "ESP01S_RELAY_40"
  1638. // Relays
  1639. #define RELAY1_PIN 0
  1640. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1641. // LEDs
  1642. #define LED1_PIN 2
  1643. #define LED1_PIN_INVERSE 0
  1644. // -----------------------------------------------------------------------------
  1645. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  1646. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  1647. // -----------------------------------------------------------------------------
  1648. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  1649. // Info
  1650. #define MANUFACTURER "GENERIC"
  1651. #define DEVICE "ESP01S_RGBLED_10"
  1652. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  1653. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  1654. // Buttons
  1655. //#define BUTTON1_PIN 2
  1656. // Relays
  1657. //#define RELAY1_PIN 2
  1658. // LEDs
  1659. #define LED1_PIN 2
  1660. #define LED1_PIN_INVERSE 0
  1661. // -----------------------------------------------------------------------------
  1662. // ESP-01S DHT11 v1.0
  1663. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  1664. // -----------------------------------------------------------------------------
  1665. #elif defined(GENERIC_ESP01S_DHT11_V10)
  1666. // Info
  1667. #define MANUFACTURER "GENERIC"
  1668. #define DEVICE "ESP01S_DHT11_10"
  1669. // DHT11
  1670. #ifndef DHT_SUPPORT
  1671. #define DHT_SUPPORT 1
  1672. #endif
  1673. #define DHT_PIN 2
  1674. #define DHT_TYPE DHT_CHIP_DHT11
  1675. // -----------------------------------------------------------------------------
  1676. // ESP-01S DS18B20 v1.0
  1677. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  1678. // -----------------------------------------------------------------------------
  1679. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  1680. // Info
  1681. #define MANUFACTURER "GENERIC"
  1682. #define DEVICE "ESP01S_DS18B20_10"
  1683. // DB18B20
  1684. #ifndef DALLAS_SUPPORT
  1685. #define DALLAS_SUPPORT 1
  1686. #endif
  1687. #define DALLAS_PIN 2
  1688. // -----------------------------------------------------------------------------
  1689. // ESP-DIN relay board V1
  1690. // https://github.com/pilotak/esp_din
  1691. // -----------------------------------------------------------------------------
  1692. #elif defined(PILOTAK_ESP_DIN_V1)
  1693. // Info
  1694. #define MANUFACTURER "PILOTAK"
  1695. #define DEVICE "ESP_DIN_V1"
  1696. // Buttons
  1697. #define BUTTON1_PIN 0
  1698. #define BUTTON1_RELAY 1
  1699. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1700. // Relays
  1701. #define RELAY1_PIN 4
  1702. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1703. #define RELAY2_PIN 5
  1704. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1705. // LEDs
  1706. #define LED1_PIN 15
  1707. #define LED1_PIN_INVERSE 0
  1708. #define I2C_SDA_PIN 12
  1709. #define I2C_SCL_PIN 13
  1710. #ifndef DALLAS_SUPPORT
  1711. #define DALLAS_SUPPORT 1
  1712. #endif
  1713. #define DALLAS_PIN 2
  1714. #ifndef RF_SUPPORT
  1715. #define RF_SUPPORT 1
  1716. #endif
  1717. #define RF_PIN 14
  1718. #ifndef DIGITAL_SUPPORT
  1719. #define DIGITAL_SUPPORT 1
  1720. #endif
  1721. #define DIGITAL_PIN 16
  1722. #define DIGITAL_PIN_MODE INPUT
  1723. // -----------------------------------------------------------------------------
  1724. // Heltec Touch Relay
  1725. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  1726. // -----------------------------------------------------------------------------
  1727. #elif defined(HELTEC_TOUCHRELAY)
  1728. // Info
  1729. #define MANUFACTURER "HELTEC"
  1730. #define DEVICE "TOUCH_RELAY"
  1731. // Buttons
  1732. #define BUTTON1_PIN 14
  1733. #define BUTTON1_RELAY 1
  1734. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1735. // Relays
  1736. #define RELAY1_PIN 12
  1737. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1738. // -----------------------------------------------------------------------------
  1739. // Zhilde ZLD-EU44-W
  1740. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  1741. // -----------------------------------------------------------------------------
  1742. #elif defined(ZHILDE_EU44_W)
  1743. // Info
  1744. #define MANUFACTURER "ZHILDE"
  1745. #define DEVICE "EU44_W"
  1746. // Based on the reporter, this product uses GPIO1 and 3 for the button
  1747. // and onboard LED, so hardware serial should be disabled...
  1748. #define DEBUG_SERIAL_SUPPORT 0
  1749. // Buttons
  1750. #define BUTTON1_PIN 3
  1751. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1752. // Relays
  1753. #define RELAY1_PIN 5
  1754. #define RELAY2_PIN 4
  1755. #define RELAY3_PIN 12
  1756. #define RELAY4_PIN 13
  1757. #define RELAY5_PIN 14
  1758. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1759. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1760. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1761. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1762. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1763. // LEDs
  1764. #define LED1_PIN 1
  1765. #define LED1_PIN_INVERSE 1
  1766. // -----------------------------------------------------------------------------
  1767. // Allnet 4duino ESP8266-UP-Relais
  1768. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  1769. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  1770. // -----------------------------------------------------------------------------
  1771. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  1772. // Info
  1773. #define MANUFACTURER "ALLNET"
  1774. #define DEVICE "4DUINO_IOT_WLAN_RELAIS"
  1775. // Relays
  1776. #define RELAY1_PIN 14
  1777. #define RELAY1_RESET_PIN 12
  1778. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1779. // LEDs
  1780. #define LED1_PIN 0
  1781. #define LED1_PIN_INVERSE 1
  1782. // Buttons
  1783. //#define BUTTON1_PIN 0
  1784. //#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1785. // Using pins labelled as SDA & SCL as buttons
  1786. #define BUTTON2_PIN 4
  1787. #define BUTTON2_MODE BUTTON_PUSHBUTTON
  1788. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  1789. #define BUTTON2_CLICK BUTTON_MODE_NONE
  1790. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  1791. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  1792. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  1793. #define BUTTON3_PIN 5
  1794. #define BUTTON3_MODE BUTTON_PUSHBUTTON
  1795. // Using pins labelled as SDA & SCL for I2C
  1796. //#define I2C_SDA_PIN 4
  1797. //#define I2C_SCL_PIN 5
  1798. // -----------------------------------------------------------------------------
  1799. // Luani HVIO
  1800. // https://luani.de/projekte/esp8266-hvio/
  1801. // https://luani.de/blog/esp8266-230v-io-modul/
  1802. // -----------------------------------------------------------------------------
  1803. #elif defined(LUANI_HVIO)
  1804. // Info
  1805. #define MANUFACTURER "LUANI"
  1806. #define DEVICE "HVIO"
  1807. // Buttons
  1808. #define BUTTON1_PIN 12
  1809. #define BUTTON1_RELAY 1
  1810. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  1811. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1812. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1813. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1814. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1815. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1816. #define BUTTON2_PIN 13
  1817. #define BUTTON2_RELAY 2
  1818. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  1819. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  1820. // Relays
  1821. #define RELAY1_PIN 4
  1822. #define RELAY2_PIN 5
  1823. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1824. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1825. // LEDs
  1826. #define LED1_PIN 15
  1827. #define LED1_PIN_INVERSE 0
  1828. // -----------------------------------------------------------------------------
  1829. // Tonbux 50-100M Smart Mosquito Killer USB
  1830. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  1831. // -----------------------------------------------------------------------------
  1832. #elif defined(TONBUX_MOSQUITO_KILLER)
  1833. // Info
  1834. #define MANUFACTURER "TONBUX"
  1835. #define DEVICE "MOSQUITO_KILLER"
  1836. // Buttons
  1837. #define BUTTON1_PIN 2
  1838. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1839. #define BUTTON1_RELAY 1
  1840. // Relays
  1841. #define RELAY1_PIN 5 // not a relay, fan
  1842. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1843. // LEDs
  1844. #define LED1_PIN 15 // blue led
  1845. #define LED1_PIN_INVERSE 1
  1846. #define LED1_MODE LED_MODE_WIFI
  1847. #define LED2_PIN 14 // red led
  1848. #define LED2_PIN_INVERSE 1
  1849. #define LED2_MODE LED_MODE_RELAY
  1850. #define LED3_PIN 12 // UV leds (1-2-3-4-5-6-7-8)
  1851. #define LED3_PIN_INVERSE 0
  1852. #define LED3_RELAY 1
  1853. #define LED4_PIN 16 // UV leds (9-10-11)
  1854. #define LED4_PIN_INVERSE 0
  1855. #define LED4_RELAY 1
  1856. // -----------------------------------------------------------------------------
  1857. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  1858. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  1859. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  1860. // -----------------------------------------------------------------------------
  1861. #elif defined(NEO_COOLCAM_NAS_WR01W)
  1862. // Info
  1863. #define MANUFACTURER "NEO_COOLCAM"
  1864. #define DEVICE "NAS_WR01W"
  1865. // Buttons
  1866. #define BUTTON1_PIN 13
  1867. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1868. #define BUTTON1_RELAY 1
  1869. // Relays
  1870. #define RELAY1_PIN 12
  1871. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1872. // LEDs
  1873. #define LED1_PIN 4
  1874. #define LED1_PIN_INVERSE 1
  1875. // ------------------------------------------------------------------------------
  1876. // Estink Wifi Power Strip
  1877. // https://www.amazon.de/Steckdosenleiste-Ladeger%C3%A4t-Sprachsteuerung-SmartphonesTablets-Android/dp/B0796W5FZY
  1878. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  1879. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  1880. // -----------------------------------------------------------------------------
  1881. #elif defined(ESTINK_WIFI_POWER_STRIP)
  1882. // Info
  1883. #define MANUFACTURER "ESTINK"
  1884. #define DEVICE "WIFI_POWER_STRIP"
  1885. // Disable UART noise since this board uses GPIO3
  1886. #define DEBUG_SERIAL_SUPPORT 0
  1887. // Buttons
  1888. #define BUTTON1_PIN 16
  1889. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1890. #define BUTTON1_RELAY 4
  1891. // Relays
  1892. #define RELAY1_PIN 14 // USB power
  1893. #define RELAY2_PIN 13 // power plug 1
  1894. #define RELAY3_PIN 4 // power plug 2
  1895. #define RELAY4_PIN 15 // power plug 3
  1896. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1897. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1898. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1899. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1900. // LEDs
  1901. #define LED1_PIN 0 // power led
  1902. #define LED2_PIN 12 // power plug 1
  1903. #define LED3_PIN 3 // power plug 2
  1904. #define LED4_PIN 5 // power plug 3
  1905. #define LED1_PIN_INVERSE 1
  1906. #define LED2_PIN_INVERSE 1
  1907. #define LED3_PIN_INVERSE 1
  1908. #define LED4_PIN_INVERSE 1
  1909. #define LED1_MODE LED_MODE_FINDME
  1910. #define LED2_MODE LED_MODE_FOLLOW
  1911. #define LED3_MODE LED_MODE_FOLLOW
  1912. #define LED4_MODE LED_MODE_FOLLOW
  1913. #define LED2_RELAY 2
  1914. #define LED3_RELAY 3
  1915. #define LED4_RELAY 4
  1916. // -----------------------------------------------------------------------------
  1917. // Bruno Horta's OnOfre
  1918. // https://www.bhonofre.pt/
  1919. // https://github.com/brunohorta82/BH_OnOfre/
  1920. // -----------------------------------------------------------------------------
  1921. #elif defined(BH_ONOFRE)
  1922. // Info
  1923. #define MANUFACTURER "BH"
  1924. #define DEVICE "ONOFRE"
  1925. // Buttons
  1926. #define BUTTON1_PIN 12
  1927. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1928. #define BUTTON1_RELAY 1
  1929. #define BUTTON2_PIN 13
  1930. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1931. #define BUTTON2_RELAY 2
  1932. // Relays
  1933. #define RELAY1_PIN 4
  1934. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1935. #define RELAY2_PIN 5
  1936. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1937. // -----------------------------------------------------------------------------
  1938. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  1939. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  1940. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  1941. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  1942. // * Goosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  1943. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  1944. // -----------------------------------------------------------------------------
  1945. #elif defined(BLITZWOLF_BWSHP2)
  1946. // Info
  1947. #define MANUFACTURER "BLITZWOLF"
  1948. #define DEVICE "BWSHP2"
  1949. // Buttons
  1950. #define BUTTON1_PIN 13
  1951. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1952. #define BUTTON1_RELAY 1
  1953. // Relays
  1954. #define RELAY1_PIN 15
  1955. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1956. // LEDs
  1957. #define LED1_PIN 2
  1958. #define LED1_PIN_INVERSE 1
  1959. #define LED2_PIN 0
  1960. #define LED2_PIN_INVERSE 1
  1961. #define LED2_MODE LED_MODE_FINDME
  1962. #define LED2_RELAY 1
  1963. // HJL01 / BL0937
  1964. #ifndef HLW8012_SUPPORT
  1965. #define HLW8012_SUPPORT 1
  1966. #endif
  1967. #define HLW8012_SEL_PIN 12
  1968. #define HLW8012_CF1_PIN 14
  1969. #define HLW8012_CF_PIN 5
  1970. #define HLW8012_SEL_CURRENT LOW
  1971. #define HLW8012_CURRENT_RATIO 25740
  1972. #define HLW8012_VOLTAGE_RATIO 313400
  1973. #define HLW8012_POWER_RATIO 3414290
  1974. #define HLW8012_INTERRUPT_ON FALLING
  1975. // ----------------------------------------------------------------------------------------
  1976. // Homecube 16A is similar but some pins differ and it also has RGB LEDs
  1977. // https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
  1978. // ----------------------------------------------------------------------------------------
  1979. #elif defined(HOMECUBE_16A)
  1980. // Info
  1981. #define MANUFACTURER "HOMECUBE"
  1982. #define DEVICE "16A"
  1983. // Buttons
  1984. #define BUTTON1_PIN 13
  1985. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1986. #define BUTTON1_RELAY 1
  1987. // Relays
  1988. #define RELAY1_PIN 15
  1989. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1990. // LEDs
  1991. //LED Pin 4 - ESP8266 onboard LED
  1992. //Red LED: 0
  1993. //Green LED: 12
  1994. //Blue LED: 2
  1995. // Blue
  1996. #define LED1_PIN 2
  1997. #define LED1_PIN_INVERSE 0
  1998. // Green
  1999. #define LED2_PIN 12
  2000. #define LED2_PIN_INVERSE 1
  2001. #define LED2_MODE LED_MODE_RELAY
  2002. // Red
  2003. #define LED3_PIN 0
  2004. #define LED3_PIN_INVERSE 0
  2005. #define LED3_MODE LED_MODE_OFF
  2006. // HJL01 / BL0937
  2007. #ifndef HLW8012_SUPPORT
  2008. #define HLW8012_SUPPORT 1
  2009. #endif
  2010. #define HLW8012_SEL_PIN 16
  2011. #define HLW8012_CF1_PIN 14
  2012. #define HLW8012_CF_PIN 5
  2013. #define HLW8012_SEL_CURRENT LOW
  2014. #define HLW8012_CURRENT_RATIO 25740
  2015. #define HLW8012_VOLTAGE_RATIO 313400
  2016. #define HLW8012_POWER_RATIO 3414290
  2017. #define HLW8012_INTERRUPT_ON FALLING
  2018. // -----------------------------------------------------------------------------
  2019. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  2020. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  2021. // -----------------------------------------------------------------------------
  2022. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  2023. // Info
  2024. #define MANUFACTURER "VANZAVANZU"
  2025. #define DEVICE "SMART_WIFI_PLUG_MINI"
  2026. // Buttons
  2027. #define BUTTON1_PIN 13
  2028. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2029. #define BUTTON1_RELAY 1
  2030. // Relays
  2031. #define RELAY1_PIN 15
  2032. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2033. // LEDs
  2034. #define LED1_PIN 2
  2035. #define LED1_PIN_INVERSE 1
  2036. #define LED2_PIN 0
  2037. #define LED2_PIN_INVERSE 1
  2038. #define LED2_MODE LED_MODE_FINDME
  2039. #define LED2_RELAY 1
  2040. // Disable UART noise
  2041. #define DEBUG_SERIAL_SUPPORT 0
  2042. // HJL01 / BL0937
  2043. #ifndef HLW8012_SUPPORT
  2044. #define HLW8012_SUPPORT 1
  2045. #endif
  2046. #define HLW8012_SEL_PIN 3
  2047. #define HLW8012_CF1_PIN 14
  2048. #define HLW8012_CF_PIN 5
  2049. #define HLW8012_SEL_CURRENT LOW
  2050. #define HLW8012_CURRENT_RATIO 25740
  2051. #define HLW8012_VOLTAGE_RATIO 313400
  2052. #define HLW8012_POWER_RATIO 3414290
  2053. #define HLW8012_INTERRUPT_ON FALLING
  2054. // -----------------------------------------------------------------------------
  2055. #elif defined(GENERIC_AG_L4)
  2056. // Info
  2057. #define MANUFACTURER "GENERIC"
  2058. #define DEVICE "AG_L4"
  2059. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2060. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2061. #define DUMMY_RELAY_COUNT 1
  2062. // button 1: "power" button
  2063. #define BUTTON1_PIN 4
  2064. #define BUTTON1_RELAY 1
  2065. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2066. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  2067. #define BUTTON1_CLICK BUTTON_MODE_NONE
  2068. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2069. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2070. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  2071. // button 2: "wifi" button
  2072. #define BUTTON2_PIN 2
  2073. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2074. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  2075. #define BUTTON2_CLICK BUTTON_MODE_NONE
  2076. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  2077. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  2078. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  2079. // LEDs
  2080. #define LED1_PIN 5 // red status led
  2081. #define LED1_PIN_INVERSE 0
  2082. #define LED2_PIN 16 // master light power
  2083. #define LED2_PIN_INVERSE 1
  2084. #define LED2_MODE LED_MODE_RELAY
  2085. // Light
  2086. #define LIGHT_CHANNELS 3
  2087. #define LIGHT_CH1_PIN 14 // RED
  2088. #define LIGHT_CH2_PIN 13 // GREEN
  2089. #define LIGHT_CH3_PIN 12 // BLUE
  2090. #define LIGHT_CH1_INVERSE 0
  2091. #define LIGHT_CH2_INVERSE 0
  2092. #define LIGHT_CH3_INVERSE 0
  2093. // -----------------------------------------------------------------------------
  2094. #elif defined(ALLTERCO_SHELLY1)
  2095. // Info
  2096. #define MANUFACTURER "ALLTERCO"
  2097. #define DEVICE "SHELLY1"
  2098. // Buttons
  2099. #define BUTTON1_PIN 5
  2100. #define BUTTON1_MODE BUTTON_SWITCH
  2101. #define BUTTON1_RELAY 1
  2102. // Relays
  2103. #define RELAY1_PIN 4
  2104. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2105. #elif defined(ALLTERCO_SHELLY2)
  2106. // Info
  2107. #define MANUFACTURER "ALLTERCO"
  2108. #define DEVICE "SHELLY2"
  2109. // Buttons
  2110. #define BUTTON1_PIN 12
  2111. #define BUTTON2_PIN 14
  2112. #define BUTTON1_MODE BUTTON_SWITCH
  2113. #define BUTTON2_MODE BUTTON_SWITCH
  2114. #define BUTTON1_RELAY 1
  2115. #define BUTTON2_RELAY 2
  2116. // Relays
  2117. #define RELAY1_PIN 4
  2118. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2119. #define RELAY2_PIN 5
  2120. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2121. // -----------------------------------------------------------------------------
  2122. #elif defined(LOHAS_9W)
  2123. // Info
  2124. #define MANUFACTURER "LOHAS"
  2125. #define DEVICE "E27_9W"
  2126. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2127. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2128. #define DUMMY_RELAY_COUNT 1
  2129. // Light
  2130. #define LIGHT_CHANNELS 5
  2131. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2132. #define MY92XX_CHIPS 2
  2133. #define MY92XX_DI_PIN 13
  2134. #define MY92XX_DCKI_PIN 15
  2135. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2136. #define MY92XX_MAPPING 0, 1, 2, 3, 4
  2137. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  2138. // -----------------------------------------------------------------------------
  2139. #elif defined(XIAOMI_SMART_DESK_LAMP)
  2140. // Info
  2141. #define MANUFACTURER "XIAOMI"
  2142. #define DEVICE "SMART_DESK_LAMP"
  2143. // Buttons
  2144. #define BUTTON1_PIN 2
  2145. #define BUTTON2_PIN 14
  2146. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2147. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2148. // This button doubles as switch here and as encoder mode switch below
  2149. // Clicking it (for less than 500ms) will turn the light on and off
  2150. // Double and Long clicks will not work as these are used to modify the encoder action
  2151. #define BUTTON1_RELAY 1
  2152. #define BUTTON_LNGCLICK_DELAY 500
  2153. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  2154. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  2155. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  2156. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  2157. #define BUTTON2_DBLCLICK BUTTON_MODE_AP
  2158. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  2159. // Light
  2160. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2161. #define DUMMY_RELAY_COUNT 1
  2162. #define LIGHT_STEP 8
  2163. #define LIGHT_CHANNELS 2
  2164. #define LIGHT_CH1_PIN 5 // warm white
  2165. #define LIGHT_CH1_INVERSE 0
  2166. #define LIGHT_CH2_PIN 4 // cold white
  2167. #define LIGHT_CH2_INVERSE 0
  2168. // Encoder
  2169. // If mode is ENCODER_MODE_RATIO, the value ratio between both channels is changed
  2170. // when the button is not pressed, and the overall brightness when pressed
  2171. // If mode is ENCODER_MODE_CHANNEL, the first channel value is changed
  2172. // when the button is not pressed, and the second channel when pressed
  2173. // If no ENCODERX_BUTTON_PIN defined it will only change the value of the first defined channel
  2174. #define ENCODER_SUPPORT 1
  2175. #define ENCODER1_PIN1 12
  2176. #define ENCODER1_PIN2 13
  2177. #define ENCODER1_BUTTON_PIN 2 // active low by default, with software pullup
  2178. #define ENCODER1_CHANNEL1 0 // please note this value is 0-based (LIGHT_CH1 above)
  2179. #define ENCODER1_CHANNEL2 1 // please note this value is 0-based (LIGHT_CH2 above)
  2180. #define ENCODER1_MODE ENCODER_MODE_RATIO
  2181. #elif defined(PHYX_ESP12_RGB)
  2182. // Info
  2183. #define MANUFACTURER "PHYX"
  2184. #define DEVICE "ESP12_RGB"
  2185. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2186. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2187. #define DUMMY_RELAY_COUNT 1
  2188. // Light
  2189. #define LIGHT_CHANNELS 3
  2190. #define LIGHT_CH1_PIN 4 // RED
  2191. #define LIGHT_CH2_PIN 14 // GREEN
  2192. #define LIGHT_CH3_PIN 12 // BLUE
  2193. #define LIGHT_CH1_INVERSE 0
  2194. #define LIGHT_CH2_INVERSE 0
  2195. #define LIGHT_CH3_INVERSE 0
  2196. // -----------------------------------------------------------------------------
  2197. // iWoole LED Table Lamp
  2198. // 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
  2199. // -----------------------------------------------------------------------------
  2200. #elif defined(IWOOLE_LED_TABLE_LAMP)
  2201. // Info
  2202. #define MANUFACTURER "IWOOLE"
  2203. #define DEVICE "LED_TABLE_LAMP"
  2204. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2205. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2206. #define DUMMY_RELAY_COUNT 1
  2207. // Light
  2208. #define LIGHT_CHANNELS 4
  2209. #define LIGHT_CH1_PIN 12 // RED
  2210. #define LIGHT_CH2_PIN 5 // GREEN
  2211. #define LIGHT_CH3_PIN 14 // BLUE
  2212. #define LIGHT_CH4_PIN 4 // WHITE
  2213. #define LIGHT_CH1_INVERSE 0
  2214. #define LIGHT_CH2_INVERSE 0
  2215. #define LIGHT_CH3_INVERSE 0
  2216. #define LIGHT_CH4_INVERSE 0
  2217. // -----------------------------------------------------------------------------
  2218. // Bestek Smart Plug with 2 USB ports
  2219. // https://www.bestekcorp.com/bestek-smart-plug-works-with-amazon-alexa-google-assistant-and-ifttt-with-2-usb
  2220. // -----------------------------------------------------------------------------
  2221. #elif defined(BESTEK_MRJ1011)
  2222. // Info
  2223. #define MANUFACTURER "BESTEK"
  2224. #define DEVICE "MRJ1011"
  2225. // Buttons
  2226. #define BUTTON1_PIN 13
  2227. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2228. #define BUTTON1_RELAY 1
  2229. // Relay
  2230. #define RELAY1_PIN 12
  2231. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2232. // LED
  2233. #define LED1_PIN 4
  2234. #define LED1_PIN_INVERSE 1
  2235. // -----------------------------------------------------------------------------
  2236. // TEST boards (do not use!!)
  2237. // -----------------------------------------------------------------------------
  2238. #elif defined(TRAVIS01)
  2239. // Info
  2240. #define MANUFACTURER "TravisCI"
  2241. #define DEVICE "Virtual board 01"
  2242. // Some buttons - pin 0
  2243. #define BUTTON1_PIN 0
  2244. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2245. #define BUTTON1_RELAY 1
  2246. // Some relays - pin 1
  2247. #define RELAY1_PIN 1
  2248. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2249. // Some LEDs - pin 2
  2250. #define LED1_PIN 2
  2251. #define LED1_PIN_INVERSE 1
  2252. // A bit of I2C - pins 3,4
  2253. #define I2C_SDA_PIN 3
  2254. #define I2C_SCL_PIN 4
  2255. // And, as they say in "From Dusk till Dawn":
  2256. // This is a sensor blow out!
  2257. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  2258. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  2259. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  2260. // C'mon, you want sensor, come on in sensor lovers!
  2261. // If we don’t got it, you don't want it!
  2262. #define AM2320_SUPPORT 1
  2263. #define BH1750_SUPPORT 1
  2264. #define BMX280_SUPPORT 1
  2265. #define SHT3X_I2C_SUPPORT 1
  2266. #define EMON_ADC121_SUPPORT 1
  2267. #define EMON_ADS1X15_SUPPORT 1
  2268. #define SHT3X_I2C_SUPPORT 1
  2269. #define SI7021_SUPPORT 1
  2270. #define PMSX003_SUPPORT 1
  2271. #define SENSEAIR_SUPPORT1
  2272. // A bit of lights - pin 5
  2273. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2274. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2275. #define DUMMY_RELAY_COUNT 1
  2276. #define LIGHT_CHANNELS 1
  2277. #define LIGHT_CH1_PIN 5
  2278. #define LIGHT_CH1_INVERSE 0
  2279. // A bit of HLW8012 - pins 6,7,8
  2280. #ifndef HLW8012_SUPPORT
  2281. #define HLW8012_SUPPORT 1
  2282. #endif
  2283. #define HLW8012_SEL_PIN 6
  2284. #define HLW8012_CF1_PIN 7
  2285. #define HLW8012_CF_PIN 8
  2286. // A bit of Dallas - pin 9
  2287. #ifndef DALLAS_SUPPORT
  2288. #define DALLAS_SUPPORT 1
  2289. #endif
  2290. #define DALLAS_PIN 9
  2291. // A bit of ECH1560 - pins 10,11, 12
  2292. #ifndef ECH1560_SUPPORT
  2293. #define ECH1560_SUPPORT 1
  2294. #endif
  2295. #define ECH1560_CLK_PIN 10
  2296. #define ECH1560_MISO_PIN 11
  2297. #define ECH1560_INVERTED 12
  2298. // MICS-2710 & MICS-5525 test
  2299. #define MICS2710_SUPPORT 1
  2300. #define MICS5525_SUPPORT 1
  2301. #elif defined(TRAVIS02)
  2302. // Relay provider dual
  2303. #define MANUFACTURER "TravisCI"
  2304. #define DEVICE "Virtual board 02"
  2305. // Some buttons - pin 0
  2306. #define BUTTON1_PIN 0
  2307. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2308. #define BUTTON1_RELAY 1
  2309. // A bit of CSE7766 - pin 1
  2310. #ifndef CSE7766_SUPPORT
  2311. #define CSE7766_SUPPORT 1
  2312. #endif
  2313. #define CSE7766_PIN 1
  2314. // Relay type dual - pins 2,3
  2315. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  2316. #define RELAY1_PIN 2
  2317. #define RELAY2_PIN 3
  2318. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2319. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2320. // IR - pin 4
  2321. #define IR_SUPPORT 1
  2322. #define IR_RX_PIN 4
  2323. #define IR_BUTTON_SET 1
  2324. // A bit of DHT - pin 5
  2325. #ifndef DHT_SUPPORT
  2326. #define DHT_SUPPORT 1
  2327. #endif
  2328. #define DHT_PIN 5
  2329. // A bit of TMP3X (analog)
  2330. #define TMP3X_SUPPORT 1
  2331. // A bit of EVENTS - pin 10
  2332. #define EVENTS_SUPPORT 1
  2333. #define EVENTS_PIN 6
  2334. // Sonar
  2335. #define SONAR_SUPPORT 1
  2336. #define SONAR_TRIGGER 7
  2337. #define SONAR_ECHO 8
  2338. // MHZ19
  2339. #define MHZ19_SUPPORT 1
  2340. #define MHZ19_RX_PIN 9
  2341. #define MHZ19_TX_PIN 10
  2342. // PZEM004T
  2343. #define PZEM004T_SUPPORT 1
  2344. #define PZEM004T_RX_PIN 11
  2345. #define PZEM004T_TX_PIN 12
  2346. // V9261F
  2347. #define V9261F_SUPPORT 1
  2348. #define V9261F_PIN 13
  2349. // GUVAS12SD
  2350. #define GUVAS12SD_SUPPORT 1
  2351. #define GUVAS12SD_PIN 14
  2352. // Test non-default modules
  2353. #define MDNS_CLIENT_SUPPORT 1
  2354. #define NOFUSS_SUPPORT 1
  2355. #define UART_MQTT_SUPPORT 1
  2356. #define INFLUXDB_SUPPORT 1
  2357. #define IR_SUPPORT 1
  2358. #elif defined(TRAVIS03)
  2359. // Relay provider light/my92XX
  2360. #define MANUFACTURER "TravisCI"
  2361. #define DEVICE "Virtual board 03"
  2362. // Some buttons - pin 0
  2363. #define BUTTON1_PIN 0
  2364. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2365. #define BUTTON1_RELAY 1
  2366. // MY9231 Light - pins 1,2
  2367. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2368. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2369. #define DUMMY_RELAY_COUNT 1
  2370. #define LIGHT_CHANNELS 5
  2371. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2372. #define MY92XX_CHIPS 2
  2373. #define MY92XX_DI_PIN 1
  2374. #define MY92XX_DCKI_PIN 2
  2375. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2376. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  2377. // A bit of Analog EMON (analog)
  2378. #ifndef EMON_ANALOG_SUPPORT
  2379. #define EMON_ANALOG_SUPPORT 1
  2380. #endif
  2381. // Test non-default modules
  2382. #define LLMNR_SUPPORT 1
  2383. #define NETBIOS_SUPPORT 1
  2384. #define SSDP_SUPPORT 1
  2385. #endif
  2386. // -----------------------------------------------------------------------------
  2387. // Check definitions
  2388. // -----------------------------------------------------------------------------
  2389. #if not defined(MANUFACTURER) || not defined(DEVICE)
  2390. #error "UNSUPPORTED HARDWARE!!"
  2391. #endif