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.

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