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.

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