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.

2550 lines
80 KiB

7 years ago
7 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  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 general.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 DOMOTICZ_SUPPORT 0
  36. #define HOMEASSISTANT_SUPPORT 0
  37. #define I2C_SUPPORT 0
  38. #define MDNS_SERVER_SUPPORT 0
  39. #define MQTT_SUPPORT 0
  40. #define NTP_SUPPORT 0
  41. #define SCHEDULER_SUPPORT 0
  42. #define SENSOR_SUPPORT 0
  43. #define THINGSPEAK_SUPPORT 0
  44. #define WEB_SUPPORT 0
  45. // Extra light-weight image
  46. //#define DEBUG_SERIAL_SUPPORT 0
  47. //#define DEBUG_TELNET_SUPPORT 0
  48. //#define DEBUG_WEB_SUPPORT 0
  49. //#define LED_SUPPORT 0
  50. //#define TELNET_SUPPORT 0
  51. //#define TERMINAL_SUPPORT 0
  52. // -----------------------------------------------------------------------------
  53. // Development boards
  54. // -----------------------------------------------------------------------------
  55. #elif defined(NODEMCU_LOLIN)
  56. // Info
  57. #define MANUFACTURER "NODEMCU"
  58. #define DEVICE "LOLIN"
  59. // Buttons
  60. #define BUTTON1_PIN 0
  61. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  62. #define BUTTON1_RELAY 1
  63. // Relays
  64. #define RELAY1_PIN 12
  65. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  66. // LEDs
  67. #define LED1_PIN 2
  68. #define LED1_PIN_INVERSE 1
  69. #elif defined(NODEMCU_BASIC)
  70. // Info
  71. // Generic NodeMCU Board without any buttons or relays connected.
  72. #define MANUFACTURER "NODEMCU"
  73. #define DEVICE "BASIC"
  74. #elif defined(WEMOS_D1_MINI_RELAYSHIELD)
  75. // Info
  76. #define MANUFACTURER "WEMOS"
  77. #define DEVICE "D1_MINI_RELAYSHIELD"
  78. // Buttons
  79. // No buttons on the D1 MINI alone, but defining it without adding a button doen't create problems
  80. #define BUTTON1_PIN 0 // Connect a pushbutton between D3 and GND,
  81. // it's the same as using a Wemos one button shield
  82. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  83. #define BUTTON1_RELAY 1
  84. // Relays
  85. #define RELAY1_PIN 5
  86. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  87. // LEDs
  88. #define LED1_PIN 2
  89. #define LED1_PIN_INVERSE 1
  90. // When Wemos relay shield is connected GPIO5 (D1) is used for relay,
  91. // so I2C must be remapped to other pins
  92. #define I2C_SDA_PIN 12 // D6
  93. #define I2C_SCL_PIN 14 // D5
  94. #elif defined(WEMOS_D1_TARPUNA_SHIELD)
  95. // Info
  96. #define MANUFACTURER "WEMOS"
  97. #define DEVICE "D1_TARPUNA_SHIELD"
  98. // -----------------------------------------------------------------------------
  99. // ESPurna
  100. // -----------------------------------------------------------------------------
  101. #elif defined(TINKERMAN_ESPURNA_H06)
  102. // Info
  103. #define MANUFACTURER "TINKERMAN"
  104. #define DEVICE "ESPURNA_H06"
  105. // Buttons
  106. #define BUTTON1_PIN 4
  107. #define BUTTON1_RELAY 1
  108. // Normal pushbutton
  109. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  110. // Relays
  111. #define RELAY1_PIN 12
  112. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  113. // LEDs
  114. #define LED1_PIN 2
  115. #define LED1_PIN_INVERSE 1
  116. // HLW8012
  117. #ifndef HLW8012_SUPPORT
  118. #define HLW8012_SUPPORT 1
  119. #endif
  120. #define HLW8012_SEL_PIN 2
  121. #define HLW8012_CF1_PIN 13
  122. #define HLW8012_CF_PIN 14
  123. #elif defined(TINKERMAN_ESPURNA_H08)
  124. // Info
  125. #define MANUFACTURER "TINKERMAN"
  126. #define DEVICE "ESPURNA_H08"
  127. // Buttons
  128. #define BUTTON1_PIN 4
  129. #define BUTTON1_RELAY 1
  130. // Normal pushbutton
  131. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  132. // Relays
  133. #define RELAY1_PIN 12
  134. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  135. // LEDs
  136. #define LED1_PIN 2
  137. #define LED1_PIN_INVERSE 0
  138. // HLW8012
  139. #ifndef HLW8012_SUPPORT
  140. #define HLW8012_SUPPORT 1
  141. #endif
  142. #define HLW8012_SEL_PIN 5
  143. #define HLW8012_CF1_PIN 13
  144. #define HLW8012_CF_PIN 14
  145. #elif defined(TINKERMAN_ESPURNA_SWITCH)
  146. // Info
  147. #define MANUFACTURER "TINKERMAN"
  148. #define DEVICE "ESPURNA_SWITCH"
  149. // Buttons
  150. #define BUTTON1_PIN 4
  151. #define BUTTON1_RELAY 1
  152. // Touch button
  153. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  154. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  155. #define BUTTON1_CLICK BUTTON_MODE_NONE
  156. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  157. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  158. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  159. // LEDs
  160. #define LED1_PIN 2
  161. #define LED1_PIN_INVERSE 0
  162. // Relays
  163. #define RELAY1_PIN 12
  164. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  165. // -----------------------------------------------------------------------------
  166. // Itead Studio boards
  167. // -----------------------------------------------------------------------------
  168. #elif defined(ITEAD_SONOFF_BASIC)
  169. // Info
  170. #define MANUFACTURER "ITEAD"
  171. #define DEVICE "SONOFF_BASIC"
  172. // Buttons
  173. #define BUTTON1_PIN 0
  174. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  175. #define BUTTON1_RELAY 1
  176. #define BUTTON2_PIN 14
  177. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  178. #define BUTTON2_RELAY 1
  179. // Relays
  180. #define RELAY1_PIN 12
  181. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  182. // LEDs
  183. #define LED1_PIN 13
  184. #define LED1_PIN_INVERSE 1
  185. #elif defined(ITEAD_SONOFF_RF)
  186. // Info
  187. #define MANUFACTURER "ITEAD"
  188. #define DEVICE "SONOFF_RF"
  189. // Buttons
  190. #define BUTTON1_PIN 0
  191. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  192. #define BUTTON1_RELAY 1
  193. #define BUTTON2_PIN 14
  194. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  195. #define BUTTON2_RELAY 1
  196. // Relays
  197. #define RELAY1_PIN 12
  198. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  199. // LEDs
  200. #define LED1_PIN 13
  201. #define LED1_PIN_INVERSE 1
  202. #elif defined(ITEAD_SONOFF_TH)
  203. // Info
  204. #define MANUFACTURER "ITEAD"
  205. #define DEVICE "SONOFF_TH"
  206. // Buttons
  207. #define BUTTON1_PIN 0
  208. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  209. #define BUTTON1_RELAY 1
  210. // Relays
  211. #define RELAY1_PIN 12
  212. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  213. // LEDs
  214. #define LED1_PIN 13
  215. #define LED1_PIN_INVERSE 1
  216. // Jack is connected to GPIO14 (and with a small hack to GPIO4)
  217. #ifndef DALLAS_SUPPORT
  218. #define DALLAS_SUPPORT 1
  219. #endif
  220. #define DALLAS_PIN 14
  221. #ifndef DHT_SUPPORT
  222. #define DHT_SUPPORT 1
  223. #endif
  224. #define DHT_PIN 14
  225. //#define I2C_SDA_PIN 4
  226. //#define I2C_SCL_PIN 14
  227. #elif defined(ITEAD_SONOFF_SV)
  228. // Info
  229. #define MANUFACTURER "ITEAD"
  230. #define DEVICE "SONOFF_SV"
  231. // Buttons
  232. #define BUTTON1_PIN 0
  233. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  234. #define BUTTON1_RELAY 1
  235. // Relays
  236. #define RELAY1_PIN 12
  237. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  238. // LEDs
  239. #define LED1_PIN 13
  240. #define LED1_PIN_INVERSE 1
  241. #elif defined(ITEAD_SLAMPHER)
  242. // Info
  243. #define MANUFACTURER "ITEAD"
  244. #define DEVICE "SLAMPHER"
  245. // Buttons
  246. #define BUTTON1_PIN 0
  247. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  248. #define BUTTON1_RELAY 1
  249. // Relays
  250. #define RELAY1_PIN 12
  251. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  252. // LEDs
  253. #define LED1_PIN 13
  254. #define LED1_PIN_INVERSE 1
  255. #elif defined(ITEAD_S20)
  256. // Info
  257. #define MANUFACTURER "ITEAD"
  258. #define DEVICE "S20"
  259. // Buttons
  260. #define BUTTON1_PIN 0
  261. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  262. #define BUTTON1_RELAY 1
  263. // Relays
  264. #define RELAY1_PIN 12
  265. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  266. // LEDs
  267. #define LED1_PIN 13
  268. #define LED1_PIN_INVERSE 1
  269. #elif defined(ITEAD_SONOFF_TOUCH)
  270. // Info
  271. #define MANUFACTURER "ITEAD"
  272. #define DEVICE "SONOFF_TOUCH"
  273. // Buttons
  274. #define BUTTON1_PIN 0
  275. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  276. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  277. #define BUTTON1_CLICK BUTTON_MODE_NONE
  278. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  279. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  280. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  281. #define BUTTON1_RELAY 1
  282. // Relays
  283. #define RELAY1_PIN 12
  284. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  285. // LEDs
  286. #define LED1_PIN 13
  287. #define LED1_PIN_INVERSE 1
  288. #elif defined(ITEAD_SONOFF_POW)
  289. // Info
  290. #define MANUFACTURER "ITEAD"
  291. #define DEVICE "SONOFF_POW"
  292. // Buttons
  293. #define BUTTON1_PIN 0
  294. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  295. #define BUTTON1_RELAY 1
  296. // Relays
  297. #define RELAY1_PIN 12
  298. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  299. // LEDs
  300. #define LED1_PIN 15
  301. #define LED1_PIN_INVERSE 0
  302. // HLW8012
  303. #ifndef HLW8012_SUPPORT
  304. #define HLW8012_SUPPORT 1
  305. #endif
  306. #define HLW8012_SEL_PIN 5
  307. #define HLW8012_CF1_PIN 13
  308. #define HLW8012_CF_PIN 14
  309. #elif defined(ITEAD_SONOFF_POW_R2)
  310. // Info
  311. #define MANUFACTURER "ITEAD"
  312. #define DEVICE "SONOFF_POW_R2"
  313. // Buttons
  314. #define BUTTON1_PIN 0
  315. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  316. #define BUTTON1_RELAY 1
  317. // Relays
  318. #define RELAY1_PIN 12
  319. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  320. // LEDs
  321. #define LED1_PIN 13
  322. #define LED1_PIN_INVERSE 1
  323. // Disable UART noise
  324. #define DEBUG_SERIAL_SUPPORT 0
  325. // CSE7766
  326. #ifndef CSE7766_SUPPORT
  327. #define CSE7766_SUPPORT 1
  328. #endif
  329. #define CSE7766_PIN 1
  330. #elif defined(ITEAD_SONOFF_DUAL)
  331. // Info
  332. #define MANUFACTURER "ITEAD"
  333. #define DEVICE "SONOFF_DUAL"
  334. #define SERIAL_BAUDRATE 19230
  335. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  336. #define DUMMY_RELAY_COUNT 2
  337. #define DEBUG_SERIAL_SUPPORT 0
  338. // Buttons
  339. #define BUTTON3_RELAY 1
  340. // LEDs
  341. #define LED1_PIN 13
  342. #define LED1_PIN_INVERSE 1
  343. #elif defined(ITEAD_SONOFF_DUAL_R2)
  344. #define MANUFACTURER "ITEAD"
  345. #define DEVICE "SONOFF_DUAL_R2"
  346. // Buttons
  347. #define BUTTON1_PIN 0 // Button 0 on header
  348. #define BUTTON2_PIN 9 // Button 1 on header
  349. #define BUTTON3_PIN 10 // Physical button
  350. #define BUTTON1_RELAY 1
  351. #define BUTTON2_RELAY 2
  352. #define BUTTON3_RELAY 1
  353. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  354. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  355. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  356. // Relays
  357. #define RELAY1_PIN 12
  358. #define RELAY2_PIN 5
  359. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  360. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  361. // LEDs
  362. #define LED1_PIN 13
  363. #define LED1_PIN_INVERSE 1
  364. #elif defined(ITEAD_SONOFF_4CH)
  365. // Info
  366. #define MANUFACTURER "ITEAD"
  367. #define DEVICE "SONOFF_4CH"
  368. // Buttons
  369. #define BUTTON1_PIN 0
  370. #define BUTTON2_PIN 9
  371. #define BUTTON3_PIN 10
  372. #define BUTTON4_PIN 14
  373. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  374. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  375. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  376. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  377. #define BUTTON1_RELAY 1
  378. #define BUTTON2_RELAY 2
  379. #define BUTTON3_RELAY 3
  380. #define BUTTON4_RELAY 4
  381. // Relays
  382. #define RELAY1_PIN 12
  383. #define RELAY2_PIN 5
  384. #define RELAY3_PIN 4
  385. #define RELAY4_PIN 15
  386. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  387. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  388. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  389. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  390. // LEDs
  391. #define LED1_PIN 13
  392. #define LED1_PIN_INVERSE 1
  393. #elif defined(ITEAD_SONOFF_4CH_PRO)
  394. // Info
  395. #define MANUFACTURER "ITEAD"
  396. #define DEVICE "SONOFF_4CH_PRO"
  397. // Buttons
  398. #define BUTTON1_PIN 0
  399. #define BUTTON2_PIN 9
  400. #define BUTTON3_PIN 10
  401. #define BUTTON4_PIN 14
  402. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  403. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  404. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  405. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  406. #define BUTTON1_RELAY 1
  407. #define BUTTON2_RELAY 2
  408. #define BUTTON3_RELAY 3
  409. #define BUTTON4_RELAY 4
  410. // Sonoff 4CH Pro uses a secondary STM32 microcontroller to handle
  411. // buttons and relays, but it also forwards button presses to the ESP8285.
  412. // This allows ESPurna to handle button presses -almost- the same way
  413. // as with other devices except:
  414. // * Double click seems to break/disable the button on the STM32 side
  415. // * With S6 switch to 1 (self-locking and inching modes) everything's OK
  416. // * With S6 switch to 0 (interlock mode) if there is a relay ON
  417. // and you click on another relay button, the STM32 sends a "press"
  418. // event for the button of the first relay (to turn it OFF) but it
  419. // does not send a "release" event. It's like it's holding the
  420. // button down since you can see it is still LOW.
  421. // Whatever reason the result is that it may actually perform a
  422. // long click or long-long click.
  423. // The configuration below make the button toggle the relay on press events
  424. // and disables any possibly harmful combination with S6 set to 0.
  425. // If you are sure you will only use S6 to 1 you can comment the
  426. // BUTTON1_LNGCLICK and BUTTON1_LNGLNGCLICK options below to recover the
  427. // reset mode and factory reset functionalities, or link other actions like
  428. // AP mode in the commented line below.
  429. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  430. #define BUTTON1_CLICK BUTTON_MODE_NONE
  431. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  432. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  433. //#define BUTTON1_LNGCLICK BUTTON_MODE_AP
  434. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  435. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  436. #define BUTTON2_CLICK BUTTON_MODE_NONE
  437. #define BUTTON3_PRESS BUTTON_MODE_TOGGLE
  438. #define BUTTON3_CLICK BUTTON_MODE_NONE
  439. #define BUTTON4_PRESS BUTTON_MODE_TOGGLE
  440. #define BUTTON4_CLICK BUTTON_MODE_NONE
  441. // Relays
  442. #define RELAY1_PIN 12
  443. #define RELAY2_PIN 5
  444. #define RELAY3_PIN 4
  445. #define RELAY4_PIN 15
  446. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  447. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  448. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  449. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  450. // LEDs
  451. #define LED1_PIN 13
  452. #define LED1_PIN_INVERSE 1
  453. #elif defined(ITEAD_1CH_INCHING)
  454. // The inching functionality is managed by a misterious IC in the board.
  455. // You cannot control the inching button and functionality from the ESP8266
  456. // Besides, enabling the inching functionality using the hardware button
  457. // will result in the relay switching on and off continuously.
  458. // Fortunately the unkown IC keeps memory of the hardware inching status
  459. // so you can just disable it and forget. The inching LED must be lit.
  460. // You can still use the pulse options from the web interface
  461. // without problem.
  462. // Info
  463. #define MANUFACTURER "ITEAD"
  464. #define DEVICE "1CH_INCHING"
  465. // Buttons
  466. #define BUTTON1_PIN 0
  467. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  468. #define BUTTON1_RELAY 1
  469. // Relays
  470. #define RELAY1_PIN 12
  471. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  472. // LEDs
  473. #define LED1_PIN 13
  474. #define LED1_PIN_INVERSE 1
  475. #elif defined(ITEAD_MOTOR)
  476. // Info
  477. #define MANUFACTURER "ITEAD"
  478. #define DEVICE "MOTOR"
  479. // Buttons
  480. #define BUTTON1_PIN 0
  481. #define BUTTON1_RELAY 1
  482. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  483. // Relays
  484. #define RELAY1_PIN 12
  485. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  486. // LEDs
  487. #define LED1_PIN 13
  488. #define LED1_PIN_INVERSE 1
  489. #elif defined(ITEAD_BNSZ01)
  490. // Info
  491. #define MANUFACTURER "ITEAD"
  492. #define DEVICE "BNSZ01"
  493. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  494. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  495. #define DUMMY_RELAY_COUNT 1
  496. // LEDs
  497. #define LED1_PIN 13
  498. #define LED1_PIN_INVERSE 1
  499. // Light
  500. #define LIGHT_CHANNELS 1
  501. #define LIGHT_CH1_PIN 12
  502. #define LIGHT_CH1_INVERSE 0
  503. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  504. // Info
  505. #define MANUFACTURER "ITEAD"
  506. #define DEVICE "SONOFF_RFBRIDGE"
  507. #define RELAY_PROVIDER RELAY_PROVIDER_RFBRIDGE
  508. // Number of virtual switches
  509. #ifndef DUMMY_RELAY_COUNT
  510. #define DUMMY_RELAY_COUNT 8
  511. #endif
  512. // Buttons
  513. #define BUTTON1_PIN 0
  514. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  515. // LEDs
  516. #define LED1_PIN 13
  517. #define LED1_PIN_INVERSE 1
  518. // RFB Direct hack thanks to @wildwiz
  519. // https://github.com/xoseperez/espurna/wiki/Hardware-Itead-Sonoff-RF-Bridge---Direct-Hack
  520. #ifndef RFB_DIRECT
  521. #define RFB_DIRECT 0
  522. #endif
  523. #ifndef RFB_RX_PIN
  524. #define RFB_RX_PIN 4 // GPIO for RX when RFB_DIRECT
  525. #endif
  526. #ifndef RFB_TX_PIN
  527. #define RFB_TX_PIN 5 // GPIO for TX when RFB_DIRECT
  528. #endif
  529. // When using un-modified harware, ESPurna communicates with the secondary
  530. // MCU EFM8BB1 via UART at 19200 bps so we need to change the speed of
  531. // the port and remove UART noise on serial line
  532. #if not RFB_DIRECT
  533. #define SERIAL_BAUDRATE 19200
  534. #define DEBUG_SERIAL_SUPPORT 0
  535. #endif
  536. #elif defined(ITEAD_SONOFF_B1)
  537. // Info
  538. #define MANUFACTURER "ITEAD"
  539. #define DEVICE "SONOFF_B1"
  540. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  541. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  542. #define DUMMY_RELAY_COUNT 1
  543. // Light
  544. #define LIGHT_CHANNELS 5
  545. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  546. #define MY92XX_CHIPS 2
  547. #define MY92XX_DI_PIN 12
  548. #define MY92XX_DCKI_PIN 14
  549. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  550. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  551. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  552. #elif defined(ITEAD_SONOFF_LED)
  553. // Info
  554. #define MANUFACTURER "ITEAD"
  555. #define DEVICE "SONOFF_LED"
  556. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  557. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  558. #define DUMMY_RELAY_COUNT 1
  559. // LEDs
  560. #define LED1_PIN 13
  561. #define LED1_PIN_INVERSE 1
  562. // Light
  563. #define LIGHT_CHANNELS 2
  564. #define LIGHT_CH1_PIN 12 // Cold white
  565. #define LIGHT_CH2_PIN 14 // Warm white
  566. #define LIGHT_CH1_INVERSE 0
  567. #define LIGHT_CH2_INVERSE 0
  568. #elif defined(ITEAD_SONOFF_T1_1CH)
  569. // Info
  570. #define MANUFACTURER "ITEAD"
  571. #define DEVICE "SONOFF_T1_1CH"
  572. // Buttons
  573. #define BUTTON1_PIN 0
  574. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  575. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  576. #define BUTTON1_CLICK BUTTON_MODE_NONE
  577. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  578. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  579. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  580. #define BUTTON1_RELAY 1
  581. // Relays
  582. #define RELAY1_PIN 12
  583. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  584. // LEDs
  585. #define LED1_PIN 13
  586. #define LED1_PIN_INVERSE 1
  587. #elif defined(ITEAD_SONOFF_T1_2CH)
  588. // Info
  589. #define MANUFACTURER "ITEAD"
  590. #define DEVICE "SONOFF_T1_2CH"
  591. // Buttons
  592. #define BUTTON1_PIN 0
  593. #define BUTTON2_PIN 9
  594. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  595. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  596. #define BUTTON1_CLICK BUTTON_MODE_NONE
  597. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  598. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  599. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  600. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  601. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  602. #define BUTTON2_CLICK BUTTON_MODE_NONE
  603. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  604. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  605. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  606. #define BUTTON1_RELAY 1
  607. #define BUTTON2_RELAY 2
  608. // Relays
  609. #define RELAY1_PIN 12
  610. #define RELAY2_PIN 5
  611. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  612. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  613. // LEDs
  614. #define LED1_PIN 13
  615. #define LED1_PIN_INVERSE 1
  616. #elif defined(ITEAD_SONOFF_T1_3CH)
  617. // Info
  618. #define MANUFACTURER "ITEAD"
  619. #define DEVICE "SONOFF_T1_3CH"
  620. // Buttons
  621. #define BUTTON1_PIN 0
  622. #define BUTTON2_PIN 9
  623. #define BUTTON3_PIN 10
  624. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  625. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  626. #define BUTTON1_CLICK BUTTON_MODE_NONE
  627. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  628. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  629. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  630. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  631. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  632. #define BUTTON2_CLICK BUTTON_MODE_NONE
  633. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  634. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  635. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  636. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  637. #define BUTTON3_PRESS BUTTON_MODE_TOGGLE
  638. #define BUTTON3_CLICK BUTTON_MODE_NONE
  639. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  640. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  641. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_RESET
  642. #define BUTTON1_RELAY 1
  643. #define BUTTON2_RELAY 2
  644. #define BUTTON3_RELAY 3
  645. // Relays
  646. #define RELAY1_PIN 12
  647. #define RELAY2_PIN 5
  648. #define RELAY3_PIN 4
  649. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  650. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  651. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  652. // LEDs
  653. #define LED1_PIN 13
  654. #define LED1_PIN_INVERSE 1
  655. #elif defined(ITEAD_SONOFF_S31)
  656. // Info
  657. #define MANUFACTURER "ITEAD"
  658. #define DEVICE "SONOFF_S31"
  659. // Buttons
  660. #define BUTTON1_PIN 0
  661. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  662. #define BUTTON1_RELAY 1
  663. // Relays
  664. #define RELAY1_PIN 12
  665. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  666. // LEDs
  667. #define LED1_PIN 13
  668. #define LED1_PIN_INVERSE 1
  669. // Disable UART noise
  670. #define DEBUG_SERIAL_SUPPORT 0
  671. // CSE7766
  672. #define CSE7766_SUPPORT 1
  673. #define CSE7766_PIN 1
  674. // -----------------------------------------------------------------------------
  675. // YJZK
  676. // -----------------------------------------------------------------------------
  677. #elif defined(YJZK_SWITCH_2CH)
  678. // Info
  679. #define MANUFACTURER "YJZK"
  680. #define DEVICE "SWITCH_2CH"
  681. // Buttons
  682. #define BUTTON1_PIN 0
  683. #define BUTTON2_PIN 9
  684. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  685. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  686. #define BUTTON1_RELAY 1
  687. #define BUTTON2_RELAY 2
  688. // Relays
  689. #define RELAY1_PIN 12
  690. #define RELAY2_PIN 5
  691. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  692. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  693. // LEDs
  694. #define LED1_PIN 13
  695. #define LED1_PIN_INVERSE 0
  696. // -----------------------------------------------------------------------------
  697. // Electrodragon boards
  698. // -----------------------------------------------------------------------------
  699. #elif defined(ELECTRODRAGON_WIFI_IOT)
  700. // Info
  701. #define MANUFACTURER "ELECTRODRAGON"
  702. #define DEVICE "WIFI_IOT"
  703. // Buttons
  704. #define BUTTON1_PIN 0
  705. #define BUTTON2_PIN 2
  706. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  707. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  708. #define BUTTON1_RELAY 1
  709. #define BUTTON2_RELAY 2
  710. // Relays
  711. #define RELAY1_PIN 12
  712. #define RELAY2_PIN 13
  713. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  714. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  715. // LEDs
  716. #define LED1_PIN 16
  717. #define LED1_PIN_INVERSE 0
  718. // -----------------------------------------------------------------------------
  719. // WorkChoice ecoPlug
  720. // -----------------------------------------------------------------------------
  721. #elif defined(WORKCHOICE_ECOPLUG)
  722. // Info
  723. #define MANUFACTURER "WORKCHOICE"
  724. #define DEVICE "ECOPLUG"
  725. // Buttons
  726. #define BUTTON1_PIN 13
  727. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  728. #define BUTTON1_RELAY 1
  729. // Relays
  730. #define RELAY1_PIN 15
  731. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  732. // LEDs
  733. #define LED1_PIN 2
  734. #define LED1_PIN_INVERSE 0
  735. // -----------------------------------------------------------------------------
  736. // AI Thinker
  737. // -----------------------------------------------------------------------------
  738. #elif defined(AITHINKER_AI_LIGHT)
  739. // Info
  740. #define MANUFACTURER "AITHINKER"
  741. #define DEVICE "AI_LIGHT"
  742. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  743. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  744. #define DUMMY_RELAY_COUNT 1
  745. // Light
  746. #define LIGHT_CHANNELS 4
  747. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  748. #define MY92XX_CHIPS 1
  749. #define MY92XX_DI_PIN 13
  750. #define MY92XX_DCKI_PIN 15
  751. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  752. #define MY92XX_MAPPING 0, 1, 2, 3
  753. // -----------------------------------------------------------------------------
  754. // LED Controller
  755. // -----------------------------------------------------------------------------
  756. #elif defined(MAGICHOME_LED_CONTROLLER)
  757. // Info
  758. #define MANUFACTURER "MAGICHOME"
  759. #define DEVICE "LED_CONTROLLER"
  760. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  761. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  762. #define DUMMY_RELAY_COUNT 1
  763. // LEDs
  764. #define LED1_PIN 2
  765. #define LED1_PIN_INVERSE 1
  766. // Light
  767. #define LIGHT_CHANNELS 4
  768. #define LIGHT_CH1_PIN 14 // RED
  769. #define LIGHT_CH2_PIN 5 // GREEN
  770. #define LIGHT_CH3_PIN 12 // BLUE
  771. #define LIGHT_CH4_PIN 13 // WHITE
  772. #define LIGHT_CH1_INVERSE 0
  773. #define LIGHT_CH2_INVERSE 0
  774. #define LIGHT_CH3_INVERSE 0
  775. #define LIGHT_CH4_INVERSE 0
  776. // IR
  777. #define IR_SUPPORT 1
  778. #define IR_PIN 4
  779. #define IR_BUTTON_SET 1
  780. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  781. // Info
  782. #define MANUFACTURER "MAGICHOME"
  783. #define DEVICE "LED_CONTROLLER_20"
  784. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  785. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  786. #define DUMMY_RELAY_COUNT 1
  787. // LEDs
  788. #define LED1_PIN 2
  789. #define LED1_PIN_INVERSE 1
  790. // Light
  791. #define LIGHT_CHANNELS 4
  792. #define LIGHT_CH1_PIN 5 // RED
  793. #define LIGHT_CH2_PIN 12 // GREEN
  794. #define LIGHT_CH3_PIN 13 // BLUE
  795. #define LIGHT_CH4_PIN 15 // WHITE
  796. #define LIGHT_CH1_INVERSE 0
  797. #define LIGHT_CH2_INVERSE 0
  798. #define LIGHT_CH3_INVERSE 0
  799. #define LIGHT_CH4_INVERSE 0
  800. // IR
  801. #define IR_SUPPORT 1
  802. #define IR_PIN 4
  803. #define IR_BUTTON_SET 1
  804. // -----------------------------------------------------------------------------
  805. // HUACANXING H801 & H802
  806. // -----------------------------------------------------------------------------
  807. #elif defined(HUACANXING_H801)
  808. // Info
  809. #define MANUFACTURER "HUACANXING"
  810. #define DEVICE "H801"
  811. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  812. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  813. #define DUMMY_RELAY_COUNT 1
  814. #define DEBUG_PORT Serial1
  815. #define SERIAL_RX_ENABLED 1
  816. // LEDs
  817. #define LED1_PIN 5
  818. #define LED1_PIN_INVERSE 1
  819. // Light
  820. #define LIGHT_CHANNELS 5
  821. #define LIGHT_CH1_PIN 15 // RED
  822. #define LIGHT_CH2_PIN 13 // GREEN
  823. #define LIGHT_CH3_PIN 12 // BLUE
  824. #define LIGHT_CH4_PIN 14 // WHITE1
  825. #define LIGHT_CH5_PIN 4 // WHITE2
  826. #define LIGHT_CH1_INVERSE 0
  827. #define LIGHT_CH2_INVERSE 0
  828. #define LIGHT_CH3_INVERSE 0
  829. #define LIGHT_CH4_INVERSE 0
  830. #define LIGHT_CH5_INVERSE 0
  831. #elif defined(HUACANXING_H802)
  832. // Info
  833. #define MANUFACTURER "HUACANXING"
  834. #define DEVICE "H802"
  835. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  836. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  837. #define DUMMY_RELAY_COUNT 1
  838. #define DEBUG_PORT Serial1
  839. #define SERIAL_RX_ENABLED 1
  840. // Light
  841. #define LIGHT_CHANNELS 4
  842. #define LIGHT_CH1_PIN 12 // RED
  843. #define LIGHT_CH2_PIN 14 // GREEN
  844. #define LIGHT_CH3_PIN 13 // BLUE
  845. #define LIGHT_CH4_PIN 15 // WHITE
  846. #define LIGHT_CH1_INVERSE 0
  847. #define LIGHT_CH2_INVERSE 0
  848. #define LIGHT_CH3_INVERSE 0
  849. #define LIGHT_CH4_INVERSE 0
  850. // -----------------------------------------------------------------------------
  851. // Jan Goedeke Wifi Relay
  852. // https://github.com/JanGoe/esp8266-wifi-relay
  853. // -----------------------------------------------------------------------------
  854. #elif defined(JANGOE_WIFI_RELAY_NC)
  855. // Info
  856. #define MANUFACTURER "JANGOE"
  857. #define DEVICE "WIFI_RELAY_NC"
  858. // Buttons
  859. #define BUTTON1_PIN 12
  860. #define BUTTON2_PIN 13
  861. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  862. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  863. #define BUTTON1_RELAY 1
  864. #define BUTTON2_RELAY 2
  865. // Relays
  866. #define RELAY1_PIN 2
  867. #define RELAY2_PIN 14
  868. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  869. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  870. #elif defined(JANGOE_WIFI_RELAY_NO)
  871. // Info
  872. #define MANUFACTURER "JANGOE"
  873. #define DEVICE "WIFI_RELAY_NO"
  874. // Buttons
  875. #define BUTTON1_PIN 12
  876. #define BUTTON2_PIN 13
  877. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  878. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  879. #define BUTTON1_RELAY 1
  880. #define BUTTON2_RELAY 2
  881. // Relays
  882. #define RELAY1_PIN 2
  883. #define RELAY2_PIN 14
  884. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  885. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  886. // -----------------------------------------------------------------------------
  887. // Jorge García Wifi+Relays Board Kit
  888. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  889. // https://github.com/jorgegarciadev/wifikit
  890. // -----------------------------------------------------------------------------
  891. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  892. // Info
  893. #define MANUFACTURER "JORGEGARCIA"
  894. #define DEVICE "WIFI_RELAYS"
  895. // Relays
  896. #define RELAY1_PIN 0
  897. #define RELAY2_PIN 2
  898. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  899. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  900. // -----------------------------------------------------------------------------
  901. // WiFi MQTT Relay / Thermostat
  902. // -----------------------------------------------------------------------------
  903. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  904. // Info
  905. #define MANUFACTURER "OPENENERGYMONITOR"
  906. #define DEVICE "MQTT_RELAY"
  907. // Buttons
  908. #define BUTTON1_PIN 0
  909. #define BUTTON1_RELAY 1
  910. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  911. // Relays
  912. #define RELAY1_PIN 12
  913. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  914. // LEDs
  915. #define LED1_PIN 16
  916. #define LED1_PIN_INVERSE 0
  917. // -----------------------------------------------------------------------------
  918. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  919. // 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
  920. // 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
  921. // -----------------------------------------------------------------------------
  922. #elif defined(WION_50055)
  923. // Currently untested, does not support energy monitoring
  924. // Info
  925. #define MANUFACTURER "WION"
  926. #define DEVICE "50055"
  927. // Buttons
  928. #define BUTTON1_PIN 13
  929. #define BUTTON1_RELAY 1
  930. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  931. // Relays
  932. #define RELAY1_PIN 15
  933. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  934. // LEDs
  935. #define LED1_PIN 2
  936. #define LED1_PIN_INVERSE 0
  937. // -----------------------------------------------------------------------------
  938. // EX-Store Wifi Relay v3.1
  939. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  940. // -----------------------------------------------------------------------------
  941. #elif defined(EXS_WIFI_RELAY_V31)
  942. // Untested
  943. // Info
  944. #define MANUFACTURER "EXS"
  945. #define DEVICE "WIFI_RELAY_V31"
  946. // Buttons
  947. #define BUTTON1_PIN 0
  948. #define BUTTON1_RELAY 1
  949. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  950. // Relays
  951. #define RELAY1_PIN 13
  952. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  953. #define RELAY1_RESET_PIN 12
  954. // -----------------------------------------------------------------------------
  955. // V9261F
  956. // -----------------------------------------------------------------------------
  957. #elif defined(GENERIC_V9261F)
  958. // Info
  959. #define MANUFACTURER "GENERIC"
  960. #define DEVICE "V9261F"
  961. #define ALEXA_SUPPORT 0
  962. // V9261F
  963. #define V9261F_SUPPORT 1
  964. #define V9261F_PIN 2
  965. #define V9261F_PIN_INVERSE 1
  966. // -----------------------------------------------------------------------------
  967. // ECH1560
  968. // -----------------------------------------------------------------------------
  969. #elif defined(GENERIC_ECH1560)
  970. // Info
  971. #define MANUFACTURER "GENERIC"
  972. #define DEVICE "ECH1560"
  973. #define ALEXA_SUPPORT 0
  974. // ECH1560
  975. #define ECH1560_SUPPORT 1
  976. #define ECH1560_CLK_PIN 4
  977. #define ECH1560_MISO_PIN 5
  978. #define ECH1560_INVERTED 0
  979. // -----------------------------------------------------------------------------
  980. // ESPLive
  981. // https://github.com/ManCaveMade/ESP-Live
  982. // -----------------------------------------------------------------------------
  983. #elif defined(MANCAVEMADE_ESPLIVE)
  984. // Info
  985. #define MANUFACTURER "MANCAVEMADE"
  986. #define DEVICE "ESPLIVE"
  987. // Buttons
  988. #define BUTTON1_PIN 4
  989. #define BUTTON2_PIN 5
  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 12
  996. #define RELAY2_PIN 13
  997. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  998. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  999. // DS18B20
  1000. #ifndef DALLAS_SUPPORT
  1001. #define DALLAS_SUPPORT 1
  1002. #endif
  1003. #define DALLAS_PIN 2
  1004. #define DALLAS_UPDATE_INTERVAL 5000
  1005. #define TEMPERATURE_MIN_CHANGE 1.0
  1006. // -----------------------------------------------------------------------------
  1007. // QuinLED
  1008. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  1009. // -----------------------------------------------------------------------------
  1010. #elif defined(INTERMITTECH_QUINLED)
  1011. // Info
  1012. #define MANUFACTURER "INTERMITTECH"
  1013. #define DEVICE "QUINLED"
  1014. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1015. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1016. #define DUMMY_RELAY_COUNT 1
  1017. // LEDs
  1018. #define LED1_PIN 5
  1019. #define LED1_PIN_INVERSE 1
  1020. // Light
  1021. #define LIGHT_CHANNELS 2
  1022. #define LIGHT_CH1_PIN 0
  1023. #define LIGHT_CH2_PIN 2
  1024. #define LIGHT_CH1_INVERSE 0
  1025. #define LIGHT_CH2_INVERSE 0
  1026. // -----------------------------------------------------------------------------
  1027. // Arilux AL-LC06
  1028. // -----------------------------------------------------------------------------
  1029. #elif defined(ARILUX_AL_LC01)
  1030. // Info
  1031. #define MANUFACTURER "ARILUX"
  1032. #define DEVICE "AL_LC01"
  1033. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1034. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1035. #define DUMMY_RELAY_COUNT 1
  1036. // Light
  1037. #define LIGHT_CHANNELS 3
  1038. #define LIGHT_CH1_PIN 5 // RED
  1039. #define LIGHT_CH2_PIN 12 // GREEN
  1040. #define LIGHT_CH3_PIN 13 // BLUE
  1041. #define LIGHT_CH1_INVERSE 0
  1042. #define LIGHT_CH2_INVERSE 0
  1043. #define LIGHT_CH3_INVERSE 0
  1044. #elif defined(ARILUX_AL_LC02)
  1045. // Info
  1046. #define MANUFACTURER "ARILUX"
  1047. #define DEVICE "AL_LC02"
  1048. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1049. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1050. #define DUMMY_RELAY_COUNT 1
  1051. // Light
  1052. #define LIGHT_CHANNELS 4
  1053. #define LIGHT_CH1_PIN 12 // RED
  1054. #define LIGHT_CH2_PIN 5 // GREEN
  1055. #define LIGHT_CH3_PIN 13 // BLUE
  1056. #define LIGHT_CH4_PIN 15 // WHITE1
  1057. #define LIGHT_CH1_INVERSE 0
  1058. #define LIGHT_CH2_INVERSE 0
  1059. #define LIGHT_CH3_INVERSE 0
  1060. #define LIGHT_CH4_INVERSE 0
  1061. #elif defined(ARILUX_AL_LC06)
  1062. // Info
  1063. #define MANUFACTURER "ARILUX"
  1064. #define DEVICE "AL_LC06"
  1065. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1066. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1067. #define DUMMY_RELAY_COUNT 1
  1068. // Light
  1069. #define LIGHT_CHANNELS 5
  1070. #define LIGHT_CH1_PIN 14 // RED
  1071. #define LIGHT_CH2_PIN 12 // GREEN
  1072. #define LIGHT_CH3_PIN 13 // BLUE
  1073. #define LIGHT_CH4_PIN 15 // WHITE1
  1074. #define LIGHT_CH5_PIN 5 // WHITE2
  1075. #define LIGHT_CH1_INVERSE 0
  1076. #define LIGHT_CH2_INVERSE 0
  1077. #define LIGHT_CH3_INVERSE 0
  1078. #define LIGHT_CH4_INVERSE 0
  1079. #define LIGHT_CH5_INVERSE 0
  1080. #elif defined(ARILUX_AL_LC11)
  1081. // Info
  1082. #define MANUFACTURER "ARILUX"
  1083. #define DEVICE "AL_LC11"
  1084. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1085. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1086. #define DUMMY_RELAY_COUNT 1
  1087. // Light
  1088. #define LIGHT_CHANNELS 5
  1089. #define LIGHT_CH1_PIN 5 // RED
  1090. #define LIGHT_CH2_PIN 4 // GREEN
  1091. #define LIGHT_CH3_PIN 14 // BLUE
  1092. #define LIGHT_CH4_PIN 13 // WHITE1
  1093. #define LIGHT_CH5_PIN 12 // WHITE1
  1094. #define LIGHT_CH1_INVERSE 0
  1095. #define LIGHT_CH2_INVERSE 0
  1096. #define LIGHT_CH3_INVERSE 0
  1097. #define LIGHT_CH4_INVERSE 0
  1098. #define LIGHT_CH5_INVERSE 0
  1099. #elif defined(ARILUX_E27)
  1100. // Info
  1101. #define MANUFACTURER "ARILUX"
  1102. #define DEVICE "E27"
  1103. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1104. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1105. #define DUMMY_RELAY_COUNT 1
  1106. // Light
  1107. #define LIGHT_CHANNELS 4
  1108. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  1109. #define MY92XX_CHIPS 1
  1110. #define MY92XX_DI_PIN 13
  1111. #define MY92XX_DCKI_PIN 15
  1112. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1113. #define MY92XX_MAPPING 0, 1, 2, 3
  1114. // -----------------------------------------------------------------------------
  1115. // XENON SM-PW701U
  1116. // -----------------------------------------------------------------------------
  1117. #elif defined(XENON_SM_PW702U)
  1118. // Info
  1119. #define MANUFACTURER "XENON"
  1120. #define DEVICE "SM_PW702U"
  1121. // Buttons
  1122. #define BUTTON1_PIN 13
  1123. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1124. #define BUTTON1_RELAY 1
  1125. // Relays
  1126. #define RELAY1_PIN 12
  1127. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1128. // LEDs
  1129. #define LED1_PIN 4
  1130. #define LED1_PIN_INVERSE 1
  1131. // -----------------------------------------------------------------------------
  1132. // AUTHOMETION LYT8266
  1133. // https://authometion.com/shop/en/home/13-lyt8266.html
  1134. // -----------------------------------------------------------------------------
  1135. #elif defined(AUTHOMETION_LYT8266)
  1136. // Info
  1137. #define MANUFACTURER "AUTHOMETION"
  1138. #define DEVICE "LYT8266"
  1139. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1140. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1141. #define DUMMY_RELAY_COUNT 1
  1142. // Light
  1143. #define LIGHT_CHANNELS 4
  1144. #define LIGHT_CH1_PIN 13 // RED
  1145. #define LIGHT_CH2_PIN 12 // GREEN
  1146. #define LIGHT_CH3_PIN 14 // BLUE
  1147. #define LIGHT_CH4_PIN 2 // WHITE
  1148. #define LIGHT_CH1_INVERSE 0
  1149. #define LIGHT_CH2_INVERSE 0
  1150. #define LIGHT_CH3_INVERSE 0
  1151. #define LIGHT_CH4_INVERSE 0
  1152. #define LIGHT_ENABLE_PIN 15
  1153. #elif defined(GIZWITS_WITTY_CLOUD)
  1154. // Info
  1155. #define MANUFACTURER "GIZWITS"
  1156. #define DEVICE "WITTY_CLOUD"
  1157. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1158. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1159. #define DUMMY_RELAY_COUNT 1
  1160. // Buttons
  1161. #define BUTTON1_PIN 4
  1162. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1163. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  1164. #define BUTTON1_CLICK BUTTON_MODE_NONE
  1165. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1166. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1167. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  1168. #define ANALOG_SUPPORT 1
  1169. // LEDs
  1170. #define LED1_PIN 2 // BLUE build-in
  1171. #define LED1_PIN_INVERSE 1
  1172. // Light
  1173. #define LIGHT_CHANNELS 3
  1174. #define LIGHT_CH1_PIN 15 // RED
  1175. #define LIGHT_CH2_PIN 12 // GREEN
  1176. #define LIGHT_CH3_PIN 13 // BLUE
  1177. #define LIGHT_CH1_INVERSE 0
  1178. #define LIGHT_CH2_INVERSE 0
  1179. #define LIGHT_CH3_INVERSE 0
  1180. // -----------------------------------------------------------------------------
  1181. // KMC 70011
  1182. // https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
  1183. // -----------------------------------------------------------------------------
  1184. #elif defined(KMC_70011)
  1185. // Info
  1186. #define MANUFACTURER "KMC"
  1187. #define DEVICE "70011"
  1188. // Buttons
  1189. #define BUTTON1_PIN 0
  1190. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1191. #define BUTTON1_RELAY 1
  1192. // Relays
  1193. #define RELAY1_PIN 14
  1194. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1195. // LEDs
  1196. #define LED1_PIN 13
  1197. #define LED1_PIN_INVERSE 0
  1198. // HLW8012
  1199. #ifndef HLW8012_SUPPORT
  1200. #define HLW8012_SUPPORT 1
  1201. #endif
  1202. #define HLW8012_SEL_PIN 12
  1203. #define HLW8012_CF1_PIN 5
  1204. #define HLW8012_CF_PIN 4
  1205. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1206. // -----------------------------------------------------------------------------
  1207. // Euromate (?) Wifi Stecker Shuko
  1208. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  1209. // Thanks to @Geitde
  1210. // -----------------------------------------------------------------------------
  1211. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  1212. // Info
  1213. #define MANUFACTURER "EUROMATE"
  1214. #define DEVICE "WIFI_STECKER_SCHUKO"
  1215. // Buttons
  1216. #define BUTTON1_PIN 14
  1217. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1218. #define BUTTON1_RELAY 1
  1219. // The relay in the device is not a bistable (latched) relay.
  1220. // The device is reported to have a flip-flop circuit to drive the relay
  1221. // So @Geitde hack is still the only possible
  1222. // Hack: drive GPIO12 low and use GPIO5 as normal relay pin:
  1223. #define RELAY1_PIN 5
  1224. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1225. #define LED2_PIN 12 /* DUMMY: exploit default off state for GPIO12=low */
  1226. #define LED2_PIN_INVERSE 0
  1227. // LEDs
  1228. #define LED1_PIN 4
  1229. #define LED1_PIN_INVERSE 0
  1230. // -----------------------------------------------------------------------------
  1231. // Generic 8CH
  1232. // -----------------------------------------------------------------------------
  1233. #elif defined(GENERIC_8CH)
  1234. // Info
  1235. #define MANUFACTURER "GENERIC"
  1236. #define DEVICE "8CH"
  1237. // Relays
  1238. #define RELAY1_PIN 0
  1239. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1240. #define RELAY2_PIN 2
  1241. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1242. #define RELAY3_PIN 4
  1243. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1244. #define RELAY4_PIN 5
  1245. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1246. #define RELAY5_PIN 12
  1247. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1248. #define RELAY6_PIN 13
  1249. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  1250. #define RELAY7_PIN 14
  1251. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  1252. #define RELAY8_PIN 15
  1253. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  1254. // -----------------------------------------------------------------------------
  1255. // STM RELAY
  1256. // -----------------------------------------------------------------------------
  1257. #elif defined(STM_RELAY)
  1258. // Info
  1259. #define MANUFACTURER "STM_RELAY"
  1260. #define DEVICE "2CH"
  1261. // Relays
  1262. #define DUMMY_RELAY_COUNT 2
  1263. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  1264. // Remove UART noise on serial line
  1265. #define DEBUG_SERIAL_SUPPORT 0
  1266. // -----------------------------------------------------------------------------
  1267. // Tonbux Powerstrip02
  1268. // -----------------------------------------------------------------------------
  1269. #elif defined(TONBUX_POWERSTRIP02)
  1270. // Info
  1271. #define MANUFACTURER "TONBUX"
  1272. #define DEVICE "POWERSTRIP02"
  1273. // Buttons
  1274. #define BUTTON1_PIN 5
  1275. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1276. #define BUTTON1_RELAY 0
  1277. // Relays
  1278. #define RELAY1_PIN 4
  1279. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1280. #define RELAY2_PIN 13
  1281. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1282. #define RELAY3_PIN 12
  1283. #define RELAY3_TYPE RELAY_TYPE_INVERSE
  1284. #define RELAY4_PIN 14
  1285. #define RELAY4_TYPE RELAY_TYPE_INVERSE
  1286. // Not a relay. USB ports on/off
  1287. #define RELAY5_PIN 16
  1288. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1289. // LEDs
  1290. #define LED1_PIN 0 // 1 blue led
  1291. #define LED1_PIN_INVERSE 1
  1292. #define LED2_PIN 3 // 3 red leds
  1293. #define LED2_PIN_INVERSE 1
  1294. // -----------------------------------------------------------------------------
  1295. // Lingan SWA1
  1296. // -----------------------------------------------------------------------------
  1297. #elif defined(LINGAN_SWA1)
  1298. // Info
  1299. #define MANUFACTURER "LINGAN"
  1300. #define DEVICE "SWA1"
  1301. // Buttons
  1302. #define BUTTON1_PIN 13
  1303. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1304. #define BUTTON1_RELAY 1
  1305. // Relays
  1306. #define RELAY1_PIN 5
  1307. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1308. // LEDs
  1309. #define LED1_PIN 4
  1310. #define LED1_PIN_INVERSE 1
  1311. // -----------------------------------------------------------------------------
  1312. // HEYGO HY02
  1313. // -----------------------------------------------------------------------------
  1314. #elif defined(HEYGO_HY02)
  1315. // Info
  1316. #define MANUFACTURER "HEYGO"
  1317. #define DEVICE "HY02"
  1318. // Buttons
  1319. #define BUTTON1_PIN 13
  1320. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1321. #define BUTTON1_RELAY 1
  1322. // Relays
  1323. #define RELAY1_PIN 12
  1324. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1325. // LEDs
  1326. #define LED1_PIN 4
  1327. #define LED1_PIN_INVERSE 0
  1328. // -----------------------------------------------------------------------------
  1329. // Maxcio W-US002S
  1330. // -----------------------------------------------------------------------------
  1331. #elif defined(MAXCIO_WUS002S)
  1332. // Info
  1333. #define MANUFACTURER "MAXCIO"
  1334. #define DEVICE "WUS002S"
  1335. // Buttons
  1336. #define BUTTON1_PIN 2
  1337. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1338. #define BUTTON1_RELAY 1
  1339. // Relays
  1340. #define RELAY1_PIN 13
  1341. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1342. // LEDs
  1343. #define LED1_PIN 3
  1344. #define LED1_PIN_INVERSE 0
  1345. // HLW8012
  1346. #ifndef HLW8012_SUPPORT
  1347. #define HLW8012_SUPPORT 1
  1348. #endif
  1349. #define HLW8012_SEL_PIN 12
  1350. #define HLW8012_CF1_PIN 5
  1351. #define HLW8012_CF_PIN 4
  1352. #define HLW8012_CURRENT_R 0.002 // Current resistor
  1353. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1354. // -----------------------------------------------------------------------------
  1355. // YiDian XS-SSA05
  1356. // -----------------------------------------------------------------------------
  1357. #elif defined(YIDIAN_XSSSA05)
  1358. // Info
  1359. #define MANUFACTURER "YIDIAN"
  1360. #define DEVICE "XSSSA05"
  1361. // Buttons
  1362. #define BUTTON1_PIN 13
  1363. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1364. #define BUTTON1_RELAY 1
  1365. // Relays
  1366. #define RELAY1_PIN 12
  1367. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1368. // LEDs
  1369. #define LED1_PIN 4
  1370. #define LED1_PIN_INVERSE 0
  1371. // HLW8012
  1372. #ifndef HLW8012_SUPPORT
  1373. #define HLW8012_SUPPORT 1
  1374. #endif
  1375. #define HLW8012_SEL_PIN 3
  1376. #define HLW8012_CF1_PIN 14
  1377. #define HLW8012_CF_PIN 5
  1378. #define HLW8012_CURRENT_R 0.001 // Current resistor
  1379. #define HLW8012_VOLTAGE_R_UP ( 2 * 1200000 ) // Upstream voltage resistor
  1380. // -----------------------------------------------------------------------------
  1381. // TONBUX XS-SSA06
  1382. // -----------------------------------------------------------------------------
  1383. #elif defined(TONBUX_XSSSA06)
  1384. // Info
  1385. #define MANUFACTURER "TONBUX"
  1386. #define DEVICE "XSSSA06"
  1387. // Buttons
  1388. #define BUTTON1_PIN 13
  1389. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1390. #define BUTTON1_RELAY 1
  1391. // Relays
  1392. #define RELAY1_PIN 15
  1393. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1394. // LEDs
  1395. #define LED1_PIN 0 // R - 8 rgb led ring
  1396. #define LED1_PIN_INVERSE 0
  1397. #define LED2_PIN 5 // G
  1398. #define LED2_PIN_INVERSE 0
  1399. #define LED3_PIN 2 // B
  1400. #define LED3_PIN_INVERSE 0
  1401. // -----------------------------------------------------------------------------
  1402. // GREEN ESP8266 RELAY MODULE
  1403. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1404. // -----------------------------------------------------------------------------
  1405. #elif defined(GREEN_ESP8266RELAY)
  1406. // Info
  1407. #define MANUFACTURER "GREEN"
  1408. #define DEVICE "ESP8266RELAY"
  1409. // Buttons
  1410. // Not a button but input via Optocoupler
  1411. #define BUTTON1_PIN 5
  1412. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1413. #define BUTTON1_RELAY 1
  1414. // Relays
  1415. #define RELAY1_PIN 4
  1416. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1417. // LEDs
  1418. #define LED1_PIN 2
  1419. #define LED1_PIN_INVERSE 1
  1420. // -----------------------------------------------------------------------------
  1421. // Henrique Gravina ESPIKE
  1422. // https://github.com/Henriquegravina/Espike
  1423. // -----------------------------------------------------------------------------
  1424. #elif defined(IKE_ESPIKE)
  1425. #define MANUFACTURER "IKE"
  1426. #define DEVICE "ESPIKE"
  1427. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1428. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1429. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1430. #define BUTTON1_PIN 13
  1431. #define BUTTON1_RELAY 1
  1432. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1433. #define BUTTON2_PIN 12
  1434. #define BUTTON2_RELAY 2
  1435. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1436. #define BUTTON3_PIN 14
  1437. #define BUTTON3_RELAY 3
  1438. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1439. #define RELAY1_PIN 4
  1440. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1441. #define RELAY2_PIN 5
  1442. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1443. #define RELAY3_PIN 16
  1444. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1445. #define LED1_PIN 2
  1446. #define LED1_PIN_INVERSE 1
  1447. // -----------------------------------------------------------------------------
  1448. // SWIFITCH
  1449. // https://github.com/ArnieX/swifitch
  1450. // -----------------------------------------------------------------------------
  1451. #elif defined(ARNIEX_SWIFITCH)
  1452. // Info
  1453. #define MANUFACTURER "ARNIEX"
  1454. #define DEVICE "SWIFITCH"
  1455. // Buttons
  1456. #define BUTTON1_PIN 4 // D2
  1457. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1458. #define BUTTON1_RELAY 1
  1459. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1460. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1461. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1462. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1463. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1464. // Relays
  1465. #define RELAY1_PIN 5 // D1
  1466. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1467. // LEDs
  1468. #define LED1_PIN 12 // D6
  1469. #define LED1_PIN_INVERSE 1
  1470. // -----------------------------------------------------------------------------
  1471. // ESP-01S RELAY v4.0
  1472. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  1473. // -----------------------------------------------------------------------------
  1474. #elif defined(GENERIC_ESP01S_RELAY_V40)
  1475. // Info
  1476. #define MANUFACTURER "GENERIC"
  1477. #define DEVICE "ESP01S_RELAY_40"
  1478. // Relays
  1479. #define RELAY1_PIN 0
  1480. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1481. // LEDs
  1482. #define LED1_PIN 2
  1483. #define LED1_PIN_INVERSE 0
  1484. // -----------------------------------------------------------------------------
  1485. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  1486. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  1487. // -----------------------------------------------------------------------------
  1488. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  1489. // Info
  1490. #define MANUFACTURER "GENERIC"
  1491. #define DEVICE "ESP01S_RGBLED_10"
  1492. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  1493. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  1494. // Buttons
  1495. //#define BUTTON1_PIN 2
  1496. // Relays
  1497. //#define RELAY1_PIN 2
  1498. // LEDs
  1499. #define LED1_PIN 2
  1500. #define LED1_PIN_INVERSE 0
  1501. // -----------------------------------------------------------------------------
  1502. // ESP-01S DHT11 v1.0
  1503. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  1504. // -----------------------------------------------------------------------------
  1505. #elif defined(GENERIC_ESP01S_DHT11_V10)
  1506. // Info
  1507. #define MANUFACTURER "GENERIC"
  1508. #define DEVICE "ESP01S_DHT11_10"
  1509. // DHT11
  1510. #ifndef DHT_SUPPORT
  1511. #define DHT_SUPPORT 1
  1512. #endif
  1513. #define DHT_PIN 2
  1514. #define DHT_TYPE DHT_CHIP_DHT11
  1515. // -----------------------------------------------------------------------------
  1516. // ESP-01S DS18B20 v1.0
  1517. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  1518. // -----------------------------------------------------------------------------
  1519. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  1520. // Info
  1521. #define MANUFACTURER "GENERIC"
  1522. #define DEVICE "ESP01S_DS18B20_10"
  1523. // DB18B20
  1524. #ifndef DALLAS_SUPPORT
  1525. #define DALLAS_SUPPORT 1
  1526. #endif
  1527. #define DALLAS_PIN 2
  1528. // -----------------------------------------------------------------------------
  1529. // ESP-DIN relay board V1
  1530. // https://github.com/pilotak/esp_din
  1531. // -----------------------------------------------------------------------------
  1532. #elif defined(PILOTAK_ESP_DIN_V1)
  1533. // Info
  1534. #define MANUFACTURER "PILOTAK"
  1535. #define DEVICE "ESP_DIN_V1"
  1536. // Buttons
  1537. #define BUTTON1_PIN 0
  1538. #define BUTTON1_RELAY 1
  1539. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1540. // Relays
  1541. #define RELAY1_PIN 4
  1542. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1543. #define RELAY2_PIN 5
  1544. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1545. // LEDs
  1546. #define LED1_PIN 15
  1547. #define LED1_PIN_INVERSE 0
  1548. #define I2C_SDA_PIN 12
  1549. #define I2C_SCL_PIN 13
  1550. #ifndef DALLAS_SUPPORT
  1551. #define DALLAS_SUPPORT 1
  1552. #endif
  1553. #define DALLAS_PIN 2
  1554. #ifndef RF_SUPPORT
  1555. #define RF_SUPPORT 1
  1556. #endif
  1557. #define RF_PIN 14
  1558. #ifndef DIGITAL_SUPPORT
  1559. #define DIGITAL_SUPPORT 1
  1560. #endif
  1561. #define DIGITAL_PIN 16
  1562. #define DIGITAL_PIN_MODE INPUT
  1563. // -----------------------------------------------------------------------------
  1564. // Heltec Touch Relay
  1565. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  1566. // -----------------------------------------------------------------------------
  1567. #elif defined(HELTEC_TOUCHRELAY)
  1568. // Info
  1569. #define MANUFACTURER "HELTEC"
  1570. #define DEVICE "TOUCH_RELAY"
  1571. // Buttons
  1572. #define BUTTON1_PIN 14
  1573. #define BUTTON1_RELAY 1
  1574. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1575. // Relays
  1576. #define RELAY1_PIN 12
  1577. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1578. // -----------------------------------------------------------------------------
  1579. // Zhilde ZLD-EU44-W
  1580. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  1581. // -----------------------------------------------------------------------------
  1582. #elif defined(ZHILDE_EU44_W)
  1583. // Info
  1584. #define MANUFACTURER "ZHILDE"
  1585. #define DEVICE "EU44_W"
  1586. // Based on the reporter, this product uses GPIO1 and 3 for the button
  1587. // and onboard LED, so hardware serial should be disabled...
  1588. #define DEBUG_SERIAL_SUPPORT 0
  1589. // Buttons
  1590. #define BUTTON1_PIN 3
  1591. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1592. // Relays
  1593. #define RELAY1_PIN 5
  1594. #define RELAY2_PIN 4
  1595. #define RELAY3_PIN 12
  1596. #define RELAY4_PIN 13
  1597. #define RELAY5_PIN 14
  1598. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1599. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1600. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1601. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1602. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1603. // LEDs
  1604. #define LED1_PIN 1
  1605. #define LED1_PIN_INVERSE 1
  1606. // -----------------------------------------------------------------------------
  1607. // Allnet 4duino ESP8266-UP-Relais
  1608. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  1609. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  1610. // -----------------------------------------------------------------------------
  1611. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  1612. // Info
  1613. #define MANUFACTURER "ALLNET"
  1614. #define DEVICE "4DUINO_IOT_WLAN_RELAIS"
  1615. // Relays
  1616. #define RELAY1_PIN 14
  1617. #define RELAY1_RESET_PIN 12
  1618. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1619. // LEDs
  1620. #define LED1_PIN 0
  1621. #define LED1_PIN_INVERSE 1
  1622. // Buttons
  1623. //#define BUTTON1_PIN 0
  1624. //#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1625. // Using pins labelled as SDA & SCL as buttons
  1626. #define BUTTON2_PIN 4
  1627. #define BUTTON2_MODE BUTTON_PUSHBUTTON
  1628. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  1629. #define BUTTON2_CLICK BUTTON_MODE_NONE
  1630. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  1631. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  1632. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  1633. #define BUTTON3_PIN 5
  1634. #define BUTTON3_MODE BUTTON_PUSHBUTTON
  1635. // Using pins labelled as SDA & SCL for I2C
  1636. //#define I2C_SDA_PIN 4
  1637. //#define I2C_SCL_PIN 5
  1638. // -----------------------------------------------------------------------------
  1639. // Luani HVIO
  1640. // https://luani.de/projekte/esp8266-hvio/
  1641. // https://luani.de/blog/esp8266-230v-io-modul/
  1642. // -----------------------------------------------------------------------------
  1643. #elif defined(LUANI_HVIO)
  1644. // Info
  1645. #define MANUFACTURER "LUANI"
  1646. #define DEVICE "HVIO"
  1647. // Buttons
  1648. #define BUTTON1_PIN 12
  1649. #define BUTTON1_RELAY 1
  1650. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1651. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1652. #define BUTTON2_PIN 13
  1653. #define BUTTON2_RELAY 2
  1654. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1655. // Relays
  1656. #define RELAY1_PIN 4
  1657. #define RELAY2_PIN 5
  1658. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1659. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1660. // LEDs
  1661. #define LED1_PIN 15
  1662. #define LED1_PIN_INVERSE 0
  1663. // -----------------------------------------------------------------------------
  1664. // Tonbux 50-100M Smart Mosquito Killer USB
  1665. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  1666. // -----------------------------------------------------------------------------
  1667. #elif defined(TONBUX_MOSQUITO_KILLER)
  1668. // Info
  1669. #define MANUFACTURER "TONBUX"
  1670. #define DEVICE "MOSQUITO_KILLER"
  1671. // Buttons
  1672. #define BUTTON1_PIN 2
  1673. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1674. #define BUTTON1_RELAY 1
  1675. // Relays
  1676. #define RELAY1_PIN 5 // not a relay, fan
  1677. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1678. // LEDs
  1679. #define LED1_PIN 15 // blue led
  1680. #define LED1_PIN_INVERSE 1
  1681. #define LED1_MODE LED_MODE_WIFI
  1682. #define LED2_PIN 14 // red led
  1683. #define LED2_PIN_INVERSE 1
  1684. #define LED2_MODE LED_MODE_RELAY
  1685. #define LED3_PIN 12 // UV leds (1-2-3-4-5-6-7-8)
  1686. #define LED3_PIN_INVERSE 0
  1687. #define LED3_RELAY 1
  1688. #define LED4_PIN 16 // UV leds (9-10-11)
  1689. #define LED4_PIN_INVERSE 0
  1690. #define LED4_RELAY 1
  1691. // -----------------------------------------------------------------------------
  1692. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  1693. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  1694. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  1695. // -----------------------------------------------------------------------------
  1696. #elif defined(NEO_COOLCAM_NAS_WR01W)
  1697. // Info
  1698. #define MANUFACTURER "NEO_COOLCAM"
  1699. #define DEVICE "NAS_WR01W"
  1700. // Buttons
  1701. #define BUTTON1_PIN 13
  1702. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1703. #define BUTTON1_RELAY 1
  1704. // Relays
  1705. #define RELAY1_PIN 12
  1706. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1707. // LEDs
  1708. #define LED1_PIN 4
  1709. #define LED1_PIN_INVERSE 1
  1710. // ------------------------------------------------------------------------------
  1711. // Estink Wifi Power Strip
  1712. // https://www.amazon.de/Steckdosenleiste-Ladeger%C3%A4t-Sprachsteuerung-SmartphonesTablets-Android/dp/B0796W5FZY
  1713. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  1714. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  1715. // -----------------------------------------------------------------------------
  1716. #elif defined(ESTINK_WIFI_POWER_STRIP)
  1717. // Info
  1718. #define MANUFACTURER "ESTINK"
  1719. #define DEVICE "WIFI_POWER_STRIP"
  1720. // Disable UART noise since this board uses GPIO3
  1721. #define DEBUG_SERIAL_SUPPORT 0
  1722. // Buttons
  1723. #define BUTTON1_PIN 16
  1724. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1725. #define BUTTON1_RELAY 4
  1726. // Relays
  1727. #define RELAY1_PIN 14 // USB power
  1728. #define RELAY2_PIN 13 // power plug 1
  1729. #define RELAY3_PIN 4 // power plug 2
  1730. #define RELAY4_PIN 15 // power plug 3
  1731. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1732. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1733. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1734. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1735. // LEDs
  1736. #define LED1_PIN 0 // power led
  1737. #define LED2_PIN 12 // power plug 1
  1738. #define LED3_PIN 3 // power plug 2
  1739. #define LED4_PIN 5 // power plug 3
  1740. #define LED1_PIN_INVERSE 1
  1741. #define LED2_PIN_INVERSE 1
  1742. #define LED3_PIN_INVERSE 1
  1743. #define LED4_PIN_INVERSE 1
  1744. #define LED1_MODE LED_MODE_FINDME
  1745. #define LED2_MODE LED_MODE_FOLLOW
  1746. #define LED3_MODE LED_MODE_FOLLOW
  1747. #define LED4_MODE LED_MODE_FOLLOW
  1748. #define LED2_RELAY 2
  1749. #define LED3_RELAY 3
  1750. #define LED4_RELAY 4
  1751. // -----------------------------------------------------------------------------
  1752. // Bruno Horta's OnOfre
  1753. // https://www.bhonofre.pt/
  1754. // https://github.com/brunohorta82/BH_OnOfre/
  1755. // -----------------------------------------------------------------------------
  1756. #elif defined(BH_ONOFRE)
  1757. // Info
  1758. #define MANUFACTURER "BH"
  1759. #define DEVICE "ONOFRE"
  1760. // Buttons
  1761. #define BUTTON1_PIN 12
  1762. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1763. #define BUTTON1_RELAY 1
  1764. #define BUTTON2_PIN 13
  1765. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1766. #define BUTTON2_RELAY 2
  1767. // Relays
  1768. #define RELAY1_PIN 4
  1769. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1770. #define RELAY2_PIN 5
  1771. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1772. // -----------------------------------------------------------------------------
  1773. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  1774. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  1775. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  1776. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  1777. // * Goosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  1778. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  1779. // -----------------------------------------------------------------------------
  1780. #elif defined(BLITZWOLF_BWSHP2)
  1781. // Info
  1782. #define MANUFACTURER "BLITZWOLF"
  1783. #define DEVICE "BWSHP2"
  1784. // Buttons
  1785. #define BUTTON1_PIN 13
  1786. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1787. #define BUTTON1_RELAY 1
  1788. // Relays
  1789. #define RELAY1_PIN 15
  1790. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1791. // LEDs
  1792. #define LED1_PIN 2
  1793. #define LED1_PIN_INVERSE 1
  1794. #define LED2_PIN 0
  1795. #define LED2_PIN_INVERSE 1
  1796. #define LED2_MODE LED_MODE_FINDME
  1797. #define LED2_RELAY 1
  1798. // HJL01 / BL0937
  1799. #ifndef HLW8012_SUPPORT
  1800. #define HLW8012_SUPPORT 1
  1801. #endif
  1802. #define HLW8012_SEL_PIN 12
  1803. #define HLW8012_CF1_PIN 14
  1804. #define HLW8012_CF_PIN 5
  1805. #define HLW8012_SEL_CURRENT LOW
  1806. #define HLW8012_CURRENT_RATIO 25740
  1807. #define HLW8012_VOLTAGE_RATIO 313400
  1808. #define HLW8012_POWER_RATIO 3414290
  1809. #define HLW8012_INTERRUPT_ON FALLING
  1810. // -----------------------------------------------------------------------------
  1811. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  1812. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  1813. // -----------------------------------------------------------------------------
  1814. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  1815. // Info
  1816. #define MANUFACTURER "VANZAVANZU"
  1817. #define DEVICE "SMART_WIFI_PLUG_MINI"
  1818. // Buttons
  1819. #define BUTTON1_PIN 13
  1820. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1821. #define BUTTON1_RELAY 1
  1822. // Relays
  1823. #define RELAY1_PIN 15
  1824. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1825. // LEDs
  1826. #define LED1_PIN 2
  1827. #define LED1_PIN_INVERSE 1
  1828. #define LED2_PIN 0
  1829. #define LED2_PIN_INVERSE 1
  1830. #define LED2_MODE LED_MODE_FINDME
  1831. #define LED2_RELAY 1
  1832. // Disable UART noise
  1833. #define DEBUG_SERIAL_SUPPORT 0
  1834. // HJL01 / BL0937
  1835. #ifndef HLW8012_SUPPORT
  1836. #define HLW8012_SUPPORT 1
  1837. #endif
  1838. #define HLW8012_SEL_PIN 3
  1839. #define HLW8012_CF1_PIN 14
  1840. #define HLW8012_CF_PIN 5
  1841. #define HLW8012_SEL_CURRENT LOW
  1842. #define HLW8012_CURRENT_RATIO 25740
  1843. #define HLW8012_VOLTAGE_RATIO 313400
  1844. #define HLW8012_POWER_RATIO 3414290
  1845. #define HLW8012_INTERRUPT_ON FALLING
  1846. // -----------------------------------------------------------------------------
  1847. // TEST boards (do not use!!)
  1848. // -----------------------------------------------------------------------------
  1849. #elif defined(TRAVIS01)
  1850. // Info
  1851. #define MANUFACTURER "TravisCI"
  1852. #define DEVICE "Virtual board 01"
  1853. // Some buttons - pin 0
  1854. #define BUTTON1_PIN 0
  1855. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1856. #define BUTTON1_RELAY 1
  1857. // Some relays - pin 1
  1858. #define RELAY1_PIN 1
  1859. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1860. // Some LEDs - pin 2
  1861. #define LED1_PIN 2
  1862. #define LED1_PIN_INVERSE 1
  1863. // A bit of I2C - pins 3,4
  1864. #define I2C_SDA_PIN 3
  1865. #define I2C_SCL_PIN 4
  1866. // And, as they say in "From Dusk till Dawn":
  1867. // This is a sensor blow out!
  1868. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  1869. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  1870. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  1871. // C'mon, you want sensor, come on in sensor lovers!
  1872. // If we don’t got it, you don't want it!
  1873. #define AM2320_SUPPORT 1
  1874. #define BH1750_SUPPORT 1
  1875. #define BMX280_SUPPORT 1
  1876. #define SHT3X_I2C_SUPPORT 1
  1877. #define EMON_ADC121_SUPPORT 1
  1878. #define EMON_ADS1X15_SUPPORT 1
  1879. #define SHT3X_I2C_SUPPORT 1
  1880. #define SI7021_SUPPORT 1
  1881. #define PMSX003_SUPPORT 1
  1882. #define SENSEAIR_SUPPORT 1
  1883. // A bit of lights - pin 5
  1884. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1885. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1886. #define DUMMY_RELAY_COUNT 1
  1887. #define LIGHT_CHANNELS 1
  1888. #define LIGHT_CH1_PIN 5
  1889. #define LIGHT_CH1_INVERSE 0
  1890. // A bit of HLW8012 - pins 6,7,8
  1891. #ifndef HLW8012_SUPPORT
  1892. #define HLW8012_SUPPORT 1
  1893. #endif
  1894. #define HLW8012_SEL_PIN 6
  1895. #define HLW8012_CF1_PIN 7
  1896. #define HLW8012_CF_PIN 8
  1897. // A bit of Dallas - pin 9
  1898. #ifndef DALLAS_SUPPORT
  1899. #define DALLAS_SUPPORT 1
  1900. #endif
  1901. #define DALLAS_PIN 9
  1902. // A bit of ECH1560 - pins 10,11, 12
  1903. #ifndef ECH1560_SUPPORT
  1904. #define ECH1560_SUPPORT 1
  1905. #endif
  1906. #define ECH1560_CLK_PIN 10
  1907. #define ECH1560_MISO_PIN 11
  1908. #define ECH1560_INVERTED 12
  1909. #elif defined(TRAVIS02)
  1910. // Relay provider dual
  1911. #define MANUFACTURER "TravisCI"
  1912. #define DEVICE "Virtual board 02"
  1913. // A bit of CSE7766 - pin 1
  1914. #ifndef CSE7766_SUPPORT
  1915. #define CSE7766_SUPPORT 1
  1916. #endif
  1917. #define CSE7766_PIN 1
  1918. // Relay type dual - pins 2,3
  1919. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  1920. #define RELAY1_PIN 2
  1921. #define RELAY2_PIN 3
  1922. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1923. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1924. // IR - pin 4
  1925. #define IR_SUPPORT 1
  1926. #define IR_PIN 4
  1927. #define IR_BUTTON_SET 1
  1928. // A bit of DHT - pin 5
  1929. #ifndef DHT_SUPPORT
  1930. #define DHT_SUPPORT 1
  1931. #endif
  1932. #define DHT_PIN 5
  1933. // A bit of TMP3X (analog)
  1934. #define TMP3X_SUPPORT 1
  1935. // A bit of EVENTS - pin 10
  1936. #define EVENTS_SUPPORT 1
  1937. #define EVENTS_PIN 6
  1938. // HC-RS04
  1939. #define HCSR04_SUPPORT 1
  1940. #define HCSR04_TRIGGER 7
  1941. #define HCSR04_ECHO 8
  1942. // MHZ19
  1943. #define MHZ19_SUPPORT 1
  1944. #define MHZ19_RX_PIN 9
  1945. #define MHZ19_TX_PIN 10
  1946. // PZEM004T
  1947. #define PZEM004T_SUPPORT 1
  1948. #define PZEM004T_RX_PIN 11
  1949. #define PZEM004T_TX_PIN 12
  1950. // V9261F
  1951. #define V9261F_SUPPORT 1
  1952. #define V9261F_PIN 13
  1953. // GUVAS12SD
  1954. #define GUVAS12SD_SUPPORT 1
  1955. #define GUVAS12SD_PIN 14
  1956. // Test non-default modules
  1957. #define MDNS_CLIENT_SUPPORT 1
  1958. #define NOFUSS_SUPPORT 1
  1959. #define UART_MQTT_SUPPORT 1
  1960. #define INFLUXDB_SUPPORT 1
  1961. #define IR_SUPPORT 1
  1962. #elif defined(TRAVIS03)
  1963. // Relay provider light/my92XX
  1964. #define MANUFACTURER "TravisCI"
  1965. #define DEVICE "Virtual board 03"
  1966. // MY9231 Light - pins 1,2
  1967. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1968. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1969. #define DUMMY_RELAY_COUNT 1
  1970. #define LIGHT_CHANNELS 5
  1971. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  1972. #define MY92XX_CHIPS 2
  1973. #define MY92XX_DI_PIN 1
  1974. #define MY92XX_DCKI_PIN 2
  1975. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1976. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  1977. // A bit of Analog EMON (analog)
  1978. #ifndef EMON_ANALOG_SUPPORT
  1979. #define EMON_ANALOG_SUPPORT 1
  1980. #endif
  1981. // Test non-default modules
  1982. #define LLMNR_SUPPORT 1
  1983. #define NETBIOS_SUPPORT 1
  1984. #define SSDP_SUPPORT 1
  1985. #endif
  1986. // -----------------------------------------------------------------------------
  1987. // Check definitions
  1988. // -----------------------------------------------------------------------------
  1989. #if not defined(MANUFACTURER) || not defined(DEVICE)
  1990. #error "UNSUPPORTED HARDWARE!!"
  1991. #endif