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.

4868 lines
157 KiB

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