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.

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