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.

4522 lines
145 KiB

7 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  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. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  2530. // Also model number KS-602S
  2531. // -----------------------------------------------------------------------------
  2532. #elif defined(GOSUND_WS1)
  2533. // Info
  2534. #define MANUFACTURER "GOSUND"
  2535. #define DEVICE "WS1"
  2536. // Buttons
  2537. #define BUTTON1_PIN 0
  2538. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2539. #define BUTTON1_RELAY 1
  2540. // Relays
  2541. #define RELAY1_PIN 14
  2542. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2543. // LEDs
  2544. #define LED1_PIN 1
  2545. #define LED1_PIN_INVERSE 1
  2546. // LED1 is using TX pin
  2547. #define DEBUG_SERIAL_SUPPORT 0
  2548. // ----------------------------------------------------------------------------------------
  2549. // Homecube 16A is similar but some pins differ and it also has RGB LEDs
  2550. // https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
  2551. // ----------------------------------------------------------------------------------------
  2552. #elif defined(HOMECUBE_16A)
  2553. // Info
  2554. #define MANUFACTURER "HOMECUBE"
  2555. #define DEVICE "16A"
  2556. // Buttons
  2557. #define BUTTON1_PIN 13
  2558. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2559. #define BUTTON1_RELAY 1
  2560. // Relays
  2561. #define RELAY1_PIN 15
  2562. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2563. // LEDs
  2564. //LED Pin 4 - ESP8266 onboard LED
  2565. //Red LED: 0
  2566. //Green LED: 12
  2567. //Blue LED: 2
  2568. // Blue
  2569. #define LED1_PIN 2
  2570. #define LED1_PIN_INVERSE 0
  2571. // Green
  2572. #define LED2_PIN 12
  2573. #define LED2_PIN_INVERSE 1
  2574. #define LED2_MODE LED_MODE_RELAY
  2575. // Red
  2576. #define LED3_PIN 0
  2577. #define LED3_PIN_INVERSE 0
  2578. #define LED3_MODE LED_MODE_OFF
  2579. // HJL01 / BL0937
  2580. #ifndef HLW8012_SUPPORT
  2581. #define HLW8012_SUPPORT 1
  2582. #endif
  2583. #define HLW8012_SEL_PIN 16
  2584. #define HLW8012_CF1_PIN 14
  2585. #define HLW8012_CF_PIN 5
  2586. #define HLW8012_SEL_CURRENT LOW
  2587. #define HLW8012_CURRENT_RATIO 25740
  2588. #define HLW8012_VOLTAGE_RATIO 313400
  2589. #define HLW8012_POWER_RATIO 3414290
  2590. #define HLW8012_INTERRUPT_ON FALLING
  2591. // -----------------------------------------------------------------------------
  2592. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  2593. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  2594. // -----------------------------------------------------------------------------
  2595. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  2596. // Info
  2597. #define MANUFACTURER "VANZAVANZU"
  2598. #define DEVICE "SMART_WIFI_PLUG_MINI"
  2599. // Buttons
  2600. #define BUTTON1_PIN 13
  2601. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2602. #define BUTTON1_RELAY 1
  2603. // Relays
  2604. #define RELAY1_PIN 15
  2605. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2606. // LEDs
  2607. #define LED1_PIN 2
  2608. #define LED1_PIN_INVERSE 1
  2609. #define LED2_PIN 0
  2610. #define LED2_PIN_INVERSE 1
  2611. #define LED2_MODE LED_MODE_FINDME
  2612. #define LED2_RELAY 1
  2613. // Disable UART noise
  2614. #define DEBUG_SERIAL_SUPPORT 0
  2615. // HJL01 / BL0937
  2616. #ifndef HLW8012_SUPPORT
  2617. #define HLW8012_SUPPORT 1
  2618. #endif
  2619. #define HLW8012_SEL_PIN 3
  2620. #define HLW8012_CF1_PIN 14
  2621. #define HLW8012_CF_PIN 5
  2622. #define HLW8012_SEL_CURRENT LOW
  2623. #define HLW8012_CURRENT_RATIO 25740
  2624. #define HLW8012_VOLTAGE_RATIO 313400
  2625. #define HLW8012_POWER_RATIO 3414290
  2626. #define HLW8012_INTERRUPT_ON FALLING
  2627. // -----------------------------------------------------------------------------
  2628. #elif defined(GENERIC_AG_L4)
  2629. // Info
  2630. #define MANUFACTURER "GENERIC"
  2631. #define DEVICE "AG_L4"
  2632. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2633. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2634. #define DUMMY_RELAY_COUNT 1
  2635. // button 1: "power" button
  2636. #define BUTTON1_PIN 4
  2637. #define BUTTON1_RELAY 1
  2638. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2639. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  2640. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  2641. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  2642. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  2643. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  2644. // button 2: "wifi" button
  2645. #define BUTTON2_PIN 2
  2646. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2647. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  2648. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  2649. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  2650. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  2651. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_NONE
  2652. // LEDs
  2653. #define LED1_PIN 5 // red status led
  2654. #define LED1_PIN_INVERSE 0
  2655. #define LED2_PIN 16 // master light power
  2656. #define LED2_PIN_INVERSE 1
  2657. #define LED2_MODE LED_MODE_RELAY
  2658. // Light
  2659. #define LIGHT_CHANNELS 3
  2660. #define LIGHT_CH1_PIN 14 // RED
  2661. #define LIGHT_CH2_PIN 13 // GREEN
  2662. #define LIGHT_CH3_PIN 12 // BLUE
  2663. // -----------------------------------------------------------------------------
  2664. #elif defined(ALLTERCO_SHELLY1)
  2665. // Info
  2666. #define MANUFACTURER "ALLTERCO"
  2667. #define DEVICE "SHELLY1"
  2668. // Buttons
  2669. #define BUTTON1_PIN 5
  2670. #define BUTTON1_CONFIG BUTTON_SWITCH
  2671. #define BUTTON1_RELAY 1
  2672. // Relays
  2673. #define RELAY1_PIN 4
  2674. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2675. #elif defined(ALLTERCO_SHELLY2)
  2676. // Info
  2677. #define MANUFACTURER "ALLTERCO"
  2678. #define DEVICE "SHELLY2"
  2679. // Buttons
  2680. #define BUTTON1_PIN 12
  2681. #define BUTTON2_PIN 14
  2682. #define BUTTON1_CONFIG BUTTON_SWITCH
  2683. #define BUTTON2_CONFIG BUTTON_SWITCH
  2684. #define BUTTON1_RELAY 1
  2685. #define BUTTON2_RELAY 2
  2686. // Relays
  2687. #define RELAY1_PIN 4
  2688. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2689. #define RELAY2_PIN 5
  2690. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2691. #elif defined(ALLTERCO_SHELLY1PM)
  2692. // Info
  2693. #define MANUFACTURER "ALLTERCO"
  2694. #define DEVICE "SHELLY1PM"
  2695. // Buttons
  2696. #define BUTTON1_PIN 4
  2697. #define BUTTON1_CONFIG BUTTON_SWITCH
  2698. #define BUTTON1_RELAY 1
  2699. #define BUTTON2_PIN 2
  2700. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2701. #define BUTTON2_LNGCLICK BUTTON_ACTION_RESET
  2702. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_FACTORY
  2703. // Relays
  2704. #define RELAY1_PIN 15
  2705. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2706. // Light
  2707. #define LED1_PIN 0
  2708. #define LED1_PIN_INVERSE 1
  2709. // HJL01 / BL0937
  2710. #define HLW8012_SUPPORT 1
  2711. #define HLW8012_SEL_PIN 12
  2712. #define HLW8012_CF1_PIN 13
  2713. #define HLW8012_CF_PIN 5
  2714. #define HLW8012_SEL_CURRENT LOW
  2715. #define HLW8012_CURRENT_RATIO 25740
  2716. #define HLW8012_VOLTAGE_RATIO 313400
  2717. #define HLW8012_POWER_RATIO 3414290
  2718. #define HLW8012_INTERRUPT_ON FALLING
  2719. //Temperature
  2720. #define NTC_SUPPORT 1
  2721. #define SENSOR_SUPPORT 1
  2722. #define NTC_BETA 3350
  2723. #define NTC_R_UP 10000
  2724. #define NTC_R_DOWN 0
  2725. #define NTC_R0 8000
  2726. #elif defined(ALLTERCO_SHELLY25)
  2727. // Info
  2728. #define MANUFACTURER "ALLTERCO"
  2729. #define DEVICE "SHELLY25"
  2730. // Buttons
  2731. #define BUTTON1_PIN 13
  2732. #define BUTTON1_CONFIG BUTTON_SWITCH
  2733. #define BUTTON1_RELAY 1
  2734. #define BUTTON2_PIN 5
  2735. #define BUTTON2_CONFIG BUTTON_SWITCH
  2736. #define BUTTON2_RELAY 2
  2737. #define BUTTON3_PIN 2
  2738. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2739. #define BUTTON3_LNGCLICK BUTTON_ACTION_RESET
  2740. #define BUTTON3_LNGLNGCLICK BUTTON_ACTION_FACTORY
  2741. // Relays
  2742. #define RELAY1_PIN 4
  2743. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2744. #define RELAY2_PIN 15
  2745. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2746. // Light
  2747. #define LED1_PIN 0
  2748. #define LED1_PIN_INVERSE 1
  2749. //Temperature
  2750. #define NTC_SUPPORT 1
  2751. #define SENSOR_SUPPORT 1
  2752. #define NTC_BETA 3350
  2753. #define NTC_R_UP 10000
  2754. #define NTC_R_DOWN 0
  2755. #define NTC_R0 8000
  2756. //Current
  2757. #define ADE7953_SUPPORT 1
  2758. #define I2C_SDA_PIN 12
  2759. #define I2C_SCL_PIN 14
  2760. // -----------------------------------------------------------------------------
  2761. // also works with https://www.amazon.com/gp/product/B07TMY394G/
  2762. // see https://github.com/xoseperez/espurna/issues/2055
  2763. #elif defined(LOHAS_E27_9W)
  2764. // Info
  2765. #define MANUFACTURER "LOHAS"
  2766. #define DEVICE "E27_9W"
  2767. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2768. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2769. #define DUMMY_RELAY_COUNT 1
  2770. // Light
  2771. #define LIGHT_CHANNELS 5
  2772. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2773. #define MY92XX_CHIPS 2
  2774. #define MY92XX_DI_PIN 13
  2775. #define MY92XX_DCKI_PIN 15
  2776. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2777. #define MY92XX_MAPPING 0, 1, 2, 3, 4
  2778. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  2779. // https://www.amazon.com/gp/product/B07T7W7ZMW
  2780. #elif defined(LOHAS_E26_A19)
  2781. // Info
  2782. #define MANUFACTURER "LOHAS"
  2783. #define DEVICE "E26_A19"
  2784. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2785. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2786. #define DUMMY_RELAY_COUNT 1
  2787. // Light
  2788. #define LIGHT_CHANNELS 5
  2789. #define LIGHT_CH1_PIN 5 // RED
  2790. #define LIGHT_CH2_PIN 4 // GREEN
  2791. #define LIGHT_CH3_PIN 13 // BLUE
  2792. #define LIGHT_CH4_PIN 14 // WHITE1
  2793. #define LIGHT_CH5_PIN 12 // WHITE1
  2794. // -----------------------------------------------------------------------------
  2795. #elif defined(TECKIN_SB53)
  2796. // Info
  2797. #define MANUFACTURER "TECKIN"
  2798. #define DEVICE "SB53"
  2799. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2800. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2801. #define DUMMY_RELAY_COUNT 1
  2802. // Light
  2803. #define LIGHT_CHANNELS 5
  2804. #define LIGHT_CH1_PIN 4 // RED
  2805. #define LIGHT_CH2_PIN 12 // GREEN
  2806. #define LIGHT_CH3_PIN 14 // BLUE
  2807. #define LIGHT_CH4_PIN 13 // WARM WHITE
  2808. #define LIGHT_CH5_PIN 5 // COLD WHITE
  2809. // -----------------------------------------------------------------------------
  2810. #elif defined(XIAOMI_SMART_DESK_LAMP)
  2811. // Info
  2812. #define MANUFACTURER "XIAOMI"
  2813. #define DEVICE "SMART_DESK_LAMP"
  2814. // Buttons
  2815. #define BUTTON1_PIN 2
  2816. #define BUTTON2_PIN 14
  2817. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2818. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2819. // This button doubles as switch here and as encoder mode switch below
  2820. // Clicking it (for less than 500ms) will turn the light on and off
  2821. // Double and Long clicks will not work as these are used to modify the encoder action
  2822. #define BUTTON1_RELAY 1
  2823. #define BUTTON_LNGCLICK_DELAY 500
  2824. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  2825. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  2826. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_NONE
  2827. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  2828. #define BUTTON2_DBLCLICK BUTTON_ACTION_AP
  2829. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_RESET
  2830. // Light
  2831. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2832. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2833. #define DUMMY_RELAY_COUNT 1
  2834. #define LIGHT_STEP 8
  2835. #define LIGHT_CHANNELS 2
  2836. #define LIGHT_CH1_PIN 5 // warm white
  2837. #define LIGHT_CH2_PIN 4 // cold white
  2838. // https://www.xiaomitoday.com/xiaomi-mijia-mjtd01yl-led-desk-lamp-review/
  2839. #define LIGHT_COLDWHITE_MIRED 153
  2840. #define LIGHT_WARMWHITE_MIRED 370
  2841. // Encoder
  2842. // If mode is ENCODER_MODE_RATIO, the value ratio between both channels is changed
  2843. // when the button is not pressed, and the overall brightness when pressed
  2844. // If mode is ENCODER_MODE_CHANNEL, the first channel value is changed
  2845. // when the button is not pressed, and the second channel when pressed
  2846. // If no ENCODERX_BUTTON_PIN defined it will only change the value of the first defined channel
  2847. #define ENCODER_SUPPORT 1
  2848. #define ENCODER1_PIN1 12
  2849. #define ENCODER1_PIN2 13
  2850. #define ENCODER1_BUTTON_PIN 2 // active low by default, with software pullup
  2851. #define ENCODER1_CHANNEL1 0 // please note this value is 0-based (LIGHT_CH1 above)
  2852. #define ENCODER1_CHANNEL2 1 // please note this value is 0-based (LIGHT_CH2 above)
  2853. #define ENCODER1_MODE ENCODER_MODE_RATIO
  2854. #elif defined(PHYX_ESP12_RGB)
  2855. // Info
  2856. #define MANUFACTURER "PHYX"
  2857. #define DEVICE "ESP12_RGB"
  2858. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2859. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2860. #define DUMMY_RELAY_COUNT 1
  2861. // Light
  2862. #define LIGHT_CHANNELS 3
  2863. #define LIGHT_CH1_PIN 4 // RED
  2864. #define LIGHT_CH2_PIN 14 // GREEN
  2865. #define LIGHT_CH3_PIN 12 // BLUE
  2866. // -----------------------------------------------------------------------------
  2867. // iWoole LED Table Lamp
  2868. // 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
  2869. // -----------------------------------------------------------------------------
  2870. #elif defined(IWOOLE_LED_TABLE_LAMP)
  2871. // Info
  2872. #define MANUFACTURER "IWOOLE"
  2873. #define DEVICE "LED_TABLE_LAMP"
  2874. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2875. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2876. #define DUMMY_RELAY_COUNT 1
  2877. // Light
  2878. #define LIGHT_CHANNELS 4
  2879. #define LIGHT_CH1_PIN 12 // RED
  2880. #define LIGHT_CH2_PIN 5 // GREEN
  2881. #define LIGHT_CH3_PIN 14 // BLUE
  2882. #define LIGHT_CH4_PIN 4 // WHITE
  2883. // -----------------------------------------------------------------------------
  2884. // Generic GU10
  2885. // https://www.ebay.com/itm/1-10PC-GU10-RGB-Smart-Bulb-Wireless-WiFi-App-Remote-Ctrl-Light-for-Alexa-Google/173724116351
  2886. // -----------------------------------------------------------------------------
  2887. #elif defined(GENERIC_GU10)
  2888. // Info
  2889. #define MANUFACTURER "GENERIC"
  2890. #define DEVICE "GU10"
  2891. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2892. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2893. #define DUMMY_RELAY_COUNT 1
  2894. // Light
  2895. #define LIGHT_CHANNELS 4
  2896. #define LIGHT_CH1_PIN 14 // RED
  2897. #define LIGHT_CH2_PIN 12 // GREEN
  2898. #define LIGHT_CH3_PIN 13 // BLUE
  2899. #define LIGHT_CH4_PIN 4 // WHITE
  2900. // -----------------------------------------------------------------------------
  2901. // Generic E14
  2902. // https://www.ebay.com/itm/LED-Bulb-Wifi-E14-4-5W-Candle-RGB-W-4in1-Dimmable-V-tac-Smart-VT-5114/163899840601
  2903. // -----------------------------------------------------------------------------
  2904. #elif defined(GENERIC_E14)
  2905. // Info
  2906. #define MANUFACTURER "GENERIC"
  2907. #define DEVICE "E14"
  2908. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2909. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2910. #define DUMMY_RELAY_COUNT 1
  2911. // Light
  2912. #define LIGHT_CHANNELS 4
  2913. #define LIGHT_CH1_PIN 4 // RED
  2914. #define LIGHT_CH2_PIN 12 // GREEN
  2915. #define LIGHT_CH3_PIN 14 // BLUE
  2916. #define LIGHT_CH4_PIN 5 // WHITE
  2917. // -----------------------------------------------------------------------------
  2918. // Deltaco white e14 (SH-LE14W) and e27 (SH-LE27W)
  2919. // -----------------------------------------------------------------------------
  2920. #elif defined(DELTACO_SH_LEXXW)
  2921. // Info
  2922. #define MANUFACTURER "DELTACO"
  2923. #define DEVICE "SH_LEXXW"
  2924. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2925. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2926. #define DUMMY_RELAY_COUNT 1
  2927. // Light
  2928. #define LIGHT_CHANNELS 2
  2929. #define LIGHT_CH1_PIN 12 // WARM WHITE
  2930. #define LIGHT_CH2_PIN 14 // COLD WHITE
  2931. // -----------------------------------------------------------------------------
  2932. // Deltaco rgbw e27 (SH-LE27RGB)
  2933. // -----------------------------------------------------------------------------
  2934. #elif defined(DELTACO_SH_LEXXRGB)
  2935. // Info
  2936. #define MANUFACTURER "DELTACO"
  2937. #define DEVICE "SH_LEXXRGB"
  2938. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2939. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2940. #define DUMMY_RELAY_COUNT 1
  2941. // Light
  2942. #define LIGHT_CHANNELS 5
  2943. #define LIGHT_CH1_PIN 5 // RED
  2944. #define LIGHT_CH2_PIN 4 // GREEN
  2945. #define LIGHT_CH3_PIN 13 // BLUE
  2946. #define LIGHT_CH4_PIN 14 // WARM WHITE
  2947. #define LIGHT_CH5_PIN 12 // COLD WHITE
  2948. // -----------------------------------------------------------------------------
  2949. // Nexete A19
  2950. // https://www.ebay.com/itm/Wifi-Smart-LED-light-Bulb-9W-60W-A19-850LM-RGBW-Dimmable-for-Alexa-Google-Home/283514779201
  2951. // -----------------------------------------------------------------------------
  2952. #elif defined(NEXETE_A19)
  2953. // Info
  2954. #define MANUFACTURER "NEXETE"
  2955. #define DEVICE "A19"
  2956. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2957. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2958. #define DUMMY_RELAY_COUNT 1
  2959. // Light
  2960. #define LIGHT_CHANNELS 4
  2961. #define LIGHT_CH1_PIN 12 // RED
  2962. #define LIGHT_CH2_PIN 15 // GREEN
  2963. #define LIGHT_CH3_PIN 14 // BLUE
  2964. #define LIGHT_CH4_PIN 5 // WHITE
  2965. // -----------------------------------------------------------------------------
  2966. // Lombex Lux Nova 2 Tunable White
  2967. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2968. // -----------------------------------------------------------------------------
  2969. #elif defined(LOMBEX_LUX_NOVA2_TUNABLE_WHITE)
  2970. // Info
  2971. #define MANUFACTURER "LOMBEX"
  2972. #define DEVICE "LUX_NOVA2_TUNABLE_WHITE"
  2973. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2974. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2975. #define DUMMY_RELAY_COUNT 1
  2976. // Light
  2977. #define LIGHT_CHANNELS 5
  2978. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2979. #define MY92XX_CHIPS 1
  2980. #define MY92XX_DI_PIN 4
  2981. #define MY92XX_DCKI_PIN 5
  2982. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2983. // No RGB on this bulb. Warm white on channel 0, cool white on channel 3
  2984. #define MY92XX_MAPPING 255, 255, 255, 3, 0
  2985. // -----------------------------------------------------------------------------
  2986. // Lombex Lux Nova 2 White and Color
  2987. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  2988. // -----------------------------------------------------------------------------
  2989. #elif defined(LOMBEX_LUX_NOVA2_WHITE_COLOR)
  2990. // Info
  2991. #define MANUFACTURER "LOMBEX"
  2992. #define DEVICE "LUX_NOVA2_WHITE_COLOR"
  2993. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2994. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2995. #define DUMMY_RELAY_COUNT 1
  2996. // Light
  2997. #define LIGHT_CHANNELS 4
  2998. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  2999. #define MY92XX_CHIPS 1
  3000. #define MY92XX_DI_PIN 4
  3001. #define MY92XX_DCKI_PIN 5
  3002. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  3003. // RGB on channels 0/1/2, either cool or warm white on channel 3
  3004. // The bulb *should* have cool leds, but could also have warm leds as a common defect
  3005. #define MY92XX_MAPPING 0, 1, 2, 3
  3006. // -----------------------------------------------------------------------------
  3007. // Bestek Smart Plug with 2 USB ports
  3008. // https://www.bestekcorp.com/bestek-smart-plug-works-with-amazon-alexa-google-assistant-and-ifttt-with-2-usb
  3009. // -----------------------------------------------------------------------------
  3010. #elif defined(BESTEK_MRJ1011)
  3011. // Info
  3012. #define MANUFACTURER "BESTEK"
  3013. #define DEVICE "MRJ1011"
  3014. // Buttons
  3015. #define BUTTON1_PIN 13
  3016. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  3017. #define BUTTON1_RELAY 1
  3018. // Relay
  3019. #define RELAY1_PIN 12
  3020. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3021. // LED
  3022. #define LED1_PIN 4
  3023. #define LED1_PIN_INVERSE 1
  3024. // -----------------------------------------------------------------------------
  3025. // GBLIFE RGBW SOCKET
  3026. // -----------------------------------------------------------------------------
  3027. #elif defined(GBLIFE_RGBW_SOCKET)
  3028. // Info
  3029. #define MANUFACTURER "GBLIFE"
  3030. #define DEVICE "RGBW_SOCKET"
  3031. // Buttons
  3032. #define BUTTON1_PIN 13
  3033. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3034. #define BUTTON1_RELAY 1
  3035. // Relays
  3036. #define RELAY1_PIN 15
  3037. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3038. // Light RGBW
  3039. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3040. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3041. #define DUMMY_RELAY_COUNT 1
  3042. #define LIGHT_CHANNELS 4
  3043. #define LIGHT_CH1_PIN 5 // RED
  3044. #define LIGHT_CH2_PIN 14 // GREEN
  3045. #define LIGHT_CH3_PIN 12 // BLUE
  3046. #define LIGHT_CH4_PIN 4 // WHITE
  3047. // ----------------------------------------------------------------------------------------
  3048. // Smart life Mini Smart Socket is similar Homecube 16A but some GPIOs differ
  3049. // https://www.ebay.de/itm/Smart-Steckdose-WIFI-WLAN-Amazon-Alexa-Fernbedienung-Home-Socket-Zeitschaltuh-DE/123352026749?hash=item1cb85a8e7d:g:IasAAOSwk6dbj390
  3050. // Also labeled NETVIP
  3051. // https://www.amazon.es/Inteligente-NETVIP-Inal%C3%A1mbrico-Interruptor-Funciona/dp/B07KH8YWS5
  3052. // ----------------------------------------------------------------------------------------
  3053. #elif defined(SMARTLIFE_MINI_SMART_SOCKET)
  3054. // Info
  3055. #define MANUFACTURER "SMARTLIFE"
  3056. #define DEVICE "MINI_SMART_SOCKET"
  3057. // Buttons
  3058. #define BUTTON1_PIN 13
  3059. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3060. #define BUTTON1_RELAY 1
  3061. // Relays
  3062. #define RELAY1_PIN 15
  3063. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3064. // LEDs
  3065. //Red LED: 0
  3066. //Green LED: 4
  3067. //Blue LED: 2
  3068. // Light
  3069. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3070. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3071. #define DUMMY_RELAY_COUNT 1
  3072. #define LIGHT_CHANNELS 3
  3073. #define LIGHT_CH1_PIN 0 // RED
  3074. #define LIGHT_CH2_PIN 4 // GREEN
  3075. #define LIGHT_CH3_PIN 2 // BLUE
  3076. // HJL01 / BL0937
  3077. #ifndef HLW8012_SUPPORT
  3078. #define HLW8012_SUPPORT 1
  3079. #endif
  3080. #define HLW8012_SEL_PIN 12
  3081. #define HLW8012_CF1_PIN 14
  3082. #define HLW8012_CF_PIN 5
  3083. #define HLW8012_SEL_CURRENT LOW
  3084. #define HLW8012_CURRENT_RATIO 25740
  3085. #define HLW8012_VOLTAGE_RATIO 313400
  3086. #define HLW8012_POWER_RATIO 3414290
  3087. #define HLW8012_INTERRUPT_ON FALLING
  3088. // ----------------------------------------------------------------------------------------
  3089. // Hama WiFi Steckdose (00176533)
  3090. // https://at.hama.com/00176533/hama-wifi-steckdose-3500w-16a
  3091. // ----------------------------------------------------------------------------------------
  3092. #elif defined(HAMA_WIFI_STECKDOSE_00176533)
  3093. // Info
  3094. #define MANUFACTURER "HAMA"
  3095. #define DEVICE "WIFI_STECKDOSE_00176533"
  3096. // Buttons
  3097. #define BUTTON1_PIN 13
  3098. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  3099. #define BUTTON1_RELAY 1
  3100. // Relays
  3101. #define RELAY1_PIN 12
  3102. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3103. // LEDs
  3104. #define LED1_PIN 4
  3105. #define LED1_PIN_INVERSE 1
  3106. // -----------------------------------------------------------------------------
  3107. // Oxaoxe NX-SP202
  3108. // Digoo NX-SP202 (not tested)
  3109. // Digoo DG-SP202 (not tested)
  3110. // https://github.com/xoseperez/espurna/issues/1502
  3111. // -----------------------------------------------------------------------------
  3112. #elif defined(DIGOO_NX_SP202)
  3113. // Info
  3114. #define MANUFACTURER "DIGOO"
  3115. #define DEVICE "NX_SP202"
  3116. // Buttons
  3117. #define BUTTON1_PIN 0
  3118. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3119. #define BUTTON1_RELAY 1
  3120. #define BUTTON2_PIN 16
  3121. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3122. #define BUTTON2_RELAY 2
  3123. // Relays
  3124. #define RELAY1_PIN 15
  3125. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3126. #define RELAY2_PIN 14
  3127. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3128. // LEDs
  3129. #define LED1_PIN 13
  3130. #define LED1_PIN_INVERSE 1
  3131. // HJL01 / BL0937
  3132. #ifndef HLW8012_SUPPORT
  3133. #define HLW8012_SUPPORT 1
  3134. #endif
  3135. #define HLW8012_SEL_PIN 12
  3136. #define HLW8012_CF1_PIN 5
  3137. #define HLW8012_CF_PIN 4
  3138. #define HLW8012_SEL_CURRENT LOW
  3139. #define HLW8012_CURRENT_RATIO 23296
  3140. #define HLW8012_VOLTAGE_RATIO 310085
  3141. #define HLW8012_POWER_RATIO 3368471
  3142. #define HLW8012_INTERRUPT_ON FALLING
  3143. // -----------------------------------------------------------------------------
  3144. // Foxel's LightFox dual
  3145. // https://github.com/foxel/esp-dual-rf-switch
  3146. // -----------------------------------------------------------------------------
  3147. #elif defined(FOXEL_LIGHTFOX_DUAL)
  3148. // Info
  3149. #define MANUFACTURER "FOXEL"
  3150. #define DEVICE "LIGHTFOX_DUAL"
  3151. #define SERIAL_BAUDRATE 19200
  3152. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  3153. #define DUMMY_RELAY_COUNT 2
  3154. #define DEBUG_SERIAL_SUPPORT 0
  3155. // Buttons
  3156. #define BUTTON1_RELAY 1
  3157. #define BUTTON2_RELAY 2
  3158. #define BUTTON3_RELAY 2
  3159. #define BUTTON4_RELAY 1
  3160. #define BUTTON_EVENTS_SOURCE BUTTON_EVENTS_SOURCE_FOXEL_LIGHTFOX_DUAL
  3161. // -----------------------------------------------------------------------------
  3162. // Teckin SP20
  3163. // -----------------------------------------------------------------------------
  3164. #elif defined(TECKIN_SP20)
  3165. // Info
  3166. #define MANUFACTURER "TECKIN"
  3167. #define DEVICE "SP20"
  3168. // Buttons
  3169. #define BUTTON1_PIN 13
  3170. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3171. #define BUTTON1_RELAY 1
  3172. // Relays
  3173. #define RELAY1_PIN 4
  3174. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3175. // LEDs
  3176. #define LED1_PIN 2
  3177. #define LED1_PIN_INVERSE 1
  3178. #define LED2_PIN 0
  3179. #define LED2_PIN_INVERSE 1
  3180. #define LED2_MODE LED_MODE_FINDME
  3181. #define LED2_RELAY 0
  3182. // HJL01 / BL0937
  3183. #ifndef HLW8012_SUPPORT
  3184. #define HLW8012_SUPPORT 1
  3185. #endif
  3186. #define HLW8012_SEL_PIN 12
  3187. #define HLW8012_CF1_PIN 14
  3188. #define HLW8012_CF_PIN 5
  3189. #define HLW8012_SEL_CURRENT LOW
  3190. #define HLW8012_CURRENT_RATIO 25740
  3191. #define HLW8012_VOLTAGE_RATIO 313400
  3192. #define HLW8012_POWER_RATIO 3414290
  3193. #define HLW8012_INTERRUPT_ON FALLING
  3194. // -----------------------------------------------------------------------------
  3195. // Charging Essentials / LITESUN LA-WF3
  3196. // -----------------------------------------------------------------------------
  3197. #elif defined(LITESUN_LA_WF3)
  3198. // Info
  3199. #define MANUFACTURER "LITESUN"
  3200. #define DEVICE "LA_WF3"
  3201. // Buttons
  3202. #define BUTTON1_PIN 13
  3203. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3204. #define BUTTON1_RELAY 1
  3205. // Relays
  3206. #define RELAY1_PIN 12
  3207. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3208. // LEDs
  3209. #define LED1_PIN 4 // 4 blue led
  3210. #define LED1_MODE LED_MODE_WIFI
  3211. #define LED1_PIN_INVERSE 1
  3212. #define LED2_PIN 5 // 5 red led
  3213. #define LED2_MODE LED_MODE_RELAY
  3214. #define LED2_PIN_INVERSE 1
  3215. // -----------------------------------------------------------------------------
  3216. // PSH
  3217. // -----------------------------------------------------------------------------
  3218. #elif defined(PSH_WIFI_PLUG)
  3219. // Info
  3220. #define MANUFACTURER "PSH"
  3221. #define DEVICE "WIFI_PLUG"
  3222. // Relays
  3223. #define RELAY1_PIN 2
  3224. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3225. // LEDs
  3226. #define LED1_PIN 0
  3227. #define LED1_PIN_INVERSE 0
  3228. #elif defined(PSH_RGBW_CONTROLLER)
  3229. // Info
  3230. #define MANUFACTURER "PSH"
  3231. #define DEVICE "RGBW_CONTROLLER"
  3232. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3233. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3234. #define DUMMY_RELAY_COUNT 1
  3235. // LEDs
  3236. #define LED1_PIN 13
  3237. #define LED1_PIN_INVERSE 1
  3238. // Light
  3239. #define LIGHT_CHANNELS 4
  3240. #define LIGHT_CH1_PIN 5 // RED
  3241. #define LIGHT_CH2_PIN 4 // GREEN
  3242. #define LIGHT_CH3_PIN 12 // BLUE
  3243. #define LIGHT_CH4_PIN 14 // WHITE1
  3244. #elif defined(PSH_WIFI_SENSOR)
  3245. // Info
  3246. #define MANUFACTURER "PSH"
  3247. #define DEVICE "WIFI_SENSOR"
  3248. // DHT12 Sensor
  3249. #define DHT_SUPPORT 1
  3250. #define DHT_PIN 14
  3251. #define DHT_TYPE DHT_CHIP_DHT12
  3252. // LDR Sensor
  3253. #define LDR_SUPPORT 1
  3254. #define LDR_TYPE LDR_GL5528
  3255. #define LDR_ON_GROUND false
  3256. #define LDR_RESISTOR 10000
  3257. #elif defined(JINVOO_VALVE_SM_AW713)
  3258. // Reflashing from original Tuya firmware
  3259. // to thirdparty firmware like espurna by:
  3260. // https://github.com/ct-Open-Source/tuya-convert
  3261. // Info
  3262. #define MANUFACTURER "JINVOO"
  3263. #define DEVICE "VALVE_SM_AW713"
  3264. // Buttons
  3265. #define BUTTON1_PIN 13
  3266. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3267. #define BUTTON1_RELAY 1
  3268. // Relays
  3269. #define RELAY1_PIN 12
  3270. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3271. // LED
  3272. #define LED1_PIN 5 // 5 red led
  3273. #define LED1_PIN_INVERSE 0
  3274. #define LED1_RELAY 1
  3275. #define LED1_MODE LED_MODE_RELAY
  3276. #define LED2_PIN 4 // 4 blue led
  3277. #define LED2_PIN_INVERSE 0
  3278. #define LED2_RELAY 1
  3279. #define LED2_MODE LED_MODE_FINDME_WIFI
  3280. #elif defined(TUYA_GENERIC_DIMMER)
  3281. #define MANUFACTURER "TUYA"
  3282. #define DEVICE "GENERIC_DIMMER"
  3283. #define LIGHT_PROVIDER LIGHT_PROVIDER_TUYA
  3284. #define LIGHT_CHANNELS 0
  3285. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3286. #define DUMMY_RELAY_COUNT 0
  3287. // -----------------------------------------------------------------------------
  3288. // Etekcity ESW01-USA
  3289. // https://www.amazon.com/Etekcity-Voltson-Outlet-Monitoring-Required/dp/B01M3MYIFS
  3290. // -----------------------------------------------------------------------------
  3291. #elif defined(ETEKCITY_ESW01_USA)
  3292. // Info
  3293. #define MANUFACTURER "ETEKCITY"
  3294. #define DEVICE "ESW01-USA"
  3295. // Buttons
  3296. #define BUTTON1_PIN 14
  3297. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3298. #define BUTTON1_RELAY 1
  3299. // Relays
  3300. #define RELAY1_PIN 4
  3301. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3302. // LEDs
  3303. // Blue
  3304. #define LED1_PIN 5
  3305. #define LED1_MODE LED_MODE_WIFI
  3306. // Yellow
  3307. #define LED2_PIN 16
  3308. #define LED2_MODE LED_MODE_FOLLOW
  3309. #define LED2_RELAY 1
  3310. // HLW8012
  3311. #ifndef HLW8012_SUPPORT
  3312. #define HLW8012_SUPPORT 1
  3313. #endif
  3314. #define HLW8012_SEL_PIN 15
  3315. #define HLW8012_CF1_PIN 12
  3316. #define HLW8012_CF_PIN 13
  3317. #define HLW8012_SEL_CURRENT HIGH // SEL pin to HIGH to measure current
  3318. #define HLW8012_CURRENT_R 0.001 // Current resistor
  3319. #define HLW8012_VOLTAGE_R_UP ( 4 * 470000 ) // Upstream voltage resistor
  3320. #define HLW8012_VOLTAGE_R_DOWN ( 1000 ) // Downstream voltage resistor
  3321. #define HLW8012_INTERRUPT_ON CHANGE
  3322. // -----------------------------------------------------------------------------
  3323. // FS UAP1
  3324. // http://frank-schuetz.de/index.php/fhem/13-hoermann-torantrieb-mit-espeasy-in-fhem-einbinden
  3325. #elif defined(FS_UAP1)
  3326. // Info
  3327. #define MANUFACTURER "FS"
  3328. #define DEVICE "UAP1"
  3329. // Inputs
  3330. #define DIGITAL1_PIN 4
  3331. #define DIGITAL2_PIN 5
  3332. // Relays
  3333. #define RELAY1_PIN 12
  3334. #define RELAY2_PIN 13
  3335. #define RELAY3_PIN 14
  3336. #define RELAY4_PIN 15
  3337. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3338. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3339. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  3340. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  3341. // LEDs
  3342. #define LED1_PIN 2
  3343. // Disable UART noise
  3344. #define DEBUG_SERIAL_SUPPORT 0
  3345. // -----------------------------------------------------------------------------
  3346. // TFLAG NX-SM100 & NX-SM200
  3347. // -----------------------------------------------------------------------------
  3348. #elif defined(TFLAG_NX_SMX00)
  3349. // Info
  3350. #define MANUFACTURER "TFLAG"
  3351. #define DEVICE "NX_SMX00"
  3352. // Buttons
  3353. #define BUTTON1_PIN 13
  3354. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3355. #define BUTTON1_RELAY 1
  3356. // Relays
  3357. #define RELAY1_PIN 12
  3358. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3359. // LEDs
  3360. #define LED1_PIN 0
  3361. #define LED1_PIN_INVERSE 1
  3362. #define LED1_MODE LED_MODE_FOLLOW_INVERSE
  3363. #define LED1_RELAY 1
  3364. #define LED2_PIN 15
  3365. #define LED2_PIN_INVERSE 1
  3366. #define LED2_MODE LED_MODE_WIFI
  3367. // HJL01 / BL0937
  3368. #ifndef HLW8012_SUPPORT
  3369. #define HLW8012_SUPPORT 1
  3370. #endif
  3371. #define HLW8012_SEL_PIN 16
  3372. #define HLW8012_CF1_PIN 14
  3373. #define HLW8012_CF_PIN 5
  3374. #define HLW8012_SEL_CURRENT LOW
  3375. #define HLW8012_CURRENT_RATIO 632
  3376. #define HLW8012_VOLTAGE_RATIO 313400
  3377. #define HLW8012_POWER_RATIO 3711185
  3378. #define HLW8012_INTERRUPT_ON FALLING
  3379. // -----------------------------------------------------------------------------
  3380. // MUVIT_IO_MIOBULB001
  3381. // -----------------------------------------------------------------------------
  3382. #elif defined(MUVIT_IO_MIOBULB001)
  3383. // Info
  3384. #define MANUFACTURER "MUVIT_IO"
  3385. #define DEVICE "MIOBULB001"
  3386. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3387. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3388. #define DUMMY_RELAY_COUNT 1
  3389. // Light
  3390. #define LIGHT_CHANNELS 4
  3391. #define LIGHT_CH1_PIN 14 // RED
  3392. #define LIGHT_CH2_PIN 12 // GREEN
  3393. #define LIGHT_CH3_PIN 13 // BLUE
  3394. #define LIGHT_CH4_PIN 4 // WHITE
  3395. // -----------------------------------------------------------------------------
  3396. // Hykker Power Plug (Smart Home Series) available in Jerónimo Martins Polska (Biedronka)
  3397. // https://www.hykker.com/akcesoria/gniazdo-wi-fi-z-licznikiem-energii/
  3398. // Reflashing from original Tuya firmware
  3399. // to thirdparty firmware like espurna by:
  3400. // https://github.com/ct-Open-Source/tuya-convert
  3401. // -----------------------------------------------------------------------------
  3402. #elif defined(HYKKER_SMART_HOME_POWER_PLUG)
  3403. // Info
  3404. #define MANUFACTURER "HYKKER"
  3405. #define DEVICE "SMART_HOME_POWER_PLUG"
  3406. // Buttons
  3407. #define BUTTON1_PIN 0
  3408. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3409. #define BUTTON1_RELAY 1
  3410. // Relays
  3411. #define RELAY1_PIN 14
  3412. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3413. // LED
  3414. // Red
  3415. #define LED1_PIN 13
  3416. #define LED1_MODE LED_MODE_WIFI
  3417. #define LED1_PIN_INVERSE 1
  3418. // Blue connected to relay
  3419. // HLW8012
  3420. #ifndef HLW8012_SUPPORT
  3421. #define HLW8012_SUPPORT 1
  3422. #endif
  3423. #define HLW8012_SEL_PIN 12
  3424. #define HLW8012_CF1_PIN 5
  3425. #define HLW8012_CF_PIN 4
  3426. #define HLW8012_SEL_CURRENT LOW
  3427. #define HLW8012_CURRENT_RATIO 25740
  3428. #define HLW8012_VOLTAGE_RATIO 282060
  3429. #define HLW8012_POWER_RATIO 3414290
  3430. #define HLW8012_INTERRUPT_ON FALLING
  3431. #define SENSOR_ENERGY_UNITS ENERGY_KWH
  3432. #define SENSOR_POWER_UNITS POWER_WATTS
  3433. // -----------------------------------------------------------------------------
  3434. // Kogan Smarter Home Plug with Energy Meter (Australia)
  3435. // Product code: KASPEMHA
  3436. // https://www.kogan.com/au/buy/kogan-smarterhome-smart-plug-energy-meter/
  3437. // Reflashing from original Tuya firmware
  3438. // to thirdparty firmware like espurna by:
  3439. // https://github.com/ct-Open-Source/tuya-convert
  3440. // -----------------------------------------------------------------------------
  3441. #elif defined(KOGAN_SMARTER_HOME_PLUG_W_POW)
  3442. // Info
  3443. #define MANUFACTURER "KOGAN"
  3444. #define DEVICE "SMARTER_HOME_PLUG_W_POW"
  3445. // Buttons
  3446. #define BUTTON1_PIN 0
  3447. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  3448. #define BUTTON1_RELAY 1
  3449. // Relays
  3450. #define RELAY1_PIN 14
  3451. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3452. // LED
  3453. // Red
  3454. #define LED1_PIN 13
  3455. #define LED1_MODE LED_MODE_WIFI
  3456. #define LED1_PIN_INVERSE 1
  3457. // Blue connected to relay
  3458. // HLW8012
  3459. #ifndef HLW8012_SUPPORT
  3460. #define HLW8012_SUPPORT 1
  3461. #endif
  3462. #define HLW8012_SEL_PIN 12
  3463. #define HLW8012_CF1_PIN 5
  3464. #define HLW8012_CF_PIN 4
  3465. #define HLW8012_SEL_CURRENT LOW
  3466. #define HLW8012_CURRENT_RATIO 25740
  3467. #define HLW8012_VOLTAGE_RATIO 282060
  3468. #define HLW8012_POWER_RATIO 3414290
  3469. #define HLW8012_INTERRUPT_ON FALLING
  3470. #define SENSOR_ENERGY_UNITS ENERGY_KWH
  3471. #define SENSOR_POWER_UNITS POWER_WATTS
  3472. // -----------------------------------------------------------------------------
  3473. // LSC Smart LED Light Strip (Smart CXonnect Series) available ACTION (Germany)
  3474. // https://www.action.com/de-de/p/lsc-smart-connect-intelligenter-multicolor-led-strip-/
  3475. // Reflashing from original Tuya firmware
  3476. // to thirdparty firmware like espurna by:
  3477. // https://github.com/ct-Open-Source/tuya-convert
  3478. // -----------------------------------------------------------------------------
  3479. #elif defined(LSC_SMART_LED_LIGHT_STRIP)
  3480. // Info
  3481. #define MANUFACTURER "LSC"
  3482. #define DEVICE "SMART_LED_LIGHT_STRIP"
  3483. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3484. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3485. #define DUMMY_RELAY_COUNT 1
  3486. // Light RGBW
  3487. #define LIGHT_CHANNELS 4
  3488. #define LIGHT_CH1_PIN 4 // RED
  3489. #define LIGHT_CH2_PIN 12 // GREEN
  3490. #define LIGHT_CH3_PIN 14 // BLUE
  3491. #define LIGHT_CH4_PIN 13 // WHITE
  3492. // #define LIGHT_CH5_PIN 5 // CW (not connected, but circuit supports it)
  3493. // IR
  3494. #define IR_SUPPORT 1
  3495. #define IR_RX_PIN 0
  3496. #define IR_BUTTON_SET 5
  3497. // -----------------------------------------------------------------------------
  3498. // eHomeDIY WT02
  3499. // https://github.com/eHomeDIY/WT02-hardware
  3500. // -----------------------------------------------------------------------------
  3501. #elif defined(EHOMEDIY_WT02)
  3502. // Info
  3503. #define MANUFACTURER "EHOMEDIY"
  3504. #define DEVICE "WT02"
  3505. #define I2C_SDA_PIN 0
  3506. #define I2C_SCL_PIN 2
  3507. #define BMX280_SUPPORT 1
  3508. // #define SI7021_SUPPORT 1
  3509. // -----------------------------------------------------------------------------
  3510. // eHomeDIY WT03
  3511. // https://github.com/eHomeDIY/WT03-hardware
  3512. // -----------------------------------------------------------------------------
  3513. #elif defined(EHOMEDIY_WT03)
  3514. // Info
  3515. #define MANUFACTURER "EHOMEDIY"
  3516. #define DEVICE "WT03"
  3517. #define I2C_SDA_PIN 2
  3518. #define I2C_SCL_PIN 0
  3519. #define BMX280_SUPPORT 1
  3520. // #define SI7021_SUPPORT 1
  3521. // -----------------------------------------------------------------------------
  3522. // Linksprite R4
  3523. // http://linksprite.com/wiki/index.php?title=LinkNode_R4:_Arduino-compatible_WiFi_relay_controller
  3524. // -----------------------------------------------------------------------------
  3525. #elif defined(LINKSPRITE_LINKNODE_R4)
  3526. // Info
  3527. #define MANUFACTURER "LINKSPRITE"
  3528. #define DEVICE "LINKNODE_R4"
  3529. // Relays
  3530. #define RELAY1_PIN 12
  3531. #define RELAY2_PIN 13
  3532. #define RELAY3_PIN 14
  3533. #define RELAY4_PIN 16
  3534. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3535. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3536. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  3537. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  3538. // -----------------------------------------------------------------------------
  3539. #else
  3540. #error "UNSUPPORTED HARDWARE!!"
  3541. #endif