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.

4545 lines
146 KiB

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