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.

2576 lines
80 KiB

7 years ago
7 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. // -----------------------------------------------------------------------------
  2. // Configuration HELP
  3. // -----------------------------------------------------------------------------
  4. //
  5. // MANUFACTURER: Name of the manufacturer of the board ("string")
  6. // DEVICE: Name of the device ("string")
  7. // BUTTON#_PIN: GPIO for the n-th button (1-based, up to 4 buttons)
  8. // BUTTON#_RELAY: Relay number that will be bind to the n-th button (1-based)
  9. // BUTTON#_MODE: A mask of options (BUTTON_PUSHBUTTON and BUTTON_SWITCH cannot be together)
  10. // - BUTTON_PUSHBUTTON: button event is fired when released
  11. // - BUTTON_SWITCH: button event is fired when pressed or released
  12. // - BUTTON_DEFAULT_HIGH: there is a pull up in place
  13. // - BUTTON_SET_PULLUP: set pullup by software
  14. // RELAY#_PIN: GPIO for the n-th relay (1-based, up to 8 relays)
  15. // RELAY#_TYPE: Relay can be RELAY_TYPE_NORMAL, RELAY_TYPE_INVERSE, RELAY_TYPE_LATCHED or RELAY_TYPE_LATCHED_INVERSE
  16. // LED#_PIN: GPIO for the n-th LED (1-based, up to 8 LEDs)
  17. // LED#_PIN_INVERSE: LED has inversed logic (lit when pulled down)
  18. // LED#_MODE: Check general.h for LED_MODE_%
  19. // LED#_RELAY: Linked relay (1-based)
  20. //
  21. // Besides, other hardware specific information should be stated here
  22. // -----------------------------------------------------------------------------
  23. // ESPurna Core
  24. // -----------------------------------------------------------------------------
  25. #if defined(ESPURNA_CORE)
  26. // This is a special device targeted to generate a light-weight binary image
  27. // meant to be able to do two-step-updates:
  28. // https://github.com/xoseperez/espurna/wiki/TwoStepUpdates
  29. // Info
  30. #define MANUFACTURER "ESPRESSIF"
  31. #define DEVICE "ESPURNA_CORE"
  32. // Disable non-core modules
  33. #define ALEXA_SUPPORT 0
  34. #define BROKER_SUPPORT 0
  35. #define 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. // -----------------------------------------------------------------------------
  694. // YJZK
  695. // -----------------------------------------------------------------------------
  696. #elif defined(YJZK_SWITCH_2CH)
  697. // Info
  698. #define MANUFACTURER "YJZK"
  699. #define DEVICE "SWITCH_2CH"
  700. // Buttons
  701. #define BUTTON1_PIN 0
  702. #define BUTTON2_PIN 9
  703. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  704. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  705. #define BUTTON1_RELAY 1
  706. #define BUTTON2_RELAY 2
  707. // Relays
  708. #define RELAY1_PIN 12
  709. #define RELAY2_PIN 5
  710. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  711. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  712. // LEDs
  713. #define LED1_PIN 13
  714. #define LED1_PIN_INVERSE 0
  715. // -----------------------------------------------------------------------------
  716. // Electrodragon boards
  717. // -----------------------------------------------------------------------------
  718. #elif defined(ELECTRODRAGON_WIFI_IOT)
  719. // Info
  720. #define MANUFACTURER "ELECTRODRAGON"
  721. #define DEVICE "WIFI_IOT"
  722. // Buttons
  723. #define BUTTON1_PIN 0
  724. #define BUTTON2_PIN 2
  725. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  726. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  727. #define BUTTON1_RELAY 1
  728. #define BUTTON2_RELAY 2
  729. // Relays
  730. #define RELAY1_PIN 12
  731. #define RELAY2_PIN 13
  732. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  733. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  734. // LEDs
  735. #define LED1_PIN 16
  736. #define LED1_PIN_INVERSE 0
  737. // -----------------------------------------------------------------------------
  738. // WorkChoice ecoPlug
  739. // -----------------------------------------------------------------------------
  740. #elif defined(WORKCHOICE_ECOPLUG)
  741. // Info
  742. #define MANUFACTURER "WORKCHOICE"
  743. #define DEVICE "ECOPLUG"
  744. // Buttons
  745. #define BUTTON1_PIN 13
  746. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  747. #define BUTTON1_RELAY 1
  748. // Relays
  749. #define RELAY1_PIN 15
  750. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  751. // LEDs
  752. #define LED1_PIN 2
  753. #define LED1_PIN_INVERSE 0
  754. // -----------------------------------------------------------------------------
  755. // AI Thinker
  756. // -----------------------------------------------------------------------------
  757. #elif defined(AITHINKER_AI_LIGHT)
  758. // Info
  759. #define MANUFACTURER "AITHINKER"
  760. #define DEVICE "AI_LIGHT"
  761. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  762. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  763. #define DUMMY_RELAY_COUNT 1
  764. // Light
  765. #define LIGHT_CHANNELS 4
  766. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  767. #define MY92XX_CHIPS 1
  768. #define MY92XX_DI_PIN 13
  769. #define MY92XX_DCKI_PIN 15
  770. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  771. #define MY92XX_MAPPING 0, 1, 2, 3
  772. // -----------------------------------------------------------------------------
  773. // LED Controller
  774. // -----------------------------------------------------------------------------
  775. #elif defined(MAGICHOME_LED_CONTROLLER)
  776. // Info
  777. #define MANUFACTURER "MAGICHOME"
  778. #define DEVICE "LED_CONTROLLER"
  779. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  780. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  781. #define DUMMY_RELAY_COUNT 1
  782. // LEDs
  783. #define LED1_PIN 2
  784. #define LED1_PIN_INVERSE 1
  785. // Light
  786. #define LIGHT_CHANNELS 4
  787. #define LIGHT_CH1_PIN 14 // RED
  788. #define LIGHT_CH2_PIN 5 // GREEN
  789. #define LIGHT_CH3_PIN 12 // BLUE
  790. #define LIGHT_CH4_PIN 13 // WHITE
  791. #define LIGHT_CH1_INVERSE 0
  792. #define LIGHT_CH2_INVERSE 0
  793. #define LIGHT_CH3_INVERSE 0
  794. #define LIGHT_CH4_INVERSE 0
  795. // IR
  796. #define IR_SUPPORT 1
  797. #define IR_PIN 4
  798. #define IR_BUTTON_SET 1
  799. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  800. // Info
  801. #define MANUFACTURER "MAGICHOME"
  802. #define DEVICE "LED_CONTROLLER_20"
  803. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  804. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  805. #define DUMMY_RELAY_COUNT 1
  806. // LEDs
  807. #define LED1_PIN 2
  808. #define LED1_PIN_INVERSE 1
  809. // Light
  810. #define LIGHT_CHANNELS 4
  811. #define LIGHT_CH1_PIN 5 // RED
  812. #define LIGHT_CH2_PIN 12 // GREEN
  813. #define LIGHT_CH3_PIN 13 // BLUE
  814. #define LIGHT_CH4_PIN 15 // WHITE
  815. #define LIGHT_CH1_INVERSE 0
  816. #define LIGHT_CH2_INVERSE 0
  817. #define LIGHT_CH3_INVERSE 0
  818. #define LIGHT_CH4_INVERSE 0
  819. // IR
  820. #define IR_SUPPORT 1
  821. #define IR_PIN 4
  822. #define IR_BUTTON_SET 1
  823. // -----------------------------------------------------------------------------
  824. // HUACANXING H801 & H802
  825. // -----------------------------------------------------------------------------
  826. #elif defined(HUACANXING_H801)
  827. // Info
  828. #define MANUFACTURER "HUACANXING"
  829. #define DEVICE "H801"
  830. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  831. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  832. #define DUMMY_RELAY_COUNT 1
  833. #define DEBUG_PORT Serial1
  834. #define SERIAL_RX_ENABLED 1
  835. // LEDs
  836. #define LED1_PIN 5
  837. #define LED1_PIN_INVERSE 1
  838. // Light
  839. #define LIGHT_CHANNELS 5
  840. #define LIGHT_CH1_PIN 15 // RED
  841. #define LIGHT_CH2_PIN 13 // GREEN
  842. #define LIGHT_CH3_PIN 12 // BLUE
  843. #define LIGHT_CH4_PIN 14 // WHITE1
  844. #define LIGHT_CH5_PIN 4 // WHITE2
  845. #define LIGHT_CH1_INVERSE 0
  846. #define LIGHT_CH2_INVERSE 0
  847. #define LIGHT_CH3_INVERSE 0
  848. #define LIGHT_CH4_INVERSE 0
  849. #define LIGHT_CH5_INVERSE 0
  850. #elif defined(HUACANXING_H802)
  851. // Info
  852. #define MANUFACTURER "HUACANXING"
  853. #define DEVICE "H802"
  854. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  855. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  856. #define DUMMY_RELAY_COUNT 1
  857. #define DEBUG_PORT Serial1
  858. #define SERIAL_RX_ENABLED 1
  859. // Light
  860. #define LIGHT_CHANNELS 4
  861. #define LIGHT_CH1_PIN 12 // RED
  862. #define LIGHT_CH2_PIN 14 // GREEN
  863. #define LIGHT_CH3_PIN 13 // BLUE
  864. #define LIGHT_CH4_PIN 15 // WHITE
  865. #define LIGHT_CH1_INVERSE 0
  866. #define LIGHT_CH2_INVERSE 0
  867. #define LIGHT_CH3_INVERSE 0
  868. #define LIGHT_CH4_INVERSE 0
  869. // -----------------------------------------------------------------------------
  870. // Jan Goedeke Wifi Relay
  871. // https://github.com/JanGoe/esp8266-wifi-relay
  872. // -----------------------------------------------------------------------------
  873. #elif defined(JANGOE_WIFI_RELAY_NC)
  874. // Info
  875. #define MANUFACTURER "JANGOE"
  876. #define DEVICE "WIFI_RELAY_NC"
  877. // Buttons
  878. #define BUTTON1_PIN 12
  879. #define BUTTON2_PIN 13
  880. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  881. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  882. #define BUTTON1_RELAY 1
  883. #define BUTTON2_RELAY 2
  884. // Relays
  885. #define RELAY1_PIN 2
  886. #define RELAY2_PIN 14
  887. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  888. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  889. #elif defined(JANGOE_WIFI_RELAY_NO)
  890. // Info
  891. #define MANUFACTURER "JANGOE"
  892. #define DEVICE "WIFI_RELAY_NO"
  893. // Buttons
  894. #define BUTTON1_PIN 12
  895. #define BUTTON2_PIN 13
  896. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  897. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  898. #define BUTTON1_RELAY 1
  899. #define BUTTON2_RELAY 2
  900. // Relays
  901. #define RELAY1_PIN 2
  902. #define RELAY2_PIN 14
  903. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  904. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  905. // -----------------------------------------------------------------------------
  906. // Jorge García Wifi+Relays Board Kit
  907. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  908. // https://github.com/jorgegarciadev/wifikit
  909. // -----------------------------------------------------------------------------
  910. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  911. // Info
  912. #define MANUFACTURER "JORGEGARCIA"
  913. #define DEVICE "WIFI_RELAYS"
  914. // Relays
  915. #define RELAY1_PIN 0
  916. #define RELAY2_PIN 2
  917. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  918. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  919. // -----------------------------------------------------------------------------
  920. // WiFi MQTT Relay / Thermostat
  921. // -----------------------------------------------------------------------------
  922. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  923. // Info
  924. #define MANUFACTURER "OPENENERGYMONITOR"
  925. #define DEVICE "MQTT_RELAY"
  926. // Buttons
  927. #define BUTTON1_PIN 0
  928. #define BUTTON1_RELAY 1
  929. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  930. // Relays
  931. #define RELAY1_PIN 12
  932. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  933. // LEDs
  934. #define LED1_PIN 16
  935. #define LED1_PIN_INVERSE 0
  936. // -----------------------------------------------------------------------------
  937. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  938. // 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
  939. // 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
  940. // -----------------------------------------------------------------------------
  941. #elif defined(WION_50055)
  942. // Currently untested, does not support energy monitoring
  943. // Info
  944. #define MANUFACTURER "WION"
  945. #define DEVICE "50055"
  946. // Buttons
  947. #define BUTTON1_PIN 13
  948. #define BUTTON1_RELAY 1
  949. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  950. // Relays
  951. #define RELAY1_PIN 15
  952. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  953. // LEDs
  954. #define LED1_PIN 2
  955. #define LED1_PIN_INVERSE 0
  956. // -----------------------------------------------------------------------------
  957. // EX-Store Wifi Relay v3.1
  958. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  959. // -----------------------------------------------------------------------------
  960. #elif defined(EXS_WIFI_RELAY_V31)
  961. // Untested
  962. // Info
  963. #define MANUFACTURER "EXS"
  964. #define DEVICE "WIFI_RELAY_V31"
  965. // Buttons
  966. #define BUTTON1_PIN 0
  967. #define BUTTON1_RELAY 1
  968. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  969. // Relays
  970. #define RELAY1_PIN 13
  971. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  972. #define RELAY1_RESET_PIN 12
  973. // -----------------------------------------------------------------------------
  974. // V9261F
  975. // -----------------------------------------------------------------------------
  976. #elif defined(GENERIC_V9261F)
  977. // Info
  978. #define MANUFACTURER "GENERIC"
  979. #define DEVICE "V9261F"
  980. #define ALEXA_SUPPORT 0
  981. // V9261F
  982. #define V9261F_SUPPORT 1
  983. #define V9261F_PIN 2
  984. #define V9261F_PIN_INVERSE 1
  985. // -----------------------------------------------------------------------------
  986. // ECH1560
  987. // -----------------------------------------------------------------------------
  988. #elif defined(GENERIC_ECH1560)
  989. // Info
  990. #define MANUFACTURER "GENERIC"
  991. #define DEVICE "ECH1560"
  992. #define ALEXA_SUPPORT 0
  993. // ECH1560
  994. #define ECH1560_SUPPORT 1
  995. #define ECH1560_CLK_PIN 4
  996. #define ECH1560_MISO_PIN 5
  997. #define ECH1560_INVERTED 0
  998. // -----------------------------------------------------------------------------
  999. // ESPLive
  1000. // https://github.com/ManCaveMade/ESP-Live
  1001. // -----------------------------------------------------------------------------
  1002. #elif defined(MANCAVEMADE_ESPLIVE)
  1003. // Info
  1004. #define MANUFACTURER "MANCAVEMADE"
  1005. #define DEVICE "ESPLIVE"
  1006. // Buttons
  1007. #define BUTTON1_PIN 4
  1008. #define BUTTON2_PIN 5
  1009. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1010. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1011. #define BUTTON1_RELAY 1
  1012. #define BUTTON2_RELAY 2
  1013. // Relays
  1014. #define RELAY1_PIN 12
  1015. #define RELAY2_PIN 13
  1016. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1017. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1018. // DS18B20
  1019. #ifndef DALLAS_SUPPORT
  1020. #define DALLAS_SUPPORT 1
  1021. #endif
  1022. #define DALLAS_PIN 2
  1023. #define DALLAS_UPDATE_INTERVAL 5000
  1024. #define TEMPERATURE_MIN_CHANGE 1.0
  1025. // -----------------------------------------------------------------------------
  1026. // QuinLED
  1027. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  1028. // -----------------------------------------------------------------------------
  1029. #elif defined(INTERMITTECH_QUINLED)
  1030. // Info
  1031. #define MANUFACTURER "INTERMITTECH"
  1032. #define DEVICE "QUINLED"
  1033. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1034. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1035. #define DUMMY_RELAY_COUNT 1
  1036. // LEDs
  1037. #define LED1_PIN 5
  1038. #define LED1_PIN_INVERSE 1
  1039. // Light
  1040. #define LIGHT_CHANNELS 2
  1041. #define LIGHT_CH1_PIN 0
  1042. #define LIGHT_CH2_PIN 2
  1043. #define LIGHT_CH1_INVERSE 0
  1044. #define LIGHT_CH2_INVERSE 0
  1045. // -----------------------------------------------------------------------------
  1046. // Arilux AL-LC06
  1047. // -----------------------------------------------------------------------------
  1048. #elif defined(ARILUX_AL_LC01)
  1049. // Info
  1050. #define MANUFACTURER "ARILUX"
  1051. #define DEVICE "AL_LC01"
  1052. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1053. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1054. #define DUMMY_RELAY_COUNT 1
  1055. // Light
  1056. #define LIGHT_CHANNELS 3
  1057. #define LIGHT_CH1_PIN 5 // RED
  1058. #define LIGHT_CH2_PIN 12 // GREEN
  1059. #define LIGHT_CH3_PIN 13 // BLUE
  1060. #define LIGHT_CH1_INVERSE 0
  1061. #define LIGHT_CH2_INVERSE 0
  1062. #define LIGHT_CH3_INVERSE 0
  1063. #elif defined(ARILUX_AL_LC02)
  1064. // Info
  1065. #define MANUFACTURER "ARILUX"
  1066. #define DEVICE "AL_LC02"
  1067. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1068. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1069. #define DUMMY_RELAY_COUNT 1
  1070. // Light
  1071. #define LIGHT_CHANNELS 4
  1072. #define LIGHT_CH1_PIN 12 // RED
  1073. #define LIGHT_CH2_PIN 5 // GREEN
  1074. #define LIGHT_CH3_PIN 13 // BLUE
  1075. #define LIGHT_CH4_PIN 15 // WHITE1
  1076. #define LIGHT_CH1_INVERSE 0
  1077. #define LIGHT_CH2_INVERSE 0
  1078. #define LIGHT_CH3_INVERSE 0
  1079. #define LIGHT_CH4_INVERSE 0
  1080. #elif defined(ARILUX_AL_LC06)
  1081. // Info
  1082. #define MANUFACTURER "ARILUX"
  1083. #define DEVICE "AL_LC06"
  1084. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1085. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1086. #define DUMMY_RELAY_COUNT 1
  1087. // Light
  1088. #define LIGHT_CHANNELS 5
  1089. #define LIGHT_CH1_PIN 14 // RED
  1090. #define LIGHT_CH2_PIN 12 // GREEN
  1091. #define LIGHT_CH3_PIN 13 // BLUE
  1092. #define LIGHT_CH4_PIN 15 // WHITE1
  1093. #define LIGHT_CH5_PIN 5 // WHITE2
  1094. #define LIGHT_CH1_INVERSE 0
  1095. #define LIGHT_CH2_INVERSE 0
  1096. #define LIGHT_CH3_INVERSE 0
  1097. #define LIGHT_CH4_INVERSE 0
  1098. #define LIGHT_CH5_INVERSE 0
  1099. #elif defined(ARILUX_AL_LC11)
  1100. // Info
  1101. #define MANUFACTURER "ARILUX"
  1102. #define DEVICE "AL_LC11"
  1103. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1104. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1105. #define DUMMY_RELAY_COUNT 1
  1106. // Light
  1107. #define LIGHT_CHANNELS 5
  1108. #define LIGHT_CH1_PIN 5 // RED
  1109. #define LIGHT_CH2_PIN 4 // GREEN
  1110. #define LIGHT_CH3_PIN 14 // BLUE
  1111. #define LIGHT_CH4_PIN 13 // WHITE1
  1112. #define LIGHT_CH5_PIN 12 // WHITE1
  1113. #define LIGHT_CH1_INVERSE 0
  1114. #define LIGHT_CH2_INVERSE 0
  1115. #define LIGHT_CH3_INVERSE 0
  1116. #define LIGHT_CH4_INVERSE 0
  1117. #define LIGHT_CH5_INVERSE 0
  1118. #elif defined(ARILUX_E27)
  1119. // Info
  1120. #define MANUFACTURER "ARILUX"
  1121. #define DEVICE "E27"
  1122. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1123. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1124. #define DUMMY_RELAY_COUNT 1
  1125. // Light
  1126. #define LIGHT_CHANNELS 4
  1127. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  1128. #define MY92XX_CHIPS 1
  1129. #define MY92XX_DI_PIN 13
  1130. #define MY92XX_DCKI_PIN 15
  1131. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1132. #define MY92XX_MAPPING 0, 1, 2, 3
  1133. // -----------------------------------------------------------------------------
  1134. // XENON SM-PW701U
  1135. // -----------------------------------------------------------------------------
  1136. #elif defined(XENON_SM_PW702U)
  1137. // Info
  1138. #define MANUFACTURER "XENON"
  1139. #define DEVICE "SM_PW702U"
  1140. // Buttons
  1141. #define BUTTON1_PIN 13
  1142. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1143. #define BUTTON1_RELAY 1
  1144. // Relays
  1145. #define RELAY1_PIN 12
  1146. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1147. // LEDs
  1148. #define LED1_PIN 4
  1149. #define LED1_PIN_INVERSE 1
  1150. // -----------------------------------------------------------------------------
  1151. // AUTHOMETION LYT8266
  1152. // https://authometion.com/shop/en/home/13-lyt8266.html
  1153. // -----------------------------------------------------------------------------
  1154. #elif defined(AUTHOMETION_LYT8266)
  1155. // Info
  1156. #define MANUFACTURER "AUTHOMETION"
  1157. #define DEVICE "LYT8266"
  1158. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1159. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1160. #define DUMMY_RELAY_COUNT 1
  1161. // Light
  1162. #define LIGHT_CHANNELS 4
  1163. #define LIGHT_CH1_PIN 13 // RED
  1164. #define LIGHT_CH2_PIN 12 // GREEN
  1165. #define LIGHT_CH3_PIN 14 // BLUE
  1166. #define LIGHT_CH4_PIN 2 // WHITE
  1167. #define LIGHT_CH1_INVERSE 0
  1168. #define LIGHT_CH2_INVERSE 0
  1169. #define LIGHT_CH3_INVERSE 0
  1170. #define LIGHT_CH4_INVERSE 0
  1171. #define LIGHT_ENABLE_PIN 15
  1172. #elif defined(GIZWITS_WITTY_CLOUD)
  1173. // Info
  1174. #define MANUFACTURER "GIZWITS"
  1175. #define DEVICE "WITTY_CLOUD"
  1176. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1177. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1178. #define DUMMY_RELAY_COUNT 1
  1179. // Buttons
  1180. #define BUTTON1_PIN 4
  1181. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1182. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  1183. #define BUTTON1_CLICK BUTTON_MODE_NONE
  1184. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1185. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1186. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  1187. #define ANALOG_SUPPORT 1
  1188. // LEDs
  1189. #define LED1_PIN 2 // BLUE build-in
  1190. #define LED1_PIN_INVERSE 1
  1191. // Light
  1192. #define LIGHT_CHANNELS 3
  1193. #define LIGHT_CH1_PIN 15 // RED
  1194. #define LIGHT_CH2_PIN 12 // GREEN
  1195. #define LIGHT_CH3_PIN 13 // BLUE
  1196. #define LIGHT_CH1_INVERSE 0
  1197. #define LIGHT_CH2_INVERSE 0
  1198. #define LIGHT_CH3_INVERSE 0
  1199. // -----------------------------------------------------------------------------
  1200. // KMC 70011
  1201. // https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
  1202. // -----------------------------------------------------------------------------
  1203. #elif defined(KMC_70011)
  1204. // Info
  1205. #define MANUFACTURER "KMC"
  1206. #define DEVICE "70011"
  1207. // Buttons
  1208. #define BUTTON1_PIN 0
  1209. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1210. #define BUTTON1_RELAY 1
  1211. // Relays
  1212. #define RELAY1_PIN 14
  1213. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1214. // LEDs
  1215. #define LED1_PIN 13
  1216. #define LED1_PIN_INVERSE 0
  1217. // HLW8012
  1218. #ifndef HLW8012_SUPPORT
  1219. #define HLW8012_SUPPORT 1
  1220. #endif
  1221. #define HLW8012_SEL_PIN 12
  1222. #define HLW8012_CF1_PIN 5
  1223. #define HLW8012_CF_PIN 4
  1224. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1225. // -----------------------------------------------------------------------------
  1226. // Euromate (?) Wifi Stecker Shuko
  1227. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  1228. // Thanks to @Geitde
  1229. // -----------------------------------------------------------------------------
  1230. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  1231. // Info
  1232. #define MANUFACTURER "EUROMATE"
  1233. #define DEVICE "WIFI_STECKER_SCHUKO"
  1234. // Buttons
  1235. #define BUTTON1_PIN 14
  1236. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1237. #define BUTTON1_RELAY 1
  1238. // The relay in the device is not a bistable (latched) relay.
  1239. // The device is reported to have a flip-flop circuit to drive the relay
  1240. // So @Geitde hack is still the only possible
  1241. // Hack: drive GPIO12 low and use GPIO5 as normal relay pin:
  1242. #define RELAY1_PIN 5
  1243. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1244. #define LED2_PIN 12 /* DUMMY: exploit default off state for GPIO12=low */
  1245. #define LED2_PIN_INVERSE 0
  1246. // LEDs
  1247. #define LED1_PIN 4
  1248. #define LED1_PIN_INVERSE 0
  1249. // -----------------------------------------------------------------------------
  1250. // Generic 8CH
  1251. // -----------------------------------------------------------------------------
  1252. #elif defined(GENERIC_8CH)
  1253. // Info
  1254. #define MANUFACTURER "GENERIC"
  1255. #define DEVICE "8CH"
  1256. // Relays
  1257. #define RELAY1_PIN 0
  1258. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1259. #define RELAY2_PIN 2
  1260. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1261. #define RELAY3_PIN 4
  1262. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1263. #define RELAY4_PIN 5
  1264. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1265. #define RELAY5_PIN 12
  1266. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1267. #define RELAY6_PIN 13
  1268. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  1269. #define RELAY7_PIN 14
  1270. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  1271. #define RELAY8_PIN 15
  1272. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  1273. // -----------------------------------------------------------------------------
  1274. // STM RELAY
  1275. // -----------------------------------------------------------------------------
  1276. #elif defined(STM_RELAY)
  1277. // Info
  1278. #define MANUFACTURER "STM_RELAY"
  1279. #define DEVICE "2CH"
  1280. // Relays
  1281. #define DUMMY_RELAY_COUNT 2
  1282. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  1283. // Remove UART noise on serial line
  1284. #define DEBUG_SERIAL_SUPPORT 0
  1285. // -----------------------------------------------------------------------------
  1286. // Tonbux Powerstrip02
  1287. // -----------------------------------------------------------------------------
  1288. #elif defined(TONBUX_POWERSTRIP02)
  1289. // Info
  1290. #define MANUFACTURER "TONBUX"
  1291. #define DEVICE "POWERSTRIP02"
  1292. // Buttons
  1293. #define BUTTON1_PIN 5
  1294. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1295. #define BUTTON1_RELAY 0
  1296. // Relays
  1297. #define RELAY1_PIN 4
  1298. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1299. #define RELAY2_PIN 13
  1300. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1301. #define RELAY3_PIN 12
  1302. #define RELAY3_TYPE RELAY_TYPE_INVERSE
  1303. #define RELAY4_PIN 14
  1304. #define RELAY4_TYPE RELAY_TYPE_INVERSE
  1305. // Not a relay. USB ports on/off
  1306. #define RELAY5_PIN 16
  1307. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1308. // LEDs
  1309. #define LED1_PIN 0 // 1 blue led
  1310. #define LED1_PIN_INVERSE 1
  1311. #define LED2_PIN 3 // 3 red leds
  1312. #define LED2_PIN_INVERSE 1
  1313. // -----------------------------------------------------------------------------
  1314. // Lingan SWA1
  1315. // -----------------------------------------------------------------------------
  1316. #elif defined(LINGAN_SWA1)
  1317. // Info
  1318. #define MANUFACTURER "LINGAN"
  1319. #define DEVICE "SWA1"
  1320. // Buttons
  1321. #define BUTTON1_PIN 13
  1322. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1323. #define BUTTON1_RELAY 1
  1324. // Relays
  1325. #define RELAY1_PIN 5
  1326. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1327. // LEDs
  1328. #define LED1_PIN 4
  1329. #define LED1_PIN_INVERSE 1
  1330. // -----------------------------------------------------------------------------
  1331. // HEYGO HY02
  1332. // -----------------------------------------------------------------------------
  1333. #elif defined(HEYGO_HY02)
  1334. // Info
  1335. #define MANUFACTURER "HEYGO"
  1336. #define DEVICE "HY02"
  1337. // Buttons
  1338. #define BUTTON1_PIN 13
  1339. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1340. #define BUTTON1_RELAY 1
  1341. // Relays
  1342. #define RELAY1_PIN 12
  1343. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1344. // LEDs
  1345. #define LED1_PIN 4
  1346. #define LED1_PIN_INVERSE 0
  1347. // -----------------------------------------------------------------------------
  1348. // Maxcio W-US002S
  1349. // -----------------------------------------------------------------------------
  1350. #elif defined(MAXCIO_WUS002S)
  1351. // Info
  1352. #define MANUFACTURER "MAXCIO"
  1353. #define DEVICE "WUS002S"
  1354. // Buttons
  1355. #define BUTTON1_PIN 2
  1356. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1357. #define BUTTON1_RELAY 1
  1358. // Relays
  1359. #define RELAY1_PIN 13
  1360. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1361. // LEDs
  1362. #define LED1_PIN 3
  1363. #define LED1_PIN_INVERSE 0
  1364. // HLW8012
  1365. #ifndef HLW8012_SUPPORT
  1366. #define HLW8012_SUPPORT 1
  1367. #endif
  1368. #define HLW8012_SEL_PIN 12
  1369. #define HLW8012_CF1_PIN 5
  1370. #define HLW8012_CF_PIN 4
  1371. #define HLW8012_CURRENT_R 0.002 // Current resistor
  1372. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1373. // -----------------------------------------------------------------------------
  1374. // YiDian XS-SSA05
  1375. // -----------------------------------------------------------------------------
  1376. #elif defined(YIDIAN_XSSSA05)
  1377. // Info
  1378. #define MANUFACTURER "YIDIAN"
  1379. #define DEVICE "XSSSA05"
  1380. // Buttons
  1381. #define BUTTON1_PIN 13
  1382. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1383. #define BUTTON1_RELAY 1
  1384. // Relays
  1385. #define RELAY1_PIN 12
  1386. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1387. // LEDs
  1388. #define LED1_PIN 4
  1389. #define LED1_PIN_INVERSE 0
  1390. // HLW8012
  1391. #ifndef HLW8012_SUPPORT
  1392. #define HLW8012_SUPPORT 1
  1393. #endif
  1394. #define HLW8012_SEL_PIN 3
  1395. #define HLW8012_CF1_PIN 14
  1396. #define HLW8012_CF_PIN 5
  1397. #define HLW8012_CURRENT_R 0.001 // Current resistor
  1398. #define HLW8012_VOLTAGE_R_UP ( 2 * 1200000 ) // Upstream voltage resistor
  1399. // -----------------------------------------------------------------------------
  1400. // TONBUX XS-SSA06
  1401. // -----------------------------------------------------------------------------
  1402. #elif defined(TONBUX_XSSSA06)
  1403. // Info
  1404. #define MANUFACTURER "TONBUX"
  1405. #define DEVICE "XSSSA06"
  1406. // Buttons
  1407. #define BUTTON1_PIN 13
  1408. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1409. #define BUTTON1_RELAY 1
  1410. // Relays
  1411. #define RELAY1_PIN 15
  1412. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1413. // LEDs
  1414. #define LED1_PIN 0 // R - 8 rgb led ring
  1415. #define LED1_PIN_INVERSE 0
  1416. #define LED2_PIN 5 // G
  1417. #define LED2_PIN_INVERSE 0
  1418. #define LED3_PIN 2 // B
  1419. #define LED3_PIN_INVERSE 0
  1420. // -----------------------------------------------------------------------------
  1421. // GREEN ESP8266 RELAY MODULE
  1422. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1423. // -----------------------------------------------------------------------------
  1424. #elif defined(GREEN_ESP8266RELAY)
  1425. // Info
  1426. #define MANUFACTURER "GREEN"
  1427. #define DEVICE "ESP8266RELAY"
  1428. // Buttons
  1429. // Not a button but input via Optocoupler
  1430. #define BUTTON1_PIN 5
  1431. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1432. #define BUTTON1_RELAY 1
  1433. // Relays
  1434. #define RELAY1_PIN 4
  1435. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1436. // LEDs
  1437. #define LED1_PIN 2
  1438. #define LED1_PIN_INVERSE 1
  1439. // -----------------------------------------------------------------------------
  1440. // Henrique Gravina ESPIKE
  1441. // https://github.com/Henriquegravina/Espike
  1442. // -----------------------------------------------------------------------------
  1443. #elif defined(IKE_ESPIKE)
  1444. #define MANUFACTURER "IKE"
  1445. #define DEVICE "ESPIKE"
  1446. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1447. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1448. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1449. #define BUTTON1_PIN 13
  1450. #define BUTTON1_RELAY 1
  1451. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1452. #define BUTTON2_PIN 12
  1453. #define BUTTON2_RELAY 2
  1454. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1455. #define BUTTON3_PIN 14
  1456. #define BUTTON3_RELAY 3
  1457. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1458. #define RELAY1_PIN 4
  1459. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1460. #define RELAY2_PIN 5
  1461. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1462. #define RELAY3_PIN 16
  1463. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1464. #define LED1_PIN 2
  1465. #define LED1_PIN_INVERSE 1
  1466. // -----------------------------------------------------------------------------
  1467. // SWIFITCH
  1468. // https://github.com/ArnieX/swifitch
  1469. // -----------------------------------------------------------------------------
  1470. #elif defined(ARNIEX_SWIFITCH)
  1471. // Info
  1472. #define MANUFACTURER "ARNIEX"
  1473. #define DEVICE "SWIFITCH"
  1474. // Buttons
  1475. #define BUTTON1_PIN 4 // D2
  1476. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1477. #define BUTTON1_RELAY 1
  1478. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1479. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1480. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1481. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1482. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1483. // Relays
  1484. #define RELAY1_PIN 5 // D1
  1485. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1486. // LEDs
  1487. #define LED1_PIN 12 // D6
  1488. #define LED1_PIN_INVERSE 1
  1489. // -----------------------------------------------------------------------------
  1490. // ESP-01S RELAY v4.0
  1491. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  1492. // -----------------------------------------------------------------------------
  1493. #elif defined(GENERIC_ESP01S_RELAY_V40)
  1494. // Info
  1495. #define MANUFACTURER "GENERIC"
  1496. #define DEVICE "ESP01S_RELAY_40"
  1497. // Relays
  1498. #define RELAY1_PIN 0
  1499. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1500. // LEDs
  1501. #define LED1_PIN 2
  1502. #define LED1_PIN_INVERSE 0
  1503. // -----------------------------------------------------------------------------
  1504. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  1505. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  1506. // -----------------------------------------------------------------------------
  1507. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  1508. // Info
  1509. #define MANUFACTURER "GENERIC"
  1510. #define DEVICE "ESP01S_RGBLED_10"
  1511. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  1512. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  1513. // Buttons
  1514. //#define BUTTON1_PIN 2
  1515. // Relays
  1516. //#define RELAY1_PIN 2
  1517. // LEDs
  1518. #define LED1_PIN 2
  1519. #define LED1_PIN_INVERSE 0
  1520. // -----------------------------------------------------------------------------
  1521. // ESP-01S DHT11 v1.0
  1522. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  1523. // -----------------------------------------------------------------------------
  1524. #elif defined(GENERIC_ESP01S_DHT11_V10)
  1525. // Info
  1526. #define MANUFACTURER "GENERIC"
  1527. #define DEVICE "ESP01S_DHT11_10"
  1528. // DHT11
  1529. #ifndef DHT_SUPPORT
  1530. #define DHT_SUPPORT 1
  1531. #endif
  1532. #define DHT_PIN 2
  1533. #define DHT_TYPE DHT_CHIP_DHT11
  1534. // -----------------------------------------------------------------------------
  1535. // ESP-01S DS18B20 v1.0
  1536. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  1537. // -----------------------------------------------------------------------------
  1538. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  1539. // Info
  1540. #define MANUFACTURER "GENERIC"
  1541. #define DEVICE "ESP01S_DS18B20_10"
  1542. // DB18B20
  1543. #ifndef DALLAS_SUPPORT
  1544. #define DALLAS_SUPPORT 1
  1545. #endif
  1546. #define DALLAS_PIN 2
  1547. // -----------------------------------------------------------------------------
  1548. // ESP-DIN relay board V1
  1549. // https://github.com/pilotak/esp_din
  1550. // -----------------------------------------------------------------------------
  1551. #elif defined(PILOTAK_ESP_DIN_V1)
  1552. // Info
  1553. #define MANUFACTURER "PILOTAK"
  1554. #define DEVICE "ESP_DIN_V1"
  1555. // Buttons
  1556. #define BUTTON1_PIN 0
  1557. #define BUTTON1_RELAY 1
  1558. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1559. // Relays
  1560. #define RELAY1_PIN 4
  1561. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1562. #define RELAY2_PIN 5
  1563. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1564. // LEDs
  1565. #define LED1_PIN 15
  1566. #define LED1_PIN_INVERSE 0
  1567. #define I2C_SDA_PIN 12
  1568. #define I2C_SCL_PIN 13
  1569. #ifndef DALLAS_SUPPORT
  1570. #define DALLAS_SUPPORT 1
  1571. #endif
  1572. #define DALLAS_PIN 2
  1573. #ifndef RF_SUPPORT
  1574. #define RF_SUPPORT 1
  1575. #endif
  1576. #define RF_PIN 14
  1577. #ifndef DIGITAL_SUPPORT
  1578. #define DIGITAL_SUPPORT 1
  1579. #endif
  1580. #define DIGITAL_PIN 16
  1581. #define DIGITAL_PIN_MODE INPUT
  1582. // -----------------------------------------------------------------------------
  1583. // Heltec Touch Relay
  1584. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  1585. // -----------------------------------------------------------------------------
  1586. #elif defined(HELTEC_TOUCHRELAY)
  1587. // Info
  1588. #define MANUFACTURER "HELTEC"
  1589. #define DEVICE "TOUCH_RELAY"
  1590. // Buttons
  1591. #define BUTTON1_PIN 14
  1592. #define BUTTON1_RELAY 1
  1593. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1594. // Relays
  1595. #define RELAY1_PIN 12
  1596. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1597. // -----------------------------------------------------------------------------
  1598. // Zhilde ZLD-EU44-W
  1599. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  1600. // -----------------------------------------------------------------------------
  1601. #elif defined(ZHILDE_EU44_W)
  1602. // Info
  1603. #define MANUFACTURER "ZHILDE"
  1604. #define DEVICE "EU44_W"
  1605. // Based on the reporter, this product uses GPIO1 and 3 for the button
  1606. // and onboard LED, so hardware serial should be disabled...
  1607. #define DEBUG_SERIAL_SUPPORT 0
  1608. // Buttons
  1609. #define BUTTON1_PIN 3
  1610. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1611. // Relays
  1612. #define RELAY1_PIN 5
  1613. #define RELAY2_PIN 4
  1614. #define RELAY3_PIN 12
  1615. #define RELAY4_PIN 13
  1616. #define RELAY5_PIN 14
  1617. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1618. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1619. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1620. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1621. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1622. // LEDs
  1623. #define LED1_PIN 1
  1624. #define LED1_PIN_INVERSE 1
  1625. // -----------------------------------------------------------------------------
  1626. // Allnet 4duino ESP8266-UP-Relais
  1627. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  1628. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  1629. // -----------------------------------------------------------------------------
  1630. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  1631. // Info
  1632. #define MANUFACTURER "ALLNET"
  1633. #define DEVICE "4DUINO_IOT_WLAN_RELAIS"
  1634. // Relays
  1635. #define RELAY1_PIN 14
  1636. #define RELAY1_RESET_PIN 12
  1637. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1638. // LEDs
  1639. #define LED1_PIN 0
  1640. #define LED1_PIN_INVERSE 1
  1641. // Buttons
  1642. //#define BUTTON1_PIN 0
  1643. //#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1644. // Using pins labelled as SDA & SCL as buttons
  1645. #define BUTTON2_PIN 4
  1646. #define BUTTON2_MODE BUTTON_PUSHBUTTON
  1647. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  1648. #define BUTTON2_CLICK BUTTON_MODE_NONE
  1649. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  1650. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  1651. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  1652. #define BUTTON3_PIN 5
  1653. #define BUTTON3_MODE BUTTON_PUSHBUTTON
  1654. // Using pins labelled as SDA & SCL for I2C
  1655. //#define I2C_SDA_PIN 4
  1656. //#define I2C_SCL_PIN 5
  1657. // -----------------------------------------------------------------------------
  1658. // Luani HVIO
  1659. // https://luani.de/projekte/esp8266-hvio/
  1660. // https://luani.de/blog/esp8266-230v-io-modul/
  1661. // -----------------------------------------------------------------------------
  1662. #elif defined(LUANI_HVIO)
  1663. // Info
  1664. #define MANUFACTURER "LUANI"
  1665. #define DEVICE "HVIO"
  1666. // Buttons
  1667. #define BUTTON1_PIN 12
  1668. #define BUTTON1_RELAY 1
  1669. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1670. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1671. #define BUTTON2_PIN 13
  1672. #define BUTTON2_RELAY 2
  1673. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1674. // Relays
  1675. #define RELAY1_PIN 4
  1676. #define RELAY2_PIN 5
  1677. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1678. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1679. // LEDs
  1680. #define LED1_PIN 15
  1681. #define LED1_PIN_INVERSE 0
  1682. // -----------------------------------------------------------------------------
  1683. // Tonbux 50-100M Smart Mosquito Killer USB
  1684. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  1685. // -----------------------------------------------------------------------------
  1686. #elif defined(TONBUX_MOSQUITO_KILLER)
  1687. // Info
  1688. #define MANUFACTURER "TONBUX"
  1689. #define DEVICE "MOSQUITO_KILLER"
  1690. // Buttons
  1691. #define BUTTON1_PIN 2
  1692. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1693. #define BUTTON1_RELAY 1
  1694. // Relays
  1695. #define RELAY1_PIN 5 // not a relay, fan
  1696. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1697. // LEDs
  1698. #define LED1_PIN 15 // blue led
  1699. #define LED1_PIN_INVERSE 1
  1700. #define LED1_MODE LED_MODE_WIFI
  1701. #define LED2_PIN 14 // red led
  1702. #define LED2_PIN_INVERSE 1
  1703. #define LED2_MODE LED_MODE_RELAY
  1704. #define LED3_PIN 12 // UV leds (1-2-3-4-5-6-7-8)
  1705. #define LED3_PIN_INVERSE 0
  1706. #define LED3_RELAY 1
  1707. #define LED4_PIN 16 // UV leds (9-10-11)
  1708. #define LED4_PIN_INVERSE 0
  1709. #define LED4_RELAY 1
  1710. // -----------------------------------------------------------------------------
  1711. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  1712. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  1713. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  1714. // -----------------------------------------------------------------------------
  1715. #elif defined(NEO_COOLCAM_NAS_WR01W)
  1716. // Info
  1717. #define MANUFACTURER "NEO_COOLCAM"
  1718. #define DEVICE "NAS_WR01W"
  1719. // Buttons
  1720. #define BUTTON1_PIN 13
  1721. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1722. #define BUTTON1_RELAY 1
  1723. // Relays
  1724. #define RELAY1_PIN 12
  1725. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1726. // LEDs
  1727. #define LED1_PIN 4
  1728. #define LED1_PIN_INVERSE 1
  1729. // ------------------------------------------------------------------------------
  1730. // Estink Wifi Power Strip
  1731. // https://www.amazon.de/Steckdosenleiste-Ladeger%C3%A4t-Sprachsteuerung-SmartphonesTablets-Android/dp/B0796W5FZY
  1732. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  1733. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  1734. // -----------------------------------------------------------------------------
  1735. #elif defined(ESTINK_WIFI_POWER_STRIP)
  1736. // Info
  1737. #define MANUFACTURER "ESTINK"
  1738. #define DEVICE "WIFI_POWER_STRIP"
  1739. // Disable UART noise since this board uses GPIO3
  1740. #define DEBUG_SERIAL_SUPPORT 0
  1741. // Buttons
  1742. #define BUTTON1_PIN 16
  1743. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1744. #define BUTTON1_RELAY 4
  1745. // Relays
  1746. #define RELAY1_PIN 14 // USB power
  1747. #define RELAY2_PIN 13 // power plug 1
  1748. #define RELAY3_PIN 4 // power plug 2
  1749. #define RELAY4_PIN 15 // power plug 3
  1750. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1751. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1752. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1753. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1754. // LEDs
  1755. #define LED1_PIN 0 // power led
  1756. #define LED2_PIN 12 // power plug 1
  1757. #define LED3_PIN 3 // power plug 2
  1758. #define LED4_PIN 5 // power plug 3
  1759. #define LED1_PIN_INVERSE 1
  1760. #define LED2_PIN_INVERSE 1
  1761. #define LED3_PIN_INVERSE 1
  1762. #define LED4_PIN_INVERSE 1
  1763. #define LED1_MODE LED_MODE_FINDME
  1764. #define LED2_MODE LED_MODE_FOLLOW
  1765. #define LED3_MODE LED_MODE_FOLLOW
  1766. #define LED4_MODE LED_MODE_FOLLOW
  1767. #define LED2_RELAY 2
  1768. #define LED3_RELAY 3
  1769. #define LED4_RELAY 4
  1770. // -----------------------------------------------------------------------------
  1771. // Bruno Horta's OnOfre
  1772. // https://www.bhonofre.pt/
  1773. // https://github.com/brunohorta82/BH_OnOfre/
  1774. // -----------------------------------------------------------------------------
  1775. #elif defined(BH_ONOFRE)
  1776. // Info
  1777. #define MANUFACTURER "BH"
  1778. #define DEVICE "ONOFRE"
  1779. // Buttons
  1780. #define BUTTON1_PIN 12
  1781. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1782. #define BUTTON1_RELAY 1
  1783. #define BUTTON2_PIN 13
  1784. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1785. #define BUTTON2_RELAY 2
  1786. // Relays
  1787. #define RELAY1_PIN 4
  1788. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1789. #define RELAY2_PIN 5
  1790. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1791. // -----------------------------------------------------------------------------
  1792. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  1793. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  1794. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  1795. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  1796. // * Goosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  1797. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  1798. // -----------------------------------------------------------------------------
  1799. #elif defined(BLITZWOLF_BWSHP2)
  1800. // Info
  1801. #define MANUFACTURER "BLITZWOLF"
  1802. #define DEVICE "BWSHP2"
  1803. // Buttons
  1804. #define BUTTON1_PIN 13
  1805. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1806. #define BUTTON1_RELAY 1
  1807. // Relays
  1808. #define RELAY1_PIN 15
  1809. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1810. // LEDs
  1811. #define LED1_PIN 2
  1812. #define LED1_PIN_INVERSE 1
  1813. #define LED2_PIN 0
  1814. #define LED2_PIN_INVERSE 1
  1815. #define LED2_MODE LED_MODE_FINDME
  1816. #define LED2_RELAY 1
  1817. // HJL01 / BL0937
  1818. #ifndef HLW8012_SUPPORT
  1819. #define HLW8012_SUPPORT 1
  1820. #endif
  1821. #define HLW8012_SEL_PIN 12
  1822. #define HLW8012_CF1_PIN 14
  1823. #define HLW8012_CF_PIN 5
  1824. #define HLW8012_SEL_CURRENT LOW
  1825. #define HLW8012_CURRENT_RATIO 25740
  1826. #define HLW8012_VOLTAGE_RATIO 313400
  1827. #define HLW8012_POWER_RATIO 3414290
  1828. #define HLW8012_INTERRUPT_ON FALLING
  1829. // -----------------------------------------------------------------------------
  1830. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  1831. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  1832. // -----------------------------------------------------------------------------
  1833. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  1834. // Info
  1835. #define MANUFACTURER "VANZAVANZU"
  1836. #define DEVICE "SMART_WIFI_PLUG_MINI"
  1837. // Buttons
  1838. #define BUTTON1_PIN 13
  1839. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1840. #define BUTTON1_RELAY 1
  1841. // Relays
  1842. #define RELAY1_PIN 15
  1843. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1844. // LEDs
  1845. #define LED1_PIN 2
  1846. #define LED1_PIN_INVERSE 1
  1847. #define LED2_PIN 0
  1848. #define LED2_PIN_INVERSE 1
  1849. #define LED2_MODE LED_MODE_FINDME
  1850. #define LED2_RELAY 1
  1851. // Disable UART noise
  1852. #define DEBUG_SERIAL_SUPPORT 0
  1853. // HJL01 / BL0937
  1854. #ifndef HLW8012_SUPPORT
  1855. #define HLW8012_SUPPORT 1
  1856. #endif
  1857. #define HLW8012_SEL_PIN 3
  1858. #define HLW8012_CF1_PIN 14
  1859. #define HLW8012_CF_PIN 5
  1860. #define HLW8012_SEL_CURRENT LOW
  1861. #define HLW8012_CURRENT_RATIO 25740
  1862. #define HLW8012_VOLTAGE_RATIO 313400
  1863. #define HLW8012_POWER_RATIO 3414290
  1864. #define HLW8012_INTERRUPT_ON FALLING
  1865. // -----------------------------------------------------------------------------
  1866. // TEST boards (do not use!!)
  1867. // -----------------------------------------------------------------------------
  1868. #elif defined(TRAVIS01)
  1869. // Info
  1870. #define MANUFACTURER "TravisCI"
  1871. #define DEVICE "Virtual board 01"
  1872. // Some buttons - pin 0
  1873. #define BUTTON1_PIN 0
  1874. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1875. #define BUTTON1_RELAY 1
  1876. // Some relays - pin 1
  1877. #define RELAY1_PIN 1
  1878. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1879. // Some LEDs - pin 2
  1880. #define LED1_PIN 2
  1881. #define LED1_PIN_INVERSE 1
  1882. // A bit of I2C - pins 3,4
  1883. #define I2C_SDA_PIN 3
  1884. #define I2C_SCL_PIN 4
  1885. // And, as they say in "From Dusk till Dawn":
  1886. // This is a sensor blow out!
  1887. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  1888. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  1889. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  1890. // C'mon, you want sensor, come on in sensor lovers!
  1891. // If we don’t got it, you don't want it!
  1892. #define AM2320_SUPPORT 1
  1893. #define BH1750_SUPPORT 1
  1894. #define BMX280_SUPPORT 1
  1895. #define SHT3X_I2C_SUPPORT 1
  1896. #define EMON_ADC121_SUPPORT 1
  1897. #define EMON_ADS1X15_SUPPORT 1
  1898. #define SHT3X_I2C_SUPPORT 1
  1899. #define SI7021_SUPPORT 1
  1900. #define PMSX003_SUPPORT 1
  1901. #define SENSEAIR_SUPPORT 1
  1902. // A bit of lights - pin 5
  1903. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1904. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1905. #define DUMMY_RELAY_COUNT 1
  1906. #define LIGHT_CHANNELS 1
  1907. #define LIGHT_CH1_PIN 5
  1908. #define LIGHT_CH1_INVERSE 0
  1909. // A bit of HLW8012 - pins 6,7,8
  1910. #ifndef HLW8012_SUPPORT
  1911. #define HLW8012_SUPPORT 1
  1912. #endif
  1913. #define HLW8012_SEL_PIN 6
  1914. #define HLW8012_CF1_PIN 7
  1915. #define HLW8012_CF_PIN 8
  1916. // A bit of Dallas - pin 9
  1917. #ifndef DALLAS_SUPPORT
  1918. #define DALLAS_SUPPORT 1
  1919. #endif
  1920. #define DALLAS_PIN 9
  1921. // A bit of ECH1560 - pins 10,11, 12
  1922. #ifndef ECH1560_SUPPORT
  1923. #define ECH1560_SUPPORT 1
  1924. #endif
  1925. #define ECH1560_CLK_PIN 10
  1926. #define ECH1560_MISO_PIN 11
  1927. #define ECH1560_INVERTED 12
  1928. #elif defined(TRAVIS02)
  1929. // Relay provider dual
  1930. #define MANUFACTURER "TravisCI"
  1931. #define DEVICE "Virtual board 02"
  1932. // A bit of CSE7766 - pin 1
  1933. #ifndef CSE7766_SUPPORT
  1934. #define CSE7766_SUPPORT 1
  1935. #endif
  1936. #define CSE7766_PIN 1
  1937. // Relay type dual - pins 2,3
  1938. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  1939. #define RELAY1_PIN 2
  1940. #define RELAY2_PIN 3
  1941. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1942. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1943. // IR - pin 4
  1944. #define IR_SUPPORT 1
  1945. #define IR_PIN 4
  1946. #define IR_BUTTON_SET 1
  1947. // A bit of DHT - pin 5
  1948. #ifndef DHT_SUPPORT
  1949. #define DHT_SUPPORT 1
  1950. #endif
  1951. #define DHT_PIN 5
  1952. // A bit of TMP3X (analog)
  1953. #define TMP3X_SUPPORT 1
  1954. // A bit of EVENTS - pin 10
  1955. #define EVENTS_SUPPORT 1
  1956. #define EVENTS_PIN 6
  1957. // HC-RS04
  1958. #define HCSR04_SUPPORT 1
  1959. #define HCSR04_TRIGGER 7
  1960. #define HCSR04_ECHO 8
  1961. // MHZ19
  1962. #define MHZ19_SUPPORT 1
  1963. #define MHZ19_RX_PIN 9
  1964. #define MHZ19_TX_PIN 10
  1965. // PZEM004T
  1966. #define PZEM004T_SUPPORT 1
  1967. #define PZEM004T_RX_PIN 11
  1968. #define PZEM004T_TX_PIN 12
  1969. // V9261F
  1970. #define V9261F_SUPPORT 1
  1971. #define V9261F_PIN 13
  1972. // GUVAS12SD
  1973. #define GUVAS12SD_SUPPORT 1
  1974. #define GUVAS12SD_PIN 14
  1975. // Test non-default modules
  1976. #define MDNS_CLIENT_SUPPORT 1
  1977. #define NOFUSS_SUPPORT 1
  1978. #define UART_MQTT_SUPPORT 1
  1979. #define INFLUXDB_SUPPORT 1
  1980. #define IR_SUPPORT 1
  1981. #elif defined(TRAVIS03)
  1982. // Relay provider light/my92XX
  1983. #define MANUFACTURER "TravisCI"
  1984. #define DEVICE "Virtual board 03"
  1985. // MY9231 Light - pins 1,2
  1986. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1987. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1988. #define DUMMY_RELAY_COUNT 1
  1989. #define LIGHT_CHANNELS 5
  1990. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  1991. #define MY92XX_CHIPS 2
  1992. #define MY92XX_DI_PIN 1
  1993. #define MY92XX_DCKI_PIN 2
  1994. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1995. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  1996. // A bit of Analog EMON (analog)
  1997. #ifndef EMON_ANALOG_SUPPORT
  1998. #define EMON_ANALOG_SUPPORT 1
  1999. #endif
  2000. // Test non-default modules
  2001. #define LLMNR_SUPPORT 1
  2002. #define NETBIOS_SUPPORT 1
  2003. #define SSDP_SUPPORT 1
  2004. #endif
  2005. // -----------------------------------------------------------------------------
  2006. // Check definitions
  2007. // -----------------------------------------------------------------------------
  2008. #if not defined(MANUFACTURER) || not defined(DEVICE)
  2009. #error "UNSUPPORTED HARDWARE!!"
  2010. #endif