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.

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