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.

4543 lines
146 KiB

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