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.

4920 lines
159 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_EVENTS_SOURCE BUTTON_EVENTS_SOURCE_ITEAD_SONOFF_DUAL
  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. // Homecube 16A is similar but some pins differ and it also has RGB LEDs
  2669. // https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
  2670. // ----------------------------------------------------------------------------------------
  2671. #elif defined(HOMECUBE_16A)
  2672. // Info
  2673. #define MANUFACTURER "HOMECUBE"
  2674. #define DEVICE "16A"
  2675. // Buttons
  2676. #define BUTTON1_PIN 13
  2677. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2678. #define BUTTON1_RELAY 1
  2679. // Relays
  2680. #define RELAY1_PIN 15
  2681. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2682. // LEDs
  2683. //LED Pin 4 - ESP8266 onboard LED
  2684. //Red LED: 0
  2685. //Green LED: 12
  2686. //Blue LED: 2
  2687. // Blue
  2688. #define LED1_PIN 2
  2689. #define LED1_PIN_INVERSE 0
  2690. // Green
  2691. #define LED2_PIN 12
  2692. #define LED2_PIN_INVERSE 1
  2693. #define LED2_MODE LED_MODE_RELAY
  2694. // Red
  2695. #define LED3_PIN 0
  2696. #define LED3_PIN_INVERSE 0
  2697. #define LED3_MODE LED_MODE_OFF
  2698. // HJL01 / BL0937
  2699. #ifndef HLW8012_SUPPORT
  2700. #define HLW8012_SUPPORT 1
  2701. #endif
  2702. #define HLW8012_SEL_PIN 16
  2703. #define HLW8012_CF1_PIN 14
  2704. #define HLW8012_CF_PIN 5
  2705. #define HLW8012_SEL_CURRENT LOW
  2706. #define HLW8012_CURRENT_RATIO 25740
  2707. #define HLW8012_VOLTAGE_RATIO 313400
  2708. #define HLW8012_POWER_RATIO 3414290
  2709. #define HLW8012_INTERRUPT_ON FALLING
  2710. // -----------------------------------------------------------------------------
  2711. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  2712. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  2713. // -----------------------------------------------------------------------------
  2714. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  2715. // Info
  2716. #define MANUFACTURER "VANZAVANZU"
  2717. #define DEVICE "SMART_WIFI_PLUG_MINI"
  2718. // Buttons
  2719. #define BUTTON1_PIN 13
  2720. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2721. #define BUTTON1_RELAY 1
  2722. // Relays
  2723. #define RELAY1_PIN 15
  2724. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2725. // LEDs
  2726. #define LED1_PIN 2
  2727. #define LED1_PIN_INVERSE 1
  2728. #define LED2_PIN 0
  2729. #define LED2_PIN_INVERSE 1
  2730. #define LED2_MODE LED_MODE_FINDME
  2731. #define LED2_RELAY 1
  2732. // Disable UART noise
  2733. #define DEBUG_SERIAL_SUPPORT 0
  2734. // HJL01 / BL0937
  2735. #ifndef HLW8012_SUPPORT
  2736. #define HLW8012_SUPPORT 1
  2737. #endif
  2738. #define HLW8012_SEL_PIN 3
  2739. #define HLW8012_CF1_PIN 14
  2740. #define HLW8012_CF_PIN 5
  2741. #define HLW8012_SEL_CURRENT LOW
  2742. #define HLW8012_CURRENT_RATIO 25740
  2743. #define HLW8012_VOLTAGE_RATIO 313400
  2744. #define HLW8012_POWER_RATIO 3414290
  2745. #define HLW8012_INTERRUPT_ON FALLING
  2746. // -----------------------------------------------------------------------------
  2747. #elif defined(GENERIC_AG_L4)
  2748. // Info
  2749. #define MANUFACTURER "GENERIC"
  2750. #define DEVICE "AG_L4"
  2751. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2752. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2753. #define DUMMY_RELAY_COUNT 1
  2754. // button 1: "power" button
  2755. #define BUTTON1_PIN 4
  2756. #define BUTTON1_RELAY 1
  2757. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2758. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  2759. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  2760. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  2761. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  2762. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  2763. // button 2: "wifi" button
  2764. #define BUTTON2_PIN 2
  2765. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2766. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  2767. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  2768. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  2769. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  2770. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_NONE
  2771. // LEDs
  2772. #define LED1_PIN 5 // red status led
  2773. #define LED1_PIN_INVERSE 0
  2774. #define LED2_PIN 16 // master light power
  2775. #define LED2_PIN_INVERSE 1
  2776. #define LED2_MODE LED_MODE_RELAY
  2777. // Light
  2778. #define LIGHT_CHANNELS 3
  2779. #define LIGHT_CH1_PIN 14 // RED
  2780. #define LIGHT_CH2_PIN 13 // GREEN
  2781. #define LIGHT_CH3_PIN 12 // BLUE
  2782. // -----------------------------------------------------------------------------
  2783. #elif defined(GENERIC_AG_L4_V3)
  2784. // Info
  2785. #define MANUFACTURER "GENERIC"
  2786. #define DEVICE "AG_L4_V3"
  2787. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2788. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2789. #define DUMMY_RELAY_COUNT 1
  2790. // button 1: "power" button
  2791. #define BUTTON1_PIN 13
  2792. #define BUTTON1_RELAY 1
  2793. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2794. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  2795. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  2796. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  2797. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  2798. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  2799. // button 2: "wifi" button
  2800. #define BUTTON2_PIN 2
  2801. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2802. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  2803. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  2804. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  2805. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  2806. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_NONE
  2807. // LEDs
  2808. #define LED1_PIN 5 // red status led
  2809. #define LED1_PIN_INVERSE 0
  2810. #define LED2_PIN 16 // master light power
  2811. #define LED2_PIN_INVERSE 1
  2812. #define LED2_MODE LED_MODE_RELAY
  2813. // Light
  2814. #define LIGHT_CHANNELS 3
  2815. #define LIGHT_CH1_PIN 4 // RED
  2816. #define LIGHT_CH2_PIN 12 // GREEN
  2817. #define LIGHT_CH3_PIN 14 // BLUE
  2818. // -----------------------------------------------------------------------------
  2819. #elif defined(ALLTERCO_SHELLY1)
  2820. // Info
  2821. #define MANUFACTURER "ALLTERCO"
  2822. #define DEVICE "SHELLY1"
  2823. // Buttons
  2824. #define BUTTON1_PIN 5
  2825. #define BUTTON1_CONFIG BUTTON_SWITCH
  2826. #define BUTTON1_RELAY 1
  2827. // Relays
  2828. #define RELAY1_PIN 4
  2829. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2830. #elif defined(ALLTERCO_SHELLY2)
  2831. // Info
  2832. #define MANUFACTURER "ALLTERCO"
  2833. #define DEVICE "SHELLY2"
  2834. // Buttons
  2835. #define BUTTON1_PIN 12
  2836. #define BUTTON2_PIN 14
  2837. #define BUTTON1_CONFIG BUTTON_SWITCH
  2838. #define BUTTON2_CONFIG BUTTON_SWITCH
  2839. #define BUTTON1_RELAY 1
  2840. #define BUTTON2_RELAY 2
  2841. // Relays
  2842. #define RELAY1_PIN 4
  2843. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2844. #define RELAY2_PIN 5
  2845. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2846. #elif defined(ALLTERCO_SHELLY1PM)
  2847. // Info
  2848. #define MANUFACTURER "ALLTERCO"
  2849. #define DEVICE "SHELLY1PM"
  2850. // Buttons
  2851. #define BUTTON1_PIN 4
  2852. #define BUTTON1_CONFIG BUTTON_SWITCH
  2853. #define BUTTON1_RELAY 1
  2854. #define BUTTON2_PIN 2
  2855. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2856. #define BUTTON2_LNGCLICK BUTTON_ACTION_RESET
  2857. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_FACTORY
  2858. // Relays
  2859. #define RELAY1_PIN 15
  2860. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2861. // Light
  2862. #define LED1_PIN 0
  2863. #define LED1_PIN_INVERSE 1
  2864. // HJL01 / BL0937
  2865. #define HLW8012_SUPPORT 1
  2866. #define HLW8012_SEL_PIN 12
  2867. #define HLW8012_CF1_PIN 13
  2868. #define HLW8012_CF_PIN 5
  2869. #define HLW8012_SEL_CURRENT LOW
  2870. #define HLW8012_CURRENT_RATIO 25740
  2871. #define HLW8012_VOLTAGE_RATIO 313400
  2872. #define HLW8012_POWER_RATIO 3414290
  2873. #define HLW8012_INTERRUPT_ON FALLING
  2874. //Temperature
  2875. #define NTC_SUPPORT 1
  2876. #define SENSOR_SUPPORT 1
  2877. #define NTC_BETA 3350
  2878. #define NTC_R_UP 10000
  2879. #define NTC_R_DOWN 0
  2880. #define NTC_R0 8000
  2881. #elif defined(ALLTERCO_SHELLY25)
  2882. // Info
  2883. #define MANUFACTURER "ALLTERCO"
  2884. #define DEVICE "SHELLY25"
  2885. // Buttons
  2886. #define BUTTON1_PIN 13
  2887. #define BUTTON1_CONFIG BUTTON_SWITCH
  2888. #define BUTTON1_RELAY 1
  2889. #define BUTTON2_PIN 5
  2890. #define BUTTON2_CONFIG BUTTON_SWITCH
  2891. #define BUTTON2_RELAY 2
  2892. #define BUTTON3_PIN 2
  2893. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2894. #define BUTTON3_LNGCLICK BUTTON_ACTION_RESET
  2895. #define BUTTON3_LNGLNGCLICK BUTTON_ACTION_FACTORY
  2896. // Relays
  2897. #define RELAY1_PIN 4
  2898. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2899. #define RELAY2_PIN 15
  2900. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2901. // Light
  2902. #define LED1_PIN 0
  2903. #define LED1_PIN_INVERSE 1
  2904. //Temperature
  2905. #define NTC_SUPPORT 1
  2906. #define SENSOR_SUPPORT 1
  2907. #define NTC_BETA 3350
  2908. #define NTC_R_UP 10000
  2909. #define NTC_R_DOWN 0
  2910. #define NTC_R0 8000
  2911. //Current
  2912. #define ADE7953_SUPPORT 1
  2913. #define I2C_SDA_PIN 12
  2914. #define I2C_SCL_PIN 14
  2915. // -----------------------------------------------------------------------------
  2916. // This device has teh same behaviour as the GOSUND WP3, but with different GPIO pin values
  2917. // GPIO equivalents extracted from https://templates.blakadder.com/aoycocr_X5P.html
  2918. #elif defined(AOYCOCR_X5P)
  2919. // Info
  2920. #define MANUFACTURER "AOYCOCR"
  2921. #define DEVICE "X5P"
  2922. // Buttons
  2923. #define BUTTON1_PIN 13
  2924. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2925. #define BUTTON1_RELAY 1
  2926. // the defaults are reasonable, but you can change them as desired
  2927. //#define BUTTON1_PRESS BUTTON_ACTION_NONE
  2928. //#define BUTTON1_CLICK BUTTON_ACTION_TOGGLE
  2929. //#define BUTTON1_DBLCLICK BUTTON_ACTION_AP
  2930. //#define BUTTON1_LNGCLICK BUTTON_ACTION_RESET
  2931. //#define BUTTON1_LNGLNGCLICK BUTTON_ACTION_FACTORY
  2932. // Relays
  2933. #define RELAY1_PIN 15
  2934. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2935. // LEDs
  2936. // LED1 (red) indicates on/off state; you could use LED_MODE_FOLLOW_INVERSE
  2937. // so that the LED lights the button when 'off' so it can be found easily.
  2938. #define LED1_PIN 0
  2939. #define LED1_PIN_INVERSE 1
  2940. #define LED1_MODE LED_MODE_FOLLOW
  2941. #define LED1_RELAY 1
  2942. // LED2 (blue) indicates wifi activity
  2943. #define LED2_PIN 2
  2944. #define LED2_PIN_INVERSE 1
  2945. #define LED2_MODE LED_MODE_WIFI
  2946. // -----------------------------------------------------------------------------
  2947. // also works with https://www.amazon.com/gp/product/B07TMY394G/
  2948. // see https://github.com/xoseperez/espurna/issues/2055
  2949. #elif defined(LOHAS_E27_9W)
  2950. // Info
  2951. #define MANUFACTURER "LOHAS"
  2952. #define DEVICE "E27_9W"
  2953. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2954. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2955. #define DUMMY_RELAY_COUNT 1
  2956. // Light
  2957. #define LIGHT_CHANNELS 5
  2958. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2959. #define MY92XX_CHIPS 2
  2960. #define MY92XX_DI_PIN 13
  2961. #define MY92XX_DCKI_PIN 15
  2962. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2963. #define MY92XX_MAPPING 0, 1, 2, 3, 4
  2964. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  2965. // https://www.amazon.com/gp/product/B07T7W7ZMW
  2966. #elif defined(LOHAS_E26_A19)
  2967. // Info
  2968. #define MANUFACTURER "LOHAS"
  2969. #define DEVICE "E26_A19"
  2970. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2971. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2972. #define DUMMY_RELAY_COUNT 1
  2973. // Light
  2974. #define LIGHT_CHANNELS 5
  2975. #define LIGHT_CH1_PIN 5 // RED
  2976. #define LIGHT_CH2_PIN 4 // GREEN
  2977. #define LIGHT_CH3_PIN 13 // BLUE
  2978. #define LIGHT_CH4_PIN 14 // WHITE1
  2979. #define LIGHT_CH5_PIN 12 // WHITE1
  2980. // -----------------------------------------------------------------------------
  2981. #elif defined(TECKIN_SB53)
  2982. // Info
  2983. #define MANUFACTURER "TECKIN"
  2984. #define DEVICE "SB53"
  2985. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2986. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2987. #define DUMMY_RELAY_COUNT 1
  2988. // Light
  2989. #define LIGHT_CHANNELS 5
  2990. #define LIGHT_CH1_PIN 4 // RED
  2991. #define LIGHT_CH2_PIN 12 // GREEN
  2992. #define LIGHT_CH3_PIN 14 // BLUE
  2993. #define LIGHT_CH4_PIN 13 // WARM WHITE
  2994. #define LIGHT_CH5_PIN 5 // COLD WHITE
  2995. // -----------------------------------------------------------------------------
  2996. #elif defined(XIAOMI_SMART_DESK_LAMP)
  2997. // Info
  2998. #define MANUFACTURER "XIAOMI"
  2999. #define DEVICE "SMART_DESK_LAMP"
  3000. // Buttons
  3001. #define BUTTON1_PIN 2
  3002. #define BUTTON2_PIN 14
  3003. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  3004. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  3005. // This button doubles as switch here and as encoder mode switch below
  3006. // Clicking it (for less than 500ms) will turn the light on and off
  3007. // Double and Long clicks will not work as these are used to modify the encoder action
  3008. #define BUTTON1_RELAY 1
  3009. #define BUTTON_LNGCLICK_DELAY 500
  3010. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  3011. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  3012. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_NONE
  3013. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  3014. #define BUTTON2_DBLCLICK BUTTON_ACTION_AP
  3015. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_RESET
  3016. // Light
  3017. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3018. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3019. #define DUMMY_RELAY_COUNT 1
  3020. #define LIGHT_STEP 8
  3021. #define LIGHT_CHANNELS 2
  3022. #define LIGHT_CH1_PIN 5 // warm white
  3023. #define LIGHT_CH2_PIN 4 // cold white
  3024. // https://www.xiaomitoday.com/xiaomi-mijia-mjtd01yl-led-desk-lamp-review/
  3025. #define LIGHT_COLDWHITE_MIRED 153
  3026. #define LIGHT_WARMWHITE_MIRED 370
  3027. // Encoder
  3028. // If mode is ENCODER_MODE_RATIO, the value ratio between both channels is changed
  3029. // when the button is not pressed, and the overall brightness when pressed
  3030. // If mode is ENCODER_MODE_CHANNEL, the first channel value is changed
  3031. // when the button is not pressed, and the second channel when pressed
  3032. // If no ENCODERX_BUTTON_PIN defined it will only change the value of the first defined channel
  3033. #define ENCODER_SUPPORT 1
  3034. #define ENCODER1_PIN1 12
  3035. #define ENCODER1_PIN2 13
  3036. #define ENCODER1_BUTTON_PIN 2 // active low by default, with software pullup
  3037. #define ENCODER1_CHANNEL1 0 // please note this value is 0-based (LIGHT_CH1 above)
  3038. #define ENCODER1_CHANNEL2 1 // please note this value is 0-based (LIGHT_CH2 above)
  3039. #define ENCODER1_MODE ENCODER_MODE_RATIO
  3040. #elif defined(PHYX_ESP12_RGB)
  3041. // Info
  3042. #define MANUFACTURER "PHYX"
  3043. #define DEVICE "ESP12_RGB"
  3044. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3045. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3046. #define DUMMY_RELAY_COUNT 1
  3047. // Light
  3048. #define LIGHT_CHANNELS 3
  3049. #define LIGHT_CH1_PIN 4 // RED
  3050. #define LIGHT_CH2_PIN 14 // GREEN
  3051. #define LIGHT_CH3_PIN 12 // BLUE
  3052. // -----------------------------------------------------------------------------
  3053. // iWoole LED Table Lamp
  3054. // 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
  3055. // -----------------------------------------------------------------------------
  3056. #elif defined(IWOOLE_LED_TABLE_LAMP)
  3057. // Info
  3058. #define MANUFACTURER "IWOOLE"
  3059. #define DEVICE "LED_TABLE_LAMP"
  3060. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3061. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3062. #define DUMMY_RELAY_COUNT 1
  3063. // Light
  3064. #define LIGHT_CHANNELS 4
  3065. #define LIGHT_CH1_PIN 12 // RED
  3066. #define LIGHT_CH2_PIN 5 // GREEN
  3067. #define LIGHT_CH3_PIN 14 // BLUE
  3068. #define LIGHT_CH4_PIN 4 // WHITE
  3069. // -----------------------------------------------------------------------------
  3070. // Generic GU10
  3071. // https://www.ebay.com/itm/1-10PC-GU10-RGB-Smart-Bulb-Wireless-WiFi-App-Remote-Ctrl-Light-for-Alexa-Google/173724116351
  3072. // -----------------------------------------------------------------------------
  3073. #elif defined(GENERIC_GU10)
  3074. // Info
  3075. #define MANUFACTURER "GENERIC"
  3076. #define DEVICE "GU10"
  3077. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3078. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3079. #define DUMMY_RELAY_COUNT 1
  3080. // Light
  3081. #define LIGHT_CHANNELS 4
  3082. #define LIGHT_CH1_PIN 14 // RED
  3083. #define LIGHT_CH2_PIN 12 // GREEN
  3084. #define LIGHT_CH3_PIN 13 // BLUE
  3085. #define LIGHT_CH4_PIN 4 // WHITE
  3086. // -----------------------------------------------------------------------------
  3087. // Generic E14
  3088. // https://www.ebay.com/itm/LED-Bulb-Wifi-E14-4-5W-Candle-RGB-W-4in1-Dimmable-V-tac-Smart-VT-5114/163899840601
  3089. // -----------------------------------------------------------------------------
  3090. #elif defined(GENERIC_E14)
  3091. // Info
  3092. #define MANUFACTURER "GENERIC"
  3093. #define DEVICE "E14"
  3094. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3095. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3096. #define DUMMY_RELAY_COUNT 1
  3097. // Light
  3098. #define LIGHT_CHANNELS 4
  3099. #define LIGHT_CH1_PIN 4 // RED
  3100. #define LIGHT_CH2_PIN 12 // GREEN
  3101. #define LIGHT_CH3_PIN 14 // BLUE
  3102. #define LIGHT_CH4_PIN 5 // WHITE
  3103. // -----------------------------------------------------------------------------
  3104. // Deltaco white e14 (SH-LE14W) and e27 (SH-LE27W)
  3105. // -----------------------------------------------------------------------------
  3106. #elif defined(DELTACO_SH_LEXXW)
  3107. // Info
  3108. #define MANUFACTURER "DELTACO"
  3109. #define DEVICE "SH_LEXXW"
  3110. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3111. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3112. #define DUMMY_RELAY_COUNT 1
  3113. // Light
  3114. #define LIGHT_CHANNELS 2
  3115. #define LIGHT_CH1_PIN 12 // WARM WHITE
  3116. #define LIGHT_CH2_PIN 14 // COLD WHITE
  3117. // -----------------------------------------------------------------------------
  3118. // Deltaco rgbw e27 (SH-LE27RGB)
  3119. // -----------------------------------------------------------------------------
  3120. #elif defined(DELTACO_SH_LEXXRGB)
  3121. // Info
  3122. #define MANUFACTURER "DELTACO"
  3123. #define DEVICE "SH_LEXXRGB"
  3124. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3125. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3126. #define DUMMY_RELAY_COUNT 1
  3127. // Light
  3128. #define LIGHT_CHANNELS 5
  3129. #define LIGHT_CH1_PIN 5 // RED
  3130. #define LIGHT_CH2_PIN 4 // GREEN
  3131. #define LIGHT_CH3_PIN 13 // BLUE
  3132. #define LIGHT_CH4_PIN 14 // WARM WHITE
  3133. #define LIGHT_CH5_PIN 12 // COLD WHITE
  3134. // -----------------------------------------------------------------------------
  3135. // Nexete A19
  3136. // https://www.ebay.com/itm/Wifi-Smart-LED-light-Bulb-9W-60W-A19-850LM-RGBW-Dimmable-for-Alexa-Google-Home/283514779201
  3137. // -----------------------------------------------------------------------------
  3138. #elif defined(NEXETE_A19)
  3139. // Info
  3140. #define MANUFACTURER "NEXETE"
  3141. #define DEVICE "A19"
  3142. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3143. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3144. #define DUMMY_RELAY_COUNT 1
  3145. // Light
  3146. #define LIGHT_CHANNELS 4
  3147. #define LIGHT_CH1_PIN 12 // RED
  3148. #define LIGHT_CH2_PIN 15 // GREEN
  3149. #define LIGHT_CH3_PIN 14 // BLUE
  3150. #define LIGHT_CH4_PIN 5 // WHITE
  3151. // -----------------------------------------------------------------------------
  3152. // Lombex Lux Nova 2 Tunable White
  3153. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  3154. // -----------------------------------------------------------------------------
  3155. #elif defined(LOMBEX_LUX_NOVA2_TUNABLE_WHITE)
  3156. // Info
  3157. #define MANUFACTURER "LOMBEX"
  3158. #define DEVICE "LUX_NOVA2_TUNABLE_WHITE"
  3159. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3160. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  3161. #define DUMMY_RELAY_COUNT 1
  3162. // Light
  3163. #define LIGHT_CHANNELS 5
  3164. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  3165. #define MY92XX_CHIPS 1
  3166. #define MY92XX_DI_PIN 4
  3167. #define MY92XX_DCKI_PIN 5
  3168. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  3169. // No RGB on this bulb. Warm white on channel 0, cool white on channel 3
  3170. #define MY92XX_MAPPING 255, 255, 255, 3, 0
  3171. // -----------------------------------------------------------------------------
  3172. // Lombex Lux Nova 2 White and Color
  3173. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  3174. // -----------------------------------------------------------------------------
  3175. #elif defined(LOMBEX_LUX_NOVA2_WHITE_COLOR)
  3176. // Info
  3177. #define MANUFACTURER "LOMBEX"
  3178. #define DEVICE "LUX_NOVA2_WHITE_COLOR"
  3179. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3180. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  3181. #define DUMMY_RELAY_COUNT 1
  3182. // Light
  3183. #define LIGHT_CHANNELS 4
  3184. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  3185. #define MY92XX_CHIPS 1
  3186. #define MY92XX_DI_PIN 4
  3187. #define MY92XX_DCKI_PIN 5
  3188. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  3189. // RGB on channels 0/1/2, either cool or warm white on channel 3
  3190. // The bulb *should* have cool leds, but could also have warm leds as a common defect
  3191. #define MY92XX_MAPPING 0, 1, 2, 3
  3192. // -----------------------------------------------------------------------------
  3193. // Bestek Smart Plug with 2 USB ports
  3194. // https://www.bestekcorp.com/bestek-smart-plug-works-with-amazon-alexa-google-assistant-and-ifttt-with-2-usb
  3195. // -----------------------------------------------------------------------------
  3196. #elif defined(BESTEK_MRJ1011)
  3197. // Info
  3198. #define MANUFACTURER "BESTEK"
  3199. #define DEVICE "MRJ1011"
  3200. // Buttons
  3201. #define BUTTON1_PIN 13
  3202. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  3203. #define BUTTON1_RELAY 1
  3204. // Relay
  3205. #define RELAY1_PIN 12
  3206. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3207. // LED
  3208. #define LED1_PIN 4
  3209. #define LED1_PIN_INVERSE 1
  3210. // -----------------------------------------------------------------------------
  3211. // GBLIFE RGBW SOCKET
  3212. // -----------------------------------------------------------------------------
  3213. #elif defined(GBLIFE_RGBW_SOCKET)
  3214. // Info
  3215. #define MANUFACTURER "GBLIFE"
  3216. #define DEVICE "RGBW_SOCKET"
  3217. // Buttons
  3218. #define BUTTON1_PIN 13
  3219. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3220. #define BUTTON1_RELAY 1
  3221. // Relays
  3222. #define RELAY1_PIN 15
  3223. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3224. // Light RGBW
  3225. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3226. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3227. #define DUMMY_RELAY_COUNT 1
  3228. #define LIGHT_CHANNELS 4
  3229. #define LIGHT_CH1_PIN 5 // RED
  3230. #define LIGHT_CH2_PIN 14 // GREEN
  3231. #define LIGHT_CH3_PIN 12 // BLUE
  3232. #define LIGHT_CH4_PIN 4 // WHITE
  3233. // ----------------------------------------------------------------------------------------
  3234. // Smart life Mini Smart Socket is similar Homecube 16A but some GPIOs differ
  3235. // https://www.ebay.de/itm/Smart-Steckdose-WIFI-WLAN-Amazon-Alexa-Fernbedienung-Home-Socket-Zeitschaltuh-DE/123352026749?hash=item1cb85a8e7d:g:IasAAOSwk6dbj390
  3236. // Also labeled NETVIP
  3237. // https://www.amazon.es/Inteligente-NETVIP-Inal%C3%A1mbrico-Interruptor-Funciona/dp/B07KH8YWS5
  3238. // ----------------------------------------------------------------------------------------
  3239. #elif defined(SMARTLIFE_MINI_SMART_SOCKET)
  3240. // Info
  3241. #define MANUFACTURER "SMARTLIFE"
  3242. #define DEVICE "MINI_SMART_SOCKET"
  3243. // Buttons
  3244. #define BUTTON1_PIN 13
  3245. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3246. #define BUTTON1_RELAY 1
  3247. // Relays
  3248. #define RELAY1_PIN 15
  3249. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3250. // LEDs
  3251. //Red LED: 0
  3252. //Green LED: 4
  3253. //Blue LED: 2
  3254. // Light
  3255. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3256. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3257. #define DUMMY_RELAY_COUNT 1
  3258. #define LIGHT_CHANNELS 3
  3259. #define LIGHT_CH1_PIN 0 // RED
  3260. #define LIGHT_CH2_PIN 4 // GREEN
  3261. #define LIGHT_CH3_PIN 2 // BLUE
  3262. // HJL01 / BL0937
  3263. #ifndef HLW8012_SUPPORT
  3264. #define HLW8012_SUPPORT 1
  3265. #endif
  3266. #define HLW8012_SEL_PIN 12
  3267. #define HLW8012_CF1_PIN 14
  3268. #define HLW8012_CF_PIN 5
  3269. #define HLW8012_SEL_CURRENT LOW
  3270. #define HLW8012_CURRENT_RATIO 25740
  3271. #define HLW8012_VOLTAGE_RATIO 313400
  3272. #define HLW8012_POWER_RATIO 3414290
  3273. #define HLW8012_INTERRUPT_ON FALLING
  3274. // ----------------------------------------------------------------------------------------
  3275. // Hama WiFi Steckdose (00176533)
  3276. // https://at.hama.com/00176533/hama-wifi-steckdose-3500w-16a
  3277. // ----------------------------------------------------------------------------------------
  3278. #elif defined(HAMA_WIFI_STECKDOSE_00176533)
  3279. // Info
  3280. #define MANUFACTURER "HAMA"
  3281. #define DEVICE "WIFI_STECKDOSE_00176533"
  3282. // Buttons
  3283. #define BUTTON1_PIN 13
  3284. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  3285. #define BUTTON1_RELAY 1
  3286. // Relays
  3287. #define RELAY1_PIN 12
  3288. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3289. // LEDs
  3290. #define LED1_PIN 4
  3291. #define LED1_PIN_INVERSE 1
  3292. // -----------------------------------------------------------------------------
  3293. // Oxaoxe NX-SP202
  3294. // Digoo NX-SP202 (not tested)
  3295. // Digoo DG-SP202 (not tested)
  3296. // https://github.com/xoseperez/espurna/issues/1502
  3297. // -----------------------------------------------------------------------------
  3298. #elif defined(DIGOO_NX_SP202)
  3299. // Info
  3300. #define MANUFACTURER "DIGOO"
  3301. #define DEVICE "NX_SP202"
  3302. // Buttons
  3303. #define BUTTON1_PIN 0
  3304. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3305. #define BUTTON1_RELAY 1
  3306. #define BUTTON2_PIN 16
  3307. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3308. #define BUTTON2_RELAY 2
  3309. // Relays
  3310. #define RELAY1_PIN 15
  3311. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3312. #define RELAY2_PIN 14
  3313. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3314. // LEDs
  3315. #define LED1_PIN 13
  3316. #define LED1_PIN_INVERSE 1
  3317. // HJL01 / BL0937
  3318. #ifndef HLW8012_SUPPORT
  3319. #define HLW8012_SUPPORT 1
  3320. #endif
  3321. #define HLW8012_SEL_PIN 12
  3322. #define HLW8012_CF1_PIN 5
  3323. #define HLW8012_CF_PIN 4
  3324. #define HLW8012_SEL_CURRENT LOW
  3325. #define HLW8012_CURRENT_RATIO 23296
  3326. #define HLW8012_VOLTAGE_RATIO 310085
  3327. #define HLW8012_POWER_RATIO 3368471
  3328. #define HLW8012_INTERRUPT_ON FALLING
  3329. // -----------------------------------------------------------------------------
  3330. // Foxel's LightFox dual
  3331. // https://github.com/foxel/esp-dual-rf-switch
  3332. // -----------------------------------------------------------------------------
  3333. #elif defined(FOXEL_LIGHTFOX_DUAL)
  3334. // Info
  3335. #define MANUFACTURER "FOXEL"
  3336. #define DEVICE "LIGHTFOX_DUAL"
  3337. #define SERIAL_BAUDRATE 19200
  3338. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  3339. #define DUMMY_RELAY_COUNT 2
  3340. #define DEBUG_SERIAL_SUPPORT 0
  3341. // Buttons
  3342. #define BUTTON1_RELAY 1
  3343. #define BUTTON2_RELAY 2
  3344. #define BUTTON3_RELAY 2
  3345. #define BUTTON4_RELAY 1
  3346. #define BUTTON_EVENTS_SOURCE BUTTON_EVENTS_SOURCE_FOXEL_LIGHTFOX_DUAL
  3347. // -----------------------------------------------------------------------------
  3348. // Teckin SP20
  3349. // -----------------------------------------------------------------------------
  3350. #elif defined(TECKIN_SP20)
  3351. // Info
  3352. #define MANUFACTURER "TECKIN"
  3353. #define DEVICE "SP20"
  3354. // Buttons
  3355. #define BUTTON1_PIN 13
  3356. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3357. #define BUTTON1_RELAY 1
  3358. // Relays
  3359. #define RELAY1_PIN 4
  3360. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3361. // LEDs
  3362. #define LED1_PIN 2
  3363. #define LED1_PIN_INVERSE 1
  3364. #define LED2_PIN 0
  3365. #define LED2_PIN_INVERSE 1
  3366. #define LED2_MODE LED_MODE_FINDME
  3367. #define LED2_RELAY 0
  3368. // HJL01 / BL0937
  3369. #ifndef HLW8012_SUPPORT
  3370. #define HLW8012_SUPPORT 1
  3371. #endif
  3372. #define HLW8012_SEL_PIN 12
  3373. #define HLW8012_CF1_PIN 14
  3374. #define HLW8012_CF_PIN 5
  3375. #define HLW8012_SEL_CURRENT LOW
  3376. #define HLW8012_CURRENT_RATIO 25740
  3377. #define HLW8012_VOLTAGE_RATIO 313400
  3378. #define HLW8012_POWER_RATIO 3414290
  3379. #define HLW8012_INTERRUPT_ON FALLING
  3380. // -----------------------------------------------------------------------------
  3381. // Charging Essentials / LITESUN LA-WF3
  3382. // -----------------------------------------------------------------------------
  3383. #elif defined(LITESUN_LA_WF3)
  3384. // Info
  3385. #define MANUFACTURER "LITESUN"
  3386. #define DEVICE "LA_WF3"
  3387. // Buttons
  3388. #define BUTTON1_PIN 13
  3389. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3390. #define BUTTON1_RELAY 1
  3391. // Relays
  3392. #define RELAY1_PIN 12
  3393. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3394. // LEDs
  3395. #define LED1_PIN 4 // 4 blue led
  3396. #define LED1_MODE LED_MODE_WIFI
  3397. #define LED1_PIN_INVERSE 1
  3398. #define LED2_PIN 5 // 5 red led
  3399. #define LED2_MODE LED_MODE_RELAY
  3400. #define LED2_PIN_INVERSE 1
  3401. // -----------------------------------------------------------------------------
  3402. // PSH
  3403. // -----------------------------------------------------------------------------
  3404. #elif defined(PSH_WIFI_PLUG)
  3405. // Info
  3406. #define MANUFACTURER "PSH"
  3407. #define DEVICE "WIFI_PLUG"
  3408. // Relays
  3409. #define RELAY1_PIN 2
  3410. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3411. // LEDs
  3412. #define LED1_PIN 0
  3413. #define LED1_PIN_INVERSE 0
  3414. #elif defined(PSH_RGBW_CONTROLLER)
  3415. // Info
  3416. #define MANUFACTURER "PSH"
  3417. #define DEVICE "RGBW_CONTROLLER"
  3418. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3419. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3420. #define DUMMY_RELAY_COUNT 1
  3421. // LEDs
  3422. #define LED1_PIN 13
  3423. #define LED1_PIN_INVERSE 1
  3424. // Light
  3425. #define LIGHT_CHANNELS 4
  3426. #define LIGHT_CH1_PIN 5 // RED
  3427. #define LIGHT_CH2_PIN 4 // GREEN
  3428. #define LIGHT_CH3_PIN 12 // BLUE
  3429. #define LIGHT_CH4_PIN 14 // WHITE1
  3430. #elif defined(PSH_WIFI_SENSOR)
  3431. // Info
  3432. #define MANUFACTURER "PSH"
  3433. #define DEVICE "WIFI_SENSOR"
  3434. // DHT12 Sensor
  3435. #define DHT_SUPPORT 1
  3436. #define DHT_PIN 14
  3437. #define DHT_TYPE DHT_CHIP_DHT12
  3438. // LDR Sensor
  3439. #define LDR_SUPPORT 1
  3440. #define LDR_TYPE LDR_GL5528
  3441. #define LDR_ON_GROUND false
  3442. #define LDR_RESISTOR 10000
  3443. #elif defined(JINVOO_VALVE_SM_AW713)
  3444. // Reflashing from original Tuya firmware
  3445. // to thirdparty firmware like espurna by:
  3446. // https://github.com/ct-Open-Source/tuya-convert
  3447. // Info
  3448. #define MANUFACTURER "JINVOO"
  3449. #define DEVICE "VALVE_SM_AW713"
  3450. // Buttons
  3451. #define BUTTON1_PIN 13
  3452. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3453. #define BUTTON1_RELAY 1
  3454. // Relays
  3455. #define RELAY1_PIN 12
  3456. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3457. // LED
  3458. #define LED1_PIN 5 // 5 red led
  3459. #define LED1_PIN_INVERSE 0
  3460. #define LED1_RELAY 1
  3461. #define LED1_MODE LED_MODE_RELAY
  3462. #define LED2_PIN 4 // 4 blue led
  3463. #define LED2_PIN_INVERSE 0
  3464. #define LED2_RELAY 1
  3465. #define LED2_MODE LED_MODE_FINDME_WIFI
  3466. #elif defined(TUYA_GENERIC_DIMMER)
  3467. #define MANUFACTURER "TUYA"
  3468. #define DEVICE "GENERIC_DIMMER"
  3469. #define LIGHT_PROVIDER LIGHT_PROVIDER_TUYA
  3470. #define LIGHT_CHANNELS 0
  3471. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3472. #define DUMMY_RELAY_COUNT 0
  3473. // -----------------------------------------------------------------------------
  3474. // Etekcity ESW01-USA
  3475. // https://www.amazon.com/Etekcity-Voltson-Outlet-Monitoring-Required/dp/B01M3MYIFS
  3476. // -----------------------------------------------------------------------------
  3477. #elif defined(ETEKCITY_ESW01_USA)
  3478. // Info
  3479. #define MANUFACTURER "ETEKCITY"
  3480. #define DEVICE "ESW01_USA"
  3481. // Buttons
  3482. #define BUTTON1_PIN 14
  3483. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3484. #define BUTTON1_RELAY 1
  3485. // Relays
  3486. #define RELAY1_PIN 4
  3487. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3488. // LEDs
  3489. // Blue
  3490. #define LED1_PIN 5
  3491. #define LED1_MODE LED_MODE_WIFI
  3492. // Yellow
  3493. #define LED2_PIN 16
  3494. #define LED2_MODE LED_MODE_FOLLOW
  3495. #define LED2_RELAY 1
  3496. // HLW8012
  3497. #ifndef HLW8012_SUPPORT
  3498. #define HLW8012_SUPPORT 1
  3499. #endif
  3500. #define HLW8012_SEL_PIN 15
  3501. #define HLW8012_CF1_PIN 12
  3502. #define HLW8012_CF_PIN 13
  3503. #define HLW8012_SEL_CURRENT HIGH // SEL pin to HIGH to measure current
  3504. #define HLW8012_CURRENT_R 0.001 // Current resistor
  3505. #define HLW8012_VOLTAGE_R_UP ( 4 * 470000 ) // Upstream voltage resistor
  3506. #define HLW8012_VOLTAGE_R_DOWN ( 1000 ) // Downstream voltage resistor
  3507. #define HLW8012_INTERRUPT_ON CHANGE
  3508. // -----------------------------------------------------------------------------
  3509. // FS UAP1
  3510. // http://frank-schuetz.de/index.php/fhem/13-hoermann-torantrieb-mit-espeasy-in-fhem-einbinden
  3511. #elif defined(FS_UAP1)
  3512. // Info
  3513. #define MANUFACTURER "FS"
  3514. #define DEVICE "UAP1"
  3515. // Inputs
  3516. #define DIGITAL1_PIN 4
  3517. #define DIGITAL2_PIN 5
  3518. // Relays
  3519. #define RELAY1_PIN 12
  3520. #define RELAY2_PIN 13
  3521. #define RELAY3_PIN 14
  3522. #define RELAY4_PIN 15
  3523. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3524. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3525. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  3526. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  3527. // LEDs
  3528. #define LED1_PIN 2
  3529. // Disable UART noise
  3530. #define DEBUG_SERIAL_SUPPORT 0
  3531. // -----------------------------------------------------------------------------
  3532. // TFLAG NX-SM100 & NX-SM200
  3533. // -----------------------------------------------------------------------------
  3534. #elif defined(TFLAG_NX_SMX00)
  3535. // Info
  3536. #define MANUFACTURER "TFLAG"
  3537. #define DEVICE "NX_SMX00"
  3538. // Buttons
  3539. #define BUTTON1_PIN 13
  3540. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3541. #define BUTTON1_RELAY 1
  3542. // Relays
  3543. #define RELAY1_PIN 12
  3544. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3545. // LEDs
  3546. #define LED1_PIN 0
  3547. #define LED1_PIN_INVERSE 1
  3548. #define LED1_MODE LED_MODE_FOLLOW_INVERSE
  3549. #define LED1_RELAY 1
  3550. #define LED2_PIN 15
  3551. #define LED2_PIN_INVERSE 1
  3552. #define LED2_MODE LED_MODE_WIFI
  3553. // HJL01 / BL0937
  3554. #ifndef HLW8012_SUPPORT
  3555. #define HLW8012_SUPPORT 1
  3556. #endif
  3557. #define HLW8012_SEL_PIN 16
  3558. #define HLW8012_CF1_PIN 14
  3559. #define HLW8012_CF_PIN 5
  3560. #define HLW8012_SEL_CURRENT LOW
  3561. #define HLW8012_CURRENT_RATIO 632
  3562. #define HLW8012_VOLTAGE_RATIO 313400
  3563. #define HLW8012_POWER_RATIO 3711185
  3564. #define HLW8012_INTERRUPT_ON FALLING
  3565. // -----------------------------------------------------------------------------
  3566. // MUVIT_IO_MIOBULB001
  3567. // -----------------------------------------------------------------------------
  3568. #elif defined(MUVIT_IO_MIOBULB001)
  3569. // Info
  3570. #define MANUFACTURER "MUVIT_IO"
  3571. #define DEVICE "MIOBULB001"
  3572. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3573. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3574. #define DUMMY_RELAY_COUNT 1
  3575. // Light
  3576. #define LIGHT_CHANNELS 4
  3577. #define LIGHT_CH1_PIN 14 // RED
  3578. #define LIGHT_CH2_PIN 12 // GREEN
  3579. #define LIGHT_CH3_PIN 13 // BLUE
  3580. #define LIGHT_CH4_PIN 4 // WHITE
  3581. // -----------------------------------------------------------------------------
  3582. // Hykker Power Plug (Smart Home Series) available in Jerónimo Martins Polska (Biedronka)
  3583. // https://www.hykker.com/akcesoria/gniazdo-wi-fi-z-licznikiem-energii/
  3584. // Reflashing from original Tuya firmware
  3585. // to thirdparty firmware like espurna by:
  3586. // https://github.com/ct-Open-Source/tuya-convert
  3587. // -----------------------------------------------------------------------------
  3588. #elif defined(HYKKER_SMART_HOME_POWER_PLUG)
  3589. // Info
  3590. #define MANUFACTURER "HYKKER"
  3591. #define DEVICE "SMART_HOME_POWER_PLUG"
  3592. // Buttons
  3593. #define BUTTON1_PIN 0
  3594. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3595. #define BUTTON1_RELAY 1
  3596. // Relays
  3597. #define RELAY1_PIN 14
  3598. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3599. // LED
  3600. // Red
  3601. #define LED1_PIN 13
  3602. #define LED1_MODE LED_MODE_WIFI
  3603. #define LED1_PIN_INVERSE 1
  3604. // Blue connected to relay
  3605. // HLW8012
  3606. #ifndef HLW8012_SUPPORT
  3607. #define HLW8012_SUPPORT 1
  3608. #endif
  3609. #define HLW8012_SEL_PIN 12
  3610. #define HLW8012_CF1_PIN 5
  3611. #define HLW8012_CF_PIN 4
  3612. #define HLW8012_SEL_CURRENT LOW
  3613. #define HLW8012_CURRENT_RATIO 25740
  3614. #define HLW8012_VOLTAGE_RATIO 282060
  3615. #define HLW8012_POWER_RATIO 3414290
  3616. #define HLW8012_INTERRUPT_ON FALLING
  3617. #define SENSOR_ENERGY_UNITS ENERGY_KWH
  3618. #define SENSOR_POWER_UNITS POWER_WATTS
  3619. // -----------------------------------------------------------------------------
  3620. // Kogan Smarter Home Plug with Energy Meter (Australia)
  3621. // Product code: KASPEMHA
  3622. // https://www.kogan.com/au/buy/kogan-smarterhome-smart-plug-energy-meter/
  3623. // Reflashing from original Tuya firmware
  3624. // to thirdparty firmware like espurna by:
  3625. // https://github.com/ct-Open-Source/tuya-convert
  3626. // -----------------------------------------------------------------------------
  3627. #elif defined(KOGAN_SMARTER_HOME_PLUG_W_POW)
  3628. // Info
  3629. #define MANUFACTURER "KOGAN"
  3630. #define DEVICE "SMARTER_HOME_PLUG_W_POW"
  3631. // Buttons
  3632. #define BUTTON1_PIN 0
  3633. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  3634. #define BUTTON1_RELAY 1
  3635. // Relays
  3636. #define RELAY1_PIN 14
  3637. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3638. // LED
  3639. // Red
  3640. #define LED1_PIN 13
  3641. #define LED1_MODE LED_MODE_WIFI
  3642. #define LED1_PIN_INVERSE 1
  3643. // Blue connected to relay
  3644. // HLW8012
  3645. #ifndef HLW8012_SUPPORT
  3646. #define HLW8012_SUPPORT 1
  3647. #endif
  3648. #define HLW8012_SEL_PIN 12
  3649. #define HLW8012_CF1_PIN 5
  3650. #define HLW8012_CF_PIN 4
  3651. #define HLW8012_SEL_CURRENT LOW
  3652. #define HLW8012_CURRENT_RATIO 25740
  3653. #define HLW8012_VOLTAGE_RATIO 282060
  3654. #define HLW8012_POWER_RATIO 3414290
  3655. #define HLW8012_INTERRUPT_ON FALLING
  3656. #define SENSOR_ENERGY_UNITS ENERGY_KWH
  3657. #define SENSOR_POWER_UNITS POWER_WATTS
  3658. // -----------------------------------------------------------------------------
  3659. // KINGART_CURTAIN_SWITCH
  3660. // -----------------------------------------------------------------------------
  3661. #elif defined(KINGART_CURTAIN_SWITCH)
  3662. // Info
  3663. #define MANUFACTURER "KINGART"
  3664. #define DEVICE "CURTAIN_SWITCH"
  3665. #define CURTAIN_SUPPORT 1
  3666. // LEDs
  3667. #define LED1_PIN 13
  3668. #define LED1_PIN_INVERSE 1
  3669. // KINGART module handles the UART, can't print any debug messages
  3670. #define KINGART_CURTAIN_SUPPORT 1
  3671. #define DEBUG_SERIAL_SUPPORT 0
  3672. // -----------------------------------------------------------------------------
  3673. // LSC Smart LED Light Strip (Smart CXonnect Series) available ACTION (Germany)
  3674. // https://www.action.com/de-de/p/lsc-smart-connect-intelligenter-multicolor-led-strip-/
  3675. // Reflashing from original Tuya firmware
  3676. // to thirdparty firmware like espurna by:
  3677. // https://github.com/ct-Open-Source/tuya-convert
  3678. // -----------------------------------------------------------------------------
  3679. #elif defined(LSC_SMART_LED_LIGHT_STRIP)
  3680. // Info
  3681. #define MANUFACTURER "LSC"
  3682. #define DEVICE "SMART_LED_LIGHT_STRIP"
  3683. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3684. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3685. #define DUMMY_RELAY_COUNT 1
  3686. // Light RGBW
  3687. #define LIGHT_CHANNELS 4
  3688. #define LIGHT_CH1_PIN 4 // RED
  3689. #define LIGHT_CH2_PIN 12 // GREEN
  3690. #define LIGHT_CH3_PIN 14 // BLUE
  3691. #define LIGHT_CH4_PIN 13 // WHITE
  3692. // #define LIGHT_CH5_PIN 5 // CW (not connected, but circuit supports it)
  3693. // IR
  3694. #define IR_SUPPORT 1
  3695. #define IR_RX_PIN 0
  3696. #define IR_BUTTON_SET 5
  3697. // -----------------------------------------------------------------------------
  3698. // eHomeDIY WT02
  3699. // https://github.com/eHomeDIY/WT02-hardware
  3700. // -----------------------------------------------------------------------------
  3701. #elif defined(EHOMEDIY_WT02)
  3702. // Info
  3703. #define MANUFACTURER "EHOMEDIY"
  3704. #define DEVICE "WT02"
  3705. #define I2C_SDA_PIN 0
  3706. #define I2C_SCL_PIN 2
  3707. #define BMX280_SUPPORT 1
  3708. // #define SI7021_SUPPORT 1
  3709. // -----------------------------------------------------------------------------
  3710. // eHomeDIY WT03
  3711. // https://github.com/eHomeDIY/WT03-hardware
  3712. // -----------------------------------------------------------------------------
  3713. #elif defined(EHOMEDIY_WT03)
  3714. // Info
  3715. #define MANUFACTURER "EHOMEDIY"
  3716. #define DEVICE "WT03"
  3717. #define I2C_SDA_PIN 2
  3718. #define I2C_SCL_PIN 0
  3719. #define BMX280_SUPPORT 1
  3720. // #define SI7021_SUPPORT 1
  3721. // -----------------------------------------------------------------------------
  3722. // Linksprite R4
  3723. // http://linksprite.com/wiki/index.php?title=LinkNode_R4:_Arduino-compatible_WiFi_relay_controller
  3724. // -----------------------------------------------------------------------------
  3725. #elif defined(LINKSPRITE_LINKNODE_R4)
  3726. // Info
  3727. #define MANUFACTURER "LINKSPRITE"
  3728. #define DEVICE "LINKNODE_R4"
  3729. // Relays
  3730. #define RELAY1_PIN 12
  3731. #define RELAY2_PIN 13
  3732. #define RELAY3_PIN 14
  3733. #define RELAY4_PIN 16
  3734. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3735. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3736. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  3737. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  3738. // -----------------------------------------------------------------------------
  3739. // NEDIS WIFIP310FWT Wi-Fi Smart Extension Socket
  3740. // 3x Schuko Type F, 4x USB, 16 A
  3741. // 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
  3742. // -----------------------------------------------------------------------------
  3743. #elif defined(NEDIS_WIFIP310FWT)
  3744. // Info
  3745. #define MANUFACTURER "NEDIS"
  3746. #define DEVICE "WIFIP310FWT"
  3747. // Based on the reporter, this product uses GPIO1 and 3 for the button
  3748. // and onboard LED, so hardware serial should be disabled...
  3749. #define DEBUG_SERIAL_SUPPORT 0
  3750. // Buttons
  3751. #define BUTTON1_PIN 3
  3752. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3753. // Relays
  3754. #define RELAY1_PIN 5
  3755. #define RELAY2_PIN 4
  3756. #define RELAY3_PIN 13
  3757. #define RELAY4_PIN 14
  3758. // LEDs
  3759. #define LED1_PIN 1
  3760. #define LED1_PIN_INVERSE 1
  3761. // -----------------------------------------------------------------------------
  3762. // Arlec Smart PC190HA Plug
  3763. // https://templates.blakadder.com/arlec_PC190HA.html
  3764. // -----------------------------------------------------------------------------
  3765. #elif defined(ARLEC_PC190HA)
  3766. // Info
  3767. #define MANUFACTURER "ARLEC"
  3768. #define DEVICE "PC190HA"
  3769. // Buttons
  3770. #define BUTTON1_PIN 14
  3771. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3772. #define BUTTON1_RELAY 1
  3773. // Relays
  3774. #define RELAY1_PIN 12
  3775. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3776. // LEDs
  3777. #define LED1_PIN 4 // blue LED
  3778. #define LED1_PIN_INVERSE 1
  3779. #define LED2_PIN 13 // red LED
  3780. #define LED2_PIN_INVERSE 1
  3781. // -----------------------------------------------------------------------------
  3782. // Arlec Smart PB89HA Power Strip
  3783. // https://templates.blakadder.com/arlec_PB89HA.html
  3784. // -----------------------------------------------------------------------------
  3785. #elif defined(ARLEC_PB89HA)
  3786. // Info
  3787. #define MANUFACTURER "ARLEC"
  3788. #define DEVICE "PB89HA"
  3789. // Buttons
  3790. #define BUTTON1_PIN 3
  3791. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3792. // Relays
  3793. #define RELAY1_PIN 5
  3794. #define RELAY2_PIN 4
  3795. #define RELAY3_PIN 13
  3796. #define RELAY4_PIN 12
  3797. // LEDs
  3798. #define LED1_PIN 1
  3799. #define LED1_PIN_INVERSE 1
  3800. // -----------------------------------------------------------------------------
  3801. // Prodino WIFI
  3802. // https://kmpelectronics.eu/products/prodino-wifi-v1/
  3803. // -----------------------------------------------------------------------------
  3804. #elif defined(PRODINO_WIFI)
  3805. // Info
  3806. #define MANUFACTURER "PRODINO"
  3807. #define DEVICE "WIFI"
  3808. // MCP23S08
  3809. #define MCP23S08_SUPPORT 1
  3810. // Relays
  3811. #define RELAY_PROVIDER RELAY_PROVIDER_MCP23S08
  3812. #define RELAY1_PIN 4
  3813. #define RELAY2_PIN 5
  3814. #define RELAY3_PIN 6
  3815. #define RELAY4_PIN 7
  3816. // Buttons
  3817. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3818. #define BUTTON1_PIN 0
  3819. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3820. #define BUTTON2_PIN 1
  3821. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3822. #define BUTTON3_PIN 2
  3823. #define BUTTON4_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3824. #define BUTTON4_PIN 3
  3825. #define BUTTON1_RELAY 1
  3826. #define BUTTON2_RELAY 2
  3827. #define BUTTON3_RELAY 3
  3828. #define BUTTON4_RELAY 4
  3829. #define BUTTON_EVENTS_SOURCE BUTTON_EVENTS_SOURCE_MCP23S08
  3830. // LEDs
  3831. #define LED1_PIN 2
  3832. #define LED1_PIN_INVERSE 1
  3833. // -----------------------------------------------------------------------------
  3834. // Fcmila E27 7W RGB+W Bulb
  3835. // https://www.aliexpress.com/item/32925895199.html
  3836. // -----------------------------------------------------------------------------
  3837. #elif defined(FCMILA_E27_7W_RGBW)
  3838. // Info
  3839. #define MANUFACTURER "FCMILA"
  3840. #define DEVICE "E27_7W_RGBW"
  3841. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3842. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3843. #define DUMMY_RELAY_COUNT 1
  3844. // Light
  3845. #define LIGHT_CHANNELS 4
  3846. #define LIGHT_CH1_PIN 4 // RED
  3847. #define LIGHT_CH2_PIN 12 // GREEN
  3848. #define LIGHT_CH3_PIN 14 // BLUE
  3849. #define LIGHT_CH4_PIN 5 // WHITE
  3850. #else
  3851. #error "UNSUPPORTED HARDWARE!!"
  3852. #endif