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.

4575 lines
147 KiB

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