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.

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