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.

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