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.

2566 lines
80 KiB

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