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.

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