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.

4965 lines
161 KiB

7 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
6 years ago
6 years ago
  1. // -----------------------------------------------------------------------------
  2. // Configuration HELP
  3. // -----------------------------------------------------------------------------
  4. //
  5. // Required:
  6. //
  7. // MANUFACTURER: Name of the manufacturer of the board ("string")
  8. // DEVICE: Name of the device ("string")
  9. //
  10. // For example, some configuration options for BUTTON, RELAY and LED modules.
  11. // See general.h, defaults.h and types.h for all of the available flags.
  12. //
  13. // BUTTON[1-8]_PIN: GPIO for the n-th button (1-based, up to 8 buttons)
  14. // BUTTON[1-8]_RELAY: Relay number that will be bind to the n-th button (1-based)
  15. // BUTTON[1-8]_CONFIG: Configuration mask (e.g. BUTTON_PUSHBUTTON and BUTTON_SWITCH cannot be together)
  16. // - BUTTON_PUSHBUTTON: button event is fired when released
  17. // - BUTTON_SWITCH: button event is fired when pressed or released
  18. // - BUTTON_DEFAULT_HIGH: there is a pull up in place
  19. // - BUTTON_SET_PULLUP: set pullup by software
  20. //
  21. // RELAY[1-8]_PIN: GPIO for the n-th relay (1-based, up to 8 relays)
  22. // RELAY[1-8]_TYPE: Relay can be RELAY_TYPE_NORMAL, RELAY_TYPE_INVERSE, RELAY_TYPE_LATCHED or RELAY_TYPE_LATCHED_INVERSE
  23. //
  24. // LED[1-8]_PIN: GPIO for the n-th LED (1-based, up to 8 LEDs)
  25. // LED[1-8]_PIN_INVERSE: LED has inversed logic (lit when pulled down)
  26. // LED[1-8]_MODE: Check types.h for LED_MODE_%
  27. // LED[1-8]_RELAY: Linked relay (1-based)
  28. //
  29. // Besides, other hardware specific information should be stated here
  30. #pragma once
  31. // -----------------------------------------------------------------------------
  32. // Custom hardware
  33. // -----------------------------------------------------------------------------
  34. #if defined(MANUFACTURER) and defined(DEVICE)
  35. // user has defined custom hardware, no need to check anything else
  36. // -----------------------------------------------------------------------------
  37. // ESPurna Core
  38. // -----------------------------------------------------------------------------
  39. #elif defined(ESPURNA_CORE)
  40. // This is a special device targeted to generate a light-weight binary image
  41. // meant to be able to do two-step-updates:
  42. // https://github.com/xoseperez/espurna/wiki/TwoStepUpdates
  43. // Info
  44. #define MANUFACTURER "ESPURNA"
  45. #define DEVICE "CORE"
  46. // Disable non-core modules
  47. #define ALEXA_SUPPORT 0
  48. #define API_SUPPORT 0
  49. #define BROKER_SUPPORT 0
  50. #define DEBUG_SERIAL_SUPPORT 0
  51. #define DEBUG_TELNET_SUPPORT 0
  52. #define DEBUG_WEB_SUPPORT 0
  53. #define DOMOTICZ_SUPPORT 0
  54. #define HOMEASSISTANT_SUPPORT 0
  55. #define I2C_SUPPORT 0
  56. #define MQTT_SUPPORT 0
  57. #define NTP_SUPPORT 0
  58. #define RPN_RULES_SUPPORT 0
  59. #define SCHEDULER_SUPPORT 0
  60. #define SENSOR_SUPPORT 0
  61. #define THINGSPEAK_SUPPORT 0
  62. #define WEB_SUPPORT 0
  63. // Extra light-weight image
  64. //#define BUTTON_SUPPORT 0 // don't need / have buttons
  65. //#define LED_SUPPORT 0 // don't need wifi indicator
  66. //#define RELAY_SUPPORT 0 // don't need to preserve pin state between resets
  67. //#define OTA_ARDUINOOTA_SUPPORT 0 // when only using `ota` command
  68. //#define MDNS_SERVER_SUPPORT 0 //
  69. //#define TELNET_SUPPORT 0 // when only using espota.py
  70. //#define TERMINAL_SUPPORT 0 //
  71. #elif defined(ESPURNA_CORE_WEBUI)
  72. // This is a special device with no specific hardware
  73. // with the basics to easily upgrade it to a device-specific image
  74. // Info
  75. #define MANUFACTURER "ESPURNA"
  76. #define DEVICE "CORE_WEBUI"
  77. // Disable non-core modules
  78. #define ALEXA_SUPPORT 0
  79. #define API_SUPPORT 0
  80. #define BROKER_SUPPORT 0
  81. #define DOMOTICZ_SUPPORT 0
  82. #define DEBUG_SERIAL_SUPPORT 0
  83. //#define DEBUG_TELNET_SUPPORT 0
  84. //#define DEBUG_WEB_SUPPORT 0
  85. #define HOMEASSISTANT_SUPPORT 0
  86. #define I2C_SUPPORT 0
  87. #define MQTT_SUPPORT 0
  88. #define NTP_SUPPORT 0
  89. #define SCHEDULER_SUPPORT 0
  90. #define SENSOR_SUPPORT 0
  91. #define THINGSPEAK_SUPPORT 0
  92. //#define WEB_SUPPORT 0
  93. // Extra light-weight image
  94. #define BUTTON_SUPPORT 0
  95. #define LED_SUPPORT 0
  96. //#define MDNS_SERVER_SUPPORT 0
  97. //#define TELNET_SUPPORT 0
  98. //#define TERMINAL_SUPPORT 0
  99. // -----------------------------------------------------------------------------
  100. // Development boards
  101. // -----------------------------------------------------------------------------
  102. #elif defined(NODEMCU_LOLIN)
  103. // Info
  104. #define MANUFACTURER "NODEMCU"
  105. #define DEVICE "LOLIN"
  106. // Buttons
  107. #define BUTTON1_PIN 0
  108. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  109. #define BUTTON1_RELAY 1
  110. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  111. #define RELAY1_PIN 12
  112. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  113. // Light
  114. #define LED1_PIN 2
  115. #define LED1_PIN_INVERSE 1
  116. #elif defined(NODEMCU_BASIC)
  117. // Info
  118. // Generic NodeMCU Board without any buttons or relays connected.
  119. #define MANUFACTURER "NODEMCU"
  120. #define DEVICE "BASIC"
  121. #elif defined(WEMOS_D1_MINI)
  122. // Info
  123. #define MANUFACTURER "WEMOS"
  124. #define DEVICE "D1_MINI"
  125. // Buttons
  126. // No buttons on the D1 MINI alone, but defining it without adding a button doen't create problems
  127. #define BUTTON1_PIN 0 // Connect a pushbutton between D3 and GND,
  128. // it's the same as using a Wemos one button shield
  129. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  130. #define BUTTON1_RELAY 1
  131. // LEDs
  132. #define LED1_PIN 2
  133. #define LED1_PIN_INVERSE 1
  134. #define I2C_SDA_PIN 4 // D2
  135. #define I2C_SCL_PIN 5 // D1
  136. #elif defined(WEMOS_D1_MINI_RELAYSHIELD)
  137. // Info
  138. #define MANUFACTURER "WEMOS"
  139. #define DEVICE "D1_MINI_RELAYSHIELD"
  140. // Buttons
  141. // No buttons on the D1 MINI alone, but defining it without adding a button doen't create problems
  142. #define BUTTON1_PIN 0 // Connect a pushbutton between D3 and GND,
  143. // it's the same as using a Wemos one button shield
  144. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  145. #define BUTTON1_RELAY 1
  146. // Relays
  147. #define RELAY1_PIN 5
  148. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  149. // LED
  150. #define LED1_PIN 2
  151. #define LED1_PIN_INVERSE 1
  152. // When Wemos relay shield is connected GPIO5 (D1) is used for relay,
  153. // so I2C must be remapped to other pins
  154. #define I2C_SDA_PIN 12 // D6
  155. #define I2C_SCL_PIN 14 // D5
  156. #elif defined(WEMOS_D1_TARPUNA_SHIELD)
  157. // Info
  158. #define MANUFACTURER "WEMOS"
  159. #define DEVICE "D1_TARPUNA_SHIELD"
  160. // Relays
  161. #define RELAY1_PIN 5
  162. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  163. #define DHT_SUPPORT 1
  164. #define DHT_PIN 12
  165. // -----------------------------------------------------------------------------
  166. // ESPurna
  167. // -----------------------------------------------------------------------------
  168. #elif defined(TINKERMAN_ESPURNA_H06)
  169. // Info
  170. #define MANUFACTURER "TINKERMAN"
  171. #define DEVICE "ESPURNA_H06"
  172. // Buttons
  173. #define BUTTON1_PIN 4
  174. #define BUTTON1_RELAY 1
  175. // Normal pushbutton
  176. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  177. // Relays
  178. #define RELAY1_PIN 12
  179. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  180. // LEDs
  181. #define LED1_PIN 2
  182. #define LED1_PIN_INVERSE 1
  183. // HLW8012
  184. #ifndef HLW8012_SUPPORT
  185. #define HLW8012_SUPPORT 1
  186. #endif
  187. #define HLW8012_SEL_PIN 2
  188. #define HLW8012_CF1_PIN 13
  189. #define HLW8012_CF_PIN 14
  190. #elif defined(TINKERMAN_ESPURNA_H08)
  191. // Info
  192. #define MANUFACTURER "TINKERMAN"
  193. #define DEVICE "ESPURNA_H08"
  194. // Buttons
  195. #define BUTTON1_PIN 4
  196. #define BUTTON1_RELAY 1
  197. // Normal pushbutton
  198. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  199. // Relays
  200. #define RELAY1_PIN 12
  201. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  202. // LEDs
  203. #define LED1_PIN 2
  204. #define LED1_PIN_INVERSE 0
  205. // HLW8012
  206. #ifndef HLW8012_SUPPORT
  207. #define HLW8012_SUPPORT 1
  208. #endif
  209. #define HLW8012_SEL_PIN 5
  210. #define HLW8012_CF1_PIN 13
  211. #define HLW8012_CF_PIN 14
  212. #elif defined(TINKERMAN_ESPURNA_SWITCH)
  213. // Info
  214. #define MANUFACTURER "TINKERMAN"
  215. #define DEVICE "ESPURNA_SWITCH"
  216. // Buttons
  217. #define BUTTON1_PIN 4
  218. #define BUTTON1_RELAY 1
  219. // Touch button
  220. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON
  221. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  222. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  223. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  224. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  225. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_NONE
  226. // LEDs
  227. #define LED1_PIN 2
  228. #define LED1_PIN_INVERSE 0
  229. // Relays
  230. #define RELAY1_PIN 12
  231. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  232. // Check http://tinkerman.cat/rfm69-wifi-gateway/
  233. #elif defined(TINKERMAN_RFM69GW)
  234. // Info
  235. #define MANUFACTURER "TINKERMAN"
  236. #define DEVICE "RFM69GW"
  237. // Buttons
  238. #define BUTTON1_PIN 0
  239. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  240. // RFM69GW
  241. #define RFM69_SUPPORT 1
  242. // Disable non-core modules
  243. #define ALEXA_SUPPORT 0
  244. #define DOMOTICZ_SUPPORT 0
  245. #define HOMEASSISTANT_SUPPORT 0
  246. #define I2C_SUPPORT 0
  247. #define SCHEDULER_SUPPORT 0
  248. #define SENSOR_SUPPORT 0
  249. #define THINGSPEAK_SUPPORT 0
  250. // -----------------------------------------------------------------------------
  251. // Itead Studio boards
  252. // -----------------------------------------------------------------------------
  253. #elif defined(ITEAD_SONOFF_BASIC)
  254. // Info
  255. #define MANUFACTURER "ITEAD"
  256. #define DEVICE "SONOFF_BASIC"
  257. // Buttons
  258. #define BUTTON1_PIN 0
  259. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  260. #define BUTTON1_RELAY 1
  261. #define BUTTON2_PIN 14
  262. #define BUTTON2_CONFIG BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  263. #define BUTTON2_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_RF)
  271. // Info
  272. #define MANUFACTURER "ITEAD"
  273. #define DEVICE "SONOFF_RF"
  274. // Buttons
  275. #define BUTTON1_PIN 0
  276. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  277. #define BUTTON1_RELAY 1
  278. #define BUTTON2_PIN 14
  279. #define BUTTON2_CONFIG BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  280. #define BUTTON2_RELAY 1
  281. // Relays
  282. #define RELAY1_PIN 12
  283. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  284. // LEDs
  285. #define LED1_PIN 13
  286. #define LED1_PIN_INVERSE 1
  287. #elif defined(ITEAD_SONOFF_MINI)
  288. // Info
  289. #define MANUFACTURER "ITEAD"
  290. #define DEVICE "SONOFF_MINI"
  291. // Buttons
  292. #define BUTTON1_PIN 0
  293. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  294. #define BUTTON1_RELAY 1
  295. #define BUTTON2_PIN 4
  296. #define BUTTON2_CONFIG BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  297. #define BUTTON2_RELAY 1
  298. // Relays
  299. #define RELAY1_PIN 12
  300. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  301. // LEDs
  302. #define LED1_PIN 13
  303. #define LED1_PIN_INVERSE 1
  304. #elif defined(ITEAD_SONOFF_TH)
  305. // Info
  306. #define MANUFACTURER "ITEAD"
  307. #define DEVICE "SONOFF_TH"
  308. // Buttons
  309. #define BUTTON1_PIN 0
  310. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  311. #define BUTTON1_RELAY 1
  312. // Relays
  313. #define RELAY1_PIN 12
  314. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  315. // LEDs
  316. #define LED1_PIN 13
  317. #define LED1_PIN_INVERSE 1
  318. // Jack is connected to GPIO14 (and with a small hack to GPIO4)
  319. #ifndef DALLAS_SUPPORT
  320. #define DALLAS_SUPPORT 1
  321. #endif
  322. #define DALLAS_PIN 14
  323. #ifndef DHT_SUPPORT
  324. #define DHT_SUPPORT 1
  325. #endif
  326. #define DHT_PIN 14
  327. #define DHT_TYPE DHT_CHIP_SI7021
  328. //#define I2C_SDA_PIN 4
  329. //#define I2C_SCL_PIN 14
  330. #elif defined(ITEAD_SONOFF_SV)
  331. // Info
  332. #define MANUFACTURER "ITEAD"
  333. #define DEVICE "SONOFF_SV"
  334. // Buttons
  335. #define BUTTON1_PIN 0
  336. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  337. #define BUTTON1_RELAY 1
  338. // Relays
  339. #define RELAY1_PIN 12
  340. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  341. // LEDs
  342. #define LED1_PIN 13
  343. #define LED1_PIN_INVERSE 1
  344. #elif defined(ITEAD_SLAMPHER)
  345. // Info
  346. #define MANUFACTURER "ITEAD"
  347. #define DEVICE "SLAMPHER"
  348. // Buttons
  349. #define BUTTON1_PIN 0
  350. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  351. #define BUTTON1_RELAY 1
  352. // Relays
  353. #define RELAY1_PIN 12
  354. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  355. // LEDs
  356. #define LED1_PIN 13
  357. #define LED1_PIN_INVERSE 1
  358. #elif defined(ITEAD_S20)
  359. // Info
  360. #define MANUFACTURER "ITEAD"
  361. #define DEVICE "S20"
  362. // Buttons
  363. #define BUTTON1_PIN 0
  364. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  365. #define BUTTON1_RELAY 1
  366. // Relays
  367. #define RELAY1_PIN 12
  368. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  369. // LEDs
  370. #define LED1_PIN 13
  371. #define LED1_PIN_INVERSE 1
  372. #elif defined(ITEAD_SONOFF_TOUCH)
  373. // Info
  374. #define MANUFACTURER "ITEAD"
  375. #define DEVICE "SONOFF_TOUCH"
  376. // Buttons
  377. #define BUTTON1_PIN 0
  378. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  379. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  380. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  381. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  382. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  383. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  384. #define BUTTON1_RELAY 1
  385. // Relays
  386. #define RELAY1_PIN 12
  387. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  388. // LEDs
  389. #define LED1_PIN 13
  390. #define LED1_PIN_INVERSE 1
  391. #elif defined(ITEAD_SONOFF_POW)
  392. // Info
  393. #define MANUFACTURER "ITEAD"
  394. #define DEVICE "SONOFF_POW"
  395. // Buttons
  396. #define BUTTON1_PIN 0
  397. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  398. #define BUTTON1_RELAY 1
  399. // Relays
  400. #define RELAY1_PIN 12
  401. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  402. // LEDs
  403. #define LED1_PIN 15
  404. #define LED1_PIN_INVERSE 0
  405. // HLW8012
  406. #ifndef HLW8012_SUPPORT
  407. #define HLW8012_SUPPORT 1
  408. #endif
  409. #define HLW8012_SEL_PIN 5
  410. #define HLW8012_CF1_PIN 13
  411. #define HLW8012_CF_PIN 14
  412. #elif defined(ITEAD_SONOFF_POW_R2)
  413. // Info
  414. #define MANUFACTURER "ITEAD"
  415. #define DEVICE "SONOFF_POW_R2"
  416. // Buttons
  417. #define BUTTON1_PIN 0
  418. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  419. #define BUTTON1_RELAY 1
  420. // Relays
  421. #define RELAY1_PIN 12
  422. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  423. // LEDs
  424. #define LED1_PIN 13
  425. #define LED1_PIN_INVERSE 1
  426. // Disable UART noise
  427. #define DEBUG_SERIAL_SUPPORT 0
  428. // CSE7766
  429. #ifndef CSE7766_SUPPORT
  430. #define CSE7766_SUPPORT 1
  431. #endif
  432. #define CSE7766_RX_PIN 3
  433. #elif defined(ITEAD_SONOFF_DUAL)
  434. // Info
  435. #define MANUFACTURER "ITEAD"
  436. #define DEVICE "SONOFF_DUAL"
  437. #define SERIAL_BAUDRATE 19230
  438. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  439. #define DUMMY_RELAY_COUNT 2
  440. #define DEBUG_SERIAL_SUPPORT 0
  441. // Buttons
  442. #define BUTTON1_RELAY 1
  443. #define BUTTON2_RELAY 2
  444. #define BUTTON3_RELAY 1
  445. #define BUTTON_PROVIDER_ITEAD_SONOFF_DUAL_SUPPORT 1
  446. // LEDs
  447. #define LED1_PIN 13
  448. #define LED1_PIN_INVERSE 1
  449. #elif defined(ITEAD_SONOFF_DUAL_R2)
  450. #define MANUFACTURER "ITEAD"
  451. #define DEVICE "SONOFF_DUAL_R2"
  452. // Buttons
  453. #define BUTTON1_PIN 0 // Button 0 on header
  454. #define BUTTON2_PIN 9 // Button 1 on header
  455. #define BUTTON3_PIN 10 // Physical button
  456. #define BUTTON1_RELAY 1
  457. #define BUTTON2_RELAY 2
  458. #define BUTTON3_RELAY 1
  459. #define BUTTON1_CONFIG BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  460. #define BUTTON2_CONFIG BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  461. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  462. // Relays
  463. #define RELAY1_PIN 12
  464. #define RELAY2_PIN 5
  465. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  466. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  467. // LEDs
  468. #define LED1_PIN 13
  469. #define LED1_PIN_INVERSE 1
  470. #elif defined(ITEAD_SONOFF_4CH)
  471. // Info
  472. #define MANUFACTURER "ITEAD"
  473. #define DEVICE "SONOFF_4CH"
  474. // Buttons
  475. #define BUTTON1_PIN 0
  476. #define BUTTON2_PIN 9
  477. #define BUTTON3_PIN 10
  478. #define BUTTON4_PIN 14
  479. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  480. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  481. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  482. #define BUTTON4_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  483. #define BUTTON1_RELAY 1
  484. #define BUTTON2_RELAY 2
  485. #define BUTTON3_RELAY 3
  486. #define BUTTON4_RELAY 4
  487. // Relays
  488. #define RELAY1_PIN 12
  489. #define RELAY2_PIN 5
  490. #define RELAY3_PIN 4
  491. #define RELAY4_PIN 15
  492. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  493. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  494. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  495. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  496. // LEDs
  497. #define LED1_PIN 13
  498. #define LED1_PIN_INVERSE 1
  499. #elif defined(ITEAD_SONOFF_4CH_PRO)
  500. // Info
  501. #define MANUFACTURER "ITEAD"
  502. #define DEVICE "SONOFF_4CH_PRO"
  503. // Buttons
  504. #define BUTTON1_PIN 0
  505. #define BUTTON2_PIN 9
  506. #define BUTTON3_PIN 10
  507. #define BUTTON4_PIN 14
  508. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  509. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  510. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  511. #define BUTTON4_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  512. #define BUTTON1_RELAY 1
  513. #define BUTTON2_RELAY 2
  514. #define BUTTON3_RELAY 3
  515. #define BUTTON4_RELAY 4
  516. // Sonoff 4CH Pro uses a secondary STM32 microcontroller to handle
  517. // buttons and relays, but it also forwards button presses to the ESP8285.
  518. // This allows ESPurna to handle button presses -almost- the same way
  519. // as with other devices except:
  520. // * Double click seems to break/disable the button on the STM32 side
  521. // * With S6 switch to 1 (self-locking and inching modes) everything's OK
  522. // * With S6 switch to 0 (interlock mode) if there is a relay ON
  523. // and you click on another relay button, the STM32 sends a "press"
  524. // event for the button of the first relay (to turn it OFF) but it
  525. // does not send a "release" event. It's like it's holding the
  526. // button down since you can see it is still LOW.
  527. // Whatever reason the result is that it may actually perform a
  528. // long click or long-long click.
  529. // The configuration below make the button toggle the relay on press events
  530. // and disables any possibly harmful combination with S6 set to 0.
  531. // If you are sure you will only use S6 to 1 you can comment the
  532. // BUTTON1_LNGCLICK and BUTTON1_LNGLNGCLICK options below to recover the
  533. // reset mode and factory reset functionalities, or link other actions like
  534. // AP mode in the commented line below.
  535. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  536. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  537. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  538. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  539. //#define BUTTON1_LNGCLICK BUTTON_ACTION_AP
  540. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_NONE
  541. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  542. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  543. #define BUTTON3_PRESS BUTTON_ACTION_TOGGLE
  544. #define BUTTON3_CLICK BUTTON_ACTION_NONE
  545. #define BUTTON4_PRESS BUTTON_ACTION_TOGGLE
  546. #define BUTTON4_CLICK BUTTON_ACTION_NONE
  547. // Relays
  548. #define RELAY1_PIN 12
  549. #define RELAY2_PIN 5
  550. #define RELAY3_PIN 4
  551. #define RELAY4_PIN 15
  552. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  553. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  554. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  555. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  556. // LEDs
  557. #define LED1_PIN 13
  558. #define LED1_PIN_INVERSE 1
  559. #elif defined(ITEAD_1CH_INCHING)
  560. // The inching functionality is managed by a misterious IC in the board.
  561. // You cannot control the inching button and functionality from the ESP8266
  562. // Besides, enabling the inching functionality using the hardware button
  563. // will result in the relay switching on and off continuously.
  564. // Fortunately the unkown IC keeps memory of the hardware inching status
  565. // so you can just disable it and forget. The inching LED must be lit.
  566. // You can still use the pulse options from the web interface
  567. // without problem.
  568. // Info
  569. #define MANUFACTURER "ITEAD"
  570. #define DEVICE "1CH_INCHING"
  571. // Buttons
  572. #define BUTTON1_PIN 0
  573. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  574. #define BUTTON1_RELAY 1
  575. // Relays
  576. #define RELAY1_PIN 12
  577. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  578. // LEDs
  579. #define LED1_PIN 13
  580. #define LED1_PIN_INVERSE 1
  581. #elif defined(ITEAD_MOTOR)
  582. // Info
  583. #define MANUFACTURER "ITEAD"
  584. #define DEVICE "MOTOR"
  585. // Buttons
  586. #define BUTTON1_PIN 0
  587. #define BUTTON1_RELAY 1
  588. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  589. // Relays
  590. #define RELAY1_PIN 12
  591. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  592. // LEDs
  593. #define LED1_PIN 13
  594. #define LED1_PIN_INVERSE 1
  595. #elif defined(ITEAD_BNSZ01)
  596. // Info
  597. #define MANUFACTURER "ITEAD"
  598. #define DEVICE "BNSZ01"
  599. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  600. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  601. #define DUMMY_RELAY_COUNT 1
  602. // LEDs
  603. #define LED1_PIN 13
  604. #define LED1_PIN_INVERSE 1
  605. // Light
  606. #define LIGHT_CHANNELS 1
  607. #define LIGHT_CH1_PIN 12
  608. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  609. // Info
  610. #define MANUFACTURER "ITEAD"
  611. #define DEVICE "SONOFF_RFBRIDGE"
  612. #define RELAY_PROVIDER RELAY_PROVIDER_RFBRIDGE
  613. // Number of virtual switches
  614. #ifndef DUMMY_RELAY_COUNT
  615. #define DUMMY_RELAY_COUNT 8
  616. #endif
  617. // Buttons
  618. #define BUTTON1_PIN 0
  619. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  620. // LEDs
  621. #define LED1_PIN 13
  622. #define LED1_PIN_INVERSE 1
  623. #define RFB_SUPPORT 1
  624. // When using un-modified harware, ESPurna communicates with the secondary
  625. // MCU EFM8BB1 via UART at 19200 bps so we need to change the speed of
  626. // the port and remove UART noise on serial line
  627. #ifndef RFB_PROVIDER
  628. #define RFB_PROVIDER RFB_PROVIDER_EFM8BB1
  629. #endif
  630. #if RFB_PROVIDER == RFB_PROVIDER_EFM8BB1
  631. #define SERIAL_BAUDRATE 19200
  632. #define DEBUG_SERIAL_SUPPORT 0
  633. #endif
  634. // Only used when RFB_PROVIDER is RCSWITCH
  635. #define RFB_RX_PIN 4
  636. #define RFB_TX_PIN 5
  637. #elif defined(ITEAD_SONOFF_B1)
  638. // Info
  639. #define MANUFACTURER "ITEAD"
  640. #define DEVICE "SONOFF_B1"
  641. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  642. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  643. #define DUMMY_RELAY_COUNT 1
  644. // Light
  645. #define LIGHT_CHANNELS 5
  646. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  647. #define MY92XX_CHIPS 2
  648. #define MY92XX_DI_PIN 12
  649. #define MY92XX_DCKI_PIN 14
  650. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  651. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  652. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  653. #elif defined(ITEAD_SONOFF_LED)
  654. // Info
  655. #define MANUFACTURER "ITEAD"
  656. #define DEVICE "SONOFF_LED"
  657. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  658. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  659. #define DUMMY_RELAY_COUNT 1
  660. // LEDs
  661. #define LED1_PIN 13
  662. #define LED1_PIN_INVERSE 1
  663. // Light
  664. #define LIGHT_CHANNELS 2
  665. #define LIGHT_CH1_PIN 12 // Cold white
  666. #define LIGHT_CH2_PIN 14 // Warm white
  667. #elif defined(ITEAD_SONOFF_T1_1CH)
  668. // Info
  669. #define MANUFACTURER "ITEAD"
  670. #define DEVICE "SONOFF_T1_1CH"
  671. // Buttons
  672. #define BUTTON1_PIN 0
  673. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  674. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  675. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  676. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  677. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  678. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  679. #define BUTTON1_RELAY 1
  680. // Relays
  681. #define RELAY1_PIN 12
  682. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  683. // LEDs
  684. #define LED1_PIN 13
  685. #define LED1_PIN_INVERSE 1
  686. #elif defined(ITEAD_SONOFF_T1_2CH)
  687. // Info
  688. #define MANUFACTURER "ITEAD"
  689. #define DEVICE "SONOFF_T1_2CH"
  690. // Buttons
  691. #define BUTTON1_PIN 0
  692. #define BUTTON2_PIN 9
  693. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  694. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  695. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  696. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  697. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  698. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  699. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  700. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  701. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  702. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  703. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  704. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_RESET
  705. #define BUTTON1_RELAY 1
  706. #define BUTTON2_RELAY 2
  707. // Relays
  708. #define RELAY1_PIN 12
  709. #define RELAY2_PIN 5
  710. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  711. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  712. // LEDs
  713. #define LED1_PIN 13
  714. #define LED1_PIN_INVERSE 1
  715. #elif defined(ITEAD_SONOFF_T1_3CH)
  716. // Info
  717. #define MANUFACTURER "ITEAD"
  718. #define DEVICE "SONOFF_T1_3CH"
  719. // Buttons
  720. #define BUTTON1_PIN 0
  721. #define BUTTON2_PIN 9
  722. #define BUTTON3_PIN 10
  723. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  724. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  725. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  726. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  727. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  728. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  729. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  730. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  731. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  732. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  733. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  734. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_RESET
  735. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  736. #define BUTTON3_PRESS BUTTON_ACTION_TOGGLE
  737. #define BUTTON3_CLICK BUTTON_ACTION_NONE
  738. #define BUTTON3_DBLCLICK BUTTON_ACTION_NONE
  739. #define BUTTON3_LNGCLICK BUTTON_ACTION_NONE
  740. #define BUTTON3_LNGLNGCLICK BUTTON_ACTION_RESET
  741. #define BUTTON1_RELAY 1
  742. #define BUTTON2_RELAY 2
  743. #define BUTTON3_RELAY 3
  744. // Relays
  745. #define RELAY1_PIN 12
  746. #define RELAY2_PIN 5
  747. #define RELAY3_PIN 4
  748. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  749. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  750. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  751. // LEDs
  752. #define LED1_PIN 13
  753. #define LED1_PIN_INVERSE 1
  754. #elif defined(ITEAD_SONOFF_S31)
  755. // Info
  756. #define MANUFACTURER "ITEAD"
  757. #define DEVICE "SONOFF_S31"
  758. // Buttons
  759. #define BUTTON1_PIN 0
  760. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  761. #define BUTTON1_RELAY 1
  762. // Relays
  763. #define RELAY1_PIN 12
  764. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  765. // LEDs
  766. #define LED1_PIN 13
  767. #define LED1_PIN_INVERSE 1
  768. // Disable UART noise
  769. #define DEBUG_SERIAL_SUPPORT 0
  770. // CSE7766
  771. #define CSE7766_SUPPORT 1
  772. #define CSE7766_RX_PIN 3
  773. #elif defined(ITEAD_SONOFF_S31_LITE)
  774. // Info
  775. #define MANUFACTURER "ITEAD"
  776. #define DEVICE "SONOFF_S31_LITE"
  777. // Buttons
  778. #define BUTTON1_PIN 0
  779. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  780. #define BUTTON1_RELAY 1
  781. // Relays
  782. #define RELAY1_PIN 12
  783. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  784. // LEDs
  785. #define LED1_PIN 13
  786. #define LED1_PIN_INVERSE 1
  787. #elif defined(ITEAD_SONOFF_IFAN02)
  788. // Info
  789. #define MANUFACTURER "ITEAD"
  790. #define DEVICE "SONOFF_IFAN02"
  791. // These are virtual buttons triggered by the remote
  792. #define BUTTON1_PIN 0
  793. #define BUTTON2_PIN 9
  794. #define BUTTON3_PIN 10
  795. #define BUTTON4_PIN 14
  796. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  797. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  798. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  799. #define BUTTON4_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  800. // Relays
  801. #define RELAY1_PIN 12
  802. #define RELAY2_PIN 5
  803. #define RELAY3_PIN 4
  804. #define RELAY4_PIN 15
  805. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  806. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  807. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  808. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  809. // LEDs
  810. #define LED1_PIN 13
  811. #define LED1_PIN_INVERSE 1
  812. // -----------------------------------------------------------------------------
  813. // ORVIBO
  814. // -----------------------------------------------------------------------------
  815. #elif defined(ORVIBO_B25)
  816. // Info
  817. #define MANUFACTURER "ORVIBO"
  818. #define DEVICE "B25"
  819. // Buttons
  820. #define BUTTON1_PIN 14
  821. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  822. #define BUTTON1_RELAY 1
  823. // Relays
  824. #define RELAY1_PIN 5
  825. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  826. // LEDs
  827. #define LED1_PIN 12 // 4 blue led
  828. #define LED1_PIN_INVERSE 1
  829. #define LED2_PIN 4 // 12 red led
  830. #define LED2_PIN_INVERSE 1
  831. // -----------------------------------------------------------------------------
  832. // YJZK
  833. // -----------------------------------------------------------------------------
  834. #elif defined(YJZK_SWITCH_1CH)
  835. // Info
  836. #define MANUFACTURER "YJZK"
  837. #define DEVICE "SWITCH_1CH"
  838. // Buttons
  839. #define BUTTON1_PIN 0
  840. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  841. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  842. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  843. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  844. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  845. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  846. #define BUTTON1_RELAY 1
  847. // Relays
  848. #define RELAY1_PIN 12
  849. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  850. // LEDs
  851. #define LED1_PIN 13
  852. #define LED1_PIN_INVERSE 0
  853. #elif defined(YJZK_SWITCH_2CH)
  854. // Info
  855. #define MANUFACTURER "YJZK"
  856. #define DEVICE "SWITCH_2CH"
  857. // Buttons
  858. #define BUTTON1_PIN 0
  859. #define BUTTON2_PIN 9
  860. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  861. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  862. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  863. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  864. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  865. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  866. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  867. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  868. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  869. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  870. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  871. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_RESET
  872. #define BUTTON1_RELAY 1
  873. #define BUTTON2_RELAY 2
  874. // Relays
  875. #define RELAY1_PIN 12
  876. #define RELAY2_PIN 5
  877. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  878. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  879. // LEDs
  880. #define LED1_PIN 13
  881. #define LED1_PIN_INVERSE 0
  882. // YJZK 3CH switch
  883. // Also Lixin Touch Wifi 3M
  884. #elif defined(YJZK_SWITCH_3CH)
  885. // Info
  886. #define MANUFACTURER "YJZK"
  887. #define DEVICE "SWITCH_3CH"
  888. // Buttons
  889. #define BUTTON1_PIN 0
  890. #define BUTTON2_PIN 9
  891. #define BUTTON3_PIN 10
  892. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  893. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  894. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  895. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  896. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  897. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  898. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  899. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  900. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  901. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  902. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  903. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_RESET
  904. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  905. #define BUTTON3_PRESS BUTTON_ACTION_TOGGLE
  906. #define BUTTON3_CLICK BUTTON_ACTION_NONE
  907. #define BUTTON3_DBLCLICK BUTTON_ACTION_NONE
  908. #define BUTTON3_LNGCLICK BUTTON_ACTION_NONE
  909. #define BUTTON3_LNGLNGCLICK BUTTON_ACTION_RESET
  910. #define BUTTON1_RELAY 1
  911. #define BUTTON2_RELAY 2
  912. #define BUTTON3_RELAY 3
  913. // Relays
  914. #define RELAY1_PIN 12
  915. #define RELAY2_PIN 5
  916. #define RELAY3_PIN 4
  917. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  918. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  919. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  920. // LEDs
  921. #define LED1_PIN 13
  922. #define LED1_PIN_INVERSE 0
  923. // -----------------------------------------------------------------------------
  924. // Electrodragon boards
  925. // -----------------------------------------------------------------------------
  926. #elif defined(ELECTRODRAGON_WIFI_IOT)
  927. // Info
  928. #define MANUFACTURER "ELECTRODRAGON"
  929. #define DEVICE "WIFI_IOT"
  930. // Buttons
  931. #define BUTTON1_PIN 0
  932. #define BUTTON2_PIN 2
  933. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  934. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  935. #define BUTTON1_RELAY 1
  936. #define BUTTON2_RELAY 2
  937. // Relays
  938. #define RELAY1_PIN 12
  939. #define RELAY2_PIN 13
  940. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  941. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  942. // LEDs
  943. #define LED1_PIN 16
  944. #define LED1_PIN_INVERSE 0
  945. // -----------------------------------------------------------------------------
  946. // WorkChoice ecoPlug
  947. // -----------------------------------------------------------------------------
  948. #elif defined(WORKCHOICE_ECOPLUG)
  949. // Info
  950. #define MANUFACTURER "WORKCHOICE"
  951. #define DEVICE "ECOPLUG"
  952. // Buttons
  953. #define BUTTON1_PIN 13
  954. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  955. #define BUTTON1_RELAY 1
  956. // Relays
  957. #define RELAY1_PIN 15
  958. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  959. // LEDs
  960. #define LED1_PIN 2
  961. #define LED1_PIN_INVERSE 0
  962. // -----------------------------------------------------------------------------
  963. // AI Thinker
  964. // -----------------------------------------------------------------------------
  965. #elif defined(AITHINKER_AI_LIGHT)
  966. // Info
  967. #define MANUFACTURER "AITHINKER"
  968. #define DEVICE "AI_LIGHT"
  969. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  970. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  971. #define DUMMY_RELAY_COUNT 1
  972. // Light
  973. #define LIGHT_CHANNELS 4
  974. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  975. #define MY92XX_CHIPS 1
  976. #define MY92XX_DI_PIN 13
  977. #define MY92XX_DCKI_PIN 15
  978. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  979. #define MY92XX_MAPPING 0, 1, 2, 3
  980. // -----------------------------------------------------------------------------
  981. // Lyasi LED
  982. // -----------------------------------------------------------------------------
  983. #elif defined(LYASI_LIGHT)
  984. // Info
  985. #define MANUFACTURER "LYASI"
  986. #define DEVICE "RGB_LED"
  987. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  988. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  989. #define DUMMY_RELAY_COUNT 1
  990. // Light
  991. #define LIGHT_CHANNELS 4
  992. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  993. #define MY92XX_CHIPS 1
  994. #define MY92XX_DI_PIN 4
  995. #define MY92XX_DCKI_PIN 5
  996. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  997. #define MY92XX_MAPPING 0, 1, 2, 3
  998. // -----------------------------------------------------------------------------
  999. // LED Controller
  1000. // -----------------------------------------------------------------------------
  1001. #elif defined(MAGICHOME_LED_CONTROLLER)
  1002. // Info
  1003. #define MANUFACTURER "MAGICHOME"
  1004. #define DEVICE "LED_CONTROLLER"
  1005. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1006. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1007. #define DUMMY_RELAY_COUNT 1
  1008. // LEDs
  1009. #define LED1_PIN 2
  1010. #define LED1_PIN_INVERSE 1
  1011. // Light
  1012. #define LIGHT_CHANNELS 4
  1013. #define LIGHT_CH1_PIN 14 // RED
  1014. #define LIGHT_CH2_PIN 5 // GREEN
  1015. #define LIGHT_CH3_PIN 12 // BLUE
  1016. #define LIGHT_CH4_PIN 13 // WHITE
  1017. // IR
  1018. #define IR_SUPPORT 1
  1019. #define IR_RX_PIN 4
  1020. #define IR_BUTTON_SET 1
  1021. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  1022. // Info
  1023. #define MANUFACTURER "MAGICHOME"
  1024. #define DEVICE "LED_CONTROLLER_20"
  1025. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1026. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1027. #define DUMMY_RELAY_COUNT 1
  1028. // LEDs
  1029. #define LED1_PIN 2
  1030. #define LED1_PIN_INVERSE 1
  1031. // Light
  1032. #define LIGHT_CHANNELS 4
  1033. #define LIGHT_CH1_PIN 5 // RED
  1034. #define LIGHT_CH2_PIN 12 // GREEN
  1035. #define LIGHT_CH3_PIN 13 // BLUE
  1036. #define LIGHT_CH4_PIN 15 // WHITE
  1037. // IR
  1038. #define IR_SUPPORT 1
  1039. #define IR_RX_PIN 4
  1040. #define IR_BUTTON_SET 1
  1041. #elif defined(MAGICHOME_ZJ_WFMN_A_11)
  1042. // Info
  1043. #define MANUFACTURER "MAGICHOME"
  1044. #define DEVICE "ZJ_WFMN_A_11"
  1045. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1046. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1047. #define DUMMY_RELAY_COUNT 1
  1048. // LEDs
  1049. #define LED1_PIN 2
  1050. #define LED1_PIN_INVERSE 1
  1051. #define LED2_PIN 15
  1052. #define LED2_PIN_INVERSE 1
  1053. // Light
  1054. #define LIGHT_CHANNELS 4
  1055. #define LIGHT_CH1_PIN 12 // RED
  1056. #define LIGHT_CH2_PIN 5 // GREEN
  1057. #define LIGHT_CH3_PIN 13 // BLUE
  1058. #define LIGHT_CH4_PIN 14 // WHITE
  1059. // IR
  1060. #define IR_SUPPORT 1
  1061. #define IR_RX_PIN 4
  1062. #define IR_BUTTON_SET 1
  1063. #elif defined(MAGICHOME_ZJ_WFMN_B_11)
  1064. // Info
  1065. #define MANUFACTURER "MAGICHOME"
  1066. #define DEVICE "ZJ_WFMN_B_11"
  1067. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1068. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1069. #define DUMMY_RELAY_COUNT 1
  1070. // LEDs
  1071. #define LED1_PIN 2
  1072. #define LED1_PIN_INVERSE 1
  1073. #define LED2_PIN 15
  1074. #define LED2_PIN_INVERSE 1
  1075. // Light
  1076. #define LIGHT_CHANNELS 4
  1077. #define LIGHT_CH1_PIN 14 // RED
  1078. #define LIGHT_CH2_PIN 5 // GREEN
  1079. #define LIGHT_CH3_PIN 12 // BLUE
  1080. #define LIGHT_CH4_PIN 13 // WHITE
  1081. // RF
  1082. #define RFB_SUPPORT 1
  1083. #define RFB_PROVIDER RFB_PROVIDER_RCSWITCH
  1084. #define RFB_RX_PIN 4
  1085. #elif defined(MAGICHOME_ZJ_WFMN_C_11)
  1086. // Info
  1087. #define MANUFACTURER "MAGICHOME"
  1088. #define DEVICE "ZJ_WFMN_C_11"
  1089. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1090. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1091. #define DUMMY_RELAY_COUNT 1
  1092. // Buttons
  1093. #define BUTTON1_PIN 0
  1094. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1095. #define BUTTON1_RELAY 1
  1096. // LEDs
  1097. #define LED1_PIN 2
  1098. #define LED1_PIN_INVERSE 1
  1099. // Light
  1100. #define LIGHT_CHANNELS 1
  1101. #define LIGHT_CH1_PIN 12 // WHITE
  1102. #elif defined(MAGICHOME_ZJ_ESPM_5CH_B_13)
  1103. // Info
  1104. #define MANUFACTURER "MAGICHOME"
  1105. #define DEVICE "ZJ_ESPM_5CH_B_13"
  1106. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1107. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1108. #define DUMMY_RELAY_COUNT 1
  1109. // Buttons
  1110. #define BUTTON1_PIN 0
  1111. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1112. #define BUTTON1_RELAY 1
  1113. // LEDs
  1114. #define LED1_PIN 2
  1115. #define LED1_PIN_INVERSE 1
  1116. // Light
  1117. #define LIGHT_CHANNELS 5
  1118. #define LIGHT_CH1_PIN 14 // RED
  1119. #define LIGHT_CH2_PIN 12 // GREEN
  1120. #define LIGHT_CH3_PIN 13 // BLUE
  1121. #define LIGHT_CH4_PIN 5 // COLD WHITE
  1122. #define LIGHT_CH5_PIN 15 // WARM WHITE
  1123. #elif defined(MAGICHOME_ZJ_LB_RGBWW_L)
  1124. // Info
  1125. #define MANUFACTURER "MAGICHOME"
  1126. #define DEVICE "ZJ_LB_RGBWW_L"
  1127. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1128. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1129. #define DUMMY_RELAY_COUNT 1
  1130. // Light
  1131. #define LIGHT_CHANNELS 5
  1132. #define LIGHT_CH1_PIN 5 // RED
  1133. #define LIGHT_CH2_PIN 4 // GREEN
  1134. #define LIGHT_CH3_PIN 14 // BLUE
  1135. #define LIGHT_CH4_PIN 12 // COLD WHITE
  1136. #define LIGHT_CH5_PIN 13 // WARM WHITE
  1137. // -----------------------------------------------------------------------------
  1138. // HUACANXING H801 & H802
  1139. // -----------------------------------------------------------------------------
  1140. #elif defined(HUACANXING_H801)
  1141. // Info
  1142. #define MANUFACTURER "HUACANXING"
  1143. #define DEVICE "H801"
  1144. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1145. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1146. #define DUMMY_RELAY_COUNT 1
  1147. #define DEBUG_PORT Serial1
  1148. #define SERIAL_RX_ENABLED 1
  1149. // LEDs
  1150. #define LED1_PIN 5
  1151. #define LED1_PIN_INVERSE 1
  1152. // Light
  1153. #define LIGHT_CHANNELS 5
  1154. #define LIGHT_CH1_PIN 15 // RED
  1155. #define LIGHT_CH2_PIN 13 // GREEN
  1156. #define LIGHT_CH3_PIN 12 // BLUE
  1157. #define LIGHT_CH4_PIN 14 // WHITE1
  1158. #define LIGHT_CH5_PIN 4 // WHITE2
  1159. #elif defined(HUACANXING_H802)
  1160. // Info
  1161. #define MANUFACTURER "HUACANXING"
  1162. #define DEVICE "H802"
  1163. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1164. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1165. #define DUMMY_RELAY_COUNT 1
  1166. #define DEBUG_PORT Serial1
  1167. #define SERIAL_RX_ENABLED 1
  1168. // Light
  1169. #define LIGHT_CHANNELS 4
  1170. #define LIGHT_CH1_PIN 12 // RED
  1171. #define LIGHT_CH2_PIN 14 // GREEN
  1172. #define LIGHT_CH3_PIN 13 // BLUE
  1173. #define LIGHT_CH4_PIN 15 // WHITE
  1174. // -----------------------------------------------------------------------------
  1175. // HUGOAI AWP02L-N
  1176. // Pin equivalence extracted from https://templates.blakadder.com/hugoai_awp02l-n.html
  1177. //
  1178. // It follows almost same structure as AOYCOCR X5P with only 1 LED on GPIO02
  1179. //
  1180. // -----------------------------------------------------------------------------
  1181. #elif defined(HUGOAI_AWP02L_N)
  1182. #define MANUFACTURER "HUGOAI"
  1183. #define DEVICE "AWP02L_N"
  1184. // Buttons
  1185. #define BUTTON1_PIN 13
  1186. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1187. #define BUTTON1_RELAY 1
  1188. // the defaults are reasonable, but you can change them as desired
  1189. //#define BUTTON1_PRESS BUTTON_ACTION_NONE
  1190. //#define BUTTON1_CLICK BUTTON_ACTION_TOGGLE
  1191. //#define BUTTON1_DBLCLICK BUTTON_ACTION_AP
  1192. //#define BUTTON1_LNGCLICK BUTTON_ACTION_RESET
  1193. //#define BUTTON1_LNGLNGCLICK BUTTON_ACTION_FACTORY
  1194. // Relays
  1195. #define RELAY1_PIN 15
  1196. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1197. // LEDs
  1198. // LED1 (blue) indicates on/off state; you could use LED_MODE_FOLLOW_INVERSE
  1199. // so that the LED lights the button when 'off' so it can be found easily.
  1200. #define LED1_PIN 2
  1201. #define LED1_PIN_INVERSE 1
  1202. #define LED1_MODE LED_MODE_FOLLOW
  1203. #define LED1_RELAY 1
  1204. // -----------------------------------------------------------------------------
  1205. // Jan Goedeke Wifi Relay
  1206. // https://github.com/JanGoe/esp8266-wifi-relay
  1207. // -----------------------------------------------------------------------------
  1208. #elif defined(JANGOE_WIFI_RELAY_NC)
  1209. // Info
  1210. #define MANUFACTURER "JANGOE"
  1211. #define DEVICE "WIFI_RELAY_NC"
  1212. // Buttons
  1213. #define BUTTON1_PIN 12
  1214. #define BUTTON2_PIN 13
  1215. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1216. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1217. #define BUTTON1_RELAY 1
  1218. #define BUTTON2_RELAY 2
  1219. // Relays
  1220. #define RELAY1_PIN 2
  1221. #define RELAY2_PIN 14
  1222. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1223. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1224. #elif defined(JANGOE_WIFI_RELAY_NO)
  1225. // Info
  1226. #define MANUFACTURER "JANGOE"
  1227. #define DEVICE "WIFI_RELAY_NO"
  1228. // Buttons
  1229. #define BUTTON1_PIN 12
  1230. #define BUTTON2_PIN 13
  1231. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1232. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1233. #define BUTTON1_RELAY 1
  1234. #define BUTTON2_RELAY 2
  1235. // Relays
  1236. #define RELAY1_PIN 2
  1237. #define RELAY2_PIN 14
  1238. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1239. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1240. // -----------------------------------------------------------------------------
  1241. // Jorge García Wifi+Relays Board Kit
  1242. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  1243. // https://github.com/jorgegarciadev/wifikit
  1244. // -----------------------------------------------------------------------------
  1245. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  1246. // Info
  1247. #define MANUFACTURER "JORGEGARCIA"
  1248. #define DEVICE "WIFI_RELAYS"
  1249. // Relays
  1250. #define RELAY1_PIN 0
  1251. #define RELAY2_PIN 2
  1252. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1253. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1254. // -----------------------------------------------------------------------------
  1255. // WiFi MQTT Relay / Thermostat
  1256. // -----------------------------------------------------------------------------
  1257. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  1258. // Info
  1259. #define MANUFACTURER "OPENENERGYMONITOR"
  1260. #define DEVICE "MQTT_RELAY"
  1261. // Buttons
  1262. #define BUTTON1_PIN 0
  1263. #define BUTTON1_RELAY 1
  1264. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1265. // Relays
  1266. #define RELAY1_PIN 12
  1267. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1268. // LEDs
  1269. #define LED1_PIN 16
  1270. #define LED1_PIN_INVERSE 0
  1271. // -----------------------------------------------------------------------------
  1272. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  1273. // 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
  1274. // 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
  1275. // -----------------------------------------------------------------------------
  1276. #elif defined(WION_50055)
  1277. // Currently untested, does not support energy monitoring
  1278. // Info
  1279. #define MANUFACTURER "WION"
  1280. #define DEVICE "50055"
  1281. // Buttons
  1282. #define BUTTON1_PIN 13
  1283. #define BUTTON1_RELAY 1
  1284. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1285. // Relays
  1286. #define RELAY1_PIN 15
  1287. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1288. // LEDs
  1289. #define LED1_PIN 2
  1290. #define LED1_PIN_INVERSE 0
  1291. // -----------------------------------------------------------------------------
  1292. // EX-Store Wifi Relay v3.1
  1293. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  1294. // -----------------------------------------------------------------------------
  1295. #elif defined(EXS_WIFI_RELAY_V31)
  1296. // Untested
  1297. // Info
  1298. #define MANUFACTURER "EXS"
  1299. #define DEVICE "WIFI_RELAY_V31"
  1300. // Buttons
  1301. #define BUTTON1_PIN 0
  1302. #define BUTTON1_RELAY 1
  1303. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1304. // Relays
  1305. #define RELAY1_PIN 13
  1306. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1307. #define RELAY1_RESET_PIN 12
  1308. // -----------------------------------------------------------------------------
  1309. // EX-Store Wifi Relay v5.0
  1310. // -----------------------------------------------------------------------------
  1311. #elif defined(EXS_WIFI_RELAY_V50)
  1312. // Info
  1313. #define MANUFACTURER "EXS"
  1314. #define DEVICE "WIFI_RELAY_V50"
  1315. // Buttons
  1316. #define BUTTON1_PIN 5
  1317. #define BUTTON2_PIN 4
  1318. #define BUTTON1_RELAY 1
  1319. #define BUTTON2_RELAY 2
  1320. #define BUTTON1_CONFIG BUTTON_SWITCH | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1321. #define BUTTON2_CONFIG BUTTON_SWITCH | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1322. // Relays
  1323. #define RELAY1_PIN 14
  1324. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1325. #define RELAY1_RESET_PIN 16
  1326. #define RELAY2_PIN 13
  1327. #define RELAY2_TYPE RELAY_TYPE_LATCHED
  1328. #define RELAY2_RESET_PIN 12
  1329. // LEDs
  1330. #define LED1_PIN 15
  1331. #define LED1_PIN_INVERSE 0
  1332. // -----------------------------------------------------------------------------
  1333. // V9261F
  1334. // -----------------------------------------------------------------------------
  1335. #elif defined(GENERIC_V9261F)
  1336. // Info
  1337. #define MANUFACTURER "GENERIC"
  1338. #define DEVICE "V9261F"
  1339. #define ALEXA_SUPPORT 0
  1340. // V9261F
  1341. #define V9261F_SUPPORT 1
  1342. #define V9261F_PIN 2
  1343. #define V9261F_PIN_INVERSE 1
  1344. // -----------------------------------------------------------------------------
  1345. // ECH1560
  1346. // -----------------------------------------------------------------------------
  1347. #elif defined(GENERIC_ECH1560)
  1348. // Info
  1349. #define MANUFACTURER "GENERIC"
  1350. #define DEVICE "ECH1560"
  1351. #define ALEXA_SUPPORT 0
  1352. // ECH1560
  1353. #define ECH1560_SUPPORT 1
  1354. #define ECH1560_CLK_PIN 4
  1355. #define ECH1560_MISO_PIN 5
  1356. #define ECH1560_INVERTED 0
  1357. // -----------------------------------------------------------------------------
  1358. // PZEM004T
  1359. // -----------------------------------------------------------------------------
  1360. #elif defined(GENERIC_PZEM004T)
  1361. // Info
  1362. #define MANUFACTURER "GENERIC"
  1363. #define DEVICE "PZEM004T"
  1364. #define PZEM004T_SUPPORT 1
  1365. #define ALEXA_SUPPORT 0
  1366. #define DEBUG_SERIAL_SUPPORT 0
  1367. // -----------------------------------------------------------------------------
  1368. // ESP-01 generic esp8266 board with 512 kB flash
  1369. // -----------------------------------------------------------------------------
  1370. #elif defined(GENERIC_ESP01_512KB)
  1371. // Info
  1372. #define MANUFACTURER "GENERIC"
  1373. #define DEVICE "ESP01_512KB"
  1374. // Relays
  1375. #define RELAY1_PIN 2
  1376. #ifndef RELAY1_TYPE
  1377. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1378. #endif
  1379. // No need for OTA
  1380. #define OTA_WEB_SUPPORT 0
  1381. #define OTA_ARDUINOOTA_SUPPORT 0
  1382. #define OTA_CLIENT OTA_CLIENT_NONE
  1383. // Web UI blob & MDNS are pretty large
  1384. #define WEB_EMBEDDED 0
  1385. #define MDNS_SERVER_SUPPORT 0
  1386. // -----------------------------------------------------------------------------
  1387. // ESPLive
  1388. // https://github.com/ManCaveMade/ESP-Live
  1389. // -----------------------------------------------------------------------------
  1390. #elif defined(MANCAVEMADE_ESPLIVE)
  1391. // Info
  1392. #define MANUFACTURER "MANCAVEMADE"
  1393. #define DEVICE "ESPLIVE"
  1394. // Buttons
  1395. #define BUTTON1_PIN 4
  1396. #define BUTTON2_PIN 5
  1397. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1398. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1399. #define BUTTON1_RELAY 1
  1400. #define BUTTON2_RELAY 2
  1401. // Relays
  1402. #define RELAY1_PIN 12
  1403. #define RELAY2_PIN 13
  1404. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1405. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1406. // DS18B20
  1407. #ifndef DALLAS_SUPPORT
  1408. #define DALLAS_SUPPORT 1
  1409. #endif
  1410. #define DALLAS_PIN 2
  1411. #define DALLAS_UPDATE_INTERVAL 5000
  1412. #define TEMPERATURE_MIN_CHANGE 1.0
  1413. // -----------------------------------------------------------------------------
  1414. // QuinLED
  1415. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  1416. // -----------------------------------------------------------------------------
  1417. #elif defined(INTERMITTECH_QUINLED)
  1418. // Info
  1419. #define MANUFACTURER "INTERMITTECH"
  1420. #define DEVICE "QUINLED"
  1421. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1422. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1423. #define DUMMY_RELAY_COUNT 1
  1424. // LEDs
  1425. #define LED1_PIN 5
  1426. #define LED1_PIN_INVERSE 1
  1427. // Light
  1428. #define LIGHT_CHANNELS 2
  1429. #define LIGHT_CH1_PIN 0
  1430. #define LIGHT_CH2_PIN 2
  1431. // -----------------------------------------------------------------------------
  1432. // Arilux AL-LC06
  1433. // -----------------------------------------------------------------------------
  1434. #elif defined(ARILUX_AL_LC01)
  1435. // Info
  1436. #define MANUFACTURER "ARILUX"
  1437. #define DEVICE "AL_LC01"
  1438. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1439. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1440. #define DUMMY_RELAY_COUNT 1
  1441. // Light
  1442. #define LIGHT_CHANNELS 3
  1443. #define LIGHT_CH1_PIN 5 // RED
  1444. #define LIGHT_CH2_PIN 12 // GREEN
  1445. #define LIGHT_CH3_PIN 13 // BLUE
  1446. #elif defined(ARILUX_AL_LC02)
  1447. // Info
  1448. #define MANUFACTURER "ARILUX"
  1449. #define DEVICE "AL_LC02"
  1450. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1451. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1452. #define DUMMY_RELAY_COUNT 1
  1453. // Light
  1454. #define LIGHT_CHANNELS 4
  1455. #define LIGHT_CH1_PIN 12 // RED
  1456. #define LIGHT_CH2_PIN 5 // GREEN
  1457. #define LIGHT_CH3_PIN 13 // BLUE
  1458. #define LIGHT_CH4_PIN 15 // WHITE1
  1459. #elif defined(ARILUX_AL_LC02_V14)
  1460. // Info
  1461. #define MANUFACTURER "ARILUX"
  1462. #define DEVICE "AL_LC02_V14"
  1463. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1464. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1465. #define DUMMY_RELAY_COUNT 1
  1466. // Light
  1467. #define LIGHT_CHANNELS 4
  1468. #define LIGHT_CH1_PIN 14 // RED
  1469. #define LIGHT_CH2_PIN 5 // GREEN
  1470. #define LIGHT_CH3_PIN 12 // BLUE
  1471. #define LIGHT_CH4_PIN 13 // WHITE1
  1472. #elif defined(ARILUX_AL_LC06)
  1473. // Info
  1474. #define MANUFACTURER "ARILUX"
  1475. #define DEVICE "AL_LC06"
  1476. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1477. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1478. #define DUMMY_RELAY_COUNT 1
  1479. // Buttons
  1480. #define BUTTON1_PIN 0
  1481. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1482. #define BUTTON1_RELAY 1
  1483. // Light
  1484. #define LIGHT_CHANNELS 5
  1485. #define LIGHT_CH1_PIN 14 // RED
  1486. #define LIGHT_CH2_PIN 12 // GREEN
  1487. #define LIGHT_CH3_PIN 13 // BLUE
  1488. #define LIGHT_CH4_PIN 15 // WHITE1
  1489. #define LIGHT_CH5_PIN 5 // WHITE2
  1490. #elif defined(ARILUX_AL_LC11)
  1491. // Info
  1492. #define MANUFACTURER "ARILUX"
  1493. #define DEVICE "AL_LC11"
  1494. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1495. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1496. #define DUMMY_RELAY_COUNT 1
  1497. // Light
  1498. #define LIGHT_CHANNELS 5
  1499. #define LIGHT_CH1_PIN 5 // RED
  1500. #define LIGHT_CH2_PIN 4 // GREEN
  1501. #define LIGHT_CH3_PIN 14 // BLUE
  1502. #define LIGHT_CH4_PIN 13 // WHITE1
  1503. #define LIGHT_CH5_PIN 12 // WHITE1
  1504. #elif defined(ARILUX_E27)
  1505. // Info
  1506. #define MANUFACTURER "ARILUX"
  1507. #define DEVICE "E27"
  1508. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1509. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1510. #define DUMMY_RELAY_COUNT 1
  1511. // Light
  1512. #define LIGHT_CHANNELS 4
  1513. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  1514. #define MY92XX_CHIPS 1
  1515. #define MY92XX_DI_PIN 13
  1516. #define MY92XX_DCKI_PIN 15
  1517. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1518. #define MY92XX_MAPPING 0, 1, 2, 3
  1519. // -----------------------------------------------------------------------------
  1520. // XENON SM-PW701U
  1521. // -----------------------------------------------------------------------------
  1522. #elif defined(XENON_SM_PW702U)
  1523. // Info
  1524. #define MANUFACTURER "XENON"
  1525. #define DEVICE "SM_PW702U"
  1526. // Buttons
  1527. #define BUTTON1_PIN 13
  1528. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1529. #define BUTTON1_RELAY 1
  1530. // Relays
  1531. #define RELAY1_PIN 12
  1532. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1533. // LEDs
  1534. #define LED1_PIN 4
  1535. #define LED1_PIN_INVERSE 1
  1536. // -----------------------------------------------------------------------------
  1537. // ISELECTOR SM-PW702
  1538. // -----------------------------------------------------------------------------
  1539. #elif defined(ISELECTOR_SM_PW702)
  1540. // Info
  1541. #define MANUFACTURER "ISELECTOR"
  1542. #define DEVICE "SM_PW702"
  1543. // Buttons
  1544. #define BUTTON1_PIN 13
  1545. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1546. #define BUTTON1_RELAY 1
  1547. // Relays
  1548. #define RELAY1_PIN 12
  1549. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1550. // LEDs
  1551. #define LED1_PIN 4 //BLUE
  1552. #define LED1_PIN_INVERSE 0
  1553. #define LED2_PIN 5 //RED
  1554. #define LED2_PIN_INVERSE 1
  1555. // -----------------------------------------------------------------------------
  1556. // AUTHOMETION LYT8266
  1557. // https://authometion.com/shop/en/home/13-lyt8266.html
  1558. // -----------------------------------------------------------------------------
  1559. #elif defined(AUTHOMETION_LYT8266)
  1560. // Info
  1561. #define MANUFACTURER "AUTHOMETION"
  1562. #define DEVICE "LYT8266"
  1563. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1564. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1565. #define DUMMY_RELAY_COUNT 1
  1566. // Light
  1567. #define LIGHT_CHANNELS 4
  1568. #define LIGHT_CH1_PIN 13 // RED
  1569. #define LIGHT_CH2_PIN 12 // GREEN
  1570. #define LIGHT_CH3_PIN 14 // BLUE
  1571. #define LIGHT_CH4_PIN 2 // WHITE
  1572. #define LIGHT_ENABLE_PIN 15
  1573. #elif defined(GIZWITS_WITTY_CLOUD)
  1574. // Info
  1575. #define MANUFACTURER "GIZWITS"
  1576. #define DEVICE "WITTY_CLOUD"
  1577. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1578. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1579. #define DUMMY_RELAY_COUNT 1
  1580. // Buttons
  1581. #define BUTTON1_PIN 4
  1582. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1583. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  1584. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  1585. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  1586. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  1587. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  1588. #define ANALOG_SUPPORT 1
  1589. // LEDs
  1590. #define LED1_PIN 2 // BLUE build-in
  1591. #define LED1_PIN_INVERSE 1
  1592. // Light
  1593. #define LIGHT_CHANNELS 3
  1594. #define LIGHT_CH1_PIN 15 // RED
  1595. #define LIGHT_CH2_PIN 12 // GREEN
  1596. #define LIGHT_CH3_PIN 13 // BLUE
  1597. // -----------------------------------------------------------------------------
  1598. // KMC 70011
  1599. // https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
  1600. // -----------------------------------------------------------------------------
  1601. #elif defined(KMC_70011)
  1602. // Info
  1603. #define MANUFACTURER "KMC"
  1604. #define DEVICE "70011"
  1605. // Buttons
  1606. #define BUTTON1_PIN 0
  1607. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1608. #define BUTTON1_RELAY 1
  1609. // Relays
  1610. #define RELAY1_PIN 14
  1611. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1612. // LEDs
  1613. #define LED1_PIN 13
  1614. #define LED1_PIN_INVERSE 1
  1615. // HLW8012
  1616. #ifndef HLW8012_SUPPORT
  1617. #define HLW8012_SUPPORT 1
  1618. #endif
  1619. #define HLW8012_SEL_PIN 12
  1620. #define HLW8012_CF1_PIN 5
  1621. #define HLW8012_CF_PIN 4
  1622. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1623. // -----------------------------------------------------------------------------
  1624. // Euromate (?) Wifi Stecker Schuko
  1625. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  1626. // Thanks to @Geitde
  1627. // -----------------------------------------------------------------------------
  1628. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  1629. // Info
  1630. #define MANUFACTURER "EUROMATE"
  1631. #define DEVICE "WIFI_STECKER_SCHUKO"
  1632. // Buttons
  1633. #define BUTTON1_PIN 14
  1634. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1635. #define BUTTON1_RELAY 1
  1636. // The relay in the device is not a bistable (latched) relay.
  1637. // The device is reported to have a flip-flop circuit to drive the relay
  1638. // So @Geitde hack is still the only possible
  1639. // Hack: drive GPIO12 low and use GPIO5 as normal relay pin:
  1640. #define RELAY1_PIN 5
  1641. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1642. #define LED2_PIN 12 /* DUMMY: exploit default off state for GPIO12=low */
  1643. #define LED2_PIN_INVERSE 0
  1644. // LEDs
  1645. #define LED1_PIN 4
  1646. #define LED1_PIN_INVERSE 0
  1647. // -----------------------------------------------------------------------------
  1648. // Euromate (?) Wifi Stecker Schuko Version 2
  1649. // This configuration is for the second generation of devices sold by OBI.
  1650. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko-weiss/p/4077806
  1651. // -----------------------------------------------------------------------------
  1652. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO_V2)
  1653. // Info
  1654. #define MANUFACTURER "EUROMATE"
  1655. #define DEVICE "WIFI_STECKER_SCHUKO_V2"
  1656. // Buttons
  1657. #define BUTTON1_PIN 5
  1658. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1659. #define BUTTON1_RELAY 1
  1660. // Relays
  1661. #define RELAY1_PIN 4
  1662. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1663. // Green
  1664. #define LED1_PIN 12
  1665. #define LED1_MODE LED_MODE_WIFI
  1666. #define LED1_PIN_INVERSE 0
  1667. // Red
  1668. #define LED2_PIN 13
  1669. #define LED2_MODE LED_MODE_RELAY
  1670. #define LED2_PIN_INVERSE 0
  1671. // -----------------------------------------------------------------------------
  1672. // Generic 8CH
  1673. // -----------------------------------------------------------------------------
  1674. #elif defined(GENERIC_8CH)
  1675. // Info
  1676. #define MANUFACTURER "GENERIC"
  1677. #define DEVICE "8CH"
  1678. // Relays
  1679. #define RELAY1_PIN 0
  1680. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1681. #define RELAY2_PIN 2
  1682. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1683. #define RELAY3_PIN 4
  1684. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1685. #define RELAY4_PIN 5
  1686. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1687. #define RELAY5_PIN 12
  1688. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1689. #define RELAY6_PIN 13
  1690. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  1691. #define RELAY7_PIN 14
  1692. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  1693. #define RELAY8_PIN 15
  1694. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  1695. // -----------------------------------------------------------------------------
  1696. // STM RELAY
  1697. // -----------------------------------------------------------------------------
  1698. #elif defined(STM_RELAY)
  1699. // Info
  1700. #define MANUFACTURER "STM_RELAY"
  1701. #define DEVICE "2CH"
  1702. // Relays
  1703. #define DUMMY_RELAY_COUNT 2
  1704. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  1705. // Remove UART noise on serial line
  1706. #define DEBUG_SERIAL_SUPPORT 0
  1707. // -----------------------------------------------------------------------------
  1708. // Tonbux Powerstrip02
  1709. // -----------------------------------------------------------------------------
  1710. #elif defined(TONBUX_POWERSTRIP02)
  1711. // Info
  1712. #define MANUFACTURER "TONBUX"
  1713. #define DEVICE "POWERSTRIP02"
  1714. // Buttons
  1715. #define BUTTON1_PIN 5
  1716. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1717. #define BUTTON1_RELAY 0
  1718. // Relays
  1719. #define RELAY1_PIN 4
  1720. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1721. #define RELAY2_PIN 13
  1722. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1723. #define RELAY3_PIN 12
  1724. #define RELAY3_TYPE RELAY_TYPE_INVERSE
  1725. #define RELAY4_PIN 14
  1726. #define RELAY4_TYPE RELAY_TYPE_INVERSE
  1727. // Not a relay. USB ports on/off
  1728. #define RELAY5_PIN 16
  1729. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1730. // LEDs
  1731. #define LED1_PIN 0 // 1 blue led
  1732. #define LED1_PIN_INVERSE 1
  1733. #define LED2_PIN 3 // 3 red leds
  1734. #define LED2_PIN_INVERSE 1
  1735. // -----------------------------------------------------------------------------
  1736. // Lingan SWA1
  1737. // -----------------------------------------------------------------------------
  1738. #elif defined(LINGAN_SWA1)
  1739. // Info
  1740. #define MANUFACTURER "LINGAN"
  1741. #define DEVICE "SWA1"
  1742. // Buttons
  1743. #define BUTTON1_PIN 13
  1744. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1745. #define BUTTON1_RELAY 1
  1746. // Relays
  1747. #define RELAY1_PIN 5
  1748. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1749. // LEDs
  1750. #define LED1_PIN 4
  1751. #define LED1_PIN_INVERSE 1
  1752. // -----------------------------------------------------------------------------
  1753. // HEYGO HY02
  1754. // -----------------------------------------------------------------------------
  1755. #elif defined(HEYGO_HY02)
  1756. // Info
  1757. #define MANUFACTURER "HEYGO"
  1758. #define DEVICE "HY02"
  1759. // Buttons
  1760. #define BUTTON1_PIN 13
  1761. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1762. #define BUTTON1_RELAY 1
  1763. // Relays
  1764. #define RELAY1_PIN 12
  1765. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1766. // LEDs
  1767. #define LED1_PIN 4
  1768. #define LED1_PIN_INVERSE 0
  1769. // -----------------------------------------------------------------------------
  1770. // Maxcio W-US002S
  1771. // -----------------------------------------------------------------------------
  1772. #elif defined(MAXCIO_WUS002S)
  1773. // Info
  1774. #define MANUFACTURER "MAXCIO"
  1775. #define DEVICE "WUS002S"
  1776. // Buttons
  1777. #define BUTTON1_PIN 2
  1778. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1779. #define BUTTON1_RELAY 1
  1780. // Relays
  1781. #define RELAY1_PIN 13
  1782. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1783. // LEDs
  1784. #define LED1_PIN 3
  1785. #define LED1_PIN_INVERSE 0
  1786. // HLW8012
  1787. #ifndef HLW8012_SUPPORT
  1788. #define HLW8012_SUPPORT 1
  1789. #endif
  1790. #define HLW8012_SEL_PIN 12
  1791. #define HLW8012_CF1_PIN 5
  1792. #define HLW8012_CF_PIN 4
  1793. #define HLW8012_CURRENT_R 0.002 // Current resistor
  1794. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1795. // LED1 on RX pin
  1796. #define DEBUG_SERIAL_SUPPORT 1
  1797. // -----------------------------------------------------------------------------
  1798. // Maxcio W-DE004
  1799. // -----------------------------------------------------------------------------
  1800. #elif defined(MAXCIO_WDE004)
  1801. // Info
  1802. #define MANUFACTURER "MAXCIO"
  1803. #define DEVICE "WDE004"
  1804. // Buttons
  1805. #define BUTTON1_PIN 1
  1806. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1807. #define BUTTON1_RELAY 1
  1808. // Relays
  1809. #define RELAY1_PIN 14
  1810. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1811. // LEDs
  1812. #define LED1_PIN 13
  1813. #define LED1_PIN_INVERSE 1
  1814. // -----------------------------------------------------------------------------
  1815. // Maxcio W-UK007S
  1816. // Like this: https://www.amazon.co.uk/Maxcio-Monitoring-Function-Compatible-Required/dp/B07BWFB55Q/ref=pd_rhf_se_p_img_2?_encoding=UTF8&psc=1&refRID=4H63A43SKHV8WV54XH19
  1817. // -----------------------------------------------------------------------------
  1818. #elif defined(MAXCIO_WUK007S)
  1819. // Info
  1820. #define MANUFACTURER "MAXCIO"
  1821. #define DEVICE "WUK007S"
  1822. // Buttons
  1823. #define BUTTON1_PIN 13
  1824. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1825. #define BUTTON1_RELAY 1
  1826. // Relays
  1827. #define RELAY1_PIN 15
  1828. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1829. // LEDs
  1830. #define LED1_PIN 0
  1831. #define LED1_PIN_INVERSE 0
  1832. #define LED1_RELAY 1
  1833. #define LED1_MODE LED_MODE_RELAY_WIFI
  1834. // HJL01 / BL0937
  1835. #ifndef HLW8012_SUPPORT
  1836. #define HLW8012_SUPPORT 1
  1837. #endif
  1838. #define HLW8012_SEL_PIN 12
  1839. #define HLW8012_CF1_PIN 14
  1840. #define HLW8012_CF_PIN 5
  1841. #define HLW8012_SEL_CURRENT LOW
  1842. #define HLW8012_CURRENT_RATIO 24380
  1843. #define HLW8012_VOLTAGE_RATIO 32048
  1844. #define HLW8012_POWER_RATIO 3509285
  1845. #define HLW8012_INTERRUPT_ON FALLING
  1846. // -----------------------------------------------------------------------------
  1847. // Oukitel P1 Smart Plug
  1848. // https://www.amazon.com/Docooler-OUKITEL-Control-Wireless-Adaptor/dp/B07J3BYFJX/ref=sr_1_fkmrnull_2?keywords=oukitel+p1+smart+switch&qid=1550424399&s=gateway&sr=8-2-fkmrnull
  1849. // -----------------------------------------------------------------------------
  1850. #elif defined(OUKITEL_P1)
  1851. // Info
  1852. #define MANUFACTURER "Oukitel"
  1853. #define DEVICE "P1"
  1854. // Buttons
  1855. #define BUTTON1_PIN 13
  1856. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1857. #define BUTTON1_RELAY 1
  1858. // Relays
  1859. // Right
  1860. #define RELAY1_PIN 12
  1861. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1862. // Left
  1863. #define RELAY2_PIN 15
  1864. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1865. // LEDs
  1866. #define LED1_PIN 0 // blue
  1867. #define LED1_PIN_INVERSE 1
  1868. #define LED1_MODE LED_MODE_WIFI
  1869. // -----------------------------------------------------------------------------
  1870. // YiDian XS-SSA05
  1871. // -----------------------------------------------------------------------------
  1872. #elif defined(YIDIAN_XSSSA05)
  1873. // Info
  1874. #define MANUFACTURER "YIDIAN"
  1875. #define DEVICE "XSSSA05"
  1876. // Buttons
  1877. #define BUTTON1_PIN 13
  1878. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1879. #define BUTTON1_RELAY 1
  1880. // Relays
  1881. #define RELAY1_PIN 12
  1882. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1883. // LEDs
  1884. #define LED1_PIN 0 // red
  1885. #define LED1_PIN_INVERSE 1
  1886. #define LED1_MODE LED_MODE_WIFI
  1887. #define LED2_PIN 15 // blue
  1888. #define LED2_PIN_INVERSE 1
  1889. #define LED2_MODE LED_MODE_RELAY
  1890. // HLW8012
  1891. #ifndef HLW8012_SUPPORT
  1892. #define HLW8012_SUPPORT 1
  1893. #endif
  1894. #define HLW8012_SEL_PIN 3
  1895. #define HLW8012_CF1_PIN 14
  1896. #define HLW8012_CF_PIN 5
  1897. #define HLW8012_SEL_CURRENT LOW
  1898. #define HLW8012_CURRENT_RATIO 25740
  1899. #define HLW8012_VOLTAGE_RATIO 313400
  1900. #define HLW8012_POWER_RATIO 3414290
  1901. #define HLW8012_INTERRUPT_ON FALLING
  1902. // -----------------------------------------------------------------------------
  1903. // TONBUX XS-SSA01
  1904. // -----------------------------------------------------------------------------
  1905. #elif defined(TONBUX_XSSSA01)
  1906. // Info
  1907. #define MANUFACTURER "TONBUX"
  1908. #define DEVICE "XSSSA01"
  1909. // Buttons
  1910. #define BUTTON1_PIN 4
  1911. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1912. #define BUTTON1_RELAY 1
  1913. // Relays
  1914. #define RELAY1_PIN 14
  1915. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1916. // LEDs
  1917. #define LED1_PIN 13
  1918. #define LED1_PIN_INVERSE 0
  1919. // -----------------------------------------------------------------------------
  1920. // TONBUX XS-SSA06
  1921. // -----------------------------------------------------------------------------
  1922. #elif defined(TONBUX_XSSSA06)
  1923. // Info
  1924. #define MANUFACTURER "TONBUX"
  1925. #define DEVICE "XSSSA06"
  1926. // Buttons
  1927. #define BUTTON1_PIN 13
  1928. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1929. #define BUTTON1_RELAY 1
  1930. // Relays
  1931. #define RELAY1_PIN 15
  1932. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1933. // LEDs
  1934. #define LED1_PIN 0 // R - 8 rgb led ring
  1935. #define LED1_PIN_INVERSE 0
  1936. #define LED2_PIN 5 // G
  1937. #define LED2_PIN_INVERSE 0
  1938. #define LED3_PIN 2 // B
  1939. #define LED3_PIN_INVERSE 0
  1940. // -----------------------------------------------------------------------------
  1941. // GREEN ESP8266 RELAY MODULE
  1942. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1943. // -----------------------------------------------------------------------------
  1944. #elif defined(GREEN_ESP8266RELAY)
  1945. // Info
  1946. #define MANUFACTURER "GREEN"
  1947. #define DEVICE "ESP8266RELAY"
  1948. // Buttons
  1949. // Not a button but input via Optocoupler
  1950. #define BUTTON1_PIN 5
  1951. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1952. #define BUTTON1_RELAY 1
  1953. // Relays
  1954. #define RELAY1_PIN 4
  1955. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1956. // LEDs
  1957. #define LED1_PIN 2
  1958. #define LED1_PIN_INVERSE 1
  1959. // -----------------------------------------------------------------------------
  1960. // Henrique Gravina ESPIKE
  1961. // https://github.com/Henriquegravina/Espike
  1962. // -----------------------------------------------------------------------------
  1963. #elif defined(IKE_ESPIKE)
  1964. #define MANUFACTURER "IKE"
  1965. #define DEVICE "ESPIKE"
  1966. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_NONE
  1967. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  1968. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  1969. #define BUTTON1_PIN 13
  1970. #define BUTTON1_RELAY 1
  1971. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1972. #define BUTTON2_PIN 12
  1973. #define BUTTON2_RELAY 2
  1974. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1975. #define BUTTON3_PIN 14
  1976. #define BUTTON3_RELAY 3
  1977. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1978. #define RELAY1_PIN 4
  1979. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1980. #define RELAY2_PIN 5
  1981. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1982. #define RELAY3_PIN 16
  1983. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1984. #define LED1_PIN 2
  1985. #define LED1_PIN_INVERSE 1
  1986. // -----------------------------------------------------------------------------
  1987. // SWIFITCH
  1988. // https://github.com/ArnieX/swifitch
  1989. // -----------------------------------------------------------------------------
  1990. #elif defined(ARNIEX_SWIFITCH)
  1991. // Info
  1992. #define MANUFACTURER "ARNIEX"
  1993. #define DEVICE "SWIFITCH"
  1994. // Buttons
  1995. #define BUTTON1_PIN 4 // D2
  1996. #define BUTTON1_CONFIG BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1997. #define BUTTON1_RELAY 1
  1998. #define BUTTON1_PRESS BUTTON_ACTION_NONE
  1999. #define BUTTON1_CLICK BUTTON_ACTION_TOGGLE
  2000. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  2001. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  2002. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_NONE
  2003. // Relays
  2004. #define RELAY1_PIN 5 // D1
  2005. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  2006. // LEDs
  2007. #define LED1_PIN 12 // D6
  2008. #define LED1_PIN_INVERSE 1
  2009. // -----------------------------------------------------------------------------
  2010. // ESP-01S RELAY v4.0
  2011. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  2012. // -----------------------------------------------------------------------------
  2013. #elif defined(GENERIC_ESP01S_RELAY_V40)
  2014. // Info
  2015. #define MANUFACTURER "GENERIC"
  2016. #define DEVICE "ESP01S_RELAY_40"
  2017. // Relays
  2018. #define RELAY1_PIN 0
  2019. #ifndef RELAY1_TYPE
  2020. #define RELAY1_TYPE RELAY_TYPE_NORMAL // See #1504 and #1554
  2021. #endif
  2022. // LEDs
  2023. #define LED1_PIN 2
  2024. #define LED1_PIN_INVERSE 0
  2025. // -----------------------------------------------------------------------------
  2026. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  2027. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  2028. // -----------------------------------------------------------------------------
  2029. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  2030. // Info
  2031. #define MANUFACTURER "GENERIC"
  2032. #define DEVICE "ESP01S_RGBLED_10"
  2033. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  2034. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  2035. // Buttons
  2036. //#define BUTTON1_PIN 2
  2037. // Relays
  2038. //#define RELAY1_PIN 2
  2039. // LEDs
  2040. #define LED1_PIN 2
  2041. #define LED1_PIN_INVERSE 0
  2042. // -----------------------------------------------------------------------------
  2043. // ESP-01S DHT11 v1.0
  2044. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  2045. // -----------------------------------------------------------------------------
  2046. #elif defined(GENERIC_ESP01S_DHT11_V10)
  2047. // Info
  2048. #define MANUFACTURER "GENERIC"
  2049. #define DEVICE "ESP01S_DHT11_10"
  2050. // DHT11
  2051. #ifndef DHT_SUPPORT
  2052. #define DHT_SUPPORT 1
  2053. #endif
  2054. #define DHT_PIN 2
  2055. #define DHT_TYPE DHT_CHIP_DHT11
  2056. // -----------------------------------------------------------------------------
  2057. // ESP-01S DS18B20 v1.0
  2058. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  2059. // -----------------------------------------------------------------------------
  2060. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  2061. // Info
  2062. #define MANUFACTURER "GENERIC"
  2063. #define DEVICE "ESP01S_DS18B20_10"
  2064. // DB18B20
  2065. #ifndef DALLAS_SUPPORT
  2066. #define DALLAS_SUPPORT 1
  2067. #endif
  2068. #define DALLAS_PIN 2
  2069. // -----------------------------------------------------------------------------
  2070. // ESP-DIN relay board V1
  2071. // https://github.com/pilotak/esp_din
  2072. // -----------------------------------------------------------------------------
  2073. #elif defined(PILOTAK_ESP_DIN_V1)
  2074. // Info
  2075. #define MANUFACTURER "PILOTAK"
  2076. #define DEVICE "ESP_DIN_V1"
  2077. // Buttons
  2078. #define BUTTON1_PIN 0
  2079. #define BUTTON1_RELAY 1
  2080. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2081. // Relays
  2082. #define RELAY1_PIN 4
  2083. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2084. #define RELAY2_PIN 5
  2085. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2086. // LEDs
  2087. #define LED1_PIN 15
  2088. #define LED1_PIN_INVERSE 0
  2089. #define I2C_SDA_PIN 12
  2090. #define I2C_SCL_PIN 13
  2091. #ifndef DALLAS_SUPPORT
  2092. #define DALLAS_SUPPORT 1
  2093. #endif
  2094. #define DALLAS_PIN 2
  2095. #define RFB_SUPPORT 1
  2096. #define RFB_PROVIDER RFB_PROVIDER_RCSWITCH
  2097. #define RFB_RX_PIN 14
  2098. #ifndef DIGITAL_SUPPORT
  2099. #define DIGITAL_SUPPORT 1
  2100. #endif
  2101. #define DIGITAL1_PIN 16
  2102. #define DIGITAL1_PIN_MODE INPUT
  2103. #define DIGITAL1_DEFAULT_STATE 0
  2104. // -----------------------------------------------------------------------------
  2105. // Heltec Touch Relay
  2106. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  2107. // -----------------------------------------------------------------------------
  2108. #elif defined(HELTEC_TOUCHRELAY)
  2109. // Info
  2110. #define MANUFACTURER "HELTEC"
  2111. #define DEVICE "TOUCH_RELAY"
  2112. // Buttons
  2113. #define BUTTON1_PIN 14
  2114. #define BUTTON1_RELAY 1
  2115. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON
  2116. // Relays
  2117. #define RELAY1_PIN 12
  2118. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2119. // -----------------------------------------------------------------------------
  2120. // Zhilde ZLD-44EU-W
  2121. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  2122. // -----------------------------------------------------------------------------
  2123. #elif defined(ZHILDE_44EU_W)
  2124. // Info
  2125. #define MANUFACTURER "ZHILDE"
  2126. #define DEVICE "44EU_W"
  2127. // Based on the reporter, this product uses GPIO1 and 3 for the button
  2128. // and onboard LED, so hardware serial should be disabled...
  2129. #define DEBUG_SERIAL_SUPPORT 0
  2130. // Buttons
  2131. #define BUTTON1_PIN 3
  2132. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2133. // Relays
  2134. #define RELAY1_PIN 5
  2135. #define RELAY2_PIN 4
  2136. #define RELAY3_PIN 12
  2137. #define RELAY4_PIN 13
  2138. #define RELAY5_PIN 14
  2139. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2140. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2141. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2142. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2143. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  2144. // LEDs
  2145. #define LED1_PIN 1
  2146. #define LED1_PIN_INVERSE 1
  2147. // -----------------------------------------------------------------------------
  2148. // Zhilde ZLD-64EU-W
  2149. // -----------------------------------------------------------------------------
  2150. #elif defined(ZHILDE_64EU_W)
  2151. // Info
  2152. #define MANUFACTURER "ZHILDE"
  2153. #define DEVICE "64EU_W"
  2154. // Based on https://templates.blakadder.com/ZLD64-EU-W.html ,
  2155. // This product uses GPIO1 for LED and 3 for the button, so hardware serial should be disabled...
  2156. #define DEBUG_SERIAL_SUPPORT 0
  2157. #define BUTTON1_PIN 3
  2158. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2159. #define BUTTON1_PRESS BUTTON_ACTION_NONE
  2160. #define BUTTON1_RELAY 3
  2161. #define RELAY1_PIN 5
  2162. #define RELAY2_PIN 4
  2163. #define RELAY3_PIN 14
  2164. #define LED1_PIN 1
  2165. #define LED1_PIN_INVERSE 1
  2166. // -----------------------------------------------------------------------------
  2167. // Allnet 4duino ESP8266-UP-Relais
  2168. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  2169. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  2170. // -----------------------------------------------------------------------------
  2171. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  2172. // Info
  2173. #define MANUFACTURER "ALLNET"
  2174. #define DEVICE "4DUINO_IOT_WLAN_RELAIS"
  2175. // Relays
  2176. #define RELAY1_PIN 14
  2177. #define RELAY1_RESET_PIN 12
  2178. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  2179. // LEDs
  2180. #define LED1_PIN 0
  2181. #define LED1_PIN_INVERSE 1
  2182. // Buttons
  2183. //#define BUTTON1_PIN 0
  2184. //#define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2185. // Using pins labelled as SDA & SCL as buttons
  2186. #define BUTTON2_PIN 4
  2187. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON
  2188. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  2189. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  2190. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  2191. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  2192. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_NONE
  2193. #define BUTTON3_PIN 5
  2194. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON
  2195. // Using pins labelled as SDA & SCL for I2C
  2196. //#define I2C_SDA_PIN 4
  2197. //#define I2C_SCL_PIN 5
  2198. // -----------------------------------------------------------------------------
  2199. // Luani HVIO
  2200. // https://luani.de/projekte/esp8266-hvio/
  2201. // https://luani.de/blog/esp8266-230v-io-modul/
  2202. // -----------------------------------------------------------------------------
  2203. #elif defined(LUANI_HVIO)
  2204. // Info
  2205. #define MANUFACTURER "LUANI"
  2206. #define DEVICE "HVIO"
  2207. // Buttons
  2208. #define BUTTON1_PIN 12
  2209. #define BUTTON1_RELAY 1
  2210. #define BUTTON1_CONFIG BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  2211. #define BUTTON1_PRESS BUTTON_ACTION_NONE
  2212. #define BUTTON1_CLICK BUTTON_ACTION_TOGGLE
  2213. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  2214. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  2215. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_NONE
  2216. #define BUTTON2_PIN 13
  2217. #define BUTTON2_RELAY 2
  2218. #define BUTTON2_CONFIG BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  2219. #define BUTTON2_CLICK BUTTON_ACTION_TOGGLE
  2220. // Relays
  2221. #define RELAY1_PIN 4
  2222. #define RELAY2_PIN 5
  2223. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2224. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2225. // LEDs
  2226. #define LED1_PIN 15
  2227. #define LED1_PIN_INVERSE 0
  2228. // -----------------------------------------------------------------------------
  2229. // Tonbux 50-100M Smart Mosquito Killer USB
  2230. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  2231. // -----------------------------------------------------------------------------
  2232. #elif defined(TONBUX_MOSQUITO_KILLER)
  2233. // Info
  2234. #define MANUFACTURER "TONBUX"
  2235. #define DEVICE "MOSQUITO_KILLER"
  2236. // Buttons
  2237. #define BUTTON1_PIN 2
  2238. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2239. #define BUTTON1_RELAY 1
  2240. // Relays
  2241. #define RELAY1_PIN 5 // not a relay, fan
  2242. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2243. // LEDs
  2244. #define LED1_PIN 15 // blue led
  2245. #define LED1_PIN_INVERSE 1
  2246. #define LED1_MODE LED_MODE_WIFI
  2247. #define LED2_PIN 14 // red led
  2248. #define LED2_PIN_INVERSE 1
  2249. #define LED2_MODE LED_MODE_RELAY
  2250. #define LED3_PIN 12 // UV leds (1-2-3-4-5-6-7-8)
  2251. #define LED3_PIN_INVERSE 0
  2252. #define LED3_RELAY 1
  2253. #define LED4_PIN 16 // UV leds (9-10-11)
  2254. #define LED4_PIN_INVERSE 0
  2255. #define LED4_RELAY 1
  2256. // -----------------------------------------------------------------------------
  2257. // Avatto NAS-WR01W Wifi Smart Power Plug
  2258. // https://www.aliexpress.com/item/33011753732.html
  2259. // https://todo...
  2260. // -----------------------------------------------------------------------------
  2261. #elif defined(AVATTO_NAS_WR01W)
  2262. // Info
  2263. #define MANUFACTURER "AVATTO"
  2264. #define DEVICE "NAS_WR01W"
  2265. // Buttons
  2266. #define BUTTON1_PIN 0
  2267. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2268. #define BUTTON1_RELAY 1
  2269. // Relays
  2270. #define RELAY1_PIN 14
  2271. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2272. // LEDs
  2273. #define LED1_PIN 13
  2274. #define LED1_PIN_INVERSE 1
  2275. // HJL01 / BL0937
  2276. #ifndef HLW8012_SUPPORT
  2277. #define HLW8012_SUPPORT 1
  2278. #endif
  2279. #define HLW8012_SEL_PIN 12
  2280. #define HLW8012_CF1_PIN 5
  2281. #define HLW8012_CF_PIN 4
  2282. #define HLW8012_SEL_CURRENT LOW
  2283. #define HLW8012_CURRENT_RATIO 25740
  2284. #define HLW8012_VOLTAGE_RATIO 313400
  2285. #define HLW8012_POWER_RATIO 3414290
  2286. #define HLW8012_INTERRUPT_ON FALLING
  2287. // -----------------------------------------------------------------------------
  2288. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  2289. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  2290. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  2291. // -----------------------------------------------------------------------------
  2292. #elif defined(NEO_COOLCAM_NAS_WR01W)
  2293. // Info
  2294. #define MANUFACTURER "NEO_COOLCAM"
  2295. #define DEVICE "NAS_WR01W"
  2296. // Buttons
  2297. #define BUTTON1_PIN 13
  2298. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2299. #define BUTTON1_RELAY 1
  2300. // Relays
  2301. #define RELAY1_PIN 12
  2302. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2303. // LEDs
  2304. #define LED1_PIN 4
  2305. #define LED1_PIN_INVERSE 1
  2306. // -----------------------------------------------------------------------------
  2307. // Deltaco SH_P01 Wifi Smart Power Plug
  2308. // -----------------------------------------------------------------------------
  2309. #elif defined(DELTACO_SH_P01)
  2310. // Info
  2311. #define MANUFACTURER "DELTACO"
  2312. #define DEVICE "SH_P01"
  2313. // Buttons
  2314. #define BUTTON1_PIN 13
  2315. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2316. #define BUTTON1_RELAY 1
  2317. // Relays
  2318. #define RELAY1_PIN 12
  2319. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2320. // LEDs
  2321. #define LED1_PIN 5
  2322. #define LED1_PIN_INVERSE 1
  2323. #define LED1_MODE LED_MODE_FINDME
  2324. // ------------------------------------------------------------------------------
  2325. // DELTACO_SH_P03USB Wifi Smart Power Plug
  2326. // -----------------------------------------------------------------------------
  2327. #elif defined(DELTACO_SH_P03USB)
  2328. // Info
  2329. #define MANUFACTURER "DELTACO"
  2330. #define DEVICE "SH_P03USB"
  2331. // Buttons
  2332. #define BUTTON1_PIN 13
  2333. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2334. #define BUTTON1_RELAY 2
  2335. // Relays
  2336. #define RELAY1_PIN 15 // USB power
  2337. #define RELAY2_PIN 12 // power plug 1
  2338. #define RELAY3_PIN 14 // power plug 2
  2339. #define RELAY4_PIN 5 // power plug 3
  2340. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2341. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2342. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2343. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2344. // LEDs
  2345. #define LED1_PIN 0 // power led
  2346. #define LED1_PIN_INVERSE 1
  2347. #define LED1_MODE LED_MODE_FINDME
  2348. // ------------------------------------------------------------------------------
  2349. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  2350. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  2351. // Also: Estink Wifi Power Strip
  2352. // -----------------------------------------------------------------------------
  2353. #elif defined(FORNORM_ZLD_34EU)
  2354. // Info
  2355. #define MANUFACTURER "FORNORM"
  2356. #define DEVICE "ZLD_34EU"
  2357. // Disable UART noise since this board uses GPIO3
  2358. #define DEBUG_SERIAL_SUPPORT 0
  2359. // Buttons
  2360. #define BUTTON1_PIN 16
  2361. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2362. #define BUTTON1_RELAY 4
  2363. // Relays
  2364. #define RELAY1_PIN 14 // USB power
  2365. #define RELAY2_PIN 13 // power plug 1
  2366. #define RELAY3_PIN 4 // power plug 2
  2367. #define RELAY4_PIN 15 // power plug 3
  2368. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2369. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2370. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2371. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2372. // LEDs
  2373. #define LED1_PIN 0 // power led
  2374. #define LED2_PIN 12 // power plug 1
  2375. #define LED3_PIN 3 // power plug 2
  2376. #define LED4_PIN 5 // power plug 3
  2377. #define LED1_PIN_INVERSE 1
  2378. #define LED2_PIN_INVERSE 1
  2379. #define LED3_PIN_INVERSE 1
  2380. #define LED4_PIN_INVERSE 1
  2381. #define LED1_MODE LED_MODE_FINDME
  2382. #define LED2_MODE LED_MODE_FOLLOW
  2383. #define LED3_MODE LED_MODE_FOLLOW
  2384. #define LED4_MODE LED_MODE_FOLLOW
  2385. #define LED2_RELAY 2
  2386. #define LED3_RELAY 3
  2387. #define LED4_RELAY 4
  2388. // -----------------------------------------------------------------------------
  2389. // Bruno Horta's OnOfre
  2390. // https://www.bhonofre.pt/
  2391. // https://github.com/brunohorta82/BH_OnOfre/
  2392. // -----------------------------------------------------------------------------
  2393. #elif defined(BH_ONOFRE)
  2394. // Info
  2395. #define MANUFACTURER "BH"
  2396. #define DEVICE "ONOFRE"
  2397. // Buttons
  2398. #define BUTTON1_PIN 12
  2399. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2400. #define BUTTON1_RELAY 1
  2401. #define BUTTON2_PIN 13
  2402. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2403. #define BUTTON2_RELAY 2
  2404. // Relays
  2405. #define RELAY1_PIN 4
  2406. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2407. #define RELAY2_PIN 5
  2408. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2409. // -----------------------------------------------------------------------------
  2410. // BlitzWolf SHP2 and SHP6
  2411. // Also several boards under different names uing a power chip labelled BL0937 or HJL-01
  2412. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  2413. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  2414. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  2415. // * Gosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  2416. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  2417. // * DIY Tech Smart Home (https://www.amazon.es/gp/product/B07HHKXYS9)
  2418. // -----------------------------------------------------------------------------
  2419. #elif defined(BLITZWOLF_BWSHPX)
  2420. // Info
  2421. #define MANUFACTURER "BLITZWOLF"
  2422. #define DEVICE "BWSHPX"
  2423. // Buttons
  2424. #define BUTTON1_PIN 13
  2425. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2426. #define BUTTON1_RELAY 1
  2427. // Relays
  2428. #define RELAY1_PIN 15
  2429. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2430. // LEDs
  2431. #define LED1_PIN 2
  2432. #define LED1_PIN_INVERSE 1
  2433. #define LED2_PIN 0
  2434. #define LED2_PIN_INVERSE 1
  2435. #define LED2_MODE LED_MODE_FINDME
  2436. #define LED2_RELAY 1
  2437. // HJL01 / BL0937
  2438. #ifndef HLW8012_SUPPORT
  2439. #define HLW8012_SUPPORT 1
  2440. #endif
  2441. #define HLW8012_SEL_PIN 12
  2442. #define HLW8012_CF1_PIN 14
  2443. #define HLW8012_CF_PIN 5
  2444. #define HLW8012_SEL_CURRENT LOW
  2445. #define HLW8012_CURRENT_RATIO 25740
  2446. #define HLW8012_VOLTAGE_RATIO 313400
  2447. #define HLW8012_POWER_RATIO 3414290
  2448. #define HLW8012_INTERRUPT_ON FALLING
  2449. // -----------------------------------------------------------------------------
  2450. // Same as the above but new board version marked V2.3
  2451. // BlitzWolf SHP2 V2.3
  2452. // Gosund SP1 V2.3
  2453. // -----------------------------------------------------------------------------
  2454. #elif defined(BLITZWOLF_BWSHPX_V23)
  2455. // Info
  2456. #define MANUFACTURER "BLITZWOLF"
  2457. #define DEVICE "BWSHPX_V23"
  2458. // Buttons
  2459. #define BUTTON1_PIN 3
  2460. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2461. #define BUTTON1_RELAY 1
  2462. // Relays
  2463. #define RELAY1_PIN 14
  2464. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2465. // LEDs
  2466. #define LED1_PIN 1
  2467. #define LED1_PIN_INVERSE 1
  2468. #define LED2_PIN 13
  2469. #define LED2_PIN_INVERSE 1
  2470. #define LED2_MODE LED_MODE_FINDME
  2471. #define LED2_RELAY 1
  2472. // HJL01 / BL0937
  2473. #ifndef HLW8012_SUPPORT
  2474. #define HLW8012_SUPPORT 1
  2475. #endif
  2476. #define HLW8012_SEL_PIN 12
  2477. #define HLW8012_CF1_PIN 5
  2478. #define HLW8012_CF_PIN 4
  2479. #define HLW8012_SEL_CURRENT LOW
  2480. #define HLW8012_CURRENT_RATIO 25740
  2481. #define HLW8012_VOLTAGE_RATIO 313400
  2482. #define HLW8012_POWER_RATIO 3414290
  2483. #define HLW8012_INTERRUPT_ON FALLING
  2484. // BUTTON1 and LED1 are using Serial pins
  2485. #define DEBUG_SERIAL_SUPPORT 0
  2486. // -----------------------------------------------------------------------------
  2487. // Similar to both devices above but also with switchable USB ports
  2488. // and other sensor (CSE7766).
  2489. // the pin layout is different to the above two versions
  2490. // BlitzWolf SHP5
  2491. // -----------------------------------------------------------------------------
  2492. #elif defined(BLITZWOLF_BWSHP5)
  2493. // Info
  2494. #define MANUFACTURER "BLITZWOLF"
  2495. #define DEVICE "BWSHP5"
  2496. // Buttons
  2497. #define BUTTON1_PIN 16
  2498. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2499. #define BUTTON1_RELAY 1
  2500. // Relays
  2501. // Power plug
  2502. #define RELAY1_PIN 14
  2503. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2504. // USB
  2505. #define RELAY2_PIN 5
  2506. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2507. // LEDs
  2508. #define LED1_PIN 2
  2509. #define LED1_PIN_INVERSE 1
  2510. #define LED2_PIN 0
  2511. #define LED2_PIN_INVERSE 1
  2512. #define LED2_MODE LED_MODE_FINDME
  2513. #define LED2_RELAY 1
  2514. // Disable UART noise
  2515. #define DEBUG_SERIAL_SUPPORT 0
  2516. // CSE7766
  2517. #ifndef CSE7766_SUPPORT
  2518. #define CSE7766_SUPPORT 1
  2519. #endif
  2520. #define CSE7766_RX_PIN 3
  2521. // -----------------------------------------------------------------------------
  2522. // Teckin SP21
  2523. // -----------------------------------------------------------------------------
  2524. #elif defined(TECKIN_SP21)
  2525. // Info
  2526. #define MANUFACTURER "TECKIN"
  2527. #define DEVICE "SP21"
  2528. // Buttons
  2529. #define BUTTON1_PIN 13
  2530. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2531. #define BUTTON1_RELAY 1
  2532. // Relays
  2533. #define RELAY1_PIN 15
  2534. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2535. // LEDs
  2536. #define LED1_PIN 2
  2537. #define LED1_PIN_INVERSE 1
  2538. // -----------------------------------------------------------------------------
  2539. // Teckin SP22 v1.4 - v1.6
  2540. // -----------------------------------------------------------------------------
  2541. #elif defined(TECKIN_SP22_V14)
  2542. // Info
  2543. #define MANUFACTURER "TECKIN"
  2544. #define DEVICE "SP22_V14"
  2545. // Buttons
  2546. #define BUTTON1_PIN 1
  2547. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2548. #define BUTTON1_RELAY 1
  2549. // Relays
  2550. #define RELAY1_PIN 14
  2551. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2552. // LEDs
  2553. #define LED1_PIN 3
  2554. #define LED1_PIN_INVERSE 1
  2555. #define LED2_PIN 13
  2556. #define LED2_PIN_INVERSE 1
  2557. #define LED2_MODE LED_MODE_FINDME
  2558. #define LED2_RELAY 1
  2559. // HJL01 / BL0937
  2560. #ifndef HLW8012_SUPPORT
  2561. #define HLW8012_SUPPORT 1
  2562. #endif
  2563. #define HLW8012_SEL_PIN 12
  2564. #define HLW8012_CF1_PIN 5
  2565. #define HLW8012_CF_PIN 4
  2566. #define HLW8012_SEL_CURRENT LOW
  2567. #define HLW8012_CURRENT_RATIO 20730
  2568. #define HLW8012_VOLTAGE_RATIO 264935
  2569. #define HLW8012_POWER_RATIO 2533110
  2570. #define HLW8012_INTERRUPT_ON FALLING
  2571. // BUTTON1 and LED1 are using Serial pins
  2572. #define DEBUG_SERIAL_SUPPORT 0
  2573. // -----------------------------------------------------------------------------
  2574. // Teckin SP22 v1.4 - v1.6
  2575. //
  2576. // NB Notes suggest that energy monitoring is removed from later versions
  2577. // -----------------------------------------------------------------------------
  2578. #elif defined(TECKIN_SP23_V13)
  2579. // Info .. NB Newer versions apparently lack energy monitor
  2580. // The board revision is not indicated externally
  2581. #define MANUFACTURER "TECKIN"
  2582. #define DEVICE "SP23_V13"
  2583. // Buttons
  2584. #define BUTTON1_PIN 13
  2585. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2586. #define BUTTON1_RELAY 1
  2587. // Relays
  2588. #define RELAY1_PIN 15
  2589. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2590. // LEDs
  2591. #define LED1_PIN 4
  2592. #define LED1_PIN_INVERSE 1
  2593. #define LED2_PIN 2
  2594. #define LED2_PIN_INVERSE 0
  2595. #define LED2_MODE LED_MODE_FINDME
  2596. #define LED2_RELAY 1
  2597. // HJL01 / BL0937
  2598. #ifndef HLW8012_SUPPORT
  2599. #define HLW8012_SUPPORT 1
  2600. #endif
  2601. #define HLW8012_SEL_PIN 12
  2602. #define HLW8012_CF1_PIN 14
  2603. #define HLW8012_CF_PIN 5
  2604. #define HLW8012_SEL_CURRENT LOW
  2605. #define HLW8012_CURRENT_RATIO 23324
  2606. #define HLW8012_VOLTAGE_RATIO 324305
  2607. #define HLW8012_POWER_RATIO 3580841
  2608. #define HLW8012_INTERRUPT_ON FALLING
  2609. // -----------------------------------------------------------------------------
  2610. // The Gosund WP3 is based on ESP8285, so 1 MB internal flash (DOUT required)
  2611. // The module has no-connect: TX, RX, RST, AD, GPIO5, (and GPIO0,
  2612. // GPIO2 via test points on the back of the module)
  2613. // and these are wired to devices:
  2614. // GPIO4: /BTN
  2615. // GPIO12: /LED red
  2616. // GPIO13: /LED blue
  2617. // GPIO14: RELAY
  2618. // -----------------------------------------------------------------------------
  2619. #elif defined(GOSUND_WP3)
  2620. // Info
  2621. #define MANUFACTURER "GOSUND"
  2622. #define DEVICE "WP3"
  2623. // Buttons
  2624. #define BUTTON1_PIN 4
  2625. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2626. #define BUTTON1_RELAY 1
  2627. // the defaults are reasonable, but you can change them as desired
  2628. //#define BUTTON1_PRESS BUTTON_ACTION_NONE
  2629. //#define BUTTON1_CLICK BUTTON_ACTION_TOGGLE
  2630. //#define BUTTON1_DBLCLICK BUTTON_ACTION_AP
  2631. //#define BUTTON1_LNGCLICK BUTTON_ACTION_RESET
  2632. //#define BUTTON1_LNGLNGCLICK BUTTON_ACTION_FACTORY
  2633. // Relays
  2634. #define RELAY1_PIN 14
  2635. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2636. // LEDs
  2637. // LED1 (red) indicates on/off state; you could use LED_MODE_FOLLOW_INVERSE
  2638. // so that the LED lights the button when 'off' so it can be found easily.
  2639. #define LED1_PIN 12
  2640. #define LED1_PIN_INVERSE 1
  2641. #define LED1_MODE LED_MODE_FOLLOW
  2642. #define LED1_RELAY 1
  2643. // LED2 (blue) indicates wifi activity
  2644. #define LED2_PIN 13
  2645. #define LED2_PIN_INVERSE 1
  2646. #define LED2_MODE LED_MODE_WIFI
  2647. // -----------------------------------------------------------------------------
  2648. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  2649. // Also model number KS-602S
  2650. // -----------------------------------------------------------------------------
  2651. #elif defined(GOSUND_WS1)
  2652. // Info
  2653. #define MANUFACTURER "GOSUND"
  2654. #define DEVICE "WS1"
  2655. // Buttons
  2656. #define BUTTON1_PIN 0
  2657. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2658. #define BUTTON1_RELAY 1
  2659. // Relays
  2660. #define RELAY1_PIN 14
  2661. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2662. // LEDs
  2663. #define LED1_PIN 1
  2664. #define LED1_PIN_INVERSE 1
  2665. // LED1 is using TX pin
  2666. #define DEBUG_SERIAL_SUPPORT 0
  2667. // ----------------------------------------------------------------------------------------
  2668. // Power socket 16A similar to BLITZWOLF_BWSHPX but button pin differs
  2669. // IMPORTANT, This template is for hardware version SP111_A_Wifi_Ver1.1 (as printed on the PCB)
  2670. // hhttps://www.amazon.de/-/en/Smallest-Consumption-Measuring-Function-Compatible/dp/B07PSMF47W
  2671. // ----------------------------------------------------------------------------------------
  2672. #elif defined(GOSUND_SP111)
  2673. // Info
  2674. #define MANUFACTURER "GOSUND"
  2675. #define DEVICE "SP111"
  2676. // Buttons
  2677. #define BUTTON1_PIN 13
  2678. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2679. #define BUTTON1_RELAY 1
  2680. // Relays
  2681. #define RELAY1_PIN 15
  2682. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2683. // LEDs
  2684. #define LED1_PIN 2
  2685. #define LED1_PIN_INVERSE 1
  2686. #define LED2_PIN 0
  2687. #define LED2_PIN_INVERSE 1
  2688. #define LED2_MODE LED_MODE_FINDME
  2689. #define LED2_RELAY 1
  2690. // HJL01 / BL0937
  2691. #ifndef HLW8012_SUPPORT
  2692. #define HLW8012_SUPPORT 1
  2693. #endif
  2694. #define HLW8012_SEL_PIN 12
  2695. #define HLW8012_CF1_PIN 4
  2696. #define HLW8012_CF_PIN 5
  2697. #define HLW8012_SEL_CURRENT LOW
  2698. #define HLW8012_CURRENT_RATIO 25740
  2699. #define HLW8012_VOLTAGE_RATIO 313400
  2700. #define HLW8012_POWER_RATIO 3414290
  2701. #define HLW8012_INTERRUPT_ON FALLING
  2702. // ----------------------------------------------------------------------------------------
  2703. // Homecube 16A is similar but some pins differ and it also has RGB LEDs
  2704. // https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
  2705. // ----------------------------------------------------------------------------------------
  2706. #elif defined(HOMECUBE_16A)
  2707. // Info
  2708. #define MANUFACTURER "HOMECUBE"
  2709. #define DEVICE "16A"
  2710. // Buttons
  2711. #define BUTTON1_PIN 13
  2712. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2713. #define BUTTON1_RELAY 1
  2714. // Relays
  2715. #define RELAY1_PIN 15
  2716. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2717. // LEDs
  2718. //LED Pin 4 - ESP8266 onboard LED
  2719. //Red LED: 0
  2720. //Green LED: 12
  2721. //Blue LED: 2
  2722. // Blue
  2723. #define LED1_PIN 2
  2724. #define LED1_PIN_INVERSE 0
  2725. // Green
  2726. #define LED2_PIN 12
  2727. #define LED2_PIN_INVERSE 1
  2728. #define LED2_MODE LED_MODE_RELAY
  2729. // Red
  2730. #define LED3_PIN 0
  2731. #define LED3_PIN_INVERSE 0
  2732. #define LED3_MODE LED_MODE_OFF
  2733. // HJL01 / BL0937
  2734. #ifndef HLW8012_SUPPORT
  2735. #define HLW8012_SUPPORT 1
  2736. #endif
  2737. #define HLW8012_SEL_PIN 16
  2738. #define HLW8012_CF1_PIN 14
  2739. #define HLW8012_CF_PIN 5
  2740. #define HLW8012_SEL_CURRENT LOW
  2741. #define HLW8012_CURRENT_RATIO 25740
  2742. #define HLW8012_VOLTAGE_RATIO 313400
  2743. #define HLW8012_POWER_RATIO 3414290
  2744. #define HLW8012_INTERRUPT_ON FALLING
  2745. // -----------------------------------------------------------------------------
  2746. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  2747. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  2748. // -----------------------------------------------------------------------------
  2749. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  2750. // Info
  2751. #define MANUFACTURER "VANZAVANZU"
  2752. #define DEVICE "SMART_WIFI_PLUG_MINI"
  2753. // Buttons
  2754. #define BUTTON1_PIN 13
  2755. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2756. #define BUTTON1_RELAY 1
  2757. // Relays
  2758. #define RELAY1_PIN 15
  2759. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2760. // LEDs
  2761. #define LED1_PIN 2
  2762. #define LED1_PIN_INVERSE 1
  2763. #define LED2_PIN 0
  2764. #define LED2_PIN_INVERSE 1
  2765. #define LED2_MODE LED_MODE_FINDME
  2766. #define LED2_RELAY 1
  2767. // Disable UART noise
  2768. #define DEBUG_SERIAL_SUPPORT 0
  2769. // HJL01 / BL0937
  2770. #ifndef HLW8012_SUPPORT
  2771. #define HLW8012_SUPPORT 1
  2772. #endif
  2773. #define HLW8012_SEL_PIN 3
  2774. #define HLW8012_CF1_PIN 14
  2775. #define HLW8012_CF_PIN 5
  2776. #define HLW8012_SEL_CURRENT LOW
  2777. #define HLW8012_CURRENT_RATIO 25740
  2778. #define HLW8012_VOLTAGE_RATIO 313400
  2779. #define HLW8012_POWER_RATIO 3414290
  2780. #define HLW8012_INTERRUPT_ON FALLING
  2781. // -----------------------------------------------------------------------------
  2782. #elif defined(GENERIC_AG_L4)
  2783. // Info
  2784. #define MANUFACTURER "GENERIC"
  2785. #define DEVICE "AG_L4"
  2786. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2787. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2788. #define DUMMY_RELAY_COUNT 1
  2789. // button 1: "power" button
  2790. #define BUTTON1_PIN 4
  2791. #define BUTTON1_RELAY 1
  2792. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2793. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  2794. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  2795. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  2796. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  2797. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  2798. // button 2: "wifi" button
  2799. #define BUTTON2_PIN 2
  2800. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2801. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  2802. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  2803. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  2804. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  2805. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_NONE
  2806. // LEDs
  2807. #define LED1_PIN 5 // red status led
  2808. #define LED1_PIN_INVERSE 0
  2809. #define LED2_PIN 16 // master light power
  2810. #define LED2_PIN_INVERSE 1
  2811. #define LED2_MODE LED_MODE_RELAY
  2812. // Light
  2813. #define LIGHT_CHANNELS 3
  2814. #define LIGHT_CH1_PIN 14 // RED
  2815. #define LIGHT_CH2_PIN 13 // GREEN
  2816. #define LIGHT_CH3_PIN 12 // BLUE
  2817. // -----------------------------------------------------------------------------
  2818. #elif defined(GENERIC_AG_L4_V3)
  2819. // Info
  2820. #define MANUFACTURER "GENERIC"
  2821. #define DEVICE "AG_L4_V3"
  2822. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2823. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2824. #define DUMMY_RELAY_COUNT 1
  2825. // button 1: "power" button
  2826. #define BUTTON1_PIN 13
  2827. #define BUTTON1_RELAY 1
  2828. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2829. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  2830. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  2831. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  2832. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  2833. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  2834. // button 2: "wifi" button
  2835. #define BUTTON2_PIN 2
  2836. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2837. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  2838. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  2839. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  2840. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  2841. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_NONE
  2842. // LEDs
  2843. #define LED1_PIN 5 // red status led
  2844. #define LED1_PIN_INVERSE 0
  2845. #define LED2_PIN 16 // master light power
  2846. #define LED2_PIN_INVERSE 1
  2847. #define LED2_MODE LED_MODE_RELAY
  2848. // Light
  2849. #define LIGHT_CHANNELS 3
  2850. #define LIGHT_CH1_PIN 4 // RED
  2851. #define LIGHT_CH2_PIN 12 // GREEN
  2852. #define LIGHT_CH3_PIN 14 // BLUE
  2853. // -----------------------------------------------------------------------------
  2854. #elif defined(ALLTERCO_SHELLY1)
  2855. // Info
  2856. #define MANUFACTURER "ALLTERCO"
  2857. #define DEVICE "SHELLY1"
  2858. // Buttons
  2859. #define BUTTON1_PIN 5
  2860. #define BUTTON1_CONFIG BUTTON_SWITCH
  2861. #define BUTTON1_RELAY 1
  2862. // Relays
  2863. #define RELAY1_PIN 4
  2864. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2865. #elif defined(ALLTERCO_SHELLY2)
  2866. // Info
  2867. #define MANUFACTURER "ALLTERCO"
  2868. #define DEVICE "SHELLY2"
  2869. // Buttons
  2870. #define BUTTON1_PIN 12
  2871. #define BUTTON2_PIN 14
  2872. #define BUTTON1_CONFIG BUTTON_SWITCH
  2873. #define BUTTON2_CONFIG BUTTON_SWITCH
  2874. #define BUTTON1_RELAY 1
  2875. #define BUTTON2_RELAY 2
  2876. // Relays
  2877. #define RELAY1_PIN 4
  2878. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2879. #define RELAY2_PIN 5
  2880. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2881. #elif defined(ALLTERCO_SHELLY1PM)
  2882. // Info
  2883. #define MANUFACTURER "ALLTERCO"
  2884. #define DEVICE "SHELLY1PM"
  2885. // Buttons
  2886. #define BUTTON1_PIN 4
  2887. #define BUTTON1_CONFIG BUTTON_SWITCH
  2888. #define BUTTON1_RELAY 1
  2889. #define BUTTON2_PIN 2
  2890. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2891. #define BUTTON2_LNGCLICK BUTTON_ACTION_RESET
  2892. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_FACTORY
  2893. // Relays
  2894. #define RELAY1_PIN 15
  2895. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2896. // Light
  2897. #define LED1_PIN 0
  2898. #define LED1_PIN_INVERSE 1
  2899. // HJL01 / BL0937
  2900. #define HLW8012_SUPPORT 1
  2901. #define HLW8012_SEL_PIN 12
  2902. #define HLW8012_CF1_PIN 13
  2903. #define HLW8012_CF_PIN 5
  2904. #define HLW8012_SEL_CURRENT LOW
  2905. #define HLW8012_CURRENT_RATIO 25740
  2906. #define HLW8012_VOLTAGE_RATIO 313400
  2907. #define HLW8012_POWER_RATIO 3414290
  2908. #define HLW8012_INTERRUPT_ON FALLING
  2909. //Temperature
  2910. #define NTC_SUPPORT 1
  2911. #define SENSOR_SUPPORT 1
  2912. #define NTC_BETA 3350
  2913. #define NTC_R_UP 10000
  2914. #define NTC_R_DOWN 0
  2915. #define NTC_R0 8000
  2916. #elif defined(ALLTERCO_SHELLY25)
  2917. // Info
  2918. #define MANUFACTURER "ALLTERCO"
  2919. #define DEVICE "SHELLY25"
  2920. // Buttons
  2921. #define BUTTON1_PIN 13
  2922. #define BUTTON1_CONFIG BUTTON_SWITCH
  2923. #define BUTTON1_RELAY 1
  2924. #define BUTTON2_PIN 5
  2925. #define BUTTON2_CONFIG BUTTON_SWITCH
  2926. #define BUTTON2_RELAY 2
  2927. #define BUTTON3_PIN 2
  2928. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2929. #define BUTTON3_LNGCLICK BUTTON_ACTION_RESET
  2930. #define BUTTON3_LNGLNGCLICK BUTTON_ACTION_FACTORY
  2931. // Relays
  2932. #define RELAY1_PIN 4
  2933. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2934. #define RELAY2_PIN 15
  2935. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2936. // Light
  2937. #define LED1_PIN 0
  2938. #define LED1_PIN_INVERSE 1
  2939. //Temperature
  2940. #define NTC_SUPPORT 1
  2941. #define SENSOR_SUPPORT 1
  2942. #define NTC_BETA 3350
  2943. #define NTC_R_UP 10000
  2944. #define NTC_R_DOWN 0
  2945. #define NTC_R0 8000
  2946. //Current
  2947. #define ADE7953_SUPPORT 1
  2948. #define I2C_SDA_PIN 12
  2949. #define I2C_SCL_PIN 14
  2950. // -----------------------------------------------------------------------------
  2951. // This device has teh same behaviour as the GOSUND WP3, but with different GPIO pin values
  2952. // GPIO equivalents extracted from https://templates.blakadder.com/aoycocr_X5P.html
  2953. #elif defined(AOYCOCR_X5P)
  2954. // Info
  2955. #define MANUFACTURER "AOYCOCR"
  2956. #define DEVICE "X5P"
  2957. // Buttons
  2958. #define BUTTON1_PIN 13
  2959. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2960. #define BUTTON1_RELAY 1
  2961. // the defaults are reasonable, but you can change them as desired
  2962. //#define BUTTON1_PRESS BUTTON_ACTION_NONE
  2963. //#define BUTTON1_CLICK BUTTON_ACTION_TOGGLE
  2964. //#define BUTTON1_DBLCLICK BUTTON_ACTION_AP
  2965. //#define BUTTON1_LNGCLICK BUTTON_ACTION_RESET
  2966. //#define BUTTON1_LNGLNGCLICK BUTTON_ACTION_FACTORY
  2967. // Relays
  2968. #define RELAY1_PIN 15
  2969. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2970. // LEDs
  2971. // LED1 (red) indicates on/off state; you could use LED_MODE_FOLLOW_INVERSE
  2972. // so that the LED lights the button when 'off' so it can be found easily.
  2973. #define LED1_PIN 0
  2974. #define LED1_PIN_INVERSE 1
  2975. #define LED1_MODE LED_MODE_FOLLOW
  2976. #define LED1_RELAY 1
  2977. // LED2 (blue) indicates wifi activity
  2978. #define LED2_PIN 2
  2979. #define LED2_PIN_INVERSE 1
  2980. #define LED2_MODE LED_MODE_WIFI
  2981. // -----------------------------------------------------------------------------
  2982. // also works with https://www.amazon.com/gp/product/B07TMY394G/
  2983. // see https://github.com/xoseperez/espurna/issues/2055
  2984. #elif defined(LOHAS_E27_9W)
  2985. // Info
  2986. #define MANUFACTURER "LOHAS"
  2987. #define DEVICE "E27_9W"
  2988. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2989. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2990. #define DUMMY_RELAY_COUNT 1
  2991. // Light
  2992. #define LIGHT_CHANNELS 5
  2993. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2994. #define MY92XX_CHIPS 2
  2995. #define MY92XX_DI_PIN 13
  2996. #define MY92XX_DCKI_PIN 15
  2997. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2998. #define MY92XX_MAPPING 0, 1, 2, 3, 4
  2999. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  3000. // https://www.amazon.com/gp/product/B07T7W7ZMW
  3001. #elif defined(LOHAS_E26_A19)
  3002. // Info
  3003. #define MANUFACTURER "LOHAS"
  3004. #define DEVICE "E26_A19"
  3005. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3006. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3007. #define DUMMY_RELAY_COUNT 1
  3008. // Light
  3009. #define LIGHT_CHANNELS 5
  3010. #define LIGHT_CH1_PIN 5 // RED
  3011. #define LIGHT_CH2_PIN 4 // GREEN
  3012. #define LIGHT_CH3_PIN 13 // BLUE
  3013. #define LIGHT_CH4_PIN 14 // WHITE1
  3014. #define LIGHT_CH5_PIN 12 // WHITE1
  3015. // -----------------------------------------------------------------------------
  3016. #elif defined(TECKIN_SB53)
  3017. // Info
  3018. #define MANUFACTURER "TECKIN"
  3019. #define DEVICE "SB53"
  3020. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3021. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3022. #define DUMMY_RELAY_COUNT 1
  3023. // Light
  3024. #define LIGHT_CHANNELS 5
  3025. #define LIGHT_CH1_PIN 4 // RED
  3026. #define LIGHT_CH2_PIN 12 // GREEN
  3027. #define LIGHT_CH3_PIN 14 // BLUE
  3028. #define LIGHT_CH4_PIN 13 // WARM WHITE
  3029. #define LIGHT_CH5_PIN 5 // COLD WHITE
  3030. // -----------------------------------------------------------------------------
  3031. #elif defined(XIAOMI_SMART_DESK_LAMP)
  3032. // Info
  3033. #define MANUFACTURER "XIAOMI"
  3034. #define DEVICE "SMART_DESK_LAMP"
  3035. // Buttons
  3036. #define BUTTON1_PIN 2
  3037. #define BUTTON2_PIN 14
  3038. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  3039. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  3040. // This button doubles as switch here and as encoder mode switch below
  3041. // Clicking it (for less than 500ms) will turn the light on and off
  3042. // Double and Long clicks will not work as these are used to modify the encoder action
  3043. #define BUTTON1_RELAY 1
  3044. #define BUTTON_LNGCLICK_DELAY 500
  3045. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  3046. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  3047. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_NONE
  3048. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  3049. #define BUTTON2_DBLCLICK BUTTON_ACTION_AP
  3050. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_RESET
  3051. // Light
  3052. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3053. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3054. #define DUMMY_RELAY_COUNT 1
  3055. #define LIGHT_STEP 8
  3056. #define LIGHT_CHANNELS 2
  3057. #define LIGHT_CH1_PIN 5 // warm white
  3058. #define LIGHT_CH2_PIN 4 // cold white
  3059. // https://www.xiaomitoday.com/xiaomi-mijia-mjtd01yl-led-desk-lamp-review/
  3060. #define LIGHT_COLDWHITE_MIRED 153
  3061. #define LIGHT_WARMWHITE_MIRED 370
  3062. // Encoder
  3063. // If mode is ENCODER_MODE_RATIO, the value ratio between both channels is changed
  3064. // when the button is not pressed, and the overall brightness when pressed
  3065. // If mode is ENCODER_MODE_CHANNEL, the first channel value is changed
  3066. // when the button is not pressed, and the second channel when pressed
  3067. // If no ENCODERX_BUTTON_PIN defined it will only change the value of the first defined channel
  3068. #define ENCODER_SUPPORT 1
  3069. #define ENCODER1_PIN1 12
  3070. #define ENCODER1_PIN2 13
  3071. #define ENCODER1_BUTTON_PIN 2 // active low by default, with software pullup
  3072. #define ENCODER1_CHANNEL1 0 // please note this value is 0-based (LIGHT_CH1 above)
  3073. #define ENCODER1_CHANNEL2 1 // please note this value is 0-based (LIGHT_CH2 above)
  3074. #define ENCODER1_MODE ENCODER_MODE_RATIO
  3075. #elif defined(PHYX_ESP12_RGB)
  3076. // Info
  3077. #define MANUFACTURER "PHYX"
  3078. #define DEVICE "ESP12_RGB"
  3079. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3080. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3081. #define DUMMY_RELAY_COUNT 1
  3082. // Light
  3083. #define LIGHT_CHANNELS 3
  3084. #define LIGHT_CH1_PIN 4 // RED
  3085. #define LIGHT_CH2_PIN 14 // GREEN
  3086. #define LIGHT_CH3_PIN 12 // BLUE
  3087. // -----------------------------------------------------------------------------
  3088. // iWoole LED Table Lamp
  3089. // http://iwoole.com/newst-led-smart-night-light-7w-smart-table-light-rgbw-wifi-app-remote-control-110v-220v-us-eu-plug-smart-lamp-google-home-decore-p00022p1.html
  3090. // -----------------------------------------------------------------------------
  3091. #elif defined(IWOOLE_LED_TABLE_LAMP)
  3092. // Info
  3093. #define MANUFACTURER "IWOOLE"
  3094. #define DEVICE "LED_TABLE_LAMP"
  3095. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3096. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3097. #define DUMMY_RELAY_COUNT 1
  3098. // Light
  3099. #define LIGHT_CHANNELS 4
  3100. #define LIGHT_CH1_PIN 12 // RED
  3101. #define LIGHT_CH2_PIN 5 // GREEN
  3102. #define LIGHT_CH3_PIN 14 // BLUE
  3103. #define LIGHT_CH4_PIN 4 // WHITE
  3104. // -----------------------------------------------------------------------------
  3105. // Generic GU10
  3106. // https://www.ebay.com/itm/1-10PC-GU10-RGB-Smart-Bulb-Wireless-WiFi-App-Remote-Ctrl-Light-for-Alexa-Google/173724116351
  3107. // -----------------------------------------------------------------------------
  3108. #elif defined(GENERIC_GU10)
  3109. // Info
  3110. #define MANUFACTURER "GENERIC"
  3111. #define DEVICE "GU10"
  3112. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3113. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3114. #define DUMMY_RELAY_COUNT 1
  3115. // Light
  3116. #define LIGHT_CHANNELS 4
  3117. #define LIGHT_CH1_PIN 14 // RED
  3118. #define LIGHT_CH2_PIN 12 // GREEN
  3119. #define LIGHT_CH3_PIN 13 // BLUE
  3120. #define LIGHT_CH4_PIN 4 // WHITE
  3121. // -----------------------------------------------------------------------------
  3122. // Generic E14
  3123. // https://www.ebay.com/itm/LED-Bulb-Wifi-E14-4-5W-Candle-RGB-W-4in1-Dimmable-V-tac-Smart-VT-5114/163899840601
  3124. // -----------------------------------------------------------------------------
  3125. #elif defined(GENERIC_E14)
  3126. // Info
  3127. #define MANUFACTURER "GENERIC"
  3128. #define DEVICE "E14"
  3129. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3130. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3131. #define DUMMY_RELAY_COUNT 1
  3132. // Light
  3133. #define LIGHT_CHANNELS 4
  3134. #define LIGHT_CH1_PIN 4 // RED
  3135. #define LIGHT_CH2_PIN 12 // GREEN
  3136. #define LIGHT_CH3_PIN 14 // BLUE
  3137. #define LIGHT_CH4_PIN 5 // WHITE
  3138. // -----------------------------------------------------------------------------
  3139. // Deltaco white e14 (SH-LE14W) and e27 (SH-LE27W)
  3140. // -----------------------------------------------------------------------------
  3141. #elif defined(DELTACO_SH_LEXXW)
  3142. // Info
  3143. #define MANUFACTURER "DELTACO"
  3144. #define DEVICE "SH_LEXXW"
  3145. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3146. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3147. #define DUMMY_RELAY_COUNT 1
  3148. // Light
  3149. #define LIGHT_CHANNELS 2
  3150. #define LIGHT_CH1_PIN 12 // WARM WHITE
  3151. #define LIGHT_CH2_PIN 14 // COLD WHITE
  3152. // -----------------------------------------------------------------------------
  3153. // Deltaco rgbw e27 (SH-LE27RGB)
  3154. // -----------------------------------------------------------------------------
  3155. #elif defined(DELTACO_SH_LEXXRGB)
  3156. // Info
  3157. #define MANUFACTURER "DELTACO"
  3158. #define DEVICE "SH_LEXXRGB"
  3159. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3160. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3161. #define DUMMY_RELAY_COUNT 1
  3162. // Light
  3163. #define LIGHT_CHANNELS 5
  3164. #define LIGHT_CH1_PIN 5 // RED
  3165. #define LIGHT_CH2_PIN 4 // GREEN
  3166. #define LIGHT_CH3_PIN 13 // BLUE
  3167. #define LIGHT_CH4_PIN 14 // WARM WHITE
  3168. #define LIGHT_CH5_PIN 12 // COLD WHITE
  3169. // -----------------------------------------------------------------------------
  3170. // Nexete A19
  3171. // https://www.ebay.com/itm/Wifi-Smart-LED-light-Bulb-9W-60W-A19-850LM-RGBW-Dimmable-for-Alexa-Google-Home/283514779201
  3172. // -----------------------------------------------------------------------------
  3173. #elif defined(NEXETE_A19)
  3174. // Info
  3175. #define MANUFACTURER "NEXETE"
  3176. #define DEVICE "A19"
  3177. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3178. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3179. #define DUMMY_RELAY_COUNT 1
  3180. // Light
  3181. #define LIGHT_CHANNELS 4
  3182. #define LIGHT_CH1_PIN 12 // RED
  3183. #define LIGHT_CH2_PIN 15 // GREEN
  3184. #define LIGHT_CH3_PIN 14 // BLUE
  3185. #define LIGHT_CH4_PIN 5 // WHITE
  3186. // -----------------------------------------------------------------------------
  3187. // Lombex Lux Nova 2 Tunable White
  3188. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  3189. // -----------------------------------------------------------------------------
  3190. #elif defined(LOMBEX_LUX_NOVA2_TUNABLE_WHITE)
  3191. // Info
  3192. #define MANUFACTURER "LOMBEX"
  3193. #define DEVICE "LUX_NOVA2_TUNABLE_WHITE"
  3194. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3195. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  3196. #define DUMMY_RELAY_COUNT 1
  3197. // Light
  3198. #define LIGHT_CHANNELS 5
  3199. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  3200. #define MY92XX_CHIPS 1
  3201. #define MY92XX_DI_PIN 4
  3202. #define MY92XX_DCKI_PIN 5
  3203. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  3204. // No RGB on this bulb. Warm white on channel 0, cool white on channel 3
  3205. #define MY92XX_MAPPING 255, 255, 255, 3, 0
  3206. // -----------------------------------------------------------------------------
  3207. // Lombex Lux Nova 2 White and Color
  3208. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  3209. // -----------------------------------------------------------------------------
  3210. #elif defined(LOMBEX_LUX_NOVA2_WHITE_COLOR)
  3211. // Info
  3212. #define MANUFACTURER "LOMBEX"
  3213. #define DEVICE "LUX_NOVA2_WHITE_COLOR"
  3214. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3215. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  3216. #define DUMMY_RELAY_COUNT 1
  3217. // Light
  3218. #define LIGHT_CHANNELS 4
  3219. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  3220. #define MY92XX_CHIPS 1
  3221. #define MY92XX_DI_PIN 4
  3222. #define MY92XX_DCKI_PIN 5
  3223. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  3224. // RGB on channels 0/1/2, either cool or warm white on channel 3
  3225. // The bulb *should* have cool leds, but could also have warm leds as a common defect
  3226. #define MY92XX_MAPPING 0, 1, 2, 3
  3227. // -----------------------------------------------------------------------------
  3228. // Bestek Smart Plug with 2 USB ports
  3229. // https://www.bestekcorp.com/bestek-smart-plug-works-with-amazon-alexa-google-assistant-and-ifttt-with-2-usb
  3230. // -----------------------------------------------------------------------------
  3231. #elif defined(BESTEK_MRJ1011)
  3232. // Info
  3233. #define MANUFACTURER "BESTEK"
  3234. #define DEVICE "MRJ1011"
  3235. // Buttons
  3236. #define BUTTON1_PIN 13
  3237. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  3238. #define BUTTON1_RELAY 1
  3239. // Relay
  3240. #define RELAY1_PIN 12
  3241. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3242. // LED
  3243. #define LED1_PIN 4
  3244. #define LED1_PIN_INVERSE 1
  3245. // -----------------------------------------------------------------------------
  3246. // GBLIFE RGBW SOCKET
  3247. // -----------------------------------------------------------------------------
  3248. #elif defined(GBLIFE_RGBW_SOCKET)
  3249. // Info
  3250. #define MANUFACTURER "GBLIFE"
  3251. #define DEVICE "RGBW_SOCKET"
  3252. // Buttons
  3253. #define BUTTON1_PIN 13
  3254. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3255. #define BUTTON1_RELAY 1
  3256. // Relays
  3257. #define RELAY1_PIN 15
  3258. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3259. // Light RGBW
  3260. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3261. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3262. #define DUMMY_RELAY_COUNT 1
  3263. #define LIGHT_CHANNELS 4
  3264. #define LIGHT_CH1_PIN 5 // RED
  3265. #define LIGHT_CH2_PIN 14 // GREEN
  3266. #define LIGHT_CH3_PIN 12 // BLUE
  3267. #define LIGHT_CH4_PIN 4 // WHITE
  3268. // ----------------------------------------------------------------------------------------
  3269. // Smart life Mini Smart Socket is similar Homecube 16A but some GPIOs differ
  3270. // https://www.ebay.de/itm/Smart-Steckdose-WIFI-WLAN-Amazon-Alexa-Fernbedienung-Home-Socket-Zeitschaltuh-DE/123352026749?hash=item1cb85a8e7d:g:IasAAOSwk6dbj390
  3271. // Also labeled NETVIP
  3272. // https://www.amazon.es/Inteligente-NETVIP-Inal%C3%A1mbrico-Interruptor-Funciona/dp/B07KH8YWS5
  3273. // ----------------------------------------------------------------------------------------
  3274. #elif defined(SMARTLIFE_MINI_SMART_SOCKET)
  3275. // Info
  3276. #define MANUFACTURER "SMARTLIFE"
  3277. #define DEVICE "MINI_SMART_SOCKET"
  3278. // Buttons
  3279. #define BUTTON1_PIN 13
  3280. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3281. #define BUTTON1_RELAY 1
  3282. // Relays
  3283. #define RELAY1_PIN 15
  3284. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3285. // LEDs
  3286. //Red LED: 0
  3287. //Green LED: 4
  3288. //Blue LED: 2
  3289. // Light
  3290. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3291. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3292. #define DUMMY_RELAY_COUNT 1
  3293. #define LIGHT_CHANNELS 3
  3294. #define LIGHT_CH1_PIN 0 // RED
  3295. #define LIGHT_CH2_PIN 4 // GREEN
  3296. #define LIGHT_CH3_PIN 2 // BLUE
  3297. // HJL01 / BL0937
  3298. #ifndef HLW8012_SUPPORT
  3299. #define HLW8012_SUPPORT 1
  3300. #endif
  3301. #define HLW8012_SEL_PIN 12
  3302. #define HLW8012_CF1_PIN 14
  3303. #define HLW8012_CF_PIN 5
  3304. #define HLW8012_SEL_CURRENT LOW
  3305. #define HLW8012_CURRENT_RATIO 25740
  3306. #define HLW8012_VOLTAGE_RATIO 313400
  3307. #define HLW8012_POWER_RATIO 3414290
  3308. #define HLW8012_INTERRUPT_ON FALLING
  3309. // ----------------------------------------------------------------------------------------
  3310. // Hama WiFi Steckdose (00176533)
  3311. // https://at.hama.com/00176533/hama-wifi-steckdose-3500w-16a
  3312. // ----------------------------------------------------------------------------------------
  3313. #elif defined(HAMA_WIFI_STECKDOSE_00176533)
  3314. // Info
  3315. #define MANUFACTURER "HAMA"
  3316. #define DEVICE "WIFI_STECKDOSE_00176533"
  3317. // Buttons
  3318. #define BUTTON1_PIN 13
  3319. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  3320. #define BUTTON1_RELAY 1
  3321. // Relays
  3322. #define RELAY1_PIN 12
  3323. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3324. // LEDs
  3325. #define LED1_PIN 4
  3326. #define LED1_PIN_INVERSE 1
  3327. // -----------------------------------------------------------------------------
  3328. // Oxaoxe NX-SP202
  3329. // Digoo NX-SP202 (not tested)
  3330. // Digoo DG-SP202 (not tested)
  3331. // https://github.com/xoseperez/espurna/issues/1502
  3332. // -----------------------------------------------------------------------------
  3333. #elif defined(DIGOO_NX_SP202)
  3334. // Info
  3335. #define MANUFACTURER "DIGOO"
  3336. #define DEVICE "NX_SP202"
  3337. // Buttons
  3338. #define BUTTON1_PIN 0
  3339. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3340. #define BUTTON1_RELAY 1
  3341. #define BUTTON2_PIN 16
  3342. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3343. #define BUTTON2_RELAY 2
  3344. // Relays
  3345. #define RELAY1_PIN 15
  3346. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3347. #define RELAY2_PIN 14
  3348. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3349. // LEDs
  3350. #define LED1_PIN 13
  3351. #define LED1_PIN_INVERSE 1
  3352. // HJL01 / BL0937
  3353. #ifndef HLW8012_SUPPORT
  3354. #define HLW8012_SUPPORT 1
  3355. #endif
  3356. #define HLW8012_SEL_PIN 12
  3357. #define HLW8012_CF1_PIN 5
  3358. #define HLW8012_CF_PIN 4
  3359. #define HLW8012_SEL_CURRENT LOW
  3360. #define HLW8012_CURRENT_RATIO 23296
  3361. #define HLW8012_VOLTAGE_RATIO 310085
  3362. #define HLW8012_POWER_RATIO 3368471
  3363. #define HLW8012_INTERRUPT_ON FALLING
  3364. // -----------------------------------------------------------------------------
  3365. // Foxel's LightFox dual
  3366. // https://github.com/foxel/esp-dual-rf-switch
  3367. // -----------------------------------------------------------------------------
  3368. #elif defined(FOXEL_LIGHTFOX_DUAL)
  3369. // Info
  3370. #define MANUFACTURER "FOXEL"
  3371. #define DEVICE "LIGHTFOX_DUAL"
  3372. #define SERIAL_BAUDRATE 19200
  3373. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  3374. #define DUMMY_RELAY_COUNT 2
  3375. #define DEBUG_SERIAL_SUPPORT 0
  3376. // Buttons
  3377. #define BUTTON1_RELAY 1
  3378. #define BUTTON2_RELAY 2
  3379. #define BUTTON3_RELAY 2
  3380. #define BUTTON4_RELAY 1
  3381. #define BUTTON_PROVIDER_FOXEL_LIGHTFOX_DUAL_SUPPORT 1
  3382. // -----------------------------------------------------------------------------
  3383. // Teckin SP20
  3384. // -----------------------------------------------------------------------------
  3385. #elif defined(TECKIN_SP20)
  3386. // Info
  3387. #define MANUFACTURER "TECKIN"
  3388. #define DEVICE "SP20"
  3389. // Buttons
  3390. #define BUTTON1_PIN 13
  3391. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3392. #define BUTTON1_RELAY 1
  3393. // Relays
  3394. #define RELAY1_PIN 4
  3395. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3396. // LEDs
  3397. #define LED1_PIN 2
  3398. #define LED1_PIN_INVERSE 1
  3399. #define LED2_PIN 0
  3400. #define LED2_PIN_INVERSE 1
  3401. #define LED2_MODE LED_MODE_FINDME
  3402. #define LED2_RELAY 0
  3403. // HJL01 / BL0937
  3404. #ifndef HLW8012_SUPPORT
  3405. #define HLW8012_SUPPORT 1
  3406. #endif
  3407. #define HLW8012_SEL_PIN 12
  3408. #define HLW8012_CF1_PIN 14
  3409. #define HLW8012_CF_PIN 5
  3410. #define HLW8012_SEL_CURRENT LOW
  3411. #define HLW8012_CURRENT_RATIO 25740
  3412. #define HLW8012_VOLTAGE_RATIO 313400
  3413. #define HLW8012_POWER_RATIO 3414290
  3414. #define HLW8012_INTERRUPT_ON FALLING
  3415. // -----------------------------------------------------------------------------
  3416. // Charging Essentials / LITESUN LA-WF3
  3417. // -----------------------------------------------------------------------------
  3418. #elif defined(LITESUN_LA_WF3)
  3419. // Info
  3420. #define MANUFACTURER "LITESUN"
  3421. #define DEVICE "LA_WF3"
  3422. // Buttons
  3423. #define BUTTON1_PIN 13
  3424. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3425. #define BUTTON1_RELAY 1
  3426. // Relays
  3427. #define RELAY1_PIN 12
  3428. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3429. // LEDs
  3430. #define LED1_PIN 4 // 4 blue led
  3431. #define LED1_MODE LED_MODE_WIFI
  3432. #define LED1_PIN_INVERSE 1
  3433. #define LED2_PIN 5 // 5 red led
  3434. #define LED2_MODE LED_MODE_RELAY
  3435. #define LED2_PIN_INVERSE 1
  3436. // -----------------------------------------------------------------------------
  3437. // PSH
  3438. // -----------------------------------------------------------------------------
  3439. #elif defined(PSH_WIFI_PLUG)
  3440. // Info
  3441. #define MANUFACTURER "PSH"
  3442. #define DEVICE "WIFI_PLUG"
  3443. // Relays
  3444. #define RELAY1_PIN 2
  3445. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3446. // LEDs
  3447. #define LED1_PIN 0
  3448. #define LED1_PIN_INVERSE 0
  3449. #elif defined(PSH_RGBW_CONTROLLER)
  3450. // Info
  3451. #define MANUFACTURER "PSH"
  3452. #define DEVICE "RGBW_CONTROLLER"
  3453. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3454. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3455. #define DUMMY_RELAY_COUNT 1
  3456. // LEDs
  3457. #define LED1_PIN 13
  3458. #define LED1_PIN_INVERSE 1
  3459. // Light
  3460. #define LIGHT_CHANNELS 4
  3461. #define LIGHT_CH1_PIN 5 // RED
  3462. #define LIGHT_CH2_PIN 4 // GREEN
  3463. #define LIGHT_CH3_PIN 12 // BLUE
  3464. #define LIGHT_CH4_PIN 14 // WHITE1
  3465. #elif defined(PSH_WIFI_SENSOR)
  3466. // Info
  3467. #define MANUFACTURER "PSH"
  3468. #define DEVICE "WIFI_SENSOR"
  3469. // DHT12 Sensor
  3470. #define DHT_SUPPORT 1
  3471. #define DHT_PIN 14
  3472. #define DHT_TYPE DHT_CHIP_DHT12
  3473. // LDR Sensor
  3474. #define LDR_SUPPORT 1
  3475. #define LDR_TYPE LDR_GL5528
  3476. #define LDR_ON_GROUND false
  3477. #define LDR_RESISTOR 10000
  3478. #elif defined(JINVOO_VALVE_SM_AW713)
  3479. // Reflashing from original Tuya firmware
  3480. // to thirdparty firmware like espurna by:
  3481. // https://github.com/ct-Open-Source/tuya-convert
  3482. // Info
  3483. #define MANUFACTURER "JINVOO"
  3484. #define DEVICE "VALVE_SM_AW713"
  3485. // Buttons
  3486. #define BUTTON1_PIN 13
  3487. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3488. #define BUTTON1_RELAY 1
  3489. // Relays
  3490. #define RELAY1_PIN 12
  3491. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3492. // LED
  3493. #define LED1_PIN 5 // 5 red led
  3494. #define LED1_PIN_INVERSE 0
  3495. #define LED1_RELAY 1
  3496. #define LED1_MODE LED_MODE_RELAY
  3497. #define LED2_PIN 4 // 4 blue led
  3498. #define LED2_PIN_INVERSE 0
  3499. #define LED2_RELAY 1
  3500. #define LED2_MODE LED_MODE_FINDME_WIFI
  3501. #elif defined(TUYA_GENERIC_DIMMER)
  3502. #define MANUFACTURER "TUYA"
  3503. #define DEVICE "GENERIC_DIMMER"
  3504. #define LIGHT_PROVIDER LIGHT_PROVIDER_TUYA
  3505. #define LIGHT_CHANNELS 0
  3506. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3507. #define DUMMY_RELAY_COUNT 0
  3508. // -----------------------------------------------------------------------------
  3509. // Etekcity ESW01-USA
  3510. // https://www.amazon.com/Etekcity-Voltson-Outlet-Monitoring-Required/dp/B01M3MYIFS
  3511. // -----------------------------------------------------------------------------
  3512. #elif defined(ETEKCITY_ESW01_USA)
  3513. // Info
  3514. #define MANUFACTURER "ETEKCITY"
  3515. #define DEVICE "ESW01_USA"
  3516. // Buttons
  3517. #define BUTTON1_PIN 14
  3518. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3519. #define BUTTON1_RELAY 1
  3520. // Relays
  3521. #define RELAY1_PIN 4
  3522. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3523. // LEDs
  3524. // Blue
  3525. #define LED1_PIN 5
  3526. #define LED1_MODE LED_MODE_WIFI
  3527. // Yellow
  3528. #define LED2_PIN 16
  3529. #define LED2_MODE LED_MODE_FOLLOW
  3530. #define LED2_RELAY 1
  3531. // HLW8012
  3532. #ifndef HLW8012_SUPPORT
  3533. #define HLW8012_SUPPORT 1
  3534. #endif
  3535. #define HLW8012_SEL_PIN 15
  3536. #define HLW8012_CF1_PIN 12
  3537. #define HLW8012_CF_PIN 13
  3538. #define HLW8012_SEL_CURRENT HIGH // SEL pin to HIGH to measure current
  3539. #define HLW8012_CURRENT_R 0.001 // Current resistor
  3540. #define HLW8012_VOLTAGE_R_UP ( 4 * 470000 ) // Upstream voltage resistor
  3541. #define HLW8012_VOLTAGE_R_DOWN ( 1000 ) // Downstream voltage resistor
  3542. #define HLW8012_INTERRUPT_ON CHANGE
  3543. // -----------------------------------------------------------------------------
  3544. // FS UAP1
  3545. // http://frank-schuetz.de/index.php/fhem/13-hoermann-torantrieb-mit-espeasy-in-fhem-einbinden
  3546. #elif defined(FS_UAP1)
  3547. // Info
  3548. #define MANUFACTURER "FS"
  3549. #define DEVICE "UAP1"
  3550. // Inputs
  3551. #define DIGITAL1_PIN 4
  3552. #define DIGITAL2_PIN 5
  3553. // Relays
  3554. #define RELAY1_PIN 12
  3555. #define RELAY2_PIN 13
  3556. #define RELAY3_PIN 14
  3557. #define RELAY4_PIN 15
  3558. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3559. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3560. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  3561. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  3562. // LEDs
  3563. #define LED1_PIN 2
  3564. // Disable UART noise
  3565. #define DEBUG_SERIAL_SUPPORT 0
  3566. // -----------------------------------------------------------------------------
  3567. // TFLAG NX-SM100 & NX-SM200
  3568. // -----------------------------------------------------------------------------
  3569. #elif defined(TFLAG_NX_SMX00)
  3570. // Info
  3571. #define MANUFACTURER "TFLAG"
  3572. #define DEVICE "NX_SMX00"
  3573. // Buttons
  3574. #define BUTTON1_PIN 13
  3575. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3576. #define BUTTON1_RELAY 1
  3577. // Relays
  3578. #define RELAY1_PIN 12
  3579. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3580. // LEDs
  3581. #define LED1_PIN 0
  3582. #define LED1_PIN_INVERSE 1
  3583. #define LED1_MODE LED_MODE_FOLLOW_INVERSE
  3584. #define LED1_RELAY 1
  3585. #define LED2_PIN 15
  3586. #define LED2_PIN_INVERSE 1
  3587. #define LED2_MODE LED_MODE_WIFI
  3588. // HJL01 / BL0937
  3589. #ifndef HLW8012_SUPPORT
  3590. #define HLW8012_SUPPORT 1
  3591. #endif
  3592. #define HLW8012_SEL_PIN 16
  3593. #define HLW8012_CF1_PIN 14
  3594. #define HLW8012_CF_PIN 5
  3595. #define HLW8012_SEL_CURRENT LOW
  3596. #define HLW8012_CURRENT_RATIO 632
  3597. #define HLW8012_VOLTAGE_RATIO 313400
  3598. #define HLW8012_POWER_RATIO 3711185
  3599. #define HLW8012_INTERRUPT_ON FALLING
  3600. // -----------------------------------------------------------------------------
  3601. // MUVIT_IO_MIOBULB001
  3602. // -----------------------------------------------------------------------------
  3603. #elif defined(MUVIT_IO_MIOBULB001)
  3604. // Info
  3605. #define MANUFACTURER "MUVIT_IO"
  3606. #define DEVICE "MIOBULB001"
  3607. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3608. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3609. #define DUMMY_RELAY_COUNT 1
  3610. // Light
  3611. #define LIGHT_CHANNELS 4
  3612. #define LIGHT_CH1_PIN 14 // RED
  3613. #define LIGHT_CH2_PIN 12 // GREEN
  3614. #define LIGHT_CH3_PIN 13 // BLUE
  3615. #define LIGHT_CH4_PIN 4 // WHITE
  3616. // -----------------------------------------------------------------------------
  3617. // Hykker Power Plug (Smart Home Series) available in Jerónimo Martins Polska (Biedronka)
  3618. // https://www.hykker.com/akcesoria/gniazdo-wi-fi-z-licznikiem-energii/
  3619. // Reflashing from original Tuya firmware
  3620. // to thirdparty firmware like espurna by:
  3621. // https://github.com/ct-Open-Source/tuya-convert
  3622. // -----------------------------------------------------------------------------
  3623. #elif defined(HYKKER_SMART_HOME_POWER_PLUG)
  3624. // Info
  3625. #define MANUFACTURER "HYKKER"
  3626. #define DEVICE "SMART_HOME_POWER_PLUG"
  3627. // Buttons
  3628. #define BUTTON1_PIN 0
  3629. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3630. #define BUTTON1_RELAY 1
  3631. // Relays
  3632. #define RELAY1_PIN 14
  3633. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3634. // LED
  3635. // Red
  3636. #define LED1_PIN 13
  3637. #define LED1_MODE LED_MODE_WIFI
  3638. #define LED1_PIN_INVERSE 1
  3639. // Blue connected to relay
  3640. // HLW8012
  3641. #ifndef HLW8012_SUPPORT
  3642. #define HLW8012_SUPPORT 1
  3643. #endif
  3644. #define HLW8012_SEL_PIN 12
  3645. #define HLW8012_CF1_PIN 5
  3646. #define HLW8012_CF_PIN 4
  3647. #define HLW8012_SEL_CURRENT LOW
  3648. #define HLW8012_CURRENT_RATIO 25740
  3649. #define HLW8012_VOLTAGE_RATIO 282060
  3650. #define HLW8012_POWER_RATIO 3414290
  3651. #define HLW8012_INTERRUPT_ON FALLING
  3652. #define SENSOR_ENERGY_UNITS ENERGY_KWH
  3653. #define SENSOR_POWER_UNITS POWER_WATTS
  3654. // -----------------------------------------------------------------------------
  3655. // Kogan Smarter Home Plug with Energy Meter (Australia)
  3656. // Product code: KASPEMHA
  3657. // https://www.kogan.com/au/buy/kogan-smarterhome-smart-plug-energy-meter/
  3658. // Reflashing from original Tuya firmware
  3659. // to thirdparty firmware like espurna by:
  3660. // https://github.com/ct-Open-Source/tuya-convert
  3661. // -----------------------------------------------------------------------------
  3662. #elif defined(KOGAN_SMARTER_HOME_PLUG_W_POW)
  3663. // Info
  3664. #define MANUFACTURER "KOGAN"
  3665. #define DEVICE "SMARTER_HOME_PLUG_W_POW"
  3666. // Buttons
  3667. #define BUTTON1_PIN 0
  3668. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  3669. #define BUTTON1_RELAY 1
  3670. // Relays
  3671. #define RELAY1_PIN 14
  3672. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3673. // LED
  3674. // Red
  3675. #define LED1_PIN 13
  3676. #define LED1_MODE LED_MODE_WIFI
  3677. #define LED1_PIN_INVERSE 1
  3678. // Blue connected to relay
  3679. // HLW8012
  3680. #ifndef HLW8012_SUPPORT
  3681. #define HLW8012_SUPPORT 1
  3682. #endif
  3683. #define HLW8012_SEL_PIN 12
  3684. #define HLW8012_CF1_PIN 5
  3685. #define HLW8012_CF_PIN 4
  3686. #define HLW8012_SEL_CURRENT LOW
  3687. #define HLW8012_CURRENT_RATIO 25740
  3688. #define HLW8012_VOLTAGE_RATIO 282060
  3689. #define HLW8012_POWER_RATIO 3414290
  3690. #define HLW8012_INTERRUPT_ON FALLING
  3691. #define SENSOR_ENERGY_UNITS ENERGY_KWH
  3692. #define SENSOR_POWER_UNITS POWER_WATTS
  3693. // -----------------------------------------------------------------------------
  3694. // KINGART_CURTAIN_SWITCH
  3695. // -----------------------------------------------------------------------------
  3696. #elif defined(KINGART_CURTAIN_SWITCH)
  3697. // Info
  3698. #define MANUFACTURER "KINGART"
  3699. #define DEVICE "CURTAIN_SWITCH"
  3700. #define CURTAIN_SUPPORT 1
  3701. // LEDs
  3702. #define LED1_PIN 13
  3703. #define LED1_PIN_INVERSE 1
  3704. // KINGART module handles the UART, can't print any debug messages
  3705. #define KINGART_CURTAIN_SUPPORT 1
  3706. #define DEBUG_SERIAL_SUPPORT 0
  3707. // -----------------------------------------------------------------------------
  3708. // LSC Smart LED Light Strip (Smart CXonnect Series) available ACTION (Germany)
  3709. // https://www.action.com/de-de/p/lsc-smart-connect-intelligenter-multicolor-led-strip-/
  3710. // Reflashing from original Tuya firmware
  3711. // to thirdparty firmware like espurna by:
  3712. // https://github.com/ct-Open-Source/tuya-convert
  3713. // -----------------------------------------------------------------------------
  3714. #elif defined(LSC_SMART_LED_LIGHT_STRIP)
  3715. // Info
  3716. #define MANUFACTURER "LSC"
  3717. #define DEVICE "SMART_LED_LIGHT_STRIP"
  3718. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3719. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3720. #define DUMMY_RELAY_COUNT 1
  3721. // Light RGBW
  3722. #define LIGHT_CHANNELS 4
  3723. #define LIGHT_CH1_PIN 4 // RED
  3724. #define LIGHT_CH2_PIN 12 // GREEN
  3725. #define LIGHT_CH3_PIN 14 // BLUE
  3726. #define LIGHT_CH4_PIN 13 // WHITE
  3727. // #define LIGHT_CH5_PIN 5 // CW (not connected, but circuit supports it)
  3728. // IR
  3729. #define IR_SUPPORT 1
  3730. #define IR_RX_PIN 0
  3731. #define IR_BUTTON_SET 5
  3732. // -----------------------------------------------------------------------------
  3733. // eHomeDIY WT02
  3734. // https://github.com/eHomeDIY/WT02-hardware
  3735. // -----------------------------------------------------------------------------
  3736. #elif defined(EHOMEDIY_WT02)
  3737. // Info
  3738. #define MANUFACTURER "EHOMEDIY"
  3739. #define DEVICE "WT02"
  3740. #define I2C_SDA_PIN 0
  3741. #define I2C_SCL_PIN 2
  3742. #define BMX280_SUPPORT 1
  3743. // #define SI7021_SUPPORT 1
  3744. // -----------------------------------------------------------------------------
  3745. // eHomeDIY WT03
  3746. // https://github.com/eHomeDIY/WT03-hardware
  3747. // -----------------------------------------------------------------------------
  3748. #elif defined(EHOMEDIY_WT03)
  3749. // Info
  3750. #define MANUFACTURER "EHOMEDIY"
  3751. #define DEVICE "WT03"
  3752. #define I2C_SDA_PIN 2
  3753. #define I2C_SCL_PIN 0
  3754. #define BMX280_SUPPORT 1
  3755. // #define SI7021_SUPPORT 1
  3756. // -----------------------------------------------------------------------------
  3757. // Linksprite R4
  3758. // http://linksprite.com/wiki/index.php?title=LinkNode_R4:_Arduino-compatible_WiFi_relay_controller
  3759. // -----------------------------------------------------------------------------
  3760. #elif defined(LINKSPRITE_LINKNODE_R4)
  3761. // Info
  3762. #define MANUFACTURER "LINKSPRITE"
  3763. #define DEVICE "LINKNODE_R4"
  3764. // Relays
  3765. #define RELAY1_PIN 12
  3766. #define RELAY2_PIN 13
  3767. #define RELAY3_PIN 14
  3768. #define RELAY4_PIN 16
  3769. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3770. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3771. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  3772. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  3773. // -----------------------------------------------------------------------------
  3774. // NEDIS WIFIP310FWT Wi-Fi Smart Extension Socket
  3775. // 3x Schuko Type F, 4x USB, 16 A
  3776. // https://nedis.com/en-us/product/smart-living/smart-home/energy/550672299/wi-fi-smart-extension-socket-3x-schuko-type-f-4x-usb-16-a
  3777. // -----------------------------------------------------------------------------
  3778. #elif defined(NEDIS_WIFIP310FWT)
  3779. // Info
  3780. #define MANUFACTURER "NEDIS"
  3781. #define DEVICE "WIFIP310FWT"
  3782. // Based on the reporter, this product uses GPIO1 and 3 for the button
  3783. // and onboard LED, so hardware serial should be disabled...
  3784. #define DEBUG_SERIAL_SUPPORT 0
  3785. // Buttons
  3786. #define BUTTON1_PIN 3
  3787. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3788. // Relays
  3789. #define RELAY1_PIN 5
  3790. #define RELAY2_PIN 4
  3791. #define RELAY3_PIN 13
  3792. #define RELAY4_PIN 14
  3793. // LEDs
  3794. #define LED1_PIN 1
  3795. #define LED1_PIN_INVERSE 1
  3796. // -----------------------------------------------------------------------------
  3797. // Arlec Smart PC190HA Plug
  3798. // https://templates.blakadder.com/arlec_PC190HA.html
  3799. // -----------------------------------------------------------------------------
  3800. #elif defined(ARLEC_PC190HA)
  3801. // Info
  3802. #define MANUFACTURER "ARLEC"
  3803. #define DEVICE "PC190HA"
  3804. // Buttons
  3805. #define BUTTON1_PIN 14
  3806. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3807. #define BUTTON1_RELAY 1
  3808. // Relays
  3809. #define RELAY1_PIN 12
  3810. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3811. // LEDs
  3812. #define LED1_PIN 4 // blue LED
  3813. #define LED1_PIN_INVERSE 1
  3814. #define LED2_PIN 13 // red LED
  3815. #define LED2_PIN_INVERSE 1
  3816. // -----------------------------------------------------------------------------
  3817. // Arlec Smart PB89HA Power Strip
  3818. // https://templates.blakadder.com/arlec_PB89HA.html
  3819. // -----------------------------------------------------------------------------
  3820. #elif defined(ARLEC_PB89HA)
  3821. // Info
  3822. #define MANUFACTURER "ARLEC"
  3823. #define DEVICE "PB89HA"
  3824. // Buttons
  3825. #define BUTTON1_PIN 3
  3826. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3827. // Relays
  3828. #define RELAY1_PIN 5
  3829. #define RELAY2_PIN 4
  3830. #define RELAY3_PIN 13
  3831. #define RELAY4_PIN 12
  3832. // LEDs
  3833. #define LED1_PIN 1
  3834. #define LED1_PIN_INVERSE 1
  3835. // -----------------------------------------------------------------------------
  3836. // Prodino WIFI
  3837. // https://kmpelectronics.eu/products/prodino-wifi-v1/
  3838. // -----------------------------------------------------------------------------
  3839. #elif defined(PRODINO_WIFI)
  3840. // Info
  3841. #define MANUFACTURER "PRODINO"
  3842. #define DEVICE "WIFI"
  3843. // MCP23S08
  3844. #define MCP23S08_SUPPORT 1
  3845. // Relays
  3846. #define RELAY_PROVIDER RELAY_PROVIDER_MCP23S08
  3847. #define RELAY1_PIN 4
  3848. #define RELAY2_PIN 5
  3849. #define RELAY3_PIN 6
  3850. #define RELAY4_PIN 7
  3851. // Buttons
  3852. #define BUTTON1_PROVIDER BUTTON_PROVIDER_MCP23S08
  3853. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3854. #define BUTTON1_PIN 0
  3855. #define BUTTON2_PROVIDER BUTTON_PROVIDER_MCP23S08
  3856. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3857. #define BUTTON2_PIN 1
  3858. #define BUTTON3_PROVIDER BUTTON_PROVIDER_MCP23S08
  3859. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3860. #define BUTTON3_PIN 2
  3861. #define BUTTON4_PROVIDER BUTTON_PROVIDER_MCP23S08
  3862. #define BUTTON4_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3863. #define BUTTON4_PIN 3
  3864. #define BUTTON1_RELAY 1
  3865. #define BUTTON2_RELAY 2
  3866. #define BUTTON3_RELAY 3
  3867. #define BUTTON4_RELAY 4
  3868. // LEDs
  3869. #define LED1_PIN 2
  3870. #define LED1_PIN_INVERSE 1
  3871. // -----------------------------------------------------------------------------
  3872. // Fcmila E27 7W RGB+W Bulb
  3873. // https://www.aliexpress.com/item/32925895199.html
  3874. // -----------------------------------------------------------------------------
  3875. #elif defined(FCMILA_E27_7W_RGBW)
  3876. // Info
  3877. #define MANUFACTURER "FCMILA"
  3878. #define DEVICE "E27_7W_RGBW"
  3879. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3880. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3881. #define DUMMY_RELAY_COUNT 1
  3882. // Light
  3883. #define LIGHT_CHANNELS 4
  3884. #define LIGHT_CH1_PIN 4 // RED
  3885. #define LIGHT_CH2_PIN 12 // GREEN
  3886. #define LIGHT_CH3_PIN 14 // BLUE
  3887. #define LIGHT_CH4_PIN 5 // WHITE
  3888. #else
  3889. #error "UNSUPPORTED HARDWARE!!"
  3890. #endif