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.

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