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.

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