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.

5077 lines
165 KiB

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