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.

5080 lines
165 KiB

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