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.

4872 lines
158 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. // -----------------------------------------------------------------------------
  1384. // ESPLive
  1385. // https://github.com/ManCaveMade/ESP-Live
  1386. // -----------------------------------------------------------------------------
  1387. #elif defined(MANCAVEMADE_ESPLIVE)
  1388. // Info
  1389. #define MANUFACTURER "MANCAVEMADE"
  1390. #define DEVICE "ESPLIVE"
  1391. // Buttons
  1392. #define BUTTON1_PIN 4
  1393. #define BUTTON2_PIN 5
  1394. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1395. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1396. #define BUTTON1_RELAY 1
  1397. #define BUTTON2_RELAY 2
  1398. // Relays
  1399. #define RELAY1_PIN 12
  1400. #define RELAY2_PIN 13
  1401. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1402. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1403. // DS18B20
  1404. #ifndef DALLAS_SUPPORT
  1405. #define DALLAS_SUPPORT 1
  1406. #endif
  1407. #define DALLAS_PIN 2
  1408. #define DALLAS_UPDATE_INTERVAL 5000
  1409. #define TEMPERATURE_MIN_CHANGE 1.0
  1410. // -----------------------------------------------------------------------------
  1411. // QuinLED
  1412. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  1413. // -----------------------------------------------------------------------------
  1414. #elif defined(INTERMITTECH_QUINLED)
  1415. // Info
  1416. #define MANUFACTURER "INTERMITTECH"
  1417. #define DEVICE "QUINLED"
  1418. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1419. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1420. #define DUMMY_RELAY_COUNT 1
  1421. // LEDs
  1422. #define LED1_PIN 5
  1423. #define LED1_PIN_INVERSE 1
  1424. // Light
  1425. #define LIGHT_CHANNELS 2
  1426. #define LIGHT_CH1_PIN 0
  1427. #define LIGHT_CH2_PIN 2
  1428. // -----------------------------------------------------------------------------
  1429. // Arilux AL-LC06
  1430. // -----------------------------------------------------------------------------
  1431. #elif defined(ARILUX_AL_LC01)
  1432. // Info
  1433. #define MANUFACTURER "ARILUX"
  1434. #define DEVICE "AL_LC01"
  1435. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1436. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1437. #define DUMMY_RELAY_COUNT 1
  1438. // Light
  1439. #define LIGHT_CHANNELS 3
  1440. #define LIGHT_CH1_PIN 5 // RED
  1441. #define LIGHT_CH2_PIN 12 // GREEN
  1442. #define LIGHT_CH3_PIN 13 // BLUE
  1443. #elif defined(ARILUX_AL_LC02)
  1444. // Info
  1445. #define MANUFACTURER "ARILUX"
  1446. #define DEVICE "AL_LC02"
  1447. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1448. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1449. #define DUMMY_RELAY_COUNT 1
  1450. // Light
  1451. #define LIGHT_CHANNELS 4
  1452. #define LIGHT_CH1_PIN 12 // RED
  1453. #define LIGHT_CH2_PIN 5 // GREEN
  1454. #define LIGHT_CH3_PIN 13 // BLUE
  1455. #define LIGHT_CH4_PIN 15 // WHITE1
  1456. #elif defined(ARILUX_AL_LC02_V14)
  1457. // Info
  1458. #define MANUFACTURER "ARILUX"
  1459. #define DEVICE "AL_LC02_V14"
  1460. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1461. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1462. #define DUMMY_RELAY_COUNT 1
  1463. // Light
  1464. #define LIGHT_CHANNELS 4
  1465. #define LIGHT_CH1_PIN 14 // RED
  1466. #define LIGHT_CH2_PIN 5 // GREEN
  1467. #define LIGHT_CH3_PIN 12 // BLUE
  1468. #define LIGHT_CH4_PIN 13 // WHITE1
  1469. #elif defined(ARILUX_AL_LC06)
  1470. // Info
  1471. #define MANUFACTURER "ARILUX"
  1472. #define DEVICE "AL_LC06"
  1473. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1474. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1475. #define DUMMY_RELAY_COUNT 1
  1476. // Buttons
  1477. #define BUTTON1_PIN 0
  1478. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1479. #define BUTTON1_RELAY 1
  1480. // Light
  1481. #define LIGHT_CHANNELS 5
  1482. #define LIGHT_CH1_PIN 14 // RED
  1483. #define LIGHT_CH2_PIN 12 // GREEN
  1484. #define LIGHT_CH3_PIN 13 // BLUE
  1485. #define LIGHT_CH4_PIN 15 // WHITE1
  1486. #define LIGHT_CH5_PIN 5 // WHITE2
  1487. #elif defined(ARILUX_AL_LC11)
  1488. // Info
  1489. #define MANUFACTURER "ARILUX"
  1490. #define DEVICE "AL_LC11"
  1491. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1492. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1493. #define DUMMY_RELAY_COUNT 1
  1494. // Light
  1495. #define LIGHT_CHANNELS 5
  1496. #define LIGHT_CH1_PIN 5 // RED
  1497. #define LIGHT_CH2_PIN 4 // GREEN
  1498. #define LIGHT_CH3_PIN 14 // BLUE
  1499. #define LIGHT_CH4_PIN 13 // WHITE1
  1500. #define LIGHT_CH5_PIN 12 // WHITE1
  1501. #elif defined(ARILUX_E27)
  1502. // Info
  1503. #define MANUFACTURER "ARILUX"
  1504. #define DEVICE "E27"
  1505. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1506. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1507. #define DUMMY_RELAY_COUNT 1
  1508. // Light
  1509. #define LIGHT_CHANNELS 4
  1510. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  1511. #define MY92XX_CHIPS 1
  1512. #define MY92XX_DI_PIN 13
  1513. #define MY92XX_DCKI_PIN 15
  1514. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1515. #define MY92XX_MAPPING 0, 1, 2, 3
  1516. // -----------------------------------------------------------------------------
  1517. // XENON SM-PW701U
  1518. // -----------------------------------------------------------------------------
  1519. #elif defined(XENON_SM_PW702U)
  1520. // Info
  1521. #define MANUFACTURER "XENON"
  1522. #define DEVICE "SM_PW702U"
  1523. // Buttons
  1524. #define BUTTON1_PIN 13
  1525. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1526. #define BUTTON1_RELAY 1
  1527. // Relays
  1528. #define RELAY1_PIN 12
  1529. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1530. // LEDs
  1531. #define LED1_PIN 4
  1532. #define LED1_PIN_INVERSE 1
  1533. // -----------------------------------------------------------------------------
  1534. // ISELECTOR SM-PW702
  1535. // -----------------------------------------------------------------------------
  1536. #elif defined(ISELECTOR_SM_PW702)
  1537. // Info
  1538. #define MANUFACTURER "ISELECTOR"
  1539. #define DEVICE "SM_PW702"
  1540. // Buttons
  1541. #define BUTTON1_PIN 13
  1542. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1543. #define BUTTON1_RELAY 1
  1544. // Relays
  1545. #define RELAY1_PIN 12
  1546. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1547. // LEDs
  1548. #define LED1_PIN 4 //BLUE
  1549. #define LED1_PIN_INVERSE 0
  1550. #define LED2_PIN 5 //RED
  1551. #define LED2_PIN_INVERSE 1
  1552. // -----------------------------------------------------------------------------
  1553. // AUTHOMETION LYT8266
  1554. // https://authometion.com/shop/en/home/13-lyt8266.html
  1555. // -----------------------------------------------------------------------------
  1556. #elif defined(AUTHOMETION_LYT8266)
  1557. // Info
  1558. #define MANUFACTURER "AUTHOMETION"
  1559. #define DEVICE "LYT8266"
  1560. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1561. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1562. #define DUMMY_RELAY_COUNT 1
  1563. // Light
  1564. #define LIGHT_CHANNELS 4
  1565. #define LIGHT_CH1_PIN 13 // RED
  1566. #define LIGHT_CH2_PIN 12 // GREEN
  1567. #define LIGHT_CH3_PIN 14 // BLUE
  1568. #define LIGHT_CH4_PIN 2 // WHITE
  1569. #define LIGHT_ENABLE_PIN 15
  1570. #elif defined(GIZWITS_WITTY_CLOUD)
  1571. // Info
  1572. #define MANUFACTURER "GIZWITS"
  1573. #define DEVICE "WITTY_CLOUD"
  1574. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1575. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1576. #define DUMMY_RELAY_COUNT 1
  1577. // Buttons
  1578. #define BUTTON1_PIN 4
  1579. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1580. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  1581. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  1582. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  1583. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  1584. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  1585. #define ANALOG_SUPPORT 1
  1586. // LEDs
  1587. #define LED1_PIN 2 // BLUE build-in
  1588. #define LED1_PIN_INVERSE 1
  1589. // Light
  1590. #define LIGHT_CHANNELS 3
  1591. #define LIGHT_CH1_PIN 15 // RED
  1592. #define LIGHT_CH2_PIN 12 // GREEN
  1593. #define LIGHT_CH3_PIN 13 // BLUE
  1594. // -----------------------------------------------------------------------------
  1595. // KMC 70011
  1596. // https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
  1597. // -----------------------------------------------------------------------------
  1598. #elif defined(KMC_70011)
  1599. // Info
  1600. #define MANUFACTURER "KMC"
  1601. #define DEVICE "70011"
  1602. // Buttons
  1603. #define BUTTON1_PIN 0
  1604. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1605. #define BUTTON1_RELAY 1
  1606. // Relays
  1607. #define RELAY1_PIN 14
  1608. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1609. // LEDs
  1610. #define LED1_PIN 13
  1611. #define LED1_PIN_INVERSE 1
  1612. // HLW8012
  1613. #ifndef HLW8012_SUPPORT
  1614. #define HLW8012_SUPPORT 1
  1615. #endif
  1616. #define HLW8012_SEL_PIN 12
  1617. #define HLW8012_CF1_PIN 5
  1618. #define HLW8012_CF_PIN 4
  1619. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1620. // -----------------------------------------------------------------------------
  1621. // Euromate (?) Wifi Stecker Schuko
  1622. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  1623. // Thanks to @Geitde
  1624. // -----------------------------------------------------------------------------
  1625. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  1626. // Info
  1627. #define MANUFACTURER "EUROMATE"
  1628. #define DEVICE "WIFI_STECKER_SCHUKO"
  1629. // Buttons
  1630. #define BUTTON1_PIN 14
  1631. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1632. #define BUTTON1_RELAY 1
  1633. // The relay in the device is not a bistable (latched) relay.
  1634. // The device is reported to have a flip-flop circuit to drive the relay
  1635. // So @Geitde hack is still the only possible
  1636. // Hack: drive GPIO12 low and use GPIO5 as normal relay pin:
  1637. #define RELAY1_PIN 5
  1638. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1639. #define LED2_PIN 12 /* DUMMY: exploit default off state for GPIO12=low */
  1640. #define LED2_PIN_INVERSE 0
  1641. // LEDs
  1642. #define LED1_PIN 4
  1643. #define LED1_PIN_INVERSE 0
  1644. // -----------------------------------------------------------------------------
  1645. // Euromate (?) Wifi Stecker Schuko Version 2
  1646. // This configuration is for the second generation of devices sold by OBI.
  1647. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko-weiss/p/4077806
  1648. // -----------------------------------------------------------------------------
  1649. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO_V2)
  1650. // Info
  1651. #define MANUFACTURER "EUROMATE"
  1652. #define DEVICE "WIFI_STECKER_SCHUKO_V2"
  1653. // Buttons
  1654. #define BUTTON1_PIN 5
  1655. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1656. #define BUTTON1_RELAY 1
  1657. // Relays
  1658. #define RELAY1_PIN 4
  1659. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1660. // Green
  1661. #define LED1_PIN 12
  1662. #define LED1_MODE LED_MODE_WIFI
  1663. #define LED1_PIN_INVERSE 0
  1664. // Red
  1665. #define LED2_PIN 13
  1666. #define LED2_MODE LED_MODE_RELAY
  1667. #define LED2_PIN_INVERSE 0
  1668. // -----------------------------------------------------------------------------
  1669. // Generic 8CH
  1670. // -----------------------------------------------------------------------------
  1671. #elif defined(GENERIC_8CH)
  1672. // Info
  1673. #define MANUFACTURER "GENERIC"
  1674. #define DEVICE "8CH"
  1675. // Relays
  1676. #define RELAY1_PIN 0
  1677. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1678. #define RELAY2_PIN 2
  1679. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1680. #define RELAY3_PIN 4
  1681. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1682. #define RELAY4_PIN 5
  1683. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1684. #define RELAY5_PIN 12
  1685. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1686. #define RELAY6_PIN 13
  1687. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  1688. #define RELAY7_PIN 14
  1689. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  1690. #define RELAY8_PIN 15
  1691. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  1692. // -----------------------------------------------------------------------------
  1693. // STM RELAY
  1694. // -----------------------------------------------------------------------------
  1695. #elif defined(STM_RELAY)
  1696. // Info
  1697. #define MANUFACTURER "STM_RELAY"
  1698. #define DEVICE "2CH"
  1699. // Relays
  1700. #define DUMMY_RELAY_COUNT 2
  1701. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  1702. // Remove UART noise on serial line
  1703. #define DEBUG_SERIAL_SUPPORT 0
  1704. // -----------------------------------------------------------------------------
  1705. // Tonbux Powerstrip02
  1706. // -----------------------------------------------------------------------------
  1707. #elif defined(TONBUX_POWERSTRIP02)
  1708. // Info
  1709. #define MANUFACTURER "TONBUX"
  1710. #define DEVICE "POWERSTRIP02"
  1711. // Buttons
  1712. #define BUTTON1_PIN 5
  1713. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1714. #define BUTTON1_RELAY 0
  1715. // Relays
  1716. #define RELAY1_PIN 4
  1717. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1718. #define RELAY2_PIN 13
  1719. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1720. #define RELAY3_PIN 12
  1721. #define RELAY3_TYPE RELAY_TYPE_INVERSE
  1722. #define RELAY4_PIN 14
  1723. #define RELAY4_TYPE RELAY_TYPE_INVERSE
  1724. // Not a relay. USB ports on/off
  1725. #define RELAY5_PIN 16
  1726. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1727. // LEDs
  1728. #define LED1_PIN 0 // 1 blue led
  1729. #define LED1_PIN_INVERSE 1
  1730. #define LED2_PIN 3 // 3 red leds
  1731. #define LED2_PIN_INVERSE 1
  1732. // -----------------------------------------------------------------------------
  1733. // Lingan SWA1
  1734. // -----------------------------------------------------------------------------
  1735. #elif defined(LINGAN_SWA1)
  1736. // Info
  1737. #define MANUFACTURER "LINGAN"
  1738. #define DEVICE "SWA1"
  1739. // Buttons
  1740. #define BUTTON1_PIN 13
  1741. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1742. #define BUTTON1_RELAY 1
  1743. // Relays
  1744. #define RELAY1_PIN 5
  1745. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1746. // LEDs
  1747. #define LED1_PIN 4
  1748. #define LED1_PIN_INVERSE 1
  1749. // -----------------------------------------------------------------------------
  1750. // HEYGO HY02
  1751. // -----------------------------------------------------------------------------
  1752. #elif defined(HEYGO_HY02)
  1753. // Info
  1754. #define MANUFACTURER "HEYGO"
  1755. #define DEVICE "HY02"
  1756. // Buttons
  1757. #define BUTTON1_PIN 13
  1758. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1759. #define BUTTON1_RELAY 1
  1760. // Relays
  1761. #define RELAY1_PIN 12
  1762. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1763. // LEDs
  1764. #define LED1_PIN 4
  1765. #define LED1_PIN_INVERSE 0
  1766. // -----------------------------------------------------------------------------
  1767. // Maxcio W-US002S
  1768. // -----------------------------------------------------------------------------
  1769. #elif defined(MAXCIO_WUS002S)
  1770. // Info
  1771. #define MANUFACTURER "MAXCIO"
  1772. #define DEVICE "WUS002S"
  1773. // Buttons
  1774. #define BUTTON1_PIN 2
  1775. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1776. #define BUTTON1_RELAY 1
  1777. // Relays
  1778. #define RELAY1_PIN 13
  1779. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1780. // LEDs
  1781. #define LED1_PIN 3
  1782. #define LED1_PIN_INVERSE 0
  1783. // HLW8012
  1784. #ifndef HLW8012_SUPPORT
  1785. #define HLW8012_SUPPORT 1
  1786. #endif
  1787. #define HLW8012_SEL_PIN 12
  1788. #define HLW8012_CF1_PIN 5
  1789. #define HLW8012_CF_PIN 4
  1790. #define HLW8012_CURRENT_R 0.002 // Current resistor
  1791. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1792. // LED1 on RX pin
  1793. #define DEBUG_SERIAL_SUPPORT 1
  1794. // -----------------------------------------------------------------------------
  1795. // Maxcio W-DE004
  1796. // -----------------------------------------------------------------------------
  1797. #elif defined(MAXCIO_WDE004)
  1798. // Info
  1799. #define MANUFACTURER "MAXCIO"
  1800. #define DEVICE "WDE004"
  1801. // Buttons
  1802. #define BUTTON1_PIN 1
  1803. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1804. #define BUTTON1_RELAY 1
  1805. // Relays
  1806. #define RELAY1_PIN 14
  1807. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1808. // LEDs
  1809. #define LED1_PIN 13
  1810. #define LED1_PIN_INVERSE 1
  1811. // -----------------------------------------------------------------------------
  1812. // Maxcio W-UK007S
  1813. // 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
  1814. // -----------------------------------------------------------------------------
  1815. #elif defined(MAXCIO_WUK007S)
  1816. // Info
  1817. #define MANUFACTURER "MAXCIO"
  1818. #define DEVICE "WUK007S"
  1819. // Buttons
  1820. #define BUTTON1_PIN 13
  1821. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1822. #define BUTTON1_RELAY 1
  1823. // Relays
  1824. #define RELAY1_PIN 15
  1825. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1826. // LEDs
  1827. #define LED1_PIN 0
  1828. #define LED1_PIN_INVERSE 0
  1829. #define LED1_RELAY 1
  1830. #define LED1_MODE LED_MODE_RELAY_WIFI
  1831. // HJL01 / BL0937
  1832. #ifndef HLW8012_SUPPORT
  1833. #define HLW8012_SUPPORT 1
  1834. #endif
  1835. #define HLW8012_SEL_PIN 12
  1836. #define HLW8012_CF1_PIN 14
  1837. #define HLW8012_CF_PIN 5
  1838. #define HLW8012_SEL_CURRENT LOW
  1839. #define HLW8012_CURRENT_RATIO 24380
  1840. #define HLW8012_VOLTAGE_RATIO 32048
  1841. #define HLW8012_POWER_RATIO 3509285
  1842. #define HLW8012_INTERRUPT_ON FALLING
  1843. // -----------------------------------------------------------------------------
  1844. // Oukitel P1 Smart Plug
  1845. // 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
  1846. // -----------------------------------------------------------------------------
  1847. #elif defined(OUKITEL_P1)
  1848. // Info
  1849. #define MANUFACTURER "Oukitel"
  1850. #define DEVICE "P1"
  1851. // Buttons
  1852. #define BUTTON1_PIN 13
  1853. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1854. #define BUTTON1_RELAY 1
  1855. // Relays
  1856. // Right
  1857. #define RELAY1_PIN 12
  1858. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1859. // Left
  1860. #define RELAY2_PIN 15
  1861. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1862. // LEDs
  1863. #define LED1_PIN 0 // blue
  1864. #define LED1_PIN_INVERSE 1
  1865. #define LED1_MODE LED_MODE_WIFI
  1866. // -----------------------------------------------------------------------------
  1867. // YiDian XS-SSA05
  1868. // -----------------------------------------------------------------------------
  1869. #elif defined(YIDIAN_XSSSA05)
  1870. // Info
  1871. #define MANUFACTURER "YIDIAN"
  1872. #define DEVICE "XSSSA05"
  1873. // Buttons
  1874. #define BUTTON1_PIN 13
  1875. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1876. #define BUTTON1_RELAY 1
  1877. // Relays
  1878. #define RELAY1_PIN 12
  1879. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1880. // LEDs
  1881. #define LED1_PIN 0 // red
  1882. #define LED1_PIN_INVERSE 1
  1883. #define LED1_MODE LED_MODE_WIFI
  1884. #define LED2_PIN 15 // blue
  1885. #define LED2_PIN_INVERSE 1
  1886. #define LED2_MODE LED_MODE_RELAY
  1887. // HLW8012
  1888. #ifndef HLW8012_SUPPORT
  1889. #define HLW8012_SUPPORT 1
  1890. #endif
  1891. #define HLW8012_SEL_PIN 3
  1892. #define HLW8012_CF1_PIN 14
  1893. #define HLW8012_CF_PIN 5
  1894. #define HLW8012_SEL_CURRENT LOW
  1895. #define HLW8012_CURRENT_RATIO 25740
  1896. #define HLW8012_VOLTAGE_RATIO 313400
  1897. #define HLW8012_POWER_RATIO 3414290
  1898. #define HLW8012_INTERRUPT_ON FALLING
  1899. // -----------------------------------------------------------------------------
  1900. // TONBUX XS-SSA01
  1901. // -----------------------------------------------------------------------------
  1902. #elif defined(TONBUX_XSSSA01)
  1903. // Info
  1904. #define MANUFACTURER "TONBUX"
  1905. #define DEVICE "XSSSA01"
  1906. // Buttons
  1907. #define BUTTON1_PIN 4
  1908. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1909. #define BUTTON1_RELAY 1
  1910. // Relays
  1911. #define RELAY1_PIN 14
  1912. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1913. // LEDs
  1914. #define LED1_PIN 13
  1915. #define LED1_PIN_INVERSE 0
  1916. // -----------------------------------------------------------------------------
  1917. // TONBUX XS-SSA06
  1918. // -----------------------------------------------------------------------------
  1919. #elif defined(TONBUX_XSSSA06)
  1920. // Info
  1921. #define MANUFACTURER "TONBUX"
  1922. #define DEVICE "XSSSA06"
  1923. // Buttons
  1924. #define BUTTON1_PIN 13
  1925. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1926. #define BUTTON1_RELAY 1
  1927. // Relays
  1928. #define RELAY1_PIN 15
  1929. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1930. // LEDs
  1931. #define LED1_PIN 0 // R - 8 rgb led ring
  1932. #define LED1_PIN_INVERSE 0
  1933. #define LED2_PIN 5 // G
  1934. #define LED2_PIN_INVERSE 0
  1935. #define LED3_PIN 2 // B
  1936. #define LED3_PIN_INVERSE 0
  1937. // -----------------------------------------------------------------------------
  1938. // GREEN ESP8266 RELAY MODULE
  1939. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1940. // -----------------------------------------------------------------------------
  1941. #elif defined(GREEN_ESP8266RELAY)
  1942. // Info
  1943. #define MANUFACTURER "GREEN"
  1944. #define DEVICE "ESP8266RELAY"
  1945. // Buttons
  1946. // Not a button but input via Optocoupler
  1947. #define BUTTON1_PIN 5
  1948. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1949. #define BUTTON1_RELAY 1
  1950. // Relays
  1951. #define RELAY1_PIN 4
  1952. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1953. // LEDs
  1954. #define LED1_PIN 2
  1955. #define LED1_PIN_INVERSE 1
  1956. // -----------------------------------------------------------------------------
  1957. // Henrique Gravina ESPIKE
  1958. // https://github.com/Henriquegravina/Espike
  1959. // -----------------------------------------------------------------------------
  1960. #elif defined(IKE_ESPIKE)
  1961. #define MANUFACTURER "IKE"
  1962. #define DEVICE "ESPIKE"
  1963. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_NONE
  1964. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  1965. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  1966. #define BUTTON1_PIN 13
  1967. #define BUTTON1_RELAY 1
  1968. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1969. #define BUTTON2_PIN 12
  1970. #define BUTTON2_RELAY 2
  1971. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1972. #define BUTTON3_PIN 14
  1973. #define BUTTON3_RELAY 3
  1974. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1975. #define RELAY1_PIN 4
  1976. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1977. #define RELAY2_PIN 5
  1978. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1979. #define RELAY3_PIN 16
  1980. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1981. #define LED1_PIN 2
  1982. #define LED1_PIN_INVERSE 1
  1983. // -----------------------------------------------------------------------------
  1984. // SWIFITCH
  1985. // https://github.com/ArnieX/swifitch
  1986. // -----------------------------------------------------------------------------
  1987. #elif defined(ARNIEX_SWIFITCH)
  1988. // Info
  1989. #define MANUFACTURER "ARNIEX"
  1990. #define DEVICE "SWIFITCH"
  1991. // Buttons
  1992. #define BUTTON1_PIN 4 // D2
  1993. #define BUTTON1_CONFIG BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1994. #define BUTTON1_RELAY 1
  1995. #define BUTTON1_PRESS BUTTON_ACTION_NONE
  1996. #define BUTTON1_CLICK BUTTON_ACTION_TOGGLE
  1997. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  1998. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  1999. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_NONE
  2000. // Relays
  2001. #define RELAY1_PIN 5 // D1
  2002. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  2003. // LEDs
  2004. #define LED1_PIN 12 // D6
  2005. #define LED1_PIN_INVERSE 1
  2006. // -----------------------------------------------------------------------------
  2007. // ESP-01S RELAY v4.0
  2008. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  2009. // -----------------------------------------------------------------------------
  2010. #elif defined(GENERIC_ESP01S_RELAY_V40)
  2011. // Info
  2012. #define MANUFACTURER "GENERIC"
  2013. #define DEVICE "ESP01S_RELAY_40"
  2014. // Relays
  2015. #define RELAY1_PIN 0
  2016. #ifndef RELAY1_TYPE
  2017. #define RELAY1_TYPE RELAY_TYPE_NORMAL // See #1504 and #1554
  2018. #endif
  2019. // LEDs
  2020. #define LED1_PIN 2
  2021. #define LED1_PIN_INVERSE 0
  2022. // -----------------------------------------------------------------------------
  2023. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  2024. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  2025. // -----------------------------------------------------------------------------
  2026. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  2027. // Info
  2028. #define MANUFACTURER "GENERIC"
  2029. #define DEVICE "ESP01S_RGBLED_10"
  2030. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  2031. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  2032. // Buttons
  2033. //#define BUTTON1_PIN 2
  2034. // Relays
  2035. //#define RELAY1_PIN 2
  2036. // LEDs
  2037. #define LED1_PIN 2
  2038. #define LED1_PIN_INVERSE 0
  2039. // -----------------------------------------------------------------------------
  2040. // ESP-01S DHT11 v1.0
  2041. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  2042. // -----------------------------------------------------------------------------
  2043. #elif defined(GENERIC_ESP01S_DHT11_V10)
  2044. // Info
  2045. #define MANUFACTURER "GENERIC"
  2046. #define DEVICE "ESP01S_DHT11_10"
  2047. // DHT11
  2048. #ifndef DHT_SUPPORT
  2049. #define DHT_SUPPORT 1
  2050. #endif
  2051. #define DHT_PIN 2
  2052. #define DHT_TYPE DHT_CHIP_DHT11
  2053. // -----------------------------------------------------------------------------
  2054. // ESP-01S DS18B20 v1.0
  2055. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  2056. // -----------------------------------------------------------------------------
  2057. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  2058. // Info
  2059. #define MANUFACTURER "GENERIC"
  2060. #define DEVICE "ESP01S_DS18B20_10"
  2061. // DB18B20
  2062. #ifndef DALLAS_SUPPORT
  2063. #define DALLAS_SUPPORT 1
  2064. #endif
  2065. #define DALLAS_PIN 2
  2066. // -----------------------------------------------------------------------------
  2067. // ESP-DIN relay board V1
  2068. // https://github.com/pilotak/esp_din
  2069. // -----------------------------------------------------------------------------
  2070. #elif defined(PILOTAK_ESP_DIN_V1)
  2071. // Info
  2072. #define MANUFACTURER "PILOTAK"
  2073. #define DEVICE "ESP_DIN_V1"
  2074. // Buttons
  2075. #define BUTTON1_PIN 0
  2076. #define BUTTON1_RELAY 1
  2077. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2078. // Relays
  2079. #define RELAY1_PIN 4
  2080. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2081. #define RELAY2_PIN 5
  2082. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2083. // LEDs
  2084. #define LED1_PIN 15
  2085. #define LED1_PIN_INVERSE 0
  2086. #define I2C_SDA_PIN 12
  2087. #define I2C_SCL_PIN 13
  2088. #ifndef DALLAS_SUPPORT
  2089. #define DALLAS_SUPPORT 1
  2090. #endif
  2091. #define DALLAS_PIN 2
  2092. #define RFB_SUPPORT 1
  2093. #define RFB_PROVIDER RFB_PROVIDER_RCSWITCH
  2094. #define RFB_RX_PIN 14
  2095. #ifndef DIGITAL_SUPPORT
  2096. #define DIGITAL_SUPPORT 1
  2097. #endif
  2098. #define DIGITAL1_PIN 16
  2099. #define DIGITAL1_PIN_MODE INPUT
  2100. #define DIGITAL1_DEFAULT_STATE 0
  2101. // -----------------------------------------------------------------------------
  2102. // Heltec Touch Relay
  2103. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  2104. // -----------------------------------------------------------------------------
  2105. #elif defined(HELTEC_TOUCHRELAY)
  2106. // Info
  2107. #define MANUFACTURER "HELTEC"
  2108. #define DEVICE "TOUCH_RELAY"
  2109. // Buttons
  2110. #define BUTTON1_PIN 14
  2111. #define BUTTON1_RELAY 1
  2112. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON
  2113. // Relays
  2114. #define RELAY1_PIN 12
  2115. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2116. // -----------------------------------------------------------------------------
  2117. // Zhilde ZLD-EU44-W
  2118. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  2119. // -----------------------------------------------------------------------------
  2120. #elif defined(ZHILDE_EU44_W)
  2121. // Info
  2122. #define MANUFACTURER "ZHILDE"
  2123. #define DEVICE "EU44_W"
  2124. // Based on the reporter, this product uses GPIO1 and 3 for the button
  2125. // and onboard LED, so hardware serial should be disabled...
  2126. #define DEBUG_SERIAL_SUPPORT 0
  2127. // Buttons
  2128. #define BUTTON1_PIN 3
  2129. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2130. // Relays
  2131. #define RELAY1_PIN 5
  2132. #define RELAY2_PIN 4
  2133. #define RELAY3_PIN 12
  2134. #define RELAY4_PIN 13
  2135. #define RELAY5_PIN 14
  2136. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2137. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2138. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2139. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2140. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  2141. // LEDs
  2142. #define LED1_PIN 1
  2143. #define LED1_PIN_INVERSE 1
  2144. // -----------------------------------------------------------------------------
  2145. // Allnet 4duino ESP8266-UP-Relais
  2146. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  2147. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  2148. // -----------------------------------------------------------------------------
  2149. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  2150. // Info
  2151. #define MANUFACTURER "ALLNET"
  2152. #define DEVICE "4DUINO_IOT_WLAN_RELAIS"
  2153. // Relays
  2154. #define RELAY1_PIN 14
  2155. #define RELAY1_RESET_PIN 12
  2156. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  2157. // LEDs
  2158. #define LED1_PIN 0
  2159. #define LED1_PIN_INVERSE 1
  2160. // Buttons
  2161. //#define BUTTON1_PIN 0
  2162. //#define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2163. // Using pins labelled as SDA & SCL as buttons
  2164. #define BUTTON2_PIN 4
  2165. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON
  2166. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  2167. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  2168. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  2169. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  2170. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_NONE
  2171. #define BUTTON3_PIN 5
  2172. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON
  2173. // Using pins labelled as SDA & SCL for I2C
  2174. //#define I2C_SDA_PIN 4
  2175. //#define I2C_SCL_PIN 5
  2176. // -----------------------------------------------------------------------------
  2177. // Luani HVIO
  2178. // https://luani.de/projekte/esp8266-hvio/
  2179. // https://luani.de/blog/esp8266-230v-io-modul/
  2180. // -----------------------------------------------------------------------------
  2181. #elif defined(LUANI_HVIO)
  2182. // Info
  2183. #define MANUFACTURER "LUANI"
  2184. #define DEVICE "HVIO"
  2185. // Buttons
  2186. #define BUTTON1_PIN 12
  2187. #define BUTTON1_RELAY 1
  2188. #define BUTTON1_CONFIG BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  2189. #define BUTTON1_PRESS BUTTON_ACTION_NONE
  2190. #define BUTTON1_CLICK BUTTON_ACTION_TOGGLE
  2191. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  2192. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  2193. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_NONE
  2194. #define BUTTON2_PIN 13
  2195. #define BUTTON2_RELAY 2
  2196. #define BUTTON2_CONFIG BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  2197. #define BUTTON2_CLICK BUTTON_ACTION_TOGGLE
  2198. // Relays
  2199. #define RELAY1_PIN 4
  2200. #define RELAY2_PIN 5
  2201. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2202. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2203. // LEDs
  2204. #define LED1_PIN 15
  2205. #define LED1_PIN_INVERSE 0
  2206. // -----------------------------------------------------------------------------
  2207. // Tonbux 50-100M Smart Mosquito Killer USB
  2208. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  2209. // -----------------------------------------------------------------------------
  2210. #elif defined(TONBUX_MOSQUITO_KILLER)
  2211. // Info
  2212. #define MANUFACTURER "TONBUX"
  2213. #define DEVICE "MOSQUITO_KILLER"
  2214. // Buttons
  2215. #define BUTTON1_PIN 2
  2216. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2217. #define BUTTON1_RELAY 1
  2218. // Relays
  2219. #define RELAY1_PIN 5 // not a relay, fan
  2220. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2221. // LEDs
  2222. #define LED1_PIN 15 // blue led
  2223. #define LED1_PIN_INVERSE 1
  2224. #define LED1_MODE LED_MODE_WIFI
  2225. #define LED2_PIN 14 // red led
  2226. #define LED2_PIN_INVERSE 1
  2227. #define LED2_MODE LED_MODE_RELAY
  2228. #define LED3_PIN 12 // UV leds (1-2-3-4-5-6-7-8)
  2229. #define LED3_PIN_INVERSE 0
  2230. #define LED3_RELAY 1
  2231. #define LED4_PIN 16 // UV leds (9-10-11)
  2232. #define LED4_PIN_INVERSE 0
  2233. #define LED4_RELAY 1
  2234. // -----------------------------------------------------------------------------
  2235. // Avatto NAS-WR01W Wifi Smart Power Plug
  2236. // https://www.aliexpress.com/item/33011753732.html
  2237. // https://todo...
  2238. // -----------------------------------------------------------------------------
  2239. #elif defined(AVATTO_NAS_WR01W)
  2240. // Info
  2241. #define MANUFACTURER "AVATTO"
  2242. #define DEVICE "NAS_WR01W"
  2243. // Buttons
  2244. #define BUTTON1_PIN 0
  2245. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2246. #define BUTTON1_RELAY 1
  2247. // Relays
  2248. #define RELAY1_PIN 14
  2249. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2250. // LEDs
  2251. #define LED1_PIN 13
  2252. #define LED1_PIN_INVERSE 1
  2253. // HJL01 / BL0937
  2254. #ifndef HLW8012_SUPPORT
  2255. #define HLW8012_SUPPORT 1
  2256. #endif
  2257. #define HLW8012_SEL_PIN 12
  2258. #define HLW8012_CF1_PIN 5
  2259. #define HLW8012_CF_PIN 4
  2260. #define HLW8012_SEL_CURRENT LOW
  2261. #define HLW8012_CURRENT_RATIO 25740
  2262. #define HLW8012_VOLTAGE_RATIO 313400
  2263. #define HLW8012_POWER_RATIO 3414290
  2264. #define HLW8012_INTERRUPT_ON FALLING
  2265. // -----------------------------------------------------------------------------
  2266. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  2267. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  2268. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  2269. // -----------------------------------------------------------------------------
  2270. #elif defined(NEO_COOLCAM_NAS_WR01W)
  2271. // Info
  2272. #define MANUFACTURER "NEO_COOLCAM"
  2273. #define DEVICE "NAS_WR01W"
  2274. // Buttons
  2275. #define BUTTON1_PIN 13
  2276. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2277. #define BUTTON1_RELAY 1
  2278. // Relays
  2279. #define RELAY1_PIN 12
  2280. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2281. // LEDs
  2282. #define LED1_PIN 4
  2283. #define LED1_PIN_INVERSE 1
  2284. // -----------------------------------------------------------------------------
  2285. // Deltaco SH_P01 Wifi Smart Power Plug
  2286. // -----------------------------------------------------------------------------
  2287. #elif defined(DELTACO_SH_P01)
  2288. // Info
  2289. #define MANUFACTURER "DELTACO"
  2290. #define DEVICE "SH_P01"
  2291. // Buttons
  2292. #define BUTTON1_PIN 13
  2293. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2294. #define BUTTON1_RELAY 1
  2295. // Relays
  2296. #define RELAY1_PIN 12
  2297. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2298. // LEDs
  2299. #define LED1_PIN 5
  2300. #define LED1_PIN_INVERSE 1
  2301. #define LED1_MODE LED_MODE_FINDME
  2302. // ------------------------------------------------------------------------------
  2303. // DELTACO_SH_P03USB Wifi Smart Power Plug
  2304. // -----------------------------------------------------------------------------
  2305. #elif defined(DELTACO_SH_P03USB)
  2306. // Info
  2307. #define MANUFACTURER "DELTACO"
  2308. #define DEVICE "SH_P03USB"
  2309. // Buttons
  2310. #define BUTTON1_PIN 13
  2311. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2312. #define BUTTON1_RELAY 2
  2313. // Relays
  2314. #define RELAY1_PIN 15 // USB power
  2315. #define RELAY2_PIN 12 // power plug 1
  2316. #define RELAY3_PIN 14 // power plug 2
  2317. #define RELAY4_PIN 5 // power plug 3
  2318. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2319. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2320. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2321. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2322. // LEDs
  2323. #define LED1_PIN 0 // power led
  2324. #define LED1_PIN_INVERSE 1
  2325. #define LED1_MODE LED_MODE_FINDME
  2326. // ------------------------------------------------------------------------------
  2327. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  2328. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  2329. // Also: Estink Wifi Power Strip
  2330. // -----------------------------------------------------------------------------
  2331. #elif defined(FORNORM_ZLD_34EU)
  2332. // Info
  2333. #define MANUFACTURER "FORNORM"
  2334. #define DEVICE "ZLD_34EU"
  2335. // Disable UART noise since this board uses GPIO3
  2336. #define DEBUG_SERIAL_SUPPORT 0
  2337. // Buttons
  2338. #define BUTTON1_PIN 16
  2339. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2340. #define BUTTON1_RELAY 4
  2341. // Relays
  2342. #define RELAY1_PIN 14 // USB power
  2343. #define RELAY2_PIN 13 // power plug 1
  2344. #define RELAY3_PIN 4 // power plug 2
  2345. #define RELAY4_PIN 15 // power plug 3
  2346. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2347. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2348. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2349. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2350. // LEDs
  2351. #define LED1_PIN 0 // power led
  2352. #define LED2_PIN 12 // power plug 1
  2353. #define LED3_PIN 3 // power plug 2
  2354. #define LED4_PIN 5 // power plug 3
  2355. #define LED1_PIN_INVERSE 1
  2356. #define LED2_PIN_INVERSE 1
  2357. #define LED3_PIN_INVERSE 1
  2358. #define LED4_PIN_INVERSE 1
  2359. #define LED1_MODE LED_MODE_FINDME
  2360. #define LED2_MODE LED_MODE_FOLLOW
  2361. #define LED3_MODE LED_MODE_FOLLOW
  2362. #define LED4_MODE LED_MODE_FOLLOW
  2363. #define LED2_RELAY 2
  2364. #define LED3_RELAY 3
  2365. #define LED4_RELAY 4
  2366. // -----------------------------------------------------------------------------
  2367. // Bruno Horta's OnOfre
  2368. // https://www.bhonofre.pt/
  2369. // https://github.com/brunohorta82/BH_OnOfre/
  2370. // -----------------------------------------------------------------------------
  2371. #elif defined(BH_ONOFRE)
  2372. // Info
  2373. #define MANUFACTURER "BH"
  2374. #define DEVICE "ONOFRE"
  2375. // Buttons
  2376. #define BUTTON1_PIN 12
  2377. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2378. #define BUTTON1_RELAY 1
  2379. #define BUTTON2_PIN 13
  2380. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2381. #define BUTTON2_RELAY 2
  2382. // Relays
  2383. #define RELAY1_PIN 4
  2384. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2385. #define RELAY2_PIN 5
  2386. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2387. // -----------------------------------------------------------------------------
  2388. // BlitzWolf SHP2 and SHP6
  2389. // Also several boards under different names uing a power chip labelled BL0937 or HJL-01
  2390. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  2391. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  2392. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  2393. // * Gosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  2394. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  2395. // * DIY Tech Smart Home (https://www.amazon.es/gp/product/B07HHKXYS9)
  2396. // -----------------------------------------------------------------------------
  2397. #elif defined(BLITZWOLF_BWSHPX)
  2398. // Info
  2399. #define MANUFACTURER "BLITZWOLF"
  2400. #define DEVICE "BWSHPX"
  2401. // Buttons
  2402. #define BUTTON1_PIN 13
  2403. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2404. #define BUTTON1_RELAY 1
  2405. // Relays
  2406. #define RELAY1_PIN 15
  2407. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2408. // LEDs
  2409. #define LED1_PIN 2
  2410. #define LED1_PIN_INVERSE 1
  2411. #define LED2_PIN 0
  2412. #define LED2_PIN_INVERSE 1
  2413. #define LED2_MODE LED_MODE_FINDME
  2414. #define LED2_RELAY 1
  2415. // HJL01 / BL0937
  2416. #ifndef HLW8012_SUPPORT
  2417. #define HLW8012_SUPPORT 1
  2418. #endif
  2419. #define HLW8012_SEL_PIN 12
  2420. #define HLW8012_CF1_PIN 14
  2421. #define HLW8012_CF_PIN 5
  2422. #define HLW8012_SEL_CURRENT LOW
  2423. #define HLW8012_CURRENT_RATIO 25740
  2424. #define HLW8012_VOLTAGE_RATIO 313400
  2425. #define HLW8012_POWER_RATIO 3414290
  2426. #define HLW8012_INTERRUPT_ON FALLING
  2427. // -----------------------------------------------------------------------------
  2428. // Same as the above but new board version marked V2.3
  2429. // BlitzWolf SHP2 V2.3
  2430. // Gosund SP1 V2.3
  2431. // -----------------------------------------------------------------------------
  2432. #elif defined(BLITZWOLF_BWSHPX_V23)
  2433. // Info
  2434. #define MANUFACTURER "BLITZWOLF"
  2435. #define DEVICE "BWSHPX_V23"
  2436. // Buttons
  2437. #define BUTTON1_PIN 3
  2438. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2439. #define BUTTON1_RELAY 1
  2440. // Relays
  2441. #define RELAY1_PIN 14
  2442. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2443. // LEDs
  2444. #define LED1_PIN 1
  2445. #define LED1_PIN_INVERSE 1
  2446. #define LED2_PIN 13
  2447. #define LED2_PIN_INVERSE 1
  2448. #define LED2_MODE LED_MODE_FINDME
  2449. #define LED2_RELAY 1
  2450. // HJL01 / BL0937
  2451. #ifndef HLW8012_SUPPORT
  2452. #define HLW8012_SUPPORT 1
  2453. #endif
  2454. #define HLW8012_SEL_PIN 12
  2455. #define HLW8012_CF1_PIN 5
  2456. #define HLW8012_CF_PIN 4
  2457. #define HLW8012_SEL_CURRENT LOW
  2458. #define HLW8012_CURRENT_RATIO 25740
  2459. #define HLW8012_VOLTAGE_RATIO 313400
  2460. #define HLW8012_POWER_RATIO 3414290
  2461. #define HLW8012_INTERRUPT_ON FALLING
  2462. // BUTTON1 and LED1 are using Serial pins
  2463. #define DEBUG_SERIAL_SUPPORT 0
  2464. // -----------------------------------------------------------------------------
  2465. // Similar to both devices above but also with switchable USB ports
  2466. // and other sensor (CSE7766).
  2467. // the pin layout is different to the above two versions
  2468. // BlitzWolf SHP5
  2469. // -----------------------------------------------------------------------------
  2470. #elif defined(BLITZWOLF_BWSHP5)
  2471. // Info
  2472. #define MANUFACTURER "BLITZWOLF"
  2473. #define DEVICE "BWSHP5"
  2474. // Buttons
  2475. #define BUTTON1_PIN 16
  2476. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2477. #define BUTTON1_RELAY 1
  2478. // Relays
  2479. // Power plug
  2480. #define RELAY1_PIN 14
  2481. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2482. // USB
  2483. #define RELAY2_PIN 5
  2484. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2485. // LEDs
  2486. #define LED1_PIN 2
  2487. #define LED1_PIN_INVERSE 1
  2488. #define LED2_PIN 0
  2489. #define LED2_PIN_INVERSE 1
  2490. #define LED2_MODE LED_MODE_FINDME
  2491. #define LED2_RELAY 1
  2492. // Disable UART noise
  2493. #define DEBUG_SERIAL_SUPPORT 0
  2494. // CSE7766
  2495. #ifndef CSE7766_SUPPORT
  2496. #define CSE7766_SUPPORT 1
  2497. #endif
  2498. #define CSE7766_RX_PIN 3
  2499. // -----------------------------------------------------------------------------
  2500. // Teckin SP21
  2501. // -----------------------------------------------------------------------------
  2502. #elif defined(TECKIN_SP21)
  2503. // Info
  2504. #define MANUFACTURER "TECKIN"
  2505. #define DEVICE "SP21"
  2506. // Buttons
  2507. #define BUTTON1_PIN 13
  2508. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2509. #define BUTTON1_RELAY 1
  2510. // Relays
  2511. #define RELAY1_PIN 15
  2512. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2513. // LEDs
  2514. #define LED1_PIN 2
  2515. #define LED1_PIN_INVERSE 1
  2516. // -----------------------------------------------------------------------------
  2517. // Teckin SP22 v1.4 - v1.6
  2518. // -----------------------------------------------------------------------------
  2519. #elif defined(TECKIN_SP22_V14)
  2520. // Info
  2521. #define MANUFACTURER "TECKIN"
  2522. #define DEVICE "SP22_V14"
  2523. // Buttons
  2524. #define BUTTON1_PIN 1
  2525. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2526. #define BUTTON1_RELAY 1
  2527. // Relays
  2528. #define RELAY1_PIN 14
  2529. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2530. // LEDs
  2531. #define LED1_PIN 3
  2532. #define LED1_PIN_INVERSE 1
  2533. #define LED2_PIN 13
  2534. #define LED2_PIN_INVERSE 1
  2535. #define LED2_MODE LED_MODE_FINDME
  2536. #define LED2_RELAY 1
  2537. // HJL01 / BL0937
  2538. #ifndef HLW8012_SUPPORT
  2539. #define HLW8012_SUPPORT 1
  2540. #endif
  2541. #define HLW8012_SEL_PIN 12
  2542. #define HLW8012_CF1_PIN 5
  2543. #define HLW8012_CF_PIN 4
  2544. #define HLW8012_SEL_CURRENT LOW
  2545. #define HLW8012_CURRENT_RATIO 20730
  2546. #define HLW8012_VOLTAGE_RATIO 264935
  2547. #define HLW8012_POWER_RATIO 2533110
  2548. #define HLW8012_INTERRUPT_ON FALLING
  2549. // BUTTON1 and LED1 are using Serial pins
  2550. #define DEBUG_SERIAL_SUPPORT 0
  2551. // -----------------------------------------------------------------------------
  2552. // Teckin SP22 v1.4 - v1.6
  2553. //
  2554. // NB Notes suggest that energy monitoring is removed from later versions
  2555. // -----------------------------------------------------------------------------
  2556. #elif defined(TECKIN_SP23_V13)
  2557. // Info .. NB Newer versions apparently lack energy monitor
  2558. // The board revision is not indicated externally
  2559. #define MANUFACTURER "TECKIN"
  2560. #define DEVICE "SP23_V13"
  2561. // Buttons
  2562. #define BUTTON1_PIN 13
  2563. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2564. #define BUTTON1_RELAY 1
  2565. // Relays
  2566. #define RELAY1_PIN 15
  2567. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2568. // LEDs
  2569. #define LED1_PIN 4
  2570. #define LED1_PIN_INVERSE 1
  2571. #define LED2_PIN 2
  2572. #define LED2_PIN_INVERSE 0
  2573. #define LED2_MODE LED_MODE_FINDME
  2574. #define LED2_RELAY 1
  2575. // HJL01 / BL0937
  2576. #ifndef HLW8012_SUPPORT
  2577. #define HLW8012_SUPPORT 1
  2578. #endif
  2579. #define HLW8012_SEL_PIN 12
  2580. #define HLW8012_CF1_PIN 14
  2581. #define HLW8012_CF_PIN 5
  2582. #define HLW8012_SEL_CURRENT LOW
  2583. #define HLW8012_CURRENT_RATIO 23324
  2584. #define HLW8012_VOLTAGE_RATIO 324305
  2585. #define HLW8012_POWER_RATIO 3580841
  2586. #define HLW8012_INTERRUPT_ON FALLING
  2587. // -----------------------------------------------------------------------------
  2588. // The Gosund WP3 is based on ESP8285, so 1 MB internal flash (DOUT required)
  2589. // The module has no-connect: TX, RX, RST, AD, GPIO5, (and GPIO0,
  2590. // GPIO2 via test points on the back of the module)
  2591. // and these are wired to devices:
  2592. // GPIO4: /BTN
  2593. // GPIO12: /LED red
  2594. // GPIO13: /LED blue
  2595. // GPIO14: RELAY
  2596. // -----------------------------------------------------------------------------
  2597. #elif defined(GOSUND_WP3)
  2598. // Info
  2599. #define MANUFACTURER "GOSUND"
  2600. #define DEVICE "WP3"
  2601. // Buttons
  2602. #define BUTTON1_PIN 4
  2603. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2604. #define BUTTON1_RELAY 1
  2605. // the defaults are reasonable, but you can change them as desired
  2606. //#define BUTTON1_PRESS BUTTON_ACTION_NONE
  2607. //#define BUTTON1_CLICK BUTTON_ACTION_TOGGLE
  2608. //#define BUTTON1_DBLCLICK BUTTON_ACTION_AP
  2609. //#define BUTTON1_LNGCLICK BUTTON_ACTION_RESET
  2610. //#define BUTTON1_LNGLNGCLICK BUTTON_ACTION_FACTORY
  2611. // Relays
  2612. #define RELAY1_PIN 14
  2613. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2614. // LEDs
  2615. // LED1 (red) indicates on/off state; you could use LED_MODE_FOLLOW_INVERSE
  2616. // so that the LED lights the button when 'off' so it can be found easily.
  2617. #define LED1_PIN 12
  2618. #define LED1_PIN_INVERSE 1
  2619. #define LED1_MODE LED_MODE_FOLLOW
  2620. #define LED1_RELAY 1
  2621. // LED2 (blue) indicates wifi activity
  2622. #define LED2_PIN 13
  2623. #define LED2_PIN_INVERSE 1
  2624. #define LED2_MODE LED_MODE_WIFI
  2625. // -----------------------------------------------------------------------------
  2626. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  2627. // Also model number KS-602S
  2628. // -----------------------------------------------------------------------------
  2629. #elif defined(GOSUND_WS1)
  2630. // Info
  2631. #define MANUFACTURER "GOSUND"
  2632. #define DEVICE "WS1"
  2633. // Buttons
  2634. #define BUTTON1_PIN 0
  2635. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2636. #define BUTTON1_RELAY 1
  2637. // Relays
  2638. #define RELAY1_PIN 14
  2639. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2640. // LEDs
  2641. #define LED1_PIN 1
  2642. #define LED1_PIN_INVERSE 1
  2643. // LED1 is using TX pin
  2644. #define DEBUG_SERIAL_SUPPORT 0
  2645. // ----------------------------------------------------------------------------------------
  2646. // Homecube 16A is similar but some pins differ and it also has RGB LEDs
  2647. // https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
  2648. // ----------------------------------------------------------------------------------------
  2649. #elif defined(HOMECUBE_16A)
  2650. // Info
  2651. #define MANUFACTURER "HOMECUBE"
  2652. #define DEVICE "16A"
  2653. // Buttons
  2654. #define BUTTON1_PIN 13
  2655. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2656. #define BUTTON1_RELAY 1
  2657. // Relays
  2658. #define RELAY1_PIN 15
  2659. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2660. // LEDs
  2661. //LED Pin 4 - ESP8266 onboard LED
  2662. //Red LED: 0
  2663. //Green LED: 12
  2664. //Blue LED: 2
  2665. // Blue
  2666. #define LED1_PIN 2
  2667. #define LED1_PIN_INVERSE 0
  2668. // Green
  2669. #define LED2_PIN 12
  2670. #define LED2_PIN_INVERSE 1
  2671. #define LED2_MODE LED_MODE_RELAY
  2672. // Red
  2673. #define LED3_PIN 0
  2674. #define LED3_PIN_INVERSE 0
  2675. #define LED3_MODE LED_MODE_OFF
  2676. // HJL01 / BL0937
  2677. #ifndef HLW8012_SUPPORT
  2678. #define HLW8012_SUPPORT 1
  2679. #endif
  2680. #define HLW8012_SEL_PIN 16
  2681. #define HLW8012_CF1_PIN 14
  2682. #define HLW8012_CF_PIN 5
  2683. #define HLW8012_SEL_CURRENT LOW
  2684. #define HLW8012_CURRENT_RATIO 25740
  2685. #define HLW8012_VOLTAGE_RATIO 313400
  2686. #define HLW8012_POWER_RATIO 3414290
  2687. #define HLW8012_INTERRUPT_ON FALLING
  2688. // -----------------------------------------------------------------------------
  2689. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  2690. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  2691. // -----------------------------------------------------------------------------
  2692. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  2693. // Info
  2694. #define MANUFACTURER "VANZAVANZU"
  2695. #define DEVICE "SMART_WIFI_PLUG_MINI"
  2696. // Buttons
  2697. #define BUTTON1_PIN 13
  2698. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2699. #define BUTTON1_RELAY 1
  2700. // Relays
  2701. #define RELAY1_PIN 15
  2702. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2703. // LEDs
  2704. #define LED1_PIN 2
  2705. #define LED1_PIN_INVERSE 1
  2706. #define LED2_PIN 0
  2707. #define LED2_PIN_INVERSE 1
  2708. #define LED2_MODE LED_MODE_FINDME
  2709. #define LED2_RELAY 1
  2710. // Disable UART noise
  2711. #define DEBUG_SERIAL_SUPPORT 0
  2712. // HJL01 / BL0937
  2713. #ifndef HLW8012_SUPPORT
  2714. #define HLW8012_SUPPORT 1
  2715. #endif
  2716. #define HLW8012_SEL_PIN 3
  2717. #define HLW8012_CF1_PIN 14
  2718. #define HLW8012_CF_PIN 5
  2719. #define HLW8012_SEL_CURRENT LOW
  2720. #define HLW8012_CURRENT_RATIO 25740
  2721. #define HLW8012_VOLTAGE_RATIO 313400
  2722. #define HLW8012_POWER_RATIO 3414290
  2723. #define HLW8012_INTERRUPT_ON FALLING
  2724. // -----------------------------------------------------------------------------
  2725. #elif defined(GENERIC_AG_L4)
  2726. // Info
  2727. #define MANUFACTURER "GENERIC"
  2728. #define DEVICE "AG_L4"
  2729. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2730. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2731. #define DUMMY_RELAY_COUNT 1
  2732. // button 1: "power" button
  2733. #define BUTTON1_PIN 4
  2734. #define BUTTON1_RELAY 1
  2735. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2736. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  2737. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  2738. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  2739. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  2740. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  2741. // button 2: "wifi" button
  2742. #define BUTTON2_PIN 2
  2743. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2744. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  2745. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  2746. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  2747. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  2748. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_NONE
  2749. // LEDs
  2750. #define LED1_PIN 5 // red status led
  2751. #define LED1_PIN_INVERSE 0
  2752. #define LED2_PIN 16 // master light power
  2753. #define LED2_PIN_INVERSE 1
  2754. #define LED2_MODE LED_MODE_RELAY
  2755. // Light
  2756. #define LIGHT_CHANNELS 3
  2757. #define LIGHT_CH1_PIN 14 // RED
  2758. #define LIGHT_CH2_PIN 13 // GREEN
  2759. #define LIGHT_CH3_PIN 12 // BLUE
  2760. // -----------------------------------------------------------------------------
  2761. #elif defined(GENERIC_AG_L4_V3)
  2762. // Info
  2763. #define MANUFACTURER "GENERIC"
  2764. #define DEVICE "AG_L4_V3"
  2765. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2766. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2767. #define DUMMY_RELAY_COUNT 1
  2768. // button 1: "power" button
  2769. #define BUTTON1_PIN 13
  2770. #define BUTTON1_RELAY 1
  2771. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2772. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  2773. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  2774. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  2775. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  2776. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  2777. // button 2: "wifi" button
  2778. #define BUTTON2_PIN 2
  2779. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2780. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  2781. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  2782. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  2783. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  2784. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_NONE
  2785. // LEDs
  2786. #define LED1_PIN 5 // red status led
  2787. #define LED1_PIN_INVERSE 0
  2788. #define LED2_PIN 16 // master light power
  2789. #define LED2_PIN_INVERSE 1
  2790. #define LED2_MODE LED_MODE_RELAY
  2791. // Light
  2792. #define LIGHT_CHANNELS 3
  2793. #define LIGHT_CH1_PIN 4 // RED
  2794. #define LIGHT_CH2_PIN 12 // GREEN
  2795. #define LIGHT_CH3_PIN 14 // BLUE
  2796. // -----------------------------------------------------------------------------
  2797. #elif defined(ALLTERCO_SHELLY1)
  2798. // Info
  2799. #define MANUFACTURER "ALLTERCO"
  2800. #define DEVICE "SHELLY1"
  2801. // Buttons
  2802. #define BUTTON1_PIN 5
  2803. #define BUTTON1_CONFIG BUTTON_SWITCH
  2804. #define BUTTON1_RELAY 1
  2805. // Relays
  2806. #define RELAY1_PIN 4
  2807. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2808. #elif defined(ALLTERCO_SHELLY2)
  2809. // Info
  2810. #define MANUFACTURER "ALLTERCO"
  2811. #define DEVICE "SHELLY2"
  2812. // Buttons
  2813. #define BUTTON1_PIN 12
  2814. #define BUTTON2_PIN 14
  2815. #define BUTTON1_CONFIG BUTTON_SWITCH
  2816. #define BUTTON2_CONFIG BUTTON_SWITCH
  2817. #define BUTTON1_RELAY 1
  2818. #define BUTTON2_RELAY 2
  2819. // Relays
  2820. #define RELAY1_PIN 4
  2821. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2822. #define RELAY2_PIN 5
  2823. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2824. #elif defined(ALLTERCO_SHELLY1PM)
  2825. // Info
  2826. #define MANUFACTURER "ALLTERCO"
  2827. #define DEVICE "SHELLY1PM"
  2828. // Buttons
  2829. #define BUTTON1_PIN 4
  2830. #define BUTTON1_CONFIG BUTTON_SWITCH
  2831. #define BUTTON1_RELAY 1
  2832. #define BUTTON2_PIN 2
  2833. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2834. #define BUTTON2_LNGCLICK BUTTON_ACTION_RESET
  2835. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_FACTORY
  2836. // Relays
  2837. #define RELAY1_PIN 15
  2838. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2839. // Light
  2840. #define LED1_PIN 0
  2841. #define LED1_PIN_INVERSE 1
  2842. // HJL01 / BL0937
  2843. #define HLW8012_SUPPORT 1
  2844. #define HLW8012_SEL_PIN 12
  2845. #define HLW8012_CF1_PIN 13
  2846. #define HLW8012_CF_PIN 5
  2847. #define HLW8012_SEL_CURRENT LOW
  2848. #define HLW8012_CURRENT_RATIO 25740
  2849. #define HLW8012_VOLTAGE_RATIO 313400
  2850. #define HLW8012_POWER_RATIO 3414290
  2851. #define HLW8012_INTERRUPT_ON FALLING
  2852. //Temperature
  2853. #define NTC_SUPPORT 1
  2854. #define SENSOR_SUPPORT 1
  2855. #define NTC_BETA 3350
  2856. #define NTC_R_UP 10000
  2857. #define NTC_R_DOWN 0
  2858. #define NTC_R0 8000
  2859. #elif defined(ALLTERCO_SHELLY25)
  2860. // Info
  2861. #define MANUFACTURER "ALLTERCO"
  2862. #define DEVICE "SHELLY25"
  2863. // Buttons
  2864. #define BUTTON1_PIN 13
  2865. #define BUTTON1_CONFIG BUTTON_SWITCH
  2866. #define BUTTON1_RELAY 1
  2867. #define BUTTON2_PIN 5
  2868. #define BUTTON2_CONFIG BUTTON_SWITCH
  2869. #define BUTTON2_RELAY 2
  2870. #define BUTTON3_PIN 2
  2871. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2872. #define BUTTON3_LNGCLICK BUTTON_ACTION_RESET
  2873. #define BUTTON3_LNGLNGCLICK BUTTON_ACTION_FACTORY
  2874. // Relays
  2875. #define RELAY1_PIN 4
  2876. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2877. #define RELAY2_PIN 15
  2878. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2879. // Light
  2880. #define LED1_PIN 0
  2881. #define LED1_PIN_INVERSE 1
  2882. //Temperature
  2883. #define NTC_SUPPORT 1
  2884. #define SENSOR_SUPPORT 1
  2885. #define NTC_BETA 3350
  2886. #define NTC_R_UP 10000
  2887. #define NTC_R_DOWN 0
  2888. #define NTC_R0 8000
  2889. //Current
  2890. #define ADE7953_SUPPORT 1
  2891. #define I2C_SDA_PIN 12
  2892. #define I2C_SCL_PIN 14
  2893. // -----------------------------------------------------------------------------
  2894. // This device has teh same behaviour as the GOSUND WP3, but with different GPIO pin values
  2895. // GPIO equivalents extracted from https://templates.blakadder.com/aoycocr_X5P.html
  2896. #elif defined(AOYCOCR_X5P)
  2897. // Info
  2898. #define MANUFACTURER "AOYCOCR"
  2899. #define DEVICE "X5P"
  2900. // Buttons
  2901. #define BUTTON1_PIN 13
  2902. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2903. #define BUTTON1_RELAY 1
  2904. // the defaults are reasonable, but you can change them as desired
  2905. //#define BUTTON1_PRESS BUTTON_ACTION_NONE
  2906. //#define BUTTON1_CLICK BUTTON_ACTION_TOGGLE
  2907. //#define BUTTON1_DBLCLICK BUTTON_ACTION_AP
  2908. //#define BUTTON1_LNGCLICK BUTTON_ACTION_RESET
  2909. //#define BUTTON1_LNGLNGCLICK BUTTON_ACTION_FACTORY
  2910. // Relays
  2911. #define RELAY1_PIN 15
  2912. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2913. // LEDs
  2914. // LED1 (red) indicates on/off state; you could use LED_MODE_FOLLOW_INVERSE
  2915. // so that the LED lights the button when 'off' so it can be found easily.
  2916. #define LED1_PIN 0
  2917. #define LED1_PIN_INVERSE 1
  2918. #define LED1_MODE LED_MODE_FOLLOW
  2919. #define LED1_RELAY 1
  2920. // LED2 (blue) indicates wifi activity
  2921. #define LED2_PIN 2
  2922. #define LED2_PIN_INVERSE 1
  2923. #define LED2_MODE LED_MODE_WIFI
  2924. // -----------------------------------------------------------------------------
  2925. // also works with https://www.amazon.com/gp/product/B07TMY394G/
  2926. // see https://github.com/xoseperez/espurna/issues/2055
  2927. #elif defined(LOHAS_E27_9W)
  2928. // Info
  2929. #define MANUFACTURER "LOHAS"
  2930. #define DEVICE "E27_9W"
  2931. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2932. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2933. #define DUMMY_RELAY_COUNT 1
  2934. // Light
  2935. #define LIGHT_CHANNELS 5
  2936. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2937. #define MY92XX_CHIPS 2
  2938. #define MY92XX_DI_PIN 13
  2939. #define MY92XX_DCKI_PIN 15
  2940. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2941. #define MY92XX_MAPPING 0, 1, 2, 3, 4
  2942. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  2943. // https://www.amazon.com/gp/product/B07T7W7ZMW
  2944. #elif defined(LOHAS_E26_A19)
  2945. // Info
  2946. #define MANUFACTURER "LOHAS"
  2947. #define DEVICE "E26_A19"
  2948. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2949. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2950. #define DUMMY_RELAY_COUNT 1
  2951. // Light
  2952. #define LIGHT_CHANNELS 5
  2953. #define LIGHT_CH1_PIN 5 // RED
  2954. #define LIGHT_CH2_PIN 4 // GREEN
  2955. #define LIGHT_CH3_PIN 13 // BLUE
  2956. #define LIGHT_CH4_PIN 14 // WHITE1
  2957. #define LIGHT_CH5_PIN 12 // WHITE1
  2958. // -----------------------------------------------------------------------------
  2959. #elif defined(TECKIN_SB53)
  2960. // Info
  2961. #define MANUFACTURER "TECKIN"
  2962. #define DEVICE "SB53"
  2963. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2964. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2965. #define DUMMY_RELAY_COUNT 1
  2966. // Light
  2967. #define LIGHT_CHANNELS 5
  2968. #define LIGHT_CH1_PIN 4 // RED
  2969. #define LIGHT_CH2_PIN 12 // GREEN
  2970. #define LIGHT_CH3_PIN 14 // BLUE
  2971. #define LIGHT_CH4_PIN 13 // WARM WHITE
  2972. #define LIGHT_CH5_PIN 5 // COLD WHITE
  2973. // -----------------------------------------------------------------------------
  2974. #elif defined(XIAOMI_SMART_DESK_LAMP)
  2975. // Info
  2976. #define MANUFACTURER "XIAOMI"
  2977. #define DEVICE "SMART_DESK_LAMP"
  2978. // Buttons
  2979. #define BUTTON1_PIN 2
  2980. #define BUTTON2_PIN 14
  2981. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2982. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2983. // This button doubles as switch here and as encoder mode switch below
  2984. // Clicking it (for less than 500ms) will turn the light on and off
  2985. // Double and Long clicks will not work as these are used to modify the encoder action
  2986. #define BUTTON1_RELAY 1
  2987. #define BUTTON_LNGCLICK_DELAY 500
  2988. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  2989. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  2990. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_NONE
  2991. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  2992. #define BUTTON2_DBLCLICK BUTTON_ACTION_AP
  2993. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_RESET
  2994. // Light
  2995. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2996. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2997. #define DUMMY_RELAY_COUNT 1
  2998. #define LIGHT_STEP 8
  2999. #define LIGHT_CHANNELS 2
  3000. #define LIGHT_CH1_PIN 5 // warm white
  3001. #define LIGHT_CH2_PIN 4 // cold white
  3002. // https://www.xiaomitoday.com/xiaomi-mijia-mjtd01yl-led-desk-lamp-review/
  3003. #define LIGHT_COLDWHITE_MIRED 153
  3004. #define LIGHT_WARMWHITE_MIRED 370
  3005. // Encoder
  3006. // If mode is ENCODER_MODE_RATIO, the value ratio between both channels is changed
  3007. // when the button is not pressed, and the overall brightness when pressed
  3008. // If mode is ENCODER_MODE_CHANNEL, the first channel value is changed
  3009. // when the button is not pressed, and the second channel when pressed
  3010. // If no ENCODERX_BUTTON_PIN defined it will only change the value of the first defined channel
  3011. #define ENCODER_SUPPORT 1
  3012. #define ENCODER1_PIN1 12
  3013. #define ENCODER1_PIN2 13
  3014. #define ENCODER1_BUTTON_PIN 2 // active low by default, with software pullup
  3015. #define ENCODER1_CHANNEL1 0 // please note this value is 0-based (LIGHT_CH1 above)
  3016. #define ENCODER1_CHANNEL2 1 // please note this value is 0-based (LIGHT_CH2 above)
  3017. #define ENCODER1_MODE ENCODER_MODE_RATIO
  3018. #elif defined(PHYX_ESP12_RGB)
  3019. // Info
  3020. #define MANUFACTURER "PHYX"
  3021. #define DEVICE "ESP12_RGB"
  3022. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3023. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3024. #define DUMMY_RELAY_COUNT 1
  3025. // Light
  3026. #define LIGHT_CHANNELS 3
  3027. #define LIGHT_CH1_PIN 4 // RED
  3028. #define LIGHT_CH2_PIN 14 // GREEN
  3029. #define LIGHT_CH3_PIN 12 // BLUE
  3030. // -----------------------------------------------------------------------------
  3031. // iWoole LED Table Lamp
  3032. // 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
  3033. // -----------------------------------------------------------------------------
  3034. #elif defined(IWOOLE_LED_TABLE_LAMP)
  3035. // Info
  3036. #define MANUFACTURER "IWOOLE"
  3037. #define DEVICE "LED_TABLE_LAMP"
  3038. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3039. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3040. #define DUMMY_RELAY_COUNT 1
  3041. // Light
  3042. #define LIGHT_CHANNELS 4
  3043. #define LIGHT_CH1_PIN 12 // RED
  3044. #define LIGHT_CH2_PIN 5 // GREEN
  3045. #define LIGHT_CH3_PIN 14 // BLUE
  3046. #define LIGHT_CH4_PIN 4 // WHITE
  3047. // -----------------------------------------------------------------------------
  3048. // Generic GU10
  3049. // https://www.ebay.com/itm/1-10PC-GU10-RGB-Smart-Bulb-Wireless-WiFi-App-Remote-Ctrl-Light-for-Alexa-Google/173724116351
  3050. // -----------------------------------------------------------------------------
  3051. #elif defined(GENERIC_GU10)
  3052. // Info
  3053. #define MANUFACTURER "GENERIC"
  3054. #define DEVICE "GU10"
  3055. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3056. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3057. #define DUMMY_RELAY_COUNT 1
  3058. // Light
  3059. #define LIGHT_CHANNELS 4
  3060. #define LIGHT_CH1_PIN 14 // RED
  3061. #define LIGHT_CH2_PIN 12 // GREEN
  3062. #define LIGHT_CH3_PIN 13 // BLUE
  3063. #define LIGHT_CH4_PIN 4 // WHITE
  3064. // -----------------------------------------------------------------------------
  3065. // Generic E14
  3066. // https://www.ebay.com/itm/LED-Bulb-Wifi-E14-4-5W-Candle-RGB-W-4in1-Dimmable-V-tac-Smart-VT-5114/163899840601
  3067. // -----------------------------------------------------------------------------
  3068. #elif defined(GENERIC_E14)
  3069. // Info
  3070. #define MANUFACTURER "GENERIC"
  3071. #define DEVICE "E14"
  3072. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3073. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3074. #define DUMMY_RELAY_COUNT 1
  3075. // Light
  3076. #define LIGHT_CHANNELS 4
  3077. #define LIGHT_CH1_PIN 4 // RED
  3078. #define LIGHT_CH2_PIN 12 // GREEN
  3079. #define LIGHT_CH3_PIN 14 // BLUE
  3080. #define LIGHT_CH4_PIN 5 // WHITE
  3081. // -----------------------------------------------------------------------------
  3082. // Deltaco white e14 (SH-LE14W) and e27 (SH-LE27W)
  3083. // -----------------------------------------------------------------------------
  3084. #elif defined(DELTACO_SH_LEXXW)
  3085. // Info
  3086. #define MANUFACTURER "DELTACO"
  3087. #define DEVICE "SH_LEXXW"
  3088. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3089. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3090. #define DUMMY_RELAY_COUNT 1
  3091. // Light
  3092. #define LIGHT_CHANNELS 2
  3093. #define LIGHT_CH1_PIN 12 // WARM WHITE
  3094. #define LIGHT_CH2_PIN 14 // COLD WHITE
  3095. // -----------------------------------------------------------------------------
  3096. // Deltaco rgbw e27 (SH-LE27RGB)
  3097. // -----------------------------------------------------------------------------
  3098. #elif defined(DELTACO_SH_LEXXRGB)
  3099. // Info
  3100. #define MANUFACTURER "DELTACO"
  3101. #define DEVICE "SH_LEXXRGB"
  3102. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3103. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3104. #define DUMMY_RELAY_COUNT 1
  3105. // Light
  3106. #define LIGHT_CHANNELS 5
  3107. #define LIGHT_CH1_PIN 5 // RED
  3108. #define LIGHT_CH2_PIN 4 // GREEN
  3109. #define LIGHT_CH3_PIN 13 // BLUE
  3110. #define LIGHT_CH4_PIN 14 // WARM WHITE
  3111. #define LIGHT_CH5_PIN 12 // COLD WHITE
  3112. // -----------------------------------------------------------------------------
  3113. // Nexete A19
  3114. // https://www.ebay.com/itm/Wifi-Smart-LED-light-Bulb-9W-60W-A19-850LM-RGBW-Dimmable-for-Alexa-Google-Home/283514779201
  3115. // -----------------------------------------------------------------------------
  3116. #elif defined(NEXETE_A19)
  3117. // Info
  3118. #define MANUFACTURER "NEXETE"
  3119. #define DEVICE "A19"
  3120. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3121. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3122. #define DUMMY_RELAY_COUNT 1
  3123. // Light
  3124. #define LIGHT_CHANNELS 4
  3125. #define LIGHT_CH1_PIN 12 // RED
  3126. #define LIGHT_CH2_PIN 15 // GREEN
  3127. #define LIGHT_CH3_PIN 14 // BLUE
  3128. #define LIGHT_CH4_PIN 5 // WHITE
  3129. // -----------------------------------------------------------------------------
  3130. // Lombex Lux Nova 2 Tunable White
  3131. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  3132. // -----------------------------------------------------------------------------
  3133. #elif defined(LOMBEX_LUX_NOVA2_TUNABLE_WHITE)
  3134. // Info
  3135. #define MANUFACTURER "LOMBEX"
  3136. #define DEVICE "LUX_NOVA2_TUNABLE_WHITE"
  3137. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3138. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  3139. #define DUMMY_RELAY_COUNT 1
  3140. // Light
  3141. #define LIGHT_CHANNELS 5
  3142. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  3143. #define MY92XX_CHIPS 1
  3144. #define MY92XX_DI_PIN 4
  3145. #define MY92XX_DCKI_PIN 5
  3146. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  3147. // No RGB on this bulb. Warm white on channel 0, cool white on channel 3
  3148. #define MY92XX_MAPPING 255, 255, 255, 3, 0
  3149. // -----------------------------------------------------------------------------
  3150. // Lombex Lux Nova 2 White and Color
  3151. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  3152. // -----------------------------------------------------------------------------
  3153. #elif defined(LOMBEX_LUX_NOVA2_WHITE_COLOR)
  3154. // Info
  3155. #define MANUFACTURER "LOMBEX"
  3156. #define DEVICE "LUX_NOVA2_WHITE_COLOR"
  3157. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3158. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  3159. #define DUMMY_RELAY_COUNT 1
  3160. // Light
  3161. #define LIGHT_CHANNELS 4
  3162. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  3163. #define MY92XX_CHIPS 1
  3164. #define MY92XX_DI_PIN 4
  3165. #define MY92XX_DCKI_PIN 5
  3166. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  3167. // RGB on channels 0/1/2, either cool or warm white on channel 3
  3168. // The bulb *should* have cool leds, but could also have warm leds as a common defect
  3169. #define MY92XX_MAPPING 0, 1, 2, 3
  3170. // -----------------------------------------------------------------------------
  3171. // Bestek Smart Plug with 2 USB ports
  3172. // https://www.bestekcorp.com/bestek-smart-plug-works-with-amazon-alexa-google-assistant-and-ifttt-with-2-usb
  3173. // -----------------------------------------------------------------------------
  3174. #elif defined(BESTEK_MRJ1011)
  3175. // Info
  3176. #define MANUFACTURER "BESTEK"
  3177. #define DEVICE "MRJ1011"
  3178. // Buttons
  3179. #define BUTTON1_PIN 13
  3180. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  3181. #define BUTTON1_RELAY 1
  3182. // Relay
  3183. #define RELAY1_PIN 12
  3184. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3185. // LED
  3186. #define LED1_PIN 4
  3187. #define LED1_PIN_INVERSE 1
  3188. // -----------------------------------------------------------------------------
  3189. // GBLIFE RGBW SOCKET
  3190. // -----------------------------------------------------------------------------
  3191. #elif defined(GBLIFE_RGBW_SOCKET)
  3192. // Info
  3193. #define MANUFACTURER "GBLIFE"
  3194. #define DEVICE "RGBW_SOCKET"
  3195. // Buttons
  3196. #define BUTTON1_PIN 13
  3197. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3198. #define BUTTON1_RELAY 1
  3199. // Relays
  3200. #define RELAY1_PIN 15
  3201. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3202. // Light RGBW
  3203. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3204. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3205. #define DUMMY_RELAY_COUNT 1
  3206. #define LIGHT_CHANNELS 4
  3207. #define LIGHT_CH1_PIN 5 // RED
  3208. #define LIGHT_CH2_PIN 14 // GREEN
  3209. #define LIGHT_CH3_PIN 12 // BLUE
  3210. #define LIGHT_CH4_PIN 4 // WHITE
  3211. // ----------------------------------------------------------------------------------------
  3212. // Smart life Mini Smart Socket is similar Homecube 16A but some GPIOs differ
  3213. // https://www.ebay.de/itm/Smart-Steckdose-WIFI-WLAN-Amazon-Alexa-Fernbedienung-Home-Socket-Zeitschaltuh-DE/123352026749?hash=item1cb85a8e7d:g:IasAAOSwk6dbj390
  3214. // Also labeled NETVIP
  3215. // https://www.amazon.es/Inteligente-NETVIP-Inal%C3%A1mbrico-Interruptor-Funciona/dp/B07KH8YWS5
  3216. // ----------------------------------------------------------------------------------------
  3217. #elif defined(SMARTLIFE_MINI_SMART_SOCKET)
  3218. // Info
  3219. #define MANUFACTURER "SMARTLIFE"
  3220. #define DEVICE "MINI_SMART_SOCKET"
  3221. // Buttons
  3222. #define BUTTON1_PIN 13
  3223. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3224. #define BUTTON1_RELAY 1
  3225. // Relays
  3226. #define RELAY1_PIN 15
  3227. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3228. // LEDs
  3229. //Red LED: 0
  3230. //Green LED: 4
  3231. //Blue LED: 2
  3232. // Light
  3233. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3234. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3235. #define DUMMY_RELAY_COUNT 1
  3236. #define LIGHT_CHANNELS 3
  3237. #define LIGHT_CH1_PIN 0 // RED
  3238. #define LIGHT_CH2_PIN 4 // GREEN
  3239. #define LIGHT_CH3_PIN 2 // BLUE
  3240. // HJL01 / BL0937
  3241. #ifndef HLW8012_SUPPORT
  3242. #define HLW8012_SUPPORT 1
  3243. #endif
  3244. #define HLW8012_SEL_PIN 12
  3245. #define HLW8012_CF1_PIN 14
  3246. #define HLW8012_CF_PIN 5
  3247. #define HLW8012_SEL_CURRENT LOW
  3248. #define HLW8012_CURRENT_RATIO 25740
  3249. #define HLW8012_VOLTAGE_RATIO 313400
  3250. #define HLW8012_POWER_RATIO 3414290
  3251. #define HLW8012_INTERRUPT_ON FALLING
  3252. // ----------------------------------------------------------------------------------------
  3253. // Hama WiFi Steckdose (00176533)
  3254. // https://at.hama.com/00176533/hama-wifi-steckdose-3500w-16a
  3255. // ----------------------------------------------------------------------------------------
  3256. #elif defined(HAMA_WIFI_STECKDOSE_00176533)
  3257. // Info
  3258. #define MANUFACTURER "HAMA"
  3259. #define DEVICE "WIFI_STECKDOSE_00176533"
  3260. // Buttons
  3261. #define BUTTON1_PIN 13
  3262. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  3263. #define BUTTON1_RELAY 1
  3264. // Relays
  3265. #define RELAY1_PIN 12
  3266. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3267. // LEDs
  3268. #define LED1_PIN 4
  3269. #define LED1_PIN_INVERSE 1
  3270. // -----------------------------------------------------------------------------
  3271. // Oxaoxe NX-SP202
  3272. // Digoo NX-SP202 (not tested)
  3273. // Digoo DG-SP202 (not tested)
  3274. // https://github.com/xoseperez/espurna/issues/1502
  3275. // -----------------------------------------------------------------------------
  3276. #elif defined(DIGOO_NX_SP202)
  3277. // Info
  3278. #define MANUFACTURER "DIGOO"
  3279. #define DEVICE "NX_SP202"
  3280. // Buttons
  3281. #define BUTTON1_PIN 0
  3282. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3283. #define BUTTON1_RELAY 1
  3284. #define BUTTON2_PIN 16
  3285. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3286. #define BUTTON2_RELAY 2
  3287. // Relays
  3288. #define RELAY1_PIN 15
  3289. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3290. #define RELAY2_PIN 14
  3291. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3292. // LEDs
  3293. #define LED1_PIN 13
  3294. #define LED1_PIN_INVERSE 1
  3295. // HJL01 / BL0937
  3296. #ifndef HLW8012_SUPPORT
  3297. #define HLW8012_SUPPORT 1
  3298. #endif
  3299. #define HLW8012_SEL_PIN 12
  3300. #define HLW8012_CF1_PIN 5
  3301. #define HLW8012_CF_PIN 4
  3302. #define HLW8012_SEL_CURRENT LOW
  3303. #define HLW8012_CURRENT_RATIO 23296
  3304. #define HLW8012_VOLTAGE_RATIO 310085
  3305. #define HLW8012_POWER_RATIO 3368471
  3306. #define HLW8012_INTERRUPT_ON FALLING
  3307. // -----------------------------------------------------------------------------
  3308. // Foxel's LightFox dual
  3309. // https://github.com/foxel/esp-dual-rf-switch
  3310. // -----------------------------------------------------------------------------
  3311. #elif defined(FOXEL_LIGHTFOX_DUAL)
  3312. // Info
  3313. #define MANUFACTURER "FOXEL"
  3314. #define DEVICE "LIGHTFOX_DUAL"
  3315. #define SERIAL_BAUDRATE 19200
  3316. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  3317. #define DUMMY_RELAY_COUNT 2
  3318. #define DEBUG_SERIAL_SUPPORT 0
  3319. // Buttons
  3320. #define BUTTON1_RELAY 1
  3321. #define BUTTON2_RELAY 2
  3322. #define BUTTON3_RELAY 2
  3323. #define BUTTON4_RELAY 1
  3324. #define BUTTON_EVENTS_SOURCE BUTTON_EVENTS_SOURCE_FOXEL_LIGHTFOX_DUAL
  3325. // -----------------------------------------------------------------------------
  3326. // Teckin SP20
  3327. // -----------------------------------------------------------------------------
  3328. #elif defined(TECKIN_SP20)
  3329. // Info
  3330. #define MANUFACTURER "TECKIN"
  3331. #define DEVICE "SP20"
  3332. // Buttons
  3333. #define BUTTON1_PIN 13
  3334. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3335. #define BUTTON1_RELAY 1
  3336. // Relays
  3337. #define RELAY1_PIN 4
  3338. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3339. // LEDs
  3340. #define LED1_PIN 2
  3341. #define LED1_PIN_INVERSE 1
  3342. #define LED2_PIN 0
  3343. #define LED2_PIN_INVERSE 1
  3344. #define LED2_MODE LED_MODE_FINDME
  3345. #define LED2_RELAY 0
  3346. // HJL01 / BL0937
  3347. #ifndef HLW8012_SUPPORT
  3348. #define HLW8012_SUPPORT 1
  3349. #endif
  3350. #define HLW8012_SEL_PIN 12
  3351. #define HLW8012_CF1_PIN 14
  3352. #define HLW8012_CF_PIN 5
  3353. #define HLW8012_SEL_CURRENT LOW
  3354. #define HLW8012_CURRENT_RATIO 25740
  3355. #define HLW8012_VOLTAGE_RATIO 313400
  3356. #define HLW8012_POWER_RATIO 3414290
  3357. #define HLW8012_INTERRUPT_ON FALLING
  3358. // -----------------------------------------------------------------------------
  3359. // Charging Essentials / LITESUN LA-WF3
  3360. // -----------------------------------------------------------------------------
  3361. #elif defined(LITESUN_LA_WF3)
  3362. // Info
  3363. #define MANUFACTURER "LITESUN"
  3364. #define DEVICE "LA_WF3"
  3365. // Buttons
  3366. #define BUTTON1_PIN 13
  3367. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3368. #define BUTTON1_RELAY 1
  3369. // Relays
  3370. #define RELAY1_PIN 12
  3371. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3372. // LEDs
  3373. #define LED1_PIN 4 // 4 blue led
  3374. #define LED1_MODE LED_MODE_WIFI
  3375. #define LED1_PIN_INVERSE 1
  3376. #define LED2_PIN 5 // 5 red led
  3377. #define LED2_MODE LED_MODE_RELAY
  3378. #define LED2_PIN_INVERSE 1
  3379. // -----------------------------------------------------------------------------
  3380. // PSH
  3381. // -----------------------------------------------------------------------------
  3382. #elif defined(PSH_WIFI_PLUG)
  3383. // Info
  3384. #define MANUFACTURER "PSH"
  3385. #define DEVICE "WIFI_PLUG"
  3386. // Relays
  3387. #define RELAY1_PIN 2
  3388. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3389. // LEDs
  3390. #define LED1_PIN 0
  3391. #define LED1_PIN_INVERSE 0
  3392. #elif defined(PSH_RGBW_CONTROLLER)
  3393. // Info
  3394. #define MANUFACTURER "PSH"
  3395. #define DEVICE "RGBW_CONTROLLER"
  3396. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3397. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3398. #define DUMMY_RELAY_COUNT 1
  3399. // LEDs
  3400. #define LED1_PIN 13
  3401. #define LED1_PIN_INVERSE 1
  3402. // Light
  3403. #define LIGHT_CHANNELS 4
  3404. #define LIGHT_CH1_PIN 5 // RED
  3405. #define LIGHT_CH2_PIN 4 // GREEN
  3406. #define LIGHT_CH3_PIN 12 // BLUE
  3407. #define LIGHT_CH4_PIN 14 // WHITE1
  3408. #elif defined(PSH_WIFI_SENSOR)
  3409. // Info
  3410. #define MANUFACTURER "PSH"
  3411. #define DEVICE "WIFI_SENSOR"
  3412. // DHT12 Sensor
  3413. #define DHT_SUPPORT 1
  3414. #define DHT_PIN 14
  3415. #define DHT_TYPE DHT_CHIP_DHT12
  3416. // LDR Sensor
  3417. #define LDR_SUPPORT 1
  3418. #define LDR_TYPE LDR_GL5528
  3419. #define LDR_ON_GROUND false
  3420. #define LDR_RESISTOR 10000
  3421. #elif defined(JINVOO_VALVE_SM_AW713)
  3422. // Reflashing from original Tuya firmware
  3423. // to thirdparty firmware like espurna by:
  3424. // https://github.com/ct-Open-Source/tuya-convert
  3425. // Info
  3426. #define MANUFACTURER "JINVOO"
  3427. #define DEVICE "VALVE_SM_AW713"
  3428. // Buttons
  3429. #define BUTTON1_PIN 13
  3430. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3431. #define BUTTON1_RELAY 1
  3432. // Relays
  3433. #define RELAY1_PIN 12
  3434. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3435. // LED
  3436. #define LED1_PIN 5 // 5 red led
  3437. #define LED1_PIN_INVERSE 0
  3438. #define LED1_RELAY 1
  3439. #define LED1_MODE LED_MODE_RELAY
  3440. #define LED2_PIN 4 // 4 blue led
  3441. #define LED2_PIN_INVERSE 0
  3442. #define LED2_RELAY 1
  3443. #define LED2_MODE LED_MODE_FINDME_WIFI
  3444. #elif defined(TUYA_GENERIC_DIMMER)
  3445. #define MANUFACTURER "TUYA"
  3446. #define DEVICE "GENERIC_DIMMER"
  3447. #define LIGHT_PROVIDER LIGHT_PROVIDER_TUYA
  3448. #define LIGHT_CHANNELS 0
  3449. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3450. #define DUMMY_RELAY_COUNT 0
  3451. // -----------------------------------------------------------------------------
  3452. // Etekcity ESW01-USA
  3453. // https://www.amazon.com/Etekcity-Voltson-Outlet-Monitoring-Required/dp/B01M3MYIFS
  3454. // -----------------------------------------------------------------------------
  3455. #elif defined(ETEKCITY_ESW01_USA)
  3456. // Info
  3457. #define MANUFACTURER "ETEKCITY"
  3458. #define DEVICE "ESW01_USA"
  3459. // Buttons
  3460. #define BUTTON1_PIN 14
  3461. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3462. #define BUTTON1_RELAY 1
  3463. // Relays
  3464. #define RELAY1_PIN 4
  3465. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3466. // LEDs
  3467. // Blue
  3468. #define LED1_PIN 5
  3469. #define LED1_MODE LED_MODE_WIFI
  3470. // Yellow
  3471. #define LED2_PIN 16
  3472. #define LED2_MODE LED_MODE_FOLLOW
  3473. #define LED2_RELAY 1
  3474. // HLW8012
  3475. #ifndef HLW8012_SUPPORT
  3476. #define HLW8012_SUPPORT 1
  3477. #endif
  3478. #define HLW8012_SEL_PIN 15
  3479. #define HLW8012_CF1_PIN 12
  3480. #define HLW8012_CF_PIN 13
  3481. #define HLW8012_SEL_CURRENT HIGH // SEL pin to HIGH to measure current
  3482. #define HLW8012_CURRENT_R 0.001 // Current resistor
  3483. #define HLW8012_VOLTAGE_R_UP ( 4 * 470000 ) // Upstream voltage resistor
  3484. #define HLW8012_VOLTAGE_R_DOWN ( 1000 ) // Downstream voltage resistor
  3485. #define HLW8012_INTERRUPT_ON CHANGE
  3486. // -----------------------------------------------------------------------------
  3487. // FS UAP1
  3488. // http://frank-schuetz.de/index.php/fhem/13-hoermann-torantrieb-mit-espeasy-in-fhem-einbinden
  3489. #elif defined(FS_UAP1)
  3490. // Info
  3491. #define MANUFACTURER "FS"
  3492. #define DEVICE "UAP1"
  3493. // Inputs
  3494. #define DIGITAL1_PIN 4
  3495. #define DIGITAL2_PIN 5
  3496. // Relays
  3497. #define RELAY1_PIN 12
  3498. #define RELAY2_PIN 13
  3499. #define RELAY3_PIN 14
  3500. #define RELAY4_PIN 15
  3501. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3502. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3503. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  3504. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  3505. // LEDs
  3506. #define LED1_PIN 2
  3507. // Disable UART noise
  3508. #define DEBUG_SERIAL_SUPPORT 0
  3509. // -----------------------------------------------------------------------------
  3510. // TFLAG NX-SM100 & NX-SM200
  3511. // -----------------------------------------------------------------------------
  3512. #elif defined(TFLAG_NX_SMX00)
  3513. // Info
  3514. #define MANUFACTURER "TFLAG"
  3515. #define DEVICE "NX_SMX00"
  3516. // Buttons
  3517. #define BUTTON1_PIN 13
  3518. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3519. #define BUTTON1_RELAY 1
  3520. // Relays
  3521. #define RELAY1_PIN 12
  3522. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3523. // LEDs
  3524. #define LED1_PIN 0
  3525. #define LED1_PIN_INVERSE 1
  3526. #define LED1_MODE LED_MODE_FOLLOW_INVERSE
  3527. #define LED1_RELAY 1
  3528. #define LED2_PIN 15
  3529. #define LED2_PIN_INVERSE 1
  3530. #define LED2_MODE LED_MODE_WIFI
  3531. // HJL01 / BL0937
  3532. #ifndef HLW8012_SUPPORT
  3533. #define HLW8012_SUPPORT 1
  3534. #endif
  3535. #define HLW8012_SEL_PIN 16
  3536. #define HLW8012_CF1_PIN 14
  3537. #define HLW8012_CF_PIN 5
  3538. #define HLW8012_SEL_CURRENT LOW
  3539. #define HLW8012_CURRENT_RATIO 632
  3540. #define HLW8012_VOLTAGE_RATIO 313400
  3541. #define HLW8012_POWER_RATIO 3711185
  3542. #define HLW8012_INTERRUPT_ON FALLING
  3543. // -----------------------------------------------------------------------------
  3544. // MUVIT_IO_MIOBULB001
  3545. // -----------------------------------------------------------------------------
  3546. #elif defined(MUVIT_IO_MIOBULB001)
  3547. // Info
  3548. #define MANUFACTURER "MUVIT_IO"
  3549. #define DEVICE "MIOBULB001"
  3550. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3551. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3552. #define DUMMY_RELAY_COUNT 1
  3553. // Light
  3554. #define LIGHT_CHANNELS 4
  3555. #define LIGHT_CH1_PIN 14 // RED
  3556. #define LIGHT_CH2_PIN 12 // GREEN
  3557. #define LIGHT_CH3_PIN 13 // BLUE
  3558. #define LIGHT_CH4_PIN 4 // WHITE
  3559. // -----------------------------------------------------------------------------
  3560. // Hykker Power Plug (Smart Home Series) available in Jerónimo Martins Polska (Biedronka)
  3561. // https://www.hykker.com/akcesoria/gniazdo-wi-fi-z-licznikiem-energii/
  3562. // Reflashing from original Tuya firmware
  3563. // to thirdparty firmware like espurna by:
  3564. // https://github.com/ct-Open-Source/tuya-convert
  3565. // -----------------------------------------------------------------------------
  3566. #elif defined(HYKKER_SMART_HOME_POWER_PLUG)
  3567. // Info
  3568. #define MANUFACTURER "HYKKER"
  3569. #define DEVICE "SMART_HOME_POWER_PLUG"
  3570. // Buttons
  3571. #define BUTTON1_PIN 0
  3572. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3573. #define BUTTON1_RELAY 1
  3574. // Relays
  3575. #define RELAY1_PIN 14
  3576. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3577. // LED
  3578. // Red
  3579. #define LED1_PIN 13
  3580. #define LED1_MODE LED_MODE_WIFI
  3581. #define LED1_PIN_INVERSE 1
  3582. // Blue connected to relay
  3583. // HLW8012
  3584. #ifndef HLW8012_SUPPORT
  3585. #define HLW8012_SUPPORT 1
  3586. #endif
  3587. #define HLW8012_SEL_PIN 12
  3588. #define HLW8012_CF1_PIN 5
  3589. #define HLW8012_CF_PIN 4
  3590. #define HLW8012_SEL_CURRENT LOW
  3591. #define HLW8012_CURRENT_RATIO 25740
  3592. #define HLW8012_VOLTAGE_RATIO 282060
  3593. #define HLW8012_POWER_RATIO 3414290
  3594. #define HLW8012_INTERRUPT_ON FALLING
  3595. #define SENSOR_ENERGY_UNITS ENERGY_KWH
  3596. #define SENSOR_POWER_UNITS POWER_WATTS
  3597. // -----------------------------------------------------------------------------
  3598. // Kogan Smarter Home Plug with Energy Meter (Australia)
  3599. // Product code: KASPEMHA
  3600. // https://www.kogan.com/au/buy/kogan-smarterhome-smart-plug-energy-meter/
  3601. // Reflashing from original Tuya firmware
  3602. // to thirdparty firmware like espurna by:
  3603. // https://github.com/ct-Open-Source/tuya-convert
  3604. // -----------------------------------------------------------------------------
  3605. #elif defined(KOGAN_SMARTER_HOME_PLUG_W_POW)
  3606. // Info
  3607. #define MANUFACTURER "KOGAN"
  3608. #define DEVICE "SMARTER_HOME_PLUG_W_POW"
  3609. // Buttons
  3610. #define BUTTON1_PIN 0
  3611. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  3612. #define BUTTON1_RELAY 1
  3613. // Relays
  3614. #define RELAY1_PIN 14
  3615. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3616. // LED
  3617. // Red
  3618. #define LED1_PIN 13
  3619. #define LED1_MODE LED_MODE_WIFI
  3620. #define LED1_PIN_INVERSE 1
  3621. // Blue connected to relay
  3622. // HLW8012
  3623. #ifndef HLW8012_SUPPORT
  3624. #define HLW8012_SUPPORT 1
  3625. #endif
  3626. #define HLW8012_SEL_PIN 12
  3627. #define HLW8012_CF1_PIN 5
  3628. #define HLW8012_CF_PIN 4
  3629. #define HLW8012_SEL_CURRENT LOW
  3630. #define HLW8012_CURRENT_RATIO 25740
  3631. #define HLW8012_VOLTAGE_RATIO 282060
  3632. #define HLW8012_POWER_RATIO 3414290
  3633. #define HLW8012_INTERRUPT_ON FALLING
  3634. #define SENSOR_ENERGY_UNITS ENERGY_KWH
  3635. #define SENSOR_POWER_UNITS POWER_WATTS
  3636. // -----------------------------------------------------------------------------
  3637. // KINGART_CURTAIN_SWITCH
  3638. // -----------------------------------------------------------------------------
  3639. #elif defined(KINGART_CURTAIN_SWITCH)
  3640. // Info
  3641. #define MANUFACTURER "KINGART"
  3642. #define DEVICE "CURTAIN_SWITCH"
  3643. #define CURTAIN_SUPPORT 1
  3644. // LEDs
  3645. #define LED1_PIN 13
  3646. #define LED1_PIN_INVERSE 1
  3647. // KINGART module handles the UART, can't print any debug messages
  3648. #define KINGART_CURTAIN_SUPPORT 1
  3649. #define DEBUG_SERIAL_SUPPORT 0
  3650. // -----------------------------------------------------------------------------
  3651. // LSC Smart LED Light Strip (Smart CXonnect Series) available ACTION (Germany)
  3652. // https://www.action.com/de-de/p/lsc-smart-connect-intelligenter-multicolor-led-strip-/
  3653. // Reflashing from original Tuya firmware
  3654. // to thirdparty firmware like espurna by:
  3655. // https://github.com/ct-Open-Source/tuya-convert
  3656. // -----------------------------------------------------------------------------
  3657. #elif defined(LSC_SMART_LED_LIGHT_STRIP)
  3658. // Info
  3659. #define MANUFACTURER "LSC"
  3660. #define DEVICE "SMART_LED_LIGHT_STRIP"
  3661. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3662. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3663. #define DUMMY_RELAY_COUNT 1
  3664. // Light RGBW
  3665. #define LIGHT_CHANNELS 4
  3666. #define LIGHT_CH1_PIN 4 // RED
  3667. #define LIGHT_CH2_PIN 12 // GREEN
  3668. #define LIGHT_CH3_PIN 14 // BLUE
  3669. #define LIGHT_CH4_PIN 13 // WHITE
  3670. // #define LIGHT_CH5_PIN 5 // CW (not connected, but circuit supports it)
  3671. // IR
  3672. #define IR_SUPPORT 1
  3673. #define IR_RX_PIN 0
  3674. #define IR_BUTTON_SET 5
  3675. // -----------------------------------------------------------------------------
  3676. // eHomeDIY WT02
  3677. // https://github.com/eHomeDIY/WT02-hardware
  3678. // -----------------------------------------------------------------------------
  3679. #elif defined(EHOMEDIY_WT02)
  3680. // Info
  3681. #define MANUFACTURER "EHOMEDIY"
  3682. #define DEVICE "WT02"
  3683. #define I2C_SDA_PIN 0
  3684. #define I2C_SCL_PIN 2
  3685. #define BMX280_SUPPORT 1
  3686. // #define SI7021_SUPPORT 1
  3687. // -----------------------------------------------------------------------------
  3688. // eHomeDIY WT03
  3689. // https://github.com/eHomeDIY/WT03-hardware
  3690. // -----------------------------------------------------------------------------
  3691. #elif defined(EHOMEDIY_WT03)
  3692. // Info
  3693. #define MANUFACTURER "EHOMEDIY"
  3694. #define DEVICE "WT03"
  3695. #define I2C_SDA_PIN 2
  3696. #define I2C_SCL_PIN 0
  3697. #define BMX280_SUPPORT 1
  3698. // #define SI7021_SUPPORT 1
  3699. // -----------------------------------------------------------------------------
  3700. // Linksprite R4
  3701. // http://linksprite.com/wiki/index.php?title=LinkNode_R4:_Arduino-compatible_WiFi_relay_controller
  3702. // -----------------------------------------------------------------------------
  3703. #elif defined(LINKSPRITE_LINKNODE_R4)
  3704. // Info
  3705. #define MANUFACTURER "LINKSPRITE"
  3706. #define DEVICE "LINKNODE_R4"
  3707. // Relays
  3708. #define RELAY1_PIN 12
  3709. #define RELAY2_PIN 13
  3710. #define RELAY3_PIN 14
  3711. #define RELAY4_PIN 16
  3712. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3713. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3714. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  3715. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  3716. // -----------------------------------------------------------------------------
  3717. // NEDIS WIFIP310FWT Wi-Fi Smart Extension Socket
  3718. // 3x Schuko Type F, 4x USB, 16 A
  3719. // 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
  3720. // -----------------------------------------------------------------------------
  3721. #elif defined(NEDIS_WIFIP310FWT)
  3722. // Info
  3723. #define MANUFACTURER "NEDIS"
  3724. #define DEVICE "WIFIP310FWT"
  3725. // Based on the reporter, this product uses GPIO1 and 3 for the button
  3726. // and onboard LED, so hardware serial should be disabled...
  3727. #define DEBUG_SERIAL_SUPPORT 0
  3728. // Buttons
  3729. #define BUTTON1_PIN 3
  3730. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3731. // Relays
  3732. #define RELAY1_PIN 5
  3733. #define RELAY2_PIN 4
  3734. #define RELAY3_PIN 13
  3735. #define RELAY4_PIN 14
  3736. // LEDs
  3737. #define LED1_PIN 1
  3738. #define LED1_PIN_INVERSE 1
  3739. // -----------------------------------------------------------------------------
  3740. // Arlec Smart PC190HA Plug
  3741. // https://templates.blakadder.com/arlec_PC190HA.html
  3742. // -----------------------------------------------------------------------------
  3743. #elif defined(ARLEC_PC190HA)
  3744. // Info
  3745. #define MANUFACTURER "ARLEC"
  3746. #define DEVICE "PC190HA"
  3747. // Buttons
  3748. #define BUTTON1_PIN 14
  3749. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3750. #define BUTTON1_RELAY 1
  3751. // Relays
  3752. #define RELAY1_PIN 12
  3753. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3754. // LEDs
  3755. #define LED1_PIN 4 // blue LED
  3756. #define LED1_PIN_INVERSE 1
  3757. #define LED2_PIN 13 // red LED
  3758. #define LED2_PIN_INVERSE 1
  3759. // -----------------------------------------------------------------------------
  3760. // Arlec Smart PB89HA Power Strip
  3761. // https://templates.blakadder.com/arlec_PB89HA.html
  3762. // -----------------------------------------------------------------------------
  3763. #elif defined(ARLEC_PB89HA)
  3764. // Info
  3765. #define MANUFACTURER "ARLEC"
  3766. #define DEVICE "PB89HA"
  3767. // Buttons
  3768. #define BUTTON1_PIN 3
  3769. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3770. // Relays
  3771. #define RELAY1_PIN 5
  3772. #define RELAY2_PIN 4
  3773. #define RELAY3_PIN 13
  3774. #define RELAY4_PIN 12
  3775. // LEDs
  3776. #define LED1_PIN 1
  3777. #define LED1_PIN_INVERSE 1
  3778. // -----------------------------------------------------------------------------
  3779. // Prodino WIFI
  3780. // https://kmpelectronics.eu/products/prodino-wifi-v1/
  3781. // -------------------------------------
  3782. #elif defined(PRODINO_WIFI)
  3783. // Info
  3784. #define MANUFACTURER "PRODINO"
  3785. #define DEVICE "WIFI"
  3786. // MCP23S08
  3787. #define MCP23S08_SUPPORT 1
  3788. // Relays
  3789. #define RELAY_PROVIDER RELAY_PROVIDER_MCP23S08
  3790. #define RELAY1_PIN 4
  3791. #define RELAY2_PIN 5
  3792. #define RELAY3_PIN 6
  3793. #define RELAY4_PIN 7
  3794. // Buttons
  3795. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3796. #define BUTTON1_PIN 0
  3797. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3798. #define BUTTON2_PIN 1
  3799. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3800. #define BUTTON3_PIN 2
  3801. #define BUTTON4_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3802. #define BUTTON4_PIN 3
  3803. #define BUTTON1_RELAY 1
  3804. #define BUTTON2_RELAY 2
  3805. #define BUTTON3_RELAY 3
  3806. #define BUTTON4_RELAY 4
  3807. #define BUTTON_EVENTS_SOURCE BUTTON_EVENTS_SOURCE_MCP23S08
  3808. // LEDs
  3809. #define LED1_PIN 2
  3810. #define LED1_PIN_INVERSE 1
  3811. // -----------------------------------------------------------------------------
  3812. #else
  3813. #error "UNSUPPORTED HARDWARE!!"
  3814. #endif