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.

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