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.

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