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.

5085 lines
166 KiB

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