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.

2739 lines
86 KiB

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