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.

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