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.

2690 lines
85 KiB

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