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.

4644 lines
150 KiB

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