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.

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