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.

4605 lines
148 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 "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_CORE_WEBUI)
  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 "CORE_WEBUI"
  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. // PZEM004T
  1326. // -----------------------------------------------------------------------------
  1327. #elif defined(GENERIC_PZEM004T)
  1328. // Info
  1329. #define MANUFACTURER "GENERIC"
  1330. #define DEVICE "PZEM004T"
  1331. #define PZEM004T_SUPPORT 1
  1332. #define ALEXA_SUPPORT 0
  1333. #define DEBUG_SERIAL_SUPPORT 0
  1334. // -----------------------------------------------------------------------------
  1335. // ESP-01 generic esp8266 board with 512 kB flash
  1336. // -----------------------------------------------------------------------------
  1337. #elif defined(GENERIC_ESP01_512KB)
  1338. // Info
  1339. #define MANUFACTURER "GENERIC"
  1340. #define DEVICE "ESP01_512KB"
  1341. // Relays
  1342. #define RELAY1_PIN 2
  1343. #ifndef RELAY1_TYPE
  1344. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1345. #endif
  1346. // No need for OTA
  1347. #define OTA_WEB_SUPPORT 0
  1348. #define OTA_ARDUINOOTA_SUPPORT 0
  1349. #define OTA_CLIENT OTA_CLIENT_NONE
  1350. // -----------------------------------------------------------------------------
  1351. // ESPLive
  1352. // https://github.com/ManCaveMade/ESP-Live
  1353. // -----------------------------------------------------------------------------
  1354. #elif defined(MANCAVEMADE_ESPLIVE)
  1355. // Info
  1356. #define MANUFACTURER "MANCAVEMADE"
  1357. #define DEVICE "ESPLIVE"
  1358. // Buttons
  1359. #define BUTTON1_PIN 4
  1360. #define BUTTON2_PIN 5
  1361. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1362. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1363. #define BUTTON1_RELAY 1
  1364. #define BUTTON2_RELAY 2
  1365. // Relays
  1366. #define RELAY1_PIN 12
  1367. #define RELAY2_PIN 13
  1368. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1369. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1370. // DS18B20
  1371. #ifndef DALLAS_SUPPORT
  1372. #define DALLAS_SUPPORT 1
  1373. #endif
  1374. #define DALLAS_PIN 2
  1375. #define DALLAS_UPDATE_INTERVAL 5000
  1376. #define TEMPERATURE_MIN_CHANGE 1.0
  1377. // -----------------------------------------------------------------------------
  1378. // QuinLED
  1379. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  1380. // -----------------------------------------------------------------------------
  1381. #elif defined(INTERMITTECH_QUINLED)
  1382. // Info
  1383. #define MANUFACTURER "INTERMITTECH"
  1384. #define DEVICE "QUINLED"
  1385. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1386. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1387. #define DUMMY_RELAY_COUNT 1
  1388. // LEDs
  1389. #define LED1_PIN 5
  1390. #define LED1_PIN_INVERSE 1
  1391. // Light
  1392. #define LIGHT_CHANNELS 2
  1393. #define LIGHT_CH1_PIN 0
  1394. #define LIGHT_CH2_PIN 2
  1395. // -----------------------------------------------------------------------------
  1396. // Arilux AL-LC06
  1397. // -----------------------------------------------------------------------------
  1398. #elif defined(ARILUX_AL_LC01)
  1399. // Info
  1400. #define MANUFACTURER "ARILUX"
  1401. #define DEVICE "AL_LC01"
  1402. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1403. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1404. #define DUMMY_RELAY_COUNT 1
  1405. // Light
  1406. #define LIGHT_CHANNELS 3
  1407. #define LIGHT_CH1_PIN 5 // RED
  1408. #define LIGHT_CH2_PIN 12 // GREEN
  1409. #define LIGHT_CH3_PIN 13 // BLUE
  1410. #elif defined(ARILUX_AL_LC02)
  1411. // Info
  1412. #define MANUFACTURER "ARILUX"
  1413. #define DEVICE "AL_LC02"
  1414. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1415. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1416. #define DUMMY_RELAY_COUNT 1
  1417. // Light
  1418. #define LIGHT_CHANNELS 4
  1419. #define LIGHT_CH1_PIN 12 // RED
  1420. #define LIGHT_CH2_PIN 5 // GREEN
  1421. #define LIGHT_CH3_PIN 13 // BLUE
  1422. #define LIGHT_CH4_PIN 15 // WHITE1
  1423. #elif defined(ARILUX_AL_LC02_V14)
  1424. // Info
  1425. #define MANUFACTURER "ARILUX"
  1426. #define DEVICE "AL_LC02_V14"
  1427. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1428. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1429. #define DUMMY_RELAY_COUNT 1
  1430. // Light
  1431. #define LIGHT_CHANNELS 4
  1432. #define LIGHT_CH1_PIN 14 // RED
  1433. #define LIGHT_CH2_PIN 5 // GREEN
  1434. #define LIGHT_CH3_PIN 12 // BLUE
  1435. #define LIGHT_CH4_PIN 13 // WHITE1
  1436. #elif defined(ARILUX_AL_LC06)
  1437. // Info
  1438. #define MANUFACTURER "ARILUX"
  1439. #define DEVICE "AL_LC06"
  1440. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1441. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1442. #define DUMMY_RELAY_COUNT 1
  1443. // Buttons
  1444. #define BUTTON1_PIN 0
  1445. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1446. #define BUTTON1_RELAY 1
  1447. // Light
  1448. #define LIGHT_CHANNELS 5
  1449. #define LIGHT_CH1_PIN 14 // RED
  1450. #define LIGHT_CH2_PIN 12 // GREEN
  1451. #define LIGHT_CH3_PIN 13 // BLUE
  1452. #define LIGHT_CH4_PIN 15 // WHITE1
  1453. #define LIGHT_CH5_PIN 5 // WHITE2
  1454. #elif defined(ARILUX_AL_LC11)
  1455. // Info
  1456. #define MANUFACTURER "ARILUX"
  1457. #define DEVICE "AL_LC11"
  1458. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1459. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1460. #define DUMMY_RELAY_COUNT 1
  1461. // Light
  1462. #define LIGHT_CHANNELS 5
  1463. #define LIGHT_CH1_PIN 5 // RED
  1464. #define LIGHT_CH2_PIN 4 // GREEN
  1465. #define LIGHT_CH3_PIN 14 // BLUE
  1466. #define LIGHT_CH4_PIN 13 // WHITE1
  1467. #define LIGHT_CH5_PIN 12 // WHITE1
  1468. #elif defined(ARILUX_E27)
  1469. // Info
  1470. #define MANUFACTURER "ARILUX"
  1471. #define DEVICE "E27"
  1472. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1473. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1474. #define DUMMY_RELAY_COUNT 1
  1475. // Light
  1476. #define LIGHT_CHANNELS 4
  1477. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  1478. #define MY92XX_CHIPS 1
  1479. #define MY92XX_DI_PIN 13
  1480. #define MY92XX_DCKI_PIN 15
  1481. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1482. #define MY92XX_MAPPING 0, 1, 2, 3
  1483. // -----------------------------------------------------------------------------
  1484. // XENON SM-PW701U
  1485. // -----------------------------------------------------------------------------
  1486. #elif defined(XENON_SM_PW702U)
  1487. // Info
  1488. #define MANUFACTURER "XENON"
  1489. #define DEVICE "SM_PW702U"
  1490. // Buttons
  1491. #define BUTTON1_PIN 13
  1492. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1493. #define BUTTON1_RELAY 1
  1494. // Relays
  1495. #define RELAY1_PIN 12
  1496. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1497. // LEDs
  1498. #define LED1_PIN 4
  1499. #define LED1_PIN_INVERSE 1
  1500. // -----------------------------------------------------------------------------
  1501. // ISELECTOR SM-PW702
  1502. // -----------------------------------------------------------------------------
  1503. #elif defined(ISELECTOR_SM_PW702)
  1504. // Info
  1505. #define MANUFACTURER "ISELECTOR"
  1506. #define DEVICE "SM_PW702"
  1507. // Buttons
  1508. #define BUTTON1_PIN 13
  1509. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1510. #define BUTTON1_RELAY 1
  1511. // Relays
  1512. #define RELAY1_PIN 12
  1513. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1514. // LEDs
  1515. #define LED1_PIN 4 //BLUE
  1516. #define LED1_PIN_INVERSE 0
  1517. #define LED2_PIN 5 //RED
  1518. #define LED2_PIN_INVERSE 1
  1519. // -----------------------------------------------------------------------------
  1520. // AUTHOMETION LYT8266
  1521. // https://authometion.com/shop/en/home/13-lyt8266.html
  1522. // -----------------------------------------------------------------------------
  1523. #elif defined(AUTHOMETION_LYT8266)
  1524. // Info
  1525. #define MANUFACTURER "AUTHOMETION"
  1526. #define DEVICE "LYT8266"
  1527. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1528. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1529. #define DUMMY_RELAY_COUNT 1
  1530. // Light
  1531. #define LIGHT_CHANNELS 4
  1532. #define LIGHT_CH1_PIN 13 // RED
  1533. #define LIGHT_CH2_PIN 12 // GREEN
  1534. #define LIGHT_CH3_PIN 14 // BLUE
  1535. #define LIGHT_CH4_PIN 2 // WHITE
  1536. #define LIGHT_ENABLE_PIN 15
  1537. #elif defined(GIZWITS_WITTY_CLOUD)
  1538. // Info
  1539. #define MANUFACTURER "GIZWITS"
  1540. #define DEVICE "WITTY_CLOUD"
  1541. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1542. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1543. #define DUMMY_RELAY_COUNT 1
  1544. // Buttons
  1545. #define BUTTON1_PIN 4
  1546. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1547. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  1548. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  1549. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  1550. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  1551. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  1552. #define ANALOG_SUPPORT 1
  1553. // LEDs
  1554. #define LED1_PIN 2 // BLUE build-in
  1555. #define LED1_PIN_INVERSE 1
  1556. // Light
  1557. #define LIGHT_CHANNELS 3
  1558. #define LIGHT_CH1_PIN 15 // RED
  1559. #define LIGHT_CH2_PIN 12 // GREEN
  1560. #define LIGHT_CH3_PIN 13 // BLUE
  1561. // -----------------------------------------------------------------------------
  1562. // KMC 70011
  1563. // https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
  1564. // -----------------------------------------------------------------------------
  1565. #elif defined(KMC_70011)
  1566. // Info
  1567. #define MANUFACTURER "KMC"
  1568. #define DEVICE "70011"
  1569. // Buttons
  1570. #define BUTTON1_PIN 0
  1571. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1572. #define BUTTON1_RELAY 1
  1573. // Relays
  1574. #define RELAY1_PIN 14
  1575. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1576. // LEDs
  1577. #define LED1_PIN 13
  1578. #define LED1_PIN_INVERSE 1
  1579. // HLW8012
  1580. #ifndef HLW8012_SUPPORT
  1581. #define HLW8012_SUPPORT 1
  1582. #endif
  1583. #define HLW8012_SEL_PIN 12
  1584. #define HLW8012_CF1_PIN 5
  1585. #define HLW8012_CF_PIN 4
  1586. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1587. // -----------------------------------------------------------------------------
  1588. // Euromate (?) Wifi Stecker Schuko
  1589. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  1590. // Thanks to @Geitde
  1591. // -----------------------------------------------------------------------------
  1592. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  1593. // Info
  1594. #define MANUFACTURER "EUROMATE"
  1595. #define DEVICE "WIFI_STECKER_SCHUKO"
  1596. // Buttons
  1597. #define BUTTON1_PIN 14
  1598. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1599. #define BUTTON1_RELAY 1
  1600. // The relay in the device is not a bistable (latched) relay.
  1601. // The device is reported to have a flip-flop circuit to drive the relay
  1602. // So @Geitde hack is still the only possible
  1603. // Hack: drive GPIO12 low and use GPIO5 as normal relay pin:
  1604. #define RELAY1_PIN 5
  1605. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1606. #define LED2_PIN 12 /* DUMMY: exploit default off state for GPIO12=low */
  1607. #define LED2_PIN_INVERSE 0
  1608. // LEDs
  1609. #define LED1_PIN 4
  1610. #define LED1_PIN_INVERSE 0
  1611. // -----------------------------------------------------------------------------
  1612. // Euromate (?) Wifi Stecker Schuko Version 2
  1613. // This configuration is for the second generation of devices sold by OBI.
  1614. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko-weiss/p/4077806
  1615. // -----------------------------------------------------------------------------
  1616. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO_V2)
  1617. // Info
  1618. #define MANUFACTURER "EUROMATE"
  1619. #define DEVICE "WIFI_STECKER_SCHUKO_V2"
  1620. // Buttons
  1621. #define BUTTON1_PIN 5
  1622. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1623. #define BUTTON1_RELAY 1
  1624. // Relays
  1625. #define RELAY1_PIN 4
  1626. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1627. // Green
  1628. #define LED1_PIN 12
  1629. #define LED1_MODE LED_MODE_WIFI
  1630. #define LED1_PIN_INVERSE 0
  1631. // Red
  1632. #define LED2_PIN 13
  1633. #define LED2_MODE LED_MODE_RELAY
  1634. #define LED2_PIN_INVERSE 0
  1635. // -----------------------------------------------------------------------------
  1636. // Generic 8CH
  1637. // -----------------------------------------------------------------------------
  1638. #elif defined(GENERIC_8CH)
  1639. // Info
  1640. #define MANUFACTURER "GENERIC"
  1641. #define DEVICE "8CH"
  1642. // Relays
  1643. #define RELAY1_PIN 0
  1644. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1645. #define RELAY2_PIN 2
  1646. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1647. #define RELAY3_PIN 4
  1648. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1649. #define RELAY4_PIN 5
  1650. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1651. #define RELAY5_PIN 12
  1652. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1653. #define RELAY6_PIN 13
  1654. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  1655. #define RELAY7_PIN 14
  1656. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  1657. #define RELAY8_PIN 15
  1658. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  1659. // -----------------------------------------------------------------------------
  1660. // STM RELAY
  1661. // -----------------------------------------------------------------------------
  1662. #elif defined(STM_RELAY)
  1663. // Info
  1664. #define MANUFACTURER "STM_RELAY"
  1665. #define DEVICE "2CH"
  1666. // Relays
  1667. #define DUMMY_RELAY_COUNT 2
  1668. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  1669. // Remove UART noise on serial line
  1670. #define DEBUG_SERIAL_SUPPORT 0
  1671. // -----------------------------------------------------------------------------
  1672. // Tonbux Powerstrip02
  1673. // -----------------------------------------------------------------------------
  1674. #elif defined(TONBUX_POWERSTRIP02)
  1675. // Info
  1676. #define MANUFACTURER "TONBUX"
  1677. #define DEVICE "POWERSTRIP02"
  1678. // Buttons
  1679. #define BUTTON1_PIN 5
  1680. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1681. #define BUTTON1_RELAY 0
  1682. // Relays
  1683. #define RELAY1_PIN 4
  1684. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1685. #define RELAY2_PIN 13
  1686. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1687. #define RELAY3_PIN 12
  1688. #define RELAY3_TYPE RELAY_TYPE_INVERSE
  1689. #define RELAY4_PIN 14
  1690. #define RELAY4_TYPE RELAY_TYPE_INVERSE
  1691. // Not a relay. USB ports on/off
  1692. #define RELAY5_PIN 16
  1693. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1694. // LEDs
  1695. #define LED1_PIN 0 // 1 blue led
  1696. #define LED1_PIN_INVERSE 1
  1697. #define LED2_PIN 3 // 3 red leds
  1698. #define LED2_PIN_INVERSE 1
  1699. // -----------------------------------------------------------------------------
  1700. // Lingan SWA1
  1701. // -----------------------------------------------------------------------------
  1702. #elif defined(LINGAN_SWA1)
  1703. // Info
  1704. #define MANUFACTURER "LINGAN"
  1705. #define DEVICE "SWA1"
  1706. // Buttons
  1707. #define BUTTON1_PIN 13
  1708. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1709. #define BUTTON1_RELAY 1
  1710. // Relays
  1711. #define RELAY1_PIN 5
  1712. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1713. // LEDs
  1714. #define LED1_PIN 4
  1715. #define LED1_PIN_INVERSE 1
  1716. // -----------------------------------------------------------------------------
  1717. // HEYGO HY02
  1718. // -----------------------------------------------------------------------------
  1719. #elif defined(HEYGO_HY02)
  1720. // Info
  1721. #define MANUFACTURER "HEYGO"
  1722. #define DEVICE "HY02"
  1723. // Buttons
  1724. #define BUTTON1_PIN 13
  1725. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1726. #define BUTTON1_RELAY 1
  1727. // Relays
  1728. #define RELAY1_PIN 12
  1729. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1730. // LEDs
  1731. #define LED1_PIN 4
  1732. #define LED1_PIN_INVERSE 0
  1733. // -----------------------------------------------------------------------------
  1734. // Maxcio W-US002S
  1735. // -----------------------------------------------------------------------------
  1736. #elif defined(MAXCIO_WUS002S)
  1737. // Info
  1738. #define MANUFACTURER "MAXCIO"
  1739. #define DEVICE "WUS002S"
  1740. // Buttons
  1741. #define BUTTON1_PIN 2
  1742. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1743. #define BUTTON1_RELAY 1
  1744. // Relays
  1745. #define RELAY1_PIN 13
  1746. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1747. // LEDs
  1748. #define LED1_PIN 3
  1749. #define LED1_PIN_INVERSE 0
  1750. // HLW8012
  1751. #ifndef HLW8012_SUPPORT
  1752. #define HLW8012_SUPPORT 1
  1753. #endif
  1754. #define HLW8012_SEL_PIN 12
  1755. #define HLW8012_CF1_PIN 5
  1756. #define HLW8012_CF_PIN 4
  1757. #define HLW8012_CURRENT_R 0.002 // Current resistor
  1758. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1759. // LED1 on RX pin
  1760. #define DEBUG_SERIAL_SUPPORT 1
  1761. // -----------------------------------------------------------------------------
  1762. // Maxcio W-DE004
  1763. // -----------------------------------------------------------------------------
  1764. #elif defined(MAXCIO_WDE004)
  1765. // Info
  1766. #define MANUFACTURER "MAXCIO"
  1767. #define DEVICE "WDE004"
  1768. // Buttons
  1769. #define BUTTON1_PIN 1
  1770. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1771. #define BUTTON1_RELAY 1
  1772. // Relays
  1773. #define RELAY1_PIN 14
  1774. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1775. // LEDs
  1776. #define LED1_PIN 13
  1777. #define LED1_PIN_INVERSE 1
  1778. // -----------------------------------------------------------------------------
  1779. // Maxcio W-UK007S
  1780. // 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
  1781. // -----------------------------------------------------------------------------
  1782. #elif defined(MAXCIO_WUK007S)
  1783. // Info
  1784. #define MANUFACTURER "MAXCIO"
  1785. #define DEVICE "WUK007S"
  1786. // Buttons
  1787. #define BUTTON1_PIN 13
  1788. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1789. #define BUTTON1_RELAY 1
  1790. // Relays
  1791. #define RELAY1_PIN 15
  1792. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1793. // LEDs
  1794. #define LED1_PIN 0
  1795. #define LED1_PIN_INVERSE 0
  1796. #define LED1_RELAY 1
  1797. #define LED1_MODE LED_MODE_RELAY_WIFI
  1798. // HJL01 / BL0937
  1799. #ifndef HLW8012_SUPPORT
  1800. #define HLW8012_SUPPORT 1
  1801. #endif
  1802. #define HLW8012_SEL_PIN 12
  1803. #define HLW8012_CF1_PIN 14
  1804. #define HLW8012_CF_PIN 5
  1805. #define HLW8012_SEL_CURRENT LOW
  1806. #define HLW8012_CURRENT_RATIO 24380
  1807. #define HLW8012_VOLTAGE_RATIO 32048
  1808. #define HLW8012_POWER_RATIO 3509285
  1809. #define HLW8012_INTERRUPT_ON FALLING
  1810. // -----------------------------------------------------------------------------
  1811. // Oukitel P1 Smart Plug
  1812. // 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
  1813. // -----------------------------------------------------------------------------
  1814. #elif defined(OUKITEL_P1)
  1815. // Info
  1816. #define MANUFACTURER "Oukitel"
  1817. #define DEVICE "P1"
  1818. // Buttons
  1819. #define BUTTON1_PIN 13
  1820. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1821. #define BUTTON1_RELAY 1
  1822. // Relays
  1823. // Right
  1824. #define RELAY1_PIN 12
  1825. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1826. // Left
  1827. #define RELAY2_PIN 15
  1828. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1829. // LEDs
  1830. #define LED1_PIN 0 // blue
  1831. #define LED1_PIN_INVERSE 1
  1832. #define LED1_MODE LED_MODE_WIFI
  1833. // -----------------------------------------------------------------------------
  1834. // YiDian XS-SSA05
  1835. // -----------------------------------------------------------------------------
  1836. #elif defined(YIDIAN_XSSSA05)
  1837. // Info
  1838. #define MANUFACTURER "YIDIAN"
  1839. #define DEVICE "XSSSA05"
  1840. // Buttons
  1841. #define BUTTON1_PIN 13
  1842. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1843. #define BUTTON1_RELAY 1
  1844. // Relays
  1845. #define RELAY1_PIN 12
  1846. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1847. // LEDs
  1848. #define LED1_PIN 0 // red
  1849. #define LED1_PIN_INVERSE 1
  1850. #define LED1_MODE LED_MODE_WIFI
  1851. #define LED2_PIN 15 // blue
  1852. #define LED2_PIN_INVERSE 1
  1853. #define LED2_MODE LED_MODE_RELAY
  1854. // HLW8012
  1855. #ifndef HLW8012_SUPPORT
  1856. #define HLW8012_SUPPORT 1
  1857. #endif
  1858. #define HLW8012_SEL_PIN 3
  1859. #define HLW8012_CF1_PIN 14
  1860. #define HLW8012_CF_PIN 5
  1861. #define HLW8012_SEL_CURRENT LOW
  1862. #define HLW8012_CURRENT_RATIO 25740
  1863. #define HLW8012_VOLTAGE_RATIO 313400
  1864. #define HLW8012_POWER_RATIO 3414290
  1865. #define HLW8012_INTERRUPT_ON FALLING
  1866. // -----------------------------------------------------------------------------
  1867. // TONBUX XS-SSA01
  1868. // -----------------------------------------------------------------------------
  1869. #elif defined(TONBUX_XSSSA01)
  1870. // Info
  1871. #define MANUFACTURER "TONBUX"
  1872. #define DEVICE "XSSSA01"
  1873. // Buttons
  1874. #define BUTTON1_PIN 4
  1875. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1876. #define BUTTON1_RELAY 1
  1877. // Relays
  1878. #define RELAY1_PIN 14
  1879. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1880. // LEDs
  1881. #define LED1_PIN 13
  1882. #define LED1_PIN_INVERSE 0
  1883. // -----------------------------------------------------------------------------
  1884. // TONBUX XS-SSA06
  1885. // -----------------------------------------------------------------------------
  1886. #elif defined(TONBUX_XSSSA06)
  1887. // Info
  1888. #define MANUFACTURER "TONBUX"
  1889. #define DEVICE "XSSSA06"
  1890. // Buttons
  1891. #define BUTTON1_PIN 13
  1892. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1893. #define BUTTON1_RELAY 1
  1894. // Relays
  1895. #define RELAY1_PIN 15
  1896. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1897. // LEDs
  1898. #define LED1_PIN 0 // R - 8 rgb led ring
  1899. #define LED1_PIN_INVERSE 0
  1900. #define LED2_PIN 5 // G
  1901. #define LED2_PIN_INVERSE 0
  1902. #define LED3_PIN 2 // B
  1903. #define LED3_PIN_INVERSE 0
  1904. // -----------------------------------------------------------------------------
  1905. // GREEN ESP8266 RELAY MODULE
  1906. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1907. // -----------------------------------------------------------------------------
  1908. #elif defined(GREEN_ESP8266RELAY)
  1909. // Info
  1910. #define MANUFACTURER "GREEN"
  1911. #define DEVICE "ESP8266RELAY"
  1912. // Buttons
  1913. // Not a button but input via Optocoupler
  1914. #define BUTTON1_PIN 5
  1915. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1916. #define BUTTON1_RELAY 1
  1917. // Relays
  1918. #define RELAY1_PIN 4
  1919. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1920. // LEDs
  1921. #define LED1_PIN 2
  1922. #define LED1_PIN_INVERSE 1
  1923. // -----------------------------------------------------------------------------
  1924. // Henrique Gravina ESPIKE
  1925. // https://github.com/Henriquegravina/Espike
  1926. // -----------------------------------------------------------------------------
  1927. #elif defined(IKE_ESPIKE)
  1928. #define MANUFACTURER "IKE"
  1929. #define DEVICE "ESPIKE"
  1930. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_NONE
  1931. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  1932. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  1933. #define BUTTON1_PIN 13
  1934. #define BUTTON1_RELAY 1
  1935. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1936. #define BUTTON2_PIN 12
  1937. #define BUTTON2_RELAY 2
  1938. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1939. #define BUTTON3_PIN 14
  1940. #define BUTTON3_RELAY 3
  1941. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1942. #define RELAY1_PIN 4
  1943. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1944. #define RELAY2_PIN 5
  1945. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1946. #define RELAY3_PIN 16
  1947. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1948. #define LED1_PIN 2
  1949. #define LED1_PIN_INVERSE 1
  1950. // -----------------------------------------------------------------------------
  1951. // SWIFITCH
  1952. // https://github.com/ArnieX/swifitch
  1953. // -----------------------------------------------------------------------------
  1954. #elif defined(ARNIEX_SWIFITCH)
  1955. // Info
  1956. #define MANUFACTURER "ARNIEX"
  1957. #define DEVICE "SWIFITCH"
  1958. // Buttons
  1959. #define BUTTON1_PIN 4 // D2
  1960. #define BUTTON1_CONFIG BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1961. #define BUTTON1_RELAY 1
  1962. #define BUTTON1_PRESS BUTTON_ACTION_NONE
  1963. #define BUTTON1_CLICK BUTTON_ACTION_TOGGLE
  1964. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  1965. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  1966. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_NONE
  1967. // Relays
  1968. #define RELAY1_PIN 5 // D1
  1969. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1970. // LEDs
  1971. #define LED1_PIN 12 // D6
  1972. #define LED1_PIN_INVERSE 1
  1973. // -----------------------------------------------------------------------------
  1974. // ESP-01S RELAY v4.0
  1975. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  1976. // -----------------------------------------------------------------------------
  1977. #elif defined(GENERIC_ESP01S_RELAY_V40)
  1978. // Info
  1979. #define MANUFACTURER "GENERIC"
  1980. #define DEVICE "ESP01S_RELAY_40"
  1981. // Relays
  1982. #define RELAY1_PIN 0
  1983. #ifndef RELAY1_TYPE
  1984. #define RELAY1_TYPE RELAY_TYPE_NORMAL // See #1504 and #1554
  1985. #endif
  1986. // LEDs
  1987. #define LED1_PIN 2
  1988. #define LED1_PIN_INVERSE 0
  1989. // -----------------------------------------------------------------------------
  1990. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  1991. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  1992. // -----------------------------------------------------------------------------
  1993. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  1994. // Info
  1995. #define MANUFACTURER "GENERIC"
  1996. #define DEVICE "ESP01S_RGBLED_10"
  1997. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  1998. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  1999. // Buttons
  2000. //#define BUTTON1_PIN 2
  2001. // Relays
  2002. //#define RELAY1_PIN 2
  2003. // LEDs
  2004. #define LED1_PIN 2
  2005. #define LED1_PIN_INVERSE 0
  2006. // -----------------------------------------------------------------------------
  2007. // ESP-01S DHT11 v1.0
  2008. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  2009. // -----------------------------------------------------------------------------
  2010. #elif defined(GENERIC_ESP01S_DHT11_V10)
  2011. // Info
  2012. #define MANUFACTURER "GENERIC"
  2013. #define DEVICE "ESP01S_DHT11_10"
  2014. // DHT11
  2015. #ifndef DHT_SUPPORT
  2016. #define DHT_SUPPORT 1
  2017. #endif
  2018. #define DHT_PIN 2
  2019. #define DHT_TYPE DHT_CHIP_DHT11
  2020. // -----------------------------------------------------------------------------
  2021. // ESP-01S DS18B20 v1.0
  2022. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  2023. // -----------------------------------------------------------------------------
  2024. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  2025. // Info
  2026. #define MANUFACTURER "GENERIC"
  2027. #define DEVICE "ESP01S_DS18B20_10"
  2028. // DB18B20
  2029. #ifndef DALLAS_SUPPORT
  2030. #define DALLAS_SUPPORT 1
  2031. #endif
  2032. #define DALLAS_PIN 2
  2033. // -----------------------------------------------------------------------------
  2034. // ESP-DIN relay board V1
  2035. // https://github.com/pilotak/esp_din
  2036. // -----------------------------------------------------------------------------
  2037. #elif defined(PILOTAK_ESP_DIN_V1)
  2038. // Info
  2039. #define MANUFACTURER "PILOTAK"
  2040. #define DEVICE "ESP_DIN_V1"
  2041. // Buttons
  2042. #define BUTTON1_PIN 0
  2043. #define BUTTON1_RELAY 1
  2044. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2045. // Relays
  2046. #define RELAY1_PIN 4
  2047. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2048. #define RELAY2_PIN 5
  2049. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2050. // LEDs
  2051. #define LED1_PIN 15
  2052. #define LED1_PIN_INVERSE 0
  2053. #define I2C_SDA_PIN 12
  2054. #define I2C_SCL_PIN 13
  2055. #ifndef DALLAS_SUPPORT
  2056. #define DALLAS_SUPPORT 1
  2057. #endif
  2058. #define DALLAS_PIN 2
  2059. #define RF_SUPPORT 1
  2060. #define RFB_DIRECT 1
  2061. #define RFB_RX_PIN 14
  2062. #ifndef DIGITAL_SUPPORT
  2063. #define DIGITAL_SUPPORT 1
  2064. #endif
  2065. #define DIGITAL1_PIN 16
  2066. #define DIGITAL1_PIN_MODE INPUT
  2067. #define DIGITAL1_DEFAULT_STATE 0
  2068. // -----------------------------------------------------------------------------
  2069. // Heltec Touch Relay
  2070. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  2071. // -----------------------------------------------------------------------------
  2072. #elif defined(HELTEC_TOUCHRELAY)
  2073. // Info
  2074. #define MANUFACTURER "HELTEC"
  2075. #define DEVICE "TOUCH_RELAY"
  2076. // Buttons
  2077. #define BUTTON1_PIN 14
  2078. #define BUTTON1_RELAY 1
  2079. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON
  2080. // Relays
  2081. #define RELAY1_PIN 12
  2082. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2083. // -----------------------------------------------------------------------------
  2084. // Zhilde ZLD-EU44-W
  2085. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  2086. // -----------------------------------------------------------------------------
  2087. #elif defined(ZHILDE_EU44_W)
  2088. // Info
  2089. #define MANUFACTURER "ZHILDE"
  2090. #define DEVICE "EU44_W"
  2091. // Based on the reporter, this product uses GPIO1 and 3 for the button
  2092. // and onboard LED, so hardware serial should be disabled...
  2093. #define DEBUG_SERIAL_SUPPORT 0
  2094. // Buttons
  2095. #define BUTTON1_PIN 3
  2096. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2097. // Relays
  2098. #define RELAY1_PIN 5
  2099. #define RELAY2_PIN 4
  2100. #define RELAY3_PIN 12
  2101. #define RELAY4_PIN 13
  2102. #define RELAY5_PIN 14
  2103. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2104. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2105. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2106. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2107. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  2108. // LEDs
  2109. #define LED1_PIN 1
  2110. #define LED1_PIN_INVERSE 1
  2111. // -----------------------------------------------------------------------------
  2112. // Allnet 4duino ESP8266-UP-Relais
  2113. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  2114. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  2115. // -----------------------------------------------------------------------------
  2116. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  2117. // Info
  2118. #define MANUFACTURER "ALLNET"
  2119. #define DEVICE "4DUINO_IOT_WLAN_RELAIS"
  2120. // Relays
  2121. #define RELAY1_PIN 14
  2122. #define RELAY1_RESET_PIN 12
  2123. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  2124. // LEDs
  2125. #define LED1_PIN 0
  2126. #define LED1_PIN_INVERSE 1
  2127. // Buttons
  2128. //#define BUTTON1_PIN 0
  2129. //#define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2130. // Using pins labelled as SDA & SCL as buttons
  2131. #define BUTTON2_PIN 4
  2132. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON
  2133. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  2134. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  2135. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  2136. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  2137. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_NONE
  2138. #define BUTTON3_PIN 5
  2139. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON
  2140. // Using pins labelled as SDA & SCL for I2C
  2141. //#define I2C_SDA_PIN 4
  2142. //#define I2C_SCL_PIN 5
  2143. // -----------------------------------------------------------------------------
  2144. // Luani HVIO
  2145. // https://luani.de/projekte/esp8266-hvio/
  2146. // https://luani.de/blog/esp8266-230v-io-modul/
  2147. // -----------------------------------------------------------------------------
  2148. #elif defined(LUANI_HVIO)
  2149. // Info
  2150. #define MANUFACTURER "LUANI"
  2151. #define DEVICE "HVIO"
  2152. // Buttons
  2153. #define BUTTON1_PIN 12
  2154. #define BUTTON1_RELAY 1
  2155. #define BUTTON1_CONFIG BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  2156. #define BUTTON1_PRESS BUTTON_ACTION_NONE
  2157. #define BUTTON1_CLICK BUTTON_ACTION_TOGGLE
  2158. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  2159. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  2160. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_NONE
  2161. #define BUTTON2_PIN 13
  2162. #define BUTTON2_RELAY 2
  2163. #define BUTTON2_CONFIG BUTTON_SWITCH | BUTTON_DEFAULT_HIGH //Hardware Pullup
  2164. #define BUTTON2_CLICK BUTTON_ACTION_TOGGLE
  2165. // Relays
  2166. #define RELAY1_PIN 4
  2167. #define RELAY2_PIN 5
  2168. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2169. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2170. // LEDs
  2171. #define LED1_PIN 15
  2172. #define LED1_PIN_INVERSE 0
  2173. // -----------------------------------------------------------------------------
  2174. // Tonbux 50-100M Smart Mosquito Killer USB
  2175. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  2176. // -----------------------------------------------------------------------------
  2177. #elif defined(TONBUX_MOSQUITO_KILLER)
  2178. // Info
  2179. #define MANUFACTURER "TONBUX"
  2180. #define DEVICE "MOSQUITO_KILLER"
  2181. // Buttons
  2182. #define BUTTON1_PIN 2
  2183. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2184. #define BUTTON1_RELAY 1
  2185. // Relays
  2186. #define RELAY1_PIN 5 // not a relay, fan
  2187. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2188. // LEDs
  2189. #define LED1_PIN 15 // blue led
  2190. #define LED1_PIN_INVERSE 1
  2191. #define LED1_MODE LED_MODE_WIFI
  2192. #define LED2_PIN 14 // red led
  2193. #define LED2_PIN_INVERSE 1
  2194. #define LED2_MODE LED_MODE_RELAY
  2195. #define LED3_PIN 12 // UV leds (1-2-3-4-5-6-7-8)
  2196. #define LED3_PIN_INVERSE 0
  2197. #define LED3_RELAY 1
  2198. #define LED4_PIN 16 // UV leds (9-10-11)
  2199. #define LED4_PIN_INVERSE 0
  2200. #define LED4_RELAY 1
  2201. // -----------------------------------------------------------------------------
  2202. // Avatto NAS-WR01W Wifi Smart Power Plug
  2203. // https://www.aliexpress.com/item/33011753732.html
  2204. // https://todo...
  2205. // -----------------------------------------------------------------------------
  2206. #elif defined(AVATTO_NAS_WR01W)
  2207. // Info
  2208. #define MANUFACTURER "AVATTO"
  2209. #define DEVICE "NAS_WR01W"
  2210. // Buttons
  2211. #define BUTTON1_PIN 0
  2212. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2213. #define BUTTON1_RELAY 1
  2214. // Relays
  2215. #define RELAY1_PIN 14
  2216. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2217. // LEDs
  2218. #define LED1_PIN 13
  2219. #define LED1_PIN_INVERSE 1
  2220. // HJL01 / BL0937
  2221. #ifndef HLW8012_SUPPORT
  2222. #define HLW8012_SUPPORT 1
  2223. #endif
  2224. #define HLW8012_SEL_PIN 12
  2225. #define HLW8012_CF1_PIN 5
  2226. #define HLW8012_CF_PIN 4
  2227. #define HLW8012_SEL_CURRENT LOW
  2228. #define HLW8012_CURRENT_RATIO 25740
  2229. #define HLW8012_VOLTAGE_RATIO 313400
  2230. #define HLW8012_POWER_RATIO 3414290
  2231. #define HLW8012_INTERRUPT_ON FALLING
  2232. // -----------------------------------------------------------------------------
  2233. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  2234. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  2235. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  2236. // -----------------------------------------------------------------------------
  2237. #elif defined(NEO_COOLCAM_NAS_WR01W)
  2238. // Info
  2239. #define MANUFACTURER "NEO_COOLCAM"
  2240. #define DEVICE "NAS_WR01W"
  2241. // Buttons
  2242. #define BUTTON1_PIN 13
  2243. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2244. #define BUTTON1_RELAY 1
  2245. // Relays
  2246. #define RELAY1_PIN 12
  2247. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2248. // LEDs
  2249. #define LED1_PIN 4
  2250. #define LED1_PIN_INVERSE 1
  2251. // -----------------------------------------------------------------------------
  2252. // Deltaco SH_P01 Wifi Smart Power Plug
  2253. // -----------------------------------------------------------------------------
  2254. #elif defined(DELTACO_SH_P01)
  2255. // Info
  2256. #define MANUFACTURER "DELTACO"
  2257. #define DEVICE "SH_P01"
  2258. // Buttons
  2259. #define BUTTON1_PIN 13
  2260. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2261. #define BUTTON1_RELAY 1
  2262. // Relays
  2263. #define RELAY1_PIN 12
  2264. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2265. // LEDs
  2266. #define LED1_PIN 5
  2267. #define LED1_PIN_INVERSE 1
  2268. #define LED1_MODE LED_MODE_FINDME
  2269. // ------------------------------------------------------------------------------
  2270. // DELTACO_SH_P03USB Wifi Smart Power Plug
  2271. // -----------------------------------------------------------------------------
  2272. #elif defined(DELTACO_SH_P03USB)
  2273. // Info
  2274. #define MANUFACTURER "DELTACO"
  2275. #define DEVICE "SH_P03USB"
  2276. // Buttons
  2277. #define BUTTON1_PIN 13
  2278. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2279. #define BUTTON1_RELAY 2
  2280. // Relays
  2281. #define RELAY1_PIN 15 // USB power
  2282. #define RELAY2_PIN 12 // power plug 1
  2283. #define RELAY3_PIN 14 // power plug 2
  2284. #define RELAY4_PIN 5 // power plug 3
  2285. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2286. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2287. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2288. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2289. // LEDs
  2290. #define LED1_PIN 0 // power led
  2291. #define LED1_PIN_INVERSE 1
  2292. #define LED1_MODE LED_MODE_FINDME
  2293. // ------------------------------------------------------------------------------
  2294. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  2295. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  2296. // Also: Estink Wifi Power Strip
  2297. // -----------------------------------------------------------------------------
  2298. #elif defined(FORNORM_ZLD_34EU)
  2299. // Info
  2300. #define MANUFACTURER "FORNORM"
  2301. #define DEVICE "ZLD_34EU"
  2302. // Disable UART noise since this board uses GPIO3
  2303. #define DEBUG_SERIAL_SUPPORT 0
  2304. // Buttons
  2305. #define BUTTON1_PIN 16
  2306. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2307. #define BUTTON1_RELAY 4
  2308. // Relays
  2309. #define RELAY1_PIN 14 // USB power
  2310. #define RELAY2_PIN 13 // power plug 1
  2311. #define RELAY3_PIN 4 // power plug 2
  2312. #define RELAY4_PIN 15 // power plug 3
  2313. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2314. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2315. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  2316. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  2317. // LEDs
  2318. #define LED1_PIN 0 // power led
  2319. #define LED2_PIN 12 // power plug 1
  2320. #define LED3_PIN 3 // power plug 2
  2321. #define LED4_PIN 5 // power plug 3
  2322. #define LED1_PIN_INVERSE 1
  2323. #define LED2_PIN_INVERSE 1
  2324. #define LED3_PIN_INVERSE 1
  2325. #define LED4_PIN_INVERSE 1
  2326. #define LED1_MODE LED_MODE_FINDME
  2327. #define LED2_MODE LED_MODE_FOLLOW
  2328. #define LED3_MODE LED_MODE_FOLLOW
  2329. #define LED4_MODE LED_MODE_FOLLOW
  2330. #define LED2_RELAY 2
  2331. #define LED3_RELAY 3
  2332. #define LED4_RELAY 4
  2333. // -----------------------------------------------------------------------------
  2334. // Bruno Horta's OnOfre
  2335. // https://www.bhonofre.pt/
  2336. // https://github.com/brunohorta82/BH_OnOfre/
  2337. // -----------------------------------------------------------------------------
  2338. #elif defined(BH_ONOFRE)
  2339. // Info
  2340. #define MANUFACTURER "BH"
  2341. #define DEVICE "ONOFRE"
  2342. // Buttons
  2343. #define BUTTON1_PIN 12
  2344. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2345. #define BUTTON1_RELAY 1
  2346. #define BUTTON2_PIN 13
  2347. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2348. #define BUTTON2_RELAY 2
  2349. // Relays
  2350. #define RELAY1_PIN 4
  2351. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2352. #define RELAY2_PIN 5
  2353. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2354. // -----------------------------------------------------------------------------
  2355. // BlitzWolf SHP2 and SHP6
  2356. // Also several boards under different names uing a power chip labelled BL0937 or HJL-01
  2357. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  2358. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  2359. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  2360. // * Gosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  2361. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  2362. // * DIY Tech Smart Home (https://www.amazon.es/gp/product/B07HHKXYS9)
  2363. // -----------------------------------------------------------------------------
  2364. #elif defined(BLITZWOLF_BWSHPX)
  2365. // Info
  2366. #define MANUFACTURER "BLITZWOLF"
  2367. #define DEVICE "BWSHPX"
  2368. // Buttons
  2369. #define BUTTON1_PIN 13
  2370. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2371. #define BUTTON1_RELAY 1
  2372. // Relays
  2373. #define RELAY1_PIN 15
  2374. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2375. // LEDs
  2376. #define LED1_PIN 2
  2377. #define LED1_PIN_INVERSE 1
  2378. #define LED2_PIN 0
  2379. #define LED2_PIN_INVERSE 1
  2380. #define LED2_MODE LED_MODE_FINDME
  2381. #define LED2_RELAY 1
  2382. // HJL01 / BL0937
  2383. #ifndef HLW8012_SUPPORT
  2384. #define HLW8012_SUPPORT 1
  2385. #endif
  2386. #define HLW8012_SEL_PIN 12
  2387. #define HLW8012_CF1_PIN 14
  2388. #define HLW8012_CF_PIN 5
  2389. #define HLW8012_SEL_CURRENT LOW
  2390. #define HLW8012_CURRENT_RATIO 25740
  2391. #define HLW8012_VOLTAGE_RATIO 313400
  2392. #define HLW8012_POWER_RATIO 3414290
  2393. #define HLW8012_INTERRUPT_ON FALLING
  2394. // -----------------------------------------------------------------------------
  2395. // Same as the above but new board version marked V2.3
  2396. // BlitzWolf SHP2 V2.3
  2397. // Gosund SP1 V2.3
  2398. // -----------------------------------------------------------------------------
  2399. #elif defined(BLITZWOLF_BWSHPX_V23)
  2400. // Info
  2401. #define MANUFACTURER "BLITZWOLF"
  2402. #define DEVICE "BWSHPX_V23"
  2403. // Buttons
  2404. #define BUTTON1_PIN 3
  2405. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2406. #define BUTTON1_RELAY 1
  2407. // Relays
  2408. #define RELAY1_PIN 14
  2409. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2410. // LEDs
  2411. #define LED1_PIN 1
  2412. #define LED1_PIN_INVERSE 1
  2413. #define LED2_PIN 13
  2414. #define LED2_PIN_INVERSE 1
  2415. #define LED2_MODE LED_MODE_FINDME
  2416. #define LED2_RELAY 1
  2417. // HJL01 / BL0937
  2418. #ifndef HLW8012_SUPPORT
  2419. #define HLW8012_SUPPORT 1
  2420. #endif
  2421. #define HLW8012_SEL_PIN 12
  2422. #define HLW8012_CF1_PIN 5
  2423. #define HLW8012_CF_PIN 4
  2424. #define HLW8012_SEL_CURRENT LOW
  2425. #define HLW8012_CURRENT_RATIO 25740
  2426. #define HLW8012_VOLTAGE_RATIO 313400
  2427. #define HLW8012_POWER_RATIO 3414290
  2428. #define HLW8012_INTERRUPT_ON FALLING
  2429. // BUTTON1 and LED1 are using Serial pins
  2430. #define DEBUG_SERIAL_SUPPORT 0
  2431. // -----------------------------------------------------------------------------
  2432. // Similar to both devices above but also with switchable USB ports
  2433. // and other sensor (CSE7766).
  2434. // the pin layout is different to the above two versions
  2435. // BlitzWolf SHP5
  2436. // -----------------------------------------------------------------------------
  2437. #elif defined(BLITZWOLF_BWSHP5)
  2438. // Info
  2439. #define MANUFACTURER "BLITZWOLF"
  2440. #define DEVICE "BWSHP5"
  2441. // Buttons
  2442. #define BUTTON1_PIN 16
  2443. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2444. #define BUTTON1_RELAY 1
  2445. // Relays
  2446. // Power plug
  2447. #define RELAY1_PIN 14
  2448. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2449. // USB
  2450. #define RELAY2_PIN 5
  2451. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2452. // LEDs
  2453. #define LED1_PIN 2
  2454. #define LED1_PIN_INVERSE 1
  2455. #define LED2_PIN 0
  2456. #define LED2_PIN_INVERSE 1
  2457. #define LED2_MODE LED_MODE_FINDME
  2458. #define LED2_RELAY 1
  2459. // Disable UART noise
  2460. #define DEBUG_SERIAL_SUPPORT 0
  2461. // CSE7766
  2462. #ifndef CSE7766_SUPPORT
  2463. #define CSE7766_SUPPORT 1
  2464. #endif
  2465. #define CSE7766_PIN 1
  2466. // -----------------------------------------------------------------------------
  2467. // Teckin SP21
  2468. // -----------------------------------------------------------------------------
  2469. #elif defined(TECKIN_SP21)
  2470. // Info
  2471. #define MANUFACTURER "TECKIN"
  2472. #define DEVICE "SP21"
  2473. // Buttons
  2474. #define BUTTON1_PIN 13
  2475. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2476. #define BUTTON1_RELAY 1
  2477. // Relays
  2478. #define RELAY1_PIN 15
  2479. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2480. // LEDs
  2481. #define LED1_PIN 2
  2482. #define LED1_PIN_INVERSE 1
  2483. // -----------------------------------------------------------------------------
  2484. // Teckin SP22 v1.4 - v1.6
  2485. // -----------------------------------------------------------------------------
  2486. #elif defined(TECKIN_SP22_V14)
  2487. // Info
  2488. #define MANUFACTURER "TECKIN"
  2489. #define DEVICE "SP22_V14"
  2490. // Buttons
  2491. #define BUTTON1_PIN 1
  2492. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2493. #define BUTTON1_RELAY 1
  2494. // Relays
  2495. #define RELAY1_PIN 14
  2496. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2497. // LEDs
  2498. #define LED1_PIN 3
  2499. #define LED1_PIN_INVERSE 1
  2500. #define LED2_PIN 13
  2501. #define LED2_PIN_INVERSE 1
  2502. #define LED2_MODE LED_MODE_FINDME
  2503. #define LED2_RELAY 1
  2504. // HJL01 / BL0937
  2505. #ifndef HLW8012_SUPPORT
  2506. #define HLW8012_SUPPORT 1
  2507. #endif
  2508. #define HLW8012_SEL_PIN 12
  2509. #define HLW8012_CF1_PIN 5
  2510. #define HLW8012_CF_PIN 4
  2511. #define HLW8012_SEL_CURRENT LOW
  2512. #define HLW8012_CURRENT_RATIO 20730
  2513. #define HLW8012_VOLTAGE_RATIO 264935
  2514. #define HLW8012_POWER_RATIO 2533110
  2515. #define HLW8012_INTERRUPT_ON FALLING
  2516. // BUTTON1 and LED1 are using Serial pins
  2517. #define DEBUG_SERIAL_SUPPORT 0
  2518. // -----------------------------------------------------------------------------
  2519. // Teckin SP22 v1.4 - v1.6
  2520. //
  2521. // NB Notes suggest that energy monitoring is removed from later versions
  2522. // -----------------------------------------------------------------------------
  2523. #elif defined(TECKIN_SP23_V13)
  2524. // Info .. NB Newer versions apparently lack energy monitor
  2525. // The board revision is not indicated externally
  2526. #define MANUFACTURER "TECKIN"
  2527. #define DEVICE "SP23_V13"
  2528. // Buttons
  2529. #define BUTTON1_PIN 13
  2530. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2531. #define BUTTON1_RELAY 1
  2532. // Relays
  2533. #define RELAY1_PIN 15
  2534. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2535. // LEDs
  2536. #define LED1_PIN 4
  2537. #define LED1_PIN_INVERSE 1
  2538. #define LED2_PIN 2
  2539. #define LED2_PIN_INVERSE 0
  2540. #define LED2_MODE LED_MODE_FINDME
  2541. #define LED2_RELAY 1
  2542. // HJL01 / BL0937
  2543. #ifndef HLW8012_SUPPORT
  2544. #define HLW8012_SUPPORT 1
  2545. #endif
  2546. #define HLW8012_SEL_PIN 12
  2547. #define HLW8012_CF1_PIN 14
  2548. #define HLW8012_CF_PIN 5
  2549. #define HLW8012_SEL_CURRENT LOW
  2550. #define HLW8012_CURRENT_RATIO 23324
  2551. #define HLW8012_VOLTAGE_RATIO 324305
  2552. #define HLW8012_POWER_RATIO 3580841
  2553. #define HLW8012_INTERRUPT_ON FALLING
  2554. // -----------------------------------------------------------------------------
  2555. // The Gosund WP3 is based on ESP8285, so 1 MB internal flash (DOUT required)
  2556. // The module has no-connect: TX, RX, RST, AD, GPIO5, (and GPIO0,
  2557. // GPIO2 via test points on the back of the module)
  2558. // and these are wired to devices:
  2559. // GPIO4: /BTN
  2560. // GPIO12: /LED red
  2561. // GPIO13: /LED blue
  2562. // GPIO14: RELAY
  2563. // -----------------------------------------------------------------------------
  2564. #elif defined(GOSUND_WP3)
  2565. // Info
  2566. #define MANUFACTURER "GOSUND"
  2567. #define DEVICE "WP3"
  2568. // Buttons
  2569. #define BUTTON1_PIN 4
  2570. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2571. #define BUTTON1_RELAY 1
  2572. // the defaults are reasonable, but you can change them as desired
  2573. //#define BUTTON1_PRESS BUTTON_ACTION_NONE
  2574. //#define BUTTON1_CLICK BUTTON_ACTION_TOGGLE
  2575. //#define BUTTON1_DBLCLICK BUTTON_ACTION_AP
  2576. //#define BUTTON1_LNGCLICK BUTTON_ACTION_RESET
  2577. //#define BUTTON1_LNGLNGCLICK BUTTON_ACTION_FACTORY
  2578. // Relays
  2579. #define RELAY1_PIN 14
  2580. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2581. // LEDs
  2582. // LED1 (red) indicates on/off state; you could use LED_MODE_FOLLOW_INVERSE
  2583. // so that the LED lights the button when 'off' so it can be found easily.
  2584. #define LED1_PIN 12
  2585. #define LED1_PIN_INVERSE 1
  2586. #define LED1_MODE LED_MODE_FOLLOW
  2587. #define LED1_RELAY 1
  2588. // LED2 (blue) indicates wifi activity
  2589. #define LED2_PIN 13
  2590. #define LED2_PIN_INVERSE 1
  2591. #define LED2_MODE LED_MODE_WIFI
  2592. // -----------------------------------------------------------------------------
  2593. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  2594. // Also model number KS-602S
  2595. // -----------------------------------------------------------------------------
  2596. #elif defined(GOSUND_WS1)
  2597. // Info
  2598. #define MANUFACTURER "GOSUND"
  2599. #define DEVICE "WS1"
  2600. // Buttons
  2601. #define BUTTON1_PIN 0
  2602. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2603. #define BUTTON1_RELAY 1
  2604. // Relays
  2605. #define RELAY1_PIN 14
  2606. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2607. // LEDs
  2608. #define LED1_PIN 1
  2609. #define LED1_PIN_INVERSE 1
  2610. // LED1 is using TX pin
  2611. #define DEBUG_SERIAL_SUPPORT 0
  2612. // ----------------------------------------------------------------------------------------
  2613. // Homecube 16A is similar but some pins differ and it also has RGB LEDs
  2614. // https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
  2615. // ----------------------------------------------------------------------------------------
  2616. #elif defined(HOMECUBE_16A)
  2617. // Info
  2618. #define MANUFACTURER "HOMECUBE"
  2619. #define DEVICE "16A"
  2620. // Buttons
  2621. #define BUTTON1_PIN 13
  2622. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2623. #define BUTTON1_RELAY 1
  2624. // Relays
  2625. #define RELAY1_PIN 15
  2626. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2627. // LEDs
  2628. //LED Pin 4 - ESP8266 onboard LED
  2629. //Red LED: 0
  2630. //Green LED: 12
  2631. //Blue LED: 2
  2632. // Blue
  2633. #define LED1_PIN 2
  2634. #define LED1_PIN_INVERSE 0
  2635. // Green
  2636. #define LED2_PIN 12
  2637. #define LED2_PIN_INVERSE 1
  2638. #define LED2_MODE LED_MODE_RELAY
  2639. // Red
  2640. #define LED3_PIN 0
  2641. #define LED3_PIN_INVERSE 0
  2642. #define LED3_MODE LED_MODE_OFF
  2643. // HJL01 / BL0937
  2644. #ifndef HLW8012_SUPPORT
  2645. #define HLW8012_SUPPORT 1
  2646. #endif
  2647. #define HLW8012_SEL_PIN 16
  2648. #define HLW8012_CF1_PIN 14
  2649. #define HLW8012_CF_PIN 5
  2650. #define HLW8012_SEL_CURRENT LOW
  2651. #define HLW8012_CURRENT_RATIO 25740
  2652. #define HLW8012_VOLTAGE_RATIO 313400
  2653. #define HLW8012_POWER_RATIO 3414290
  2654. #define HLW8012_INTERRUPT_ON FALLING
  2655. // -----------------------------------------------------------------------------
  2656. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  2657. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  2658. // -----------------------------------------------------------------------------
  2659. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  2660. // Info
  2661. #define MANUFACTURER "VANZAVANZU"
  2662. #define DEVICE "SMART_WIFI_PLUG_MINI"
  2663. // Buttons
  2664. #define BUTTON1_PIN 13
  2665. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2666. #define BUTTON1_RELAY 1
  2667. // Relays
  2668. #define RELAY1_PIN 15
  2669. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2670. // LEDs
  2671. #define LED1_PIN 2
  2672. #define LED1_PIN_INVERSE 1
  2673. #define LED2_PIN 0
  2674. #define LED2_PIN_INVERSE 1
  2675. #define LED2_MODE LED_MODE_FINDME
  2676. #define LED2_RELAY 1
  2677. // Disable UART noise
  2678. #define DEBUG_SERIAL_SUPPORT 0
  2679. // HJL01 / BL0937
  2680. #ifndef HLW8012_SUPPORT
  2681. #define HLW8012_SUPPORT 1
  2682. #endif
  2683. #define HLW8012_SEL_PIN 3
  2684. #define HLW8012_CF1_PIN 14
  2685. #define HLW8012_CF_PIN 5
  2686. #define HLW8012_SEL_CURRENT LOW
  2687. #define HLW8012_CURRENT_RATIO 25740
  2688. #define HLW8012_VOLTAGE_RATIO 313400
  2689. #define HLW8012_POWER_RATIO 3414290
  2690. #define HLW8012_INTERRUPT_ON FALLING
  2691. // -----------------------------------------------------------------------------
  2692. #elif defined(GENERIC_AG_L4)
  2693. // Info
  2694. #define MANUFACTURER "GENERIC"
  2695. #define DEVICE "AG_L4"
  2696. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2697. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2698. #define DUMMY_RELAY_COUNT 1
  2699. // button 1: "power" button
  2700. #define BUTTON1_PIN 4
  2701. #define BUTTON1_RELAY 1
  2702. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  2703. #define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
  2704. #define BUTTON1_CLICK BUTTON_ACTION_NONE
  2705. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  2706. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  2707. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET
  2708. // button 2: "wifi" button
  2709. #define BUTTON2_PIN 2
  2710. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2711. #define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
  2712. #define BUTTON2_CLICK BUTTON_ACTION_NONE
  2713. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  2714. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  2715. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_NONE
  2716. // LEDs
  2717. #define LED1_PIN 5 // red status led
  2718. #define LED1_PIN_INVERSE 0
  2719. #define LED2_PIN 16 // master light power
  2720. #define LED2_PIN_INVERSE 1
  2721. #define LED2_MODE LED_MODE_RELAY
  2722. // Light
  2723. #define LIGHT_CHANNELS 3
  2724. #define LIGHT_CH1_PIN 14 // RED
  2725. #define LIGHT_CH2_PIN 13 // GREEN
  2726. #define LIGHT_CH3_PIN 12 // BLUE
  2727. // -----------------------------------------------------------------------------
  2728. #elif defined(ALLTERCO_SHELLY1)
  2729. // Info
  2730. #define MANUFACTURER "ALLTERCO"
  2731. #define DEVICE "SHELLY1"
  2732. // Buttons
  2733. #define BUTTON1_PIN 5
  2734. #define BUTTON1_CONFIG BUTTON_SWITCH
  2735. #define BUTTON1_RELAY 1
  2736. // Relays
  2737. #define RELAY1_PIN 4
  2738. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2739. #elif defined(ALLTERCO_SHELLY2)
  2740. // Info
  2741. #define MANUFACTURER "ALLTERCO"
  2742. #define DEVICE "SHELLY2"
  2743. // Buttons
  2744. #define BUTTON1_PIN 12
  2745. #define BUTTON2_PIN 14
  2746. #define BUTTON1_CONFIG BUTTON_SWITCH
  2747. #define BUTTON2_CONFIG BUTTON_SWITCH
  2748. #define BUTTON1_RELAY 1
  2749. #define BUTTON2_RELAY 2
  2750. // Relays
  2751. #define RELAY1_PIN 4
  2752. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2753. #define RELAY2_PIN 5
  2754. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2755. #elif defined(ALLTERCO_SHELLY1PM)
  2756. // Info
  2757. #define MANUFACTURER "ALLTERCO"
  2758. #define DEVICE "SHELLY1PM"
  2759. // Buttons
  2760. #define BUTTON1_PIN 4
  2761. #define BUTTON1_CONFIG BUTTON_SWITCH
  2762. #define BUTTON1_RELAY 1
  2763. #define BUTTON2_PIN 2
  2764. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2765. #define BUTTON2_LNGCLICK BUTTON_ACTION_RESET
  2766. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_FACTORY
  2767. // Relays
  2768. #define RELAY1_PIN 15
  2769. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2770. // Light
  2771. #define LED1_PIN 0
  2772. #define LED1_PIN_INVERSE 1
  2773. // HJL01 / BL0937
  2774. #define HLW8012_SUPPORT 1
  2775. #define HLW8012_SEL_PIN 12
  2776. #define HLW8012_CF1_PIN 13
  2777. #define HLW8012_CF_PIN 5
  2778. #define HLW8012_SEL_CURRENT LOW
  2779. #define HLW8012_CURRENT_RATIO 25740
  2780. #define HLW8012_VOLTAGE_RATIO 313400
  2781. #define HLW8012_POWER_RATIO 3414290
  2782. #define HLW8012_INTERRUPT_ON FALLING
  2783. //Temperature
  2784. #define NTC_SUPPORT 1
  2785. #define SENSOR_SUPPORT 1
  2786. #define NTC_BETA 3350
  2787. #define NTC_R_UP 10000
  2788. #define NTC_R_DOWN 0
  2789. #define NTC_R0 8000
  2790. #elif defined(ALLTERCO_SHELLY25)
  2791. // Info
  2792. #define MANUFACTURER "ALLTERCO"
  2793. #define DEVICE "SHELLY25"
  2794. // Buttons
  2795. #define BUTTON1_PIN 13
  2796. #define BUTTON1_CONFIG BUTTON_SWITCH
  2797. #define BUTTON1_RELAY 1
  2798. #define BUTTON2_PIN 5
  2799. #define BUTTON2_CONFIG BUTTON_SWITCH
  2800. #define BUTTON2_RELAY 2
  2801. #define BUTTON3_PIN 2
  2802. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  2803. #define BUTTON3_LNGCLICK BUTTON_ACTION_RESET
  2804. #define BUTTON3_LNGLNGCLICK BUTTON_ACTION_FACTORY
  2805. // Relays
  2806. #define RELAY1_PIN 4
  2807. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  2808. #define RELAY2_PIN 15
  2809. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  2810. // Light
  2811. #define LED1_PIN 0
  2812. #define LED1_PIN_INVERSE 1
  2813. //Temperature
  2814. #define NTC_SUPPORT 1
  2815. #define SENSOR_SUPPORT 1
  2816. #define NTC_BETA 3350
  2817. #define NTC_R_UP 10000
  2818. #define NTC_R_DOWN 0
  2819. #define NTC_R0 8000
  2820. //Current
  2821. #define ADE7953_SUPPORT 1
  2822. #define I2C_SDA_PIN 12
  2823. #define I2C_SCL_PIN 14
  2824. // -----------------------------------------------------------------------------
  2825. // also works with https://www.amazon.com/gp/product/B07TMY394G/
  2826. // see https://github.com/xoseperez/espurna/issues/2055
  2827. #elif defined(LOHAS_E27_9W)
  2828. // Info
  2829. #define MANUFACTURER "LOHAS"
  2830. #define DEVICE "E27_9W"
  2831. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2832. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2833. #define DUMMY_RELAY_COUNT 1
  2834. // Light
  2835. #define LIGHT_CHANNELS 5
  2836. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2837. #define MY92XX_CHIPS 2
  2838. #define MY92XX_DI_PIN 13
  2839. #define MY92XX_DCKI_PIN 15
  2840. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2841. #define MY92XX_MAPPING 0, 1, 2, 3, 4
  2842. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  2843. // https://www.amazon.com/gp/product/B07T7W7ZMW
  2844. #elif defined(LOHAS_E26_A19)
  2845. // Info
  2846. #define MANUFACTURER "LOHAS"
  2847. #define DEVICE "E26_A19"
  2848. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2849. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2850. #define DUMMY_RELAY_COUNT 1
  2851. // Light
  2852. #define LIGHT_CHANNELS 5
  2853. #define LIGHT_CH1_PIN 5 // RED
  2854. #define LIGHT_CH2_PIN 4 // GREEN
  2855. #define LIGHT_CH3_PIN 13 // BLUE
  2856. #define LIGHT_CH4_PIN 14 // WHITE1
  2857. #define LIGHT_CH5_PIN 12 // WHITE1
  2858. // -----------------------------------------------------------------------------
  2859. #elif defined(TECKIN_SB53)
  2860. // Info
  2861. #define MANUFACTURER "TECKIN"
  2862. #define DEVICE "SB53"
  2863. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2864. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2865. #define DUMMY_RELAY_COUNT 1
  2866. // Light
  2867. #define LIGHT_CHANNELS 5
  2868. #define LIGHT_CH1_PIN 4 // RED
  2869. #define LIGHT_CH2_PIN 12 // GREEN
  2870. #define LIGHT_CH3_PIN 14 // BLUE
  2871. #define LIGHT_CH4_PIN 13 // WARM WHITE
  2872. #define LIGHT_CH5_PIN 5 // COLD WHITE
  2873. // -----------------------------------------------------------------------------
  2874. #elif defined(XIAOMI_SMART_DESK_LAMP)
  2875. // Info
  2876. #define MANUFACTURER "XIAOMI"
  2877. #define DEVICE "SMART_DESK_LAMP"
  2878. // Buttons
  2879. #define BUTTON1_PIN 2
  2880. #define BUTTON2_PIN 14
  2881. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2882. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  2883. // This button doubles as switch here and as encoder mode switch below
  2884. // Clicking it (for less than 500ms) will turn the light on and off
  2885. // Double and Long clicks will not work as these are used to modify the encoder action
  2886. #define BUTTON1_RELAY 1
  2887. #define BUTTON_LNGCLICK_DELAY 500
  2888. #define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
  2889. #define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
  2890. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_NONE
  2891. // Hidden button will enter AP mode if dblclick and reset the device when long-long-clicked
  2892. #define BUTTON2_DBLCLICK BUTTON_ACTION_AP
  2893. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_RESET
  2894. // Light
  2895. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2896. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2897. #define DUMMY_RELAY_COUNT 1
  2898. #define LIGHT_STEP 8
  2899. #define LIGHT_CHANNELS 2
  2900. #define LIGHT_CH1_PIN 5 // warm white
  2901. #define LIGHT_CH2_PIN 4 // cold white
  2902. // https://www.xiaomitoday.com/xiaomi-mijia-mjtd01yl-led-desk-lamp-review/
  2903. #define LIGHT_COLDWHITE_MIRED 153
  2904. #define LIGHT_WARMWHITE_MIRED 370
  2905. // Encoder
  2906. // If mode is ENCODER_MODE_RATIO, the value ratio between both channels is changed
  2907. // when the button is not pressed, and the overall brightness when pressed
  2908. // If mode is ENCODER_MODE_CHANNEL, the first channel value is changed
  2909. // when the button is not pressed, and the second channel when pressed
  2910. // If no ENCODERX_BUTTON_PIN defined it will only change the value of the first defined channel
  2911. #define ENCODER_SUPPORT 1
  2912. #define ENCODER1_PIN1 12
  2913. #define ENCODER1_PIN2 13
  2914. #define ENCODER1_BUTTON_PIN 2 // active low by default, with software pullup
  2915. #define ENCODER1_CHANNEL1 0 // please note this value is 0-based (LIGHT_CH1 above)
  2916. #define ENCODER1_CHANNEL2 1 // please note this value is 0-based (LIGHT_CH2 above)
  2917. #define ENCODER1_MODE ENCODER_MODE_RATIO
  2918. #elif defined(PHYX_ESP12_RGB)
  2919. // Info
  2920. #define MANUFACTURER "PHYX"
  2921. #define DEVICE "ESP12_RGB"
  2922. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2923. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2924. #define DUMMY_RELAY_COUNT 1
  2925. // Light
  2926. #define LIGHT_CHANNELS 3
  2927. #define LIGHT_CH1_PIN 4 // RED
  2928. #define LIGHT_CH2_PIN 14 // GREEN
  2929. #define LIGHT_CH3_PIN 12 // BLUE
  2930. // -----------------------------------------------------------------------------
  2931. // iWoole LED Table Lamp
  2932. // 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
  2933. // -----------------------------------------------------------------------------
  2934. #elif defined(IWOOLE_LED_TABLE_LAMP)
  2935. // Info
  2936. #define MANUFACTURER "IWOOLE"
  2937. #define DEVICE "LED_TABLE_LAMP"
  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 4
  2943. #define LIGHT_CH1_PIN 12 // RED
  2944. #define LIGHT_CH2_PIN 5 // GREEN
  2945. #define LIGHT_CH3_PIN 14 // BLUE
  2946. #define LIGHT_CH4_PIN 4 // WHITE
  2947. // -----------------------------------------------------------------------------
  2948. // Generic GU10
  2949. // https://www.ebay.com/itm/1-10PC-GU10-RGB-Smart-Bulb-Wireless-WiFi-App-Remote-Ctrl-Light-for-Alexa-Google/173724116351
  2950. // -----------------------------------------------------------------------------
  2951. #elif defined(GENERIC_GU10)
  2952. // Info
  2953. #define MANUFACTURER "GENERIC"
  2954. #define DEVICE "GU10"
  2955. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2956. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2957. #define DUMMY_RELAY_COUNT 1
  2958. // Light
  2959. #define LIGHT_CHANNELS 4
  2960. #define LIGHT_CH1_PIN 14 // RED
  2961. #define LIGHT_CH2_PIN 12 // GREEN
  2962. #define LIGHT_CH3_PIN 13 // BLUE
  2963. #define LIGHT_CH4_PIN 4 // WHITE
  2964. // -----------------------------------------------------------------------------
  2965. // Generic E14
  2966. // https://www.ebay.com/itm/LED-Bulb-Wifi-E14-4-5W-Candle-RGB-W-4in1-Dimmable-V-tac-Smart-VT-5114/163899840601
  2967. // -----------------------------------------------------------------------------
  2968. #elif defined(GENERIC_E14)
  2969. // Info
  2970. #define MANUFACTURER "GENERIC"
  2971. #define DEVICE "E14"
  2972. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2973. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2974. #define DUMMY_RELAY_COUNT 1
  2975. // Light
  2976. #define LIGHT_CHANNELS 4
  2977. #define LIGHT_CH1_PIN 4 // RED
  2978. #define LIGHT_CH2_PIN 12 // GREEN
  2979. #define LIGHT_CH3_PIN 14 // BLUE
  2980. #define LIGHT_CH4_PIN 5 // WHITE
  2981. // -----------------------------------------------------------------------------
  2982. // Deltaco white e14 (SH-LE14W) and e27 (SH-LE27W)
  2983. // -----------------------------------------------------------------------------
  2984. #elif defined(DELTACO_SH_LEXXW)
  2985. // Info
  2986. #define MANUFACTURER "DELTACO"
  2987. #define DEVICE "SH_LEXXW"
  2988. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2989. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  2990. #define DUMMY_RELAY_COUNT 1
  2991. // Light
  2992. #define LIGHT_CHANNELS 2
  2993. #define LIGHT_CH1_PIN 12 // WARM WHITE
  2994. #define LIGHT_CH2_PIN 14 // COLD WHITE
  2995. // -----------------------------------------------------------------------------
  2996. // Deltaco rgbw e27 (SH-LE27RGB)
  2997. // -----------------------------------------------------------------------------
  2998. #elif defined(DELTACO_SH_LEXXRGB)
  2999. // Info
  3000. #define MANUFACTURER "DELTACO"
  3001. #define DEVICE "SH_LEXXRGB"
  3002. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3003. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3004. #define DUMMY_RELAY_COUNT 1
  3005. // Light
  3006. #define LIGHT_CHANNELS 5
  3007. #define LIGHT_CH1_PIN 5 // RED
  3008. #define LIGHT_CH2_PIN 4 // GREEN
  3009. #define LIGHT_CH3_PIN 13 // BLUE
  3010. #define LIGHT_CH4_PIN 14 // WARM WHITE
  3011. #define LIGHT_CH5_PIN 12 // COLD WHITE
  3012. // -----------------------------------------------------------------------------
  3013. // Nexete A19
  3014. // https://www.ebay.com/itm/Wifi-Smart-LED-light-Bulb-9W-60W-A19-850LM-RGBW-Dimmable-for-Alexa-Google-Home/283514779201
  3015. // -----------------------------------------------------------------------------
  3016. #elif defined(NEXETE_A19)
  3017. // Info
  3018. #define MANUFACTURER "NEXETE"
  3019. #define DEVICE "A19"
  3020. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3021. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3022. #define DUMMY_RELAY_COUNT 1
  3023. // Light
  3024. #define LIGHT_CHANNELS 4
  3025. #define LIGHT_CH1_PIN 12 // RED
  3026. #define LIGHT_CH2_PIN 15 // GREEN
  3027. #define LIGHT_CH3_PIN 14 // BLUE
  3028. #define LIGHT_CH4_PIN 5 // WHITE
  3029. // -----------------------------------------------------------------------------
  3030. // Lombex Lux Nova 2 Tunable White
  3031. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  3032. // -----------------------------------------------------------------------------
  3033. #elif defined(LOMBEX_LUX_NOVA2_TUNABLE_WHITE)
  3034. // Info
  3035. #define MANUFACTURER "LOMBEX"
  3036. #define DEVICE "LUX_NOVA2_TUNABLE_WHITE"
  3037. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3038. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  3039. #define DUMMY_RELAY_COUNT 1
  3040. // Light
  3041. #define LIGHT_CHANNELS 5
  3042. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  3043. #define MY92XX_CHIPS 1
  3044. #define MY92XX_DI_PIN 4
  3045. #define MY92XX_DCKI_PIN 5
  3046. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  3047. // No RGB on this bulb. Warm white on channel 0, cool white on channel 3
  3048. #define MY92XX_MAPPING 255, 255, 255, 3, 0
  3049. // -----------------------------------------------------------------------------
  3050. // Lombex Lux Nova 2 White and Color
  3051. // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR
  3052. // -----------------------------------------------------------------------------
  3053. #elif defined(LOMBEX_LUX_NOVA2_WHITE_COLOR)
  3054. // Info
  3055. #define MANUFACTURER "LOMBEX"
  3056. #define DEVICE "LUX_NOVA2_WHITE_COLOR"
  3057. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3058. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  3059. #define DUMMY_RELAY_COUNT 1
  3060. // Light
  3061. #define LIGHT_CHANNELS 4
  3062. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  3063. #define MY92XX_CHIPS 1
  3064. #define MY92XX_DI_PIN 4
  3065. #define MY92XX_DCKI_PIN 5
  3066. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  3067. // RGB on channels 0/1/2, either cool or warm white on channel 3
  3068. // The bulb *should* have cool leds, but could also have warm leds as a common defect
  3069. #define MY92XX_MAPPING 0, 1, 2, 3
  3070. // -----------------------------------------------------------------------------
  3071. // Bestek Smart Plug with 2 USB ports
  3072. // https://www.bestekcorp.com/bestek-smart-plug-works-with-amazon-alexa-google-assistant-and-ifttt-with-2-usb
  3073. // -----------------------------------------------------------------------------
  3074. #elif defined(BESTEK_MRJ1011)
  3075. // Info
  3076. #define MANUFACTURER "BESTEK"
  3077. #define DEVICE "MRJ1011"
  3078. // Buttons
  3079. #define BUTTON1_PIN 13
  3080. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  3081. #define BUTTON1_RELAY 1
  3082. // Relay
  3083. #define RELAY1_PIN 12
  3084. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3085. // LED
  3086. #define LED1_PIN 4
  3087. #define LED1_PIN_INVERSE 1
  3088. // -----------------------------------------------------------------------------
  3089. // GBLIFE RGBW SOCKET
  3090. // -----------------------------------------------------------------------------
  3091. #elif defined(GBLIFE_RGBW_SOCKET)
  3092. // Info
  3093. #define MANUFACTURER "GBLIFE"
  3094. #define DEVICE "RGBW_SOCKET"
  3095. // Buttons
  3096. #define BUTTON1_PIN 13
  3097. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3098. #define BUTTON1_RELAY 1
  3099. // Relays
  3100. #define RELAY1_PIN 15
  3101. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3102. // Light RGBW
  3103. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3104. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3105. #define DUMMY_RELAY_COUNT 1
  3106. #define LIGHT_CHANNELS 4
  3107. #define LIGHT_CH1_PIN 5 // RED
  3108. #define LIGHT_CH2_PIN 14 // GREEN
  3109. #define LIGHT_CH3_PIN 12 // BLUE
  3110. #define LIGHT_CH4_PIN 4 // WHITE
  3111. // ----------------------------------------------------------------------------------------
  3112. // Smart life Mini Smart Socket is similar Homecube 16A but some GPIOs differ
  3113. // https://www.ebay.de/itm/Smart-Steckdose-WIFI-WLAN-Amazon-Alexa-Fernbedienung-Home-Socket-Zeitschaltuh-DE/123352026749?hash=item1cb85a8e7d:g:IasAAOSwk6dbj390
  3114. // Also labeled NETVIP
  3115. // https://www.amazon.es/Inteligente-NETVIP-Inal%C3%A1mbrico-Interruptor-Funciona/dp/B07KH8YWS5
  3116. // ----------------------------------------------------------------------------------------
  3117. #elif defined(SMARTLIFE_MINI_SMART_SOCKET)
  3118. // Info
  3119. #define MANUFACTURER "SMARTLIFE"
  3120. #define DEVICE "MINI_SMART_SOCKET"
  3121. // Buttons
  3122. #define BUTTON1_PIN 13
  3123. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3124. #define BUTTON1_RELAY 1
  3125. // Relays
  3126. #define RELAY1_PIN 15
  3127. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3128. // LEDs
  3129. //Red LED: 0
  3130. //Green LED: 4
  3131. //Blue LED: 2
  3132. // Light
  3133. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3134. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3135. #define DUMMY_RELAY_COUNT 1
  3136. #define LIGHT_CHANNELS 3
  3137. #define LIGHT_CH1_PIN 0 // RED
  3138. #define LIGHT_CH2_PIN 4 // GREEN
  3139. #define LIGHT_CH3_PIN 2 // BLUE
  3140. // HJL01 / BL0937
  3141. #ifndef HLW8012_SUPPORT
  3142. #define HLW8012_SUPPORT 1
  3143. #endif
  3144. #define HLW8012_SEL_PIN 12
  3145. #define HLW8012_CF1_PIN 14
  3146. #define HLW8012_CF_PIN 5
  3147. #define HLW8012_SEL_CURRENT LOW
  3148. #define HLW8012_CURRENT_RATIO 25740
  3149. #define HLW8012_VOLTAGE_RATIO 313400
  3150. #define HLW8012_POWER_RATIO 3414290
  3151. #define HLW8012_INTERRUPT_ON FALLING
  3152. // ----------------------------------------------------------------------------------------
  3153. // Hama WiFi Steckdose (00176533)
  3154. // https://at.hama.com/00176533/hama-wifi-steckdose-3500w-16a
  3155. // ----------------------------------------------------------------------------------------
  3156. #elif defined(HAMA_WIFI_STECKDOSE_00176533)
  3157. // Info
  3158. #define MANUFACTURER "HAMA"
  3159. #define DEVICE "WIFI_STECKDOSE_00176533"
  3160. // Buttons
  3161. #define BUTTON1_PIN 13
  3162. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  3163. #define BUTTON1_RELAY 1
  3164. // Relays
  3165. #define RELAY1_PIN 12
  3166. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3167. // LEDs
  3168. #define LED1_PIN 4
  3169. #define LED1_PIN_INVERSE 1
  3170. // -----------------------------------------------------------------------------
  3171. // Oxaoxe NX-SP202
  3172. // Digoo NX-SP202 (not tested)
  3173. // Digoo DG-SP202 (not tested)
  3174. // https://github.com/xoseperez/espurna/issues/1502
  3175. // -----------------------------------------------------------------------------
  3176. #elif defined(DIGOO_NX_SP202)
  3177. // Info
  3178. #define MANUFACTURER "DIGOO"
  3179. #define DEVICE "NX_SP202"
  3180. // Buttons
  3181. #define BUTTON1_PIN 0
  3182. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3183. #define BUTTON1_RELAY 1
  3184. #define BUTTON2_PIN 16
  3185. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3186. #define BUTTON2_RELAY 2
  3187. // Relays
  3188. #define RELAY1_PIN 15
  3189. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3190. #define RELAY2_PIN 14
  3191. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3192. // LEDs
  3193. #define LED1_PIN 13
  3194. #define LED1_PIN_INVERSE 1
  3195. // HJL01 / BL0937
  3196. #ifndef HLW8012_SUPPORT
  3197. #define HLW8012_SUPPORT 1
  3198. #endif
  3199. #define HLW8012_SEL_PIN 12
  3200. #define HLW8012_CF1_PIN 5
  3201. #define HLW8012_CF_PIN 4
  3202. #define HLW8012_SEL_CURRENT LOW
  3203. #define HLW8012_CURRENT_RATIO 23296
  3204. #define HLW8012_VOLTAGE_RATIO 310085
  3205. #define HLW8012_POWER_RATIO 3368471
  3206. #define HLW8012_INTERRUPT_ON FALLING
  3207. // -----------------------------------------------------------------------------
  3208. // Foxel's LightFox dual
  3209. // https://github.com/foxel/esp-dual-rf-switch
  3210. // -----------------------------------------------------------------------------
  3211. #elif defined(FOXEL_LIGHTFOX_DUAL)
  3212. // Info
  3213. #define MANUFACTURER "FOXEL"
  3214. #define DEVICE "LIGHTFOX_DUAL"
  3215. #define SERIAL_BAUDRATE 19200
  3216. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  3217. #define DUMMY_RELAY_COUNT 2
  3218. #define DEBUG_SERIAL_SUPPORT 0
  3219. // Buttons
  3220. #define BUTTON1_RELAY 1
  3221. #define BUTTON2_RELAY 2
  3222. #define BUTTON3_RELAY 2
  3223. #define BUTTON4_RELAY 1
  3224. #define BUTTON_EVENTS_SOURCE BUTTON_EVENTS_SOURCE_FOXEL_LIGHTFOX_DUAL
  3225. // -----------------------------------------------------------------------------
  3226. // Teckin SP20
  3227. // -----------------------------------------------------------------------------
  3228. #elif defined(TECKIN_SP20)
  3229. // Info
  3230. #define MANUFACTURER "TECKIN"
  3231. #define DEVICE "SP20"
  3232. // Buttons
  3233. #define BUTTON1_PIN 13
  3234. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3235. #define BUTTON1_RELAY 1
  3236. // Relays
  3237. #define RELAY1_PIN 4
  3238. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3239. // LEDs
  3240. #define LED1_PIN 2
  3241. #define LED1_PIN_INVERSE 1
  3242. #define LED2_PIN 0
  3243. #define LED2_PIN_INVERSE 1
  3244. #define LED2_MODE LED_MODE_FINDME
  3245. #define LED2_RELAY 0
  3246. // HJL01 / BL0937
  3247. #ifndef HLW8012_SUPPORT
  3248. #define HLW8012_SUPPORT 1
  3249. #endif
  3250. #define HLW8012_SEL_PIN 12
  3251. #define HLW8012_CF1_PIN 14
  3252. #define HLW8012_CF_PIN 5
  3253. #define HLW8012_SEL_CURRENT LOW
  3254. #define HLW8012_CURRENT_RATIO 25740
  3255. #define HLW8012_VOLTAGE_RATIO 313400
  3256. #define HLW8012_POWER_RATIO 3414290
  3257. #define HLW8012_INTERRUPT_ON FALLING
  3258. // -----------------------------------------------------------------------------
  3259. // Charging Essentials / LITESUN LA-WF3
  3260. // -----------------------------------------------------------------------------
  3261. #elif defined(LITESUN_LA_WF3)
  3262. // Info
  3263. #define MANUFACTURER "LITESUN"
  3264. #define DEVICE "LA_WF3"
  3265. // Buttons
  3266. #define BUTTON1_PIN 13
  3267. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3268. #define BUTTON1_RELAY 1
  3269. // Relays
  3270. #define RELAY1_PIN 12
  3271. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3272. // LEDs
  3273. #define LED1_PIN 4 // 4 blue led
  3274. #define LED1_MODE LED_MODE_WIFI
  3275. #define LED1_PIN_INVERSE 1
  3276. #define LED2_PIN 5 // 5 red led
  3277. #define LED2_MODE LED_MODE_RELAY
  3278. #define LED2_PIN_INVERSE 1
  3279. // -----------------------------------------------------------------------------
  3280. // PSH
  3281. // -----------------------------------------------------------------------------
  3282. #elif defined(PSH_WIFI_PLUG)
  3283. // Info
  3284. #define MANUFACTURER "PSH"
  3285. #define DEVICE "WIFI_PLUG"
  3286. // Relays
  3287. #define RELAY1_PIN 2
  3288. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3289. // LEDs
  3290. #define LED1_PIN 0
  3291. #define LED1_PIN_INVERSE 0
  3292. #elif defined(PSH_RGBW_CONTROLLER)
  3293. // Info
  3294. #define MANUFACTURER "PSH"
  3295. #define DEVICE "RGBW_CONTROLLER"
  3296. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3297. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3298. #define DUMMY_RELAY_COUNT 1
  3299. // LEDs
  3300. #define LED1_PIN 13
  3301. #define LED1_PIN_INVERSE 1
  3302. // Light
  3303. #define LIGHT_CHANNELS 4
  3304. #define LIGHT_CH1_PIN 5 // RED
  3305. #define LIGHT_CH2_PIN 4 // GREEN
  3306. #define LIGHT_CH3_PIN 12 // BLUE
  3307. #define LIGHT_CH4_PIN 14 // WHITE1
  3308. #elif defined(PSH_WIFI_SENSOR)
  3309. // Info
  3310. #define MANUFACTURER "PSH"
  3311. #define DEVICE "WIFI_SENSOR"
  3312. // DHT12 Sensor
  3313. #define DHT_SUPPORT 1
  3314. #define DHT_PIN 14
  3315. #define DHT_TYPE DHT_CHIP_DHT12
  3316. // LDR Sensor
  3317. #define LDR_SUPPORT 1
  3318. #define LDR_TYPE LDR_GL5528
  3319. #define LDR_ON_GROUND false
  3320. #define LDR_RESISTOR 10000
  3321. #elif defined(JINVOO_VALVE_SM_AW713)
  3322. // Reflashing from original Tuya firmware
  3323. // to thirdparty firmware like espurna by:
  3324. // https://github.com/ct-Open-Source/tuya-convert
  3325. // Info
  3326. #define MANUFACTURER "JINVOO"
  3327. #define DEVICE "VALVE_SM_AW713"
  3328. // Buttons
  3329. #define BUTTON1_PIN 13
  3330. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3331. #define BUTTON1_RELAY 1
  3332. // Relays
  3333. #define RELAY1_PIN 12
  3334. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3335. // LED
  3336. #define LED1_PIN 5 // 5 red led
  3337. #define LED1_PIN_INVERSE 0
  3338. #define LED1_RELAY 1
  3339. #define LED1_MODE LED_MODE_RELAY
  3340. #define LED2_PIN 4 // 4 blue led
  3341. #define LED2_PIN_INVERSE 0
  3342. #define LED2_RELAY 1
  3343. #define LED2_MODE LED_MODE_FINDME_WIFI
  3344. #elif defined(TUYA_GENERIC_DIMMER)
  3345. #define MANUFACTURER "TUYA"
  3346. #define DEVICE "GENERIC_DIMMER"
  3347. #define LIGHT_PROVIDER LIGHT_PROVIDER_TUYA
  3348. #define LIGHT_CHANNELS 0
  3349. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3350. #define DUMMY_RELAY_COUNT 0
  3351. // -----------------------------------------------------------------------------
  3352. // Etekcity ESW01-USA
  3353. // https://www.amazon.com/Etekcity-Voltson-Outlet-Monitoring-Required/dp/B01M3MYIFS
  3354. // -----------------------------------------------------------------------------
  3355. #elif defined(ETEKCITY_ESW01_USA)
  3356. // Info
  3357. #define MANUFACTURER "ETEKCITY"
  3358. #define DEVICE "ESW01-USA"
  3359. // Buttons
  3360. #define BUTTON1_PIN 14
  3361. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3362. #define BUTTON1_RELAY 1
  3363. // Relays
  3364. #define RELAY1_PIN 4
  3365. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3366. // LEDs
  3367. // Blue
  3368. #define LED1_PIN 5
  3369. #define LED1_MODE LED_MODE_WIFI
  3370. // Yellow
  3371. #define LED2_PIN 16
  3372. #define LED2_MODE LED_MODE_FOLLOW
  3373. #define LED2_RELAY 1
  3374. // HLW8012
  3375. #ifndef HLW8012_SUPPORT
  3376. #define HLW8012_SUPPORT 1
  3377. #endif
  3378. #define HLW8012_SEL_PIN 15
  3379. #define HLW8012_CF1_PIN 12
  3380. #define HLW8012_CF_PIN 13
  3381. #define HLW8012_SEL_CURRENT HIGH // SEL pin to HIGH to measure current
  3382. #define HLW8012_CURRENT_R 0.001 // Current resistor
  3383. #define HLW8012_VOLTAGE_R_UP ( 4 * 470000 ) // Upstream voltage resistor
  3384. #define HLW8012_VOLTAGE_R_DOWN ( 1000 ) // Downstream voltage resistor
  3385. #define HLW8012_INTERRUPT_ON CHANGE
  3386. // -----------------------------------------------------------------------------
  3387. // FS UAP1
  3388. // http://frank-schuetz.de/index.php/fhem/13-hoermann-torantrieb-mit-espeasy-in-fhem-einbinden
  3389. #elif defined(FS_UAP1)
  3390. // Info
  3391. #define MANUFACTURER "FS"
  3392. #define DEVICE "UAP1"
  3393. // Inputs
  3394. #define DIGITAL1_PIN 4
  3395. #define DIGITAL2_PIN 5
  3396. // Relays
  3397. #define RELAY1_PIN 12
  3398. #define RELAY2_PIN 13
  3399. #define RELAY3_PIN 14
  3400. #define RELAY4_PIN 15
  3401. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3402. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3403. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  3404. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  3405. // LEDs
  3406. #define LED1_PIN 2
  3407. // Disable UART noise
  3408. #define DEBUG_SERIAL_SUPPORT 0
  3409. // -----------------------------------------------------------------------------
  3410. // TFLAG NX-SM100 & NX-SM200
  3411. // -----------------------------------------------------------------------------
  3412. #elif defined(TFLAG_NX_SMX00)
  3413. // Info
  3414. #define MANUFACTURER "TFLAG"
  3415. #define DEVICE "NX_SMX00"
  3416. // Buttons
  3417. #define BUTTON1_PIN 13
  3418. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3419. #define BUTTON1_RELAY 1
  3420. // Relays
  3421. #define RELAY1_PIN 12
  3422. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3423. // LEDs
  3424. #define LED1_PIN 0
  3425. #define LED1_PIN_INVERSE 1
  3426. #define LED1_MODE LED_MODE_FOLLOW_INVERSE
  3427. #define LED1_RELAY 1
  3428. #define LED2_PIN 15
  3429. #define LED2_PIN_INVERSE 1
  3430. #define LED2_MODE LED_MODE_WIFI
  3431. // HJL01 / BL0937
  3432. #ifndef HLW8012_SUPPORT
  3433. #define HLW8012_SUPPORT 1
  3434. #endif
  3435. #define HLW8012_SEL_PIN 16
  3436. #define HLW8012_CF1_PIN 14
  3437. #define HLW8012_CF_PIN 5
  3438. #define HLW8012_SEL_CURRENT LOW
  3439. #define HLW8012_CURRENT_RATIO 632
  3440. #define HLW8012_VOLTAGE_RATIO 313400
  3441. #define HLW8012_POWER_RATIO 3711185
  3442. #define HLW8012_INTERRUPT_ON FALLING
  3443. // -----------------------------------------------------------------------------
  3444. // MUVIT_IO_MIOBULB001
  3445. // -----------------------------------------------------------------------------
  3446. #elif defined(MUVIT_IO_MIOBULB001)
  3447. // Info
  3448. #define MANUFACTURER "MUVIT_IO"
  3449. #define DEVICE "MIOBULB001"
  3450. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3451. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3452. #define DUMMY_RELAY_COUNT 1
  3453. // Light
  3454. #define LIGHT_CHANNELS 4
  3455. #define LIGHT_CH1_PIN 14 // RED
  3456. #define LIGHT_CH2_PIN 12 // GREEN
  3457. #define LIGHT_CH3_PIN 13 // BLUE
  3458. #define LIGHT_CH4_PIN 4 // WHITE
  3459. // -----------------------------------------------------------------------------
  3460. // Hykker Power Plug (Smart Home Series) available in Jerónimo Martins Polska (Biedronka)
  3461. // https://www.hykker.com/akcesoria/gniazdo-wi-fi-z-licznikiem-energii/
  3462. // Reflashing from original Tuya firmware
  3463. // to thirdparty firmware like espurna by:
  3464. // https://github.com/ct-Open-Source/tuya-convert
  3465. // -----------------------------------------------------------------------------
  3466. #elif defined(HYKKER_SMART_HOME_POWER_PLUG)
  3467. // Info
  3468. #define MANUFACTURER "HYKKER"
  3469. #define DEVICE "SMART_HOME_POWER_PLUG"
  3470. // Buttons
  3471. #define BUTTON1_PIN 0
  3472. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  3473. #define BUTTON1_RELAY 1
  3474. // Relays
  3475. #define RELAY1_PIN 14
  3476. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3477. // LED
  3478. // Red
  3479. #define LED1_PIN 13
  3480. #define LED1_MODE LED_MODE_WIFI
  3481. #define LED1_PIN_INVERSE 1
  3482. // Blue connected to relay
  3483. // HLW8012
  3484. #ifndef HLW8012_SUPPORT
  3485. #define HLW8012_SUPPORT 1
  3486. #endif
  3487. #define HLW8012_SEL_PIN 12
  3488. #define HLW8012_CF1_PIN 5
  3489. #define HLW8012_CF_PIN 4
  3490. #define HLW8012_SEL_CURRENT LOW
  3491. #define HLW8012_CURRENT_RATIO 25740
  3492. #define HLW8012_VOLTAGE_RATIO 282060
  3493. #define HLW8012_POWER_RATIO 3414290
  3494. #define HLW8012_INTERRUPT_ON FALLING
  3495. #define SENSOR_ENERGY_UNITS ENERGY_KWH
  3496. #define SENSOR_POWER_UNITS POWER_WATTS
  3497. // -----------------------------------------------------------------------------
  3498. // Kogan Smarter Home Plug with Energy Meter (Australia)
  3499. // Product code: KASPEMHA
  3500. // https://www.kogan.com/au/buy/kogan-smarterhome-smart-plug-energy-meter/
  3501. // Reflashing from original Tuya firmware
  3502. // to thirdparty firmware like espurna by:
  3503. // https://github.com/ct-Open-Source/tuya-convert
  3504. // -----------------------------------------------------------------------------
  3505. #elif defined(KOGAN_SMARTER_HOME_PLUG_W_POW)
  3506. // Info
  3507. #define MANUFACTURER "KOGAN"
  3508. #define DEVICE "SMARTER_HOME_PLUG_W_POW"
  3509. // Buttons
  3510. #define BUTTON1_PIN 0
  3511. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  3512. #define BUTTON1_RELAY 1
  3513. // Relays
  3514. #define RELAY1_PIN 14
  3515. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3516. // LED
  3517. // Red
  3518. #define LED1_PIN 13
  3519. #define LED1_MODE LED_MODE_WIFI
  3520. #define LED1_PIN_INVERSE 1
  3521. // Blue connected to relay
  3522. // HLW8012
  3523. #ifndef HLW8012_SUPPORT
  3524. #define HLW8012_SUPPORT 1
  3525. #endif
  3526. #define HLW8012_SEL_PIN 12
  3527. #define HLW8012_CF1_PIN 5
  3528. #define HLW8012_CF_PIN 4
  3529. #define HLW8012_SEL_CURRENT LOW
  3530. #define HLW8012_CURRENT_RATIO 25740
  3531. #define HLW8012_VOLTAGE_RATIO 282060
  3532. #define HLW8012_POWER_RATIO 3414290
  3533. #define HLW8012_INTERRUPT_ON FALLING
  3534. #define SENSOR_ENERGY_UNITS ENERGY_KWH
  3535. #define SENSOR_POWER_UNITS POWER_WATTS
  3536. // -----------------------------------------------------------------------------
  3537. // LSC Smart LED Light Strip (Smart CXonnect Series) available ACTION (Germany)
  3538. // https://www.action.com/de-de/p/lsc-smart-connect-intelligenter-multicolor-led-strip-/
  3539. // Reflashing from original Tuya firmware
  3540. // to thirdparty firmware like espurna by:
  3541. // https://github.com/ct-Open-Source/tuya-convert
  3542. // -----------------------------------------------------------------------------
  3543. #elif defined(LSC_SMART_LED_LIGHT_STRIP)
  3544. // Info
  3545. #define MANUFACTURER "LSC"
  3546. #define DEVICE "SMART_LED_LIGHT_STRIP"
  3547. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  3548. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  3549. #define DUMMY_RELAY_COUNT 1
  3550. // Light RGBW
  3551. #define LIGHT_CHANNELS 4
  3552. #define LIGHT_CH1_PIN 4 // RED
  3553. #define LIGHT_CH2_PIN 12 // GREEN
  3554. #define LIGHT_CH3_PIN 14 // BLUE
  3555. #define LIGHT_CH4_PIN 13 // WHITE
  3556. // #define LIGHT_CH5_PIN 5 // CW (not connected, but circuit supports it)
  3557. // IR
  3558. #define IR_SUPPORT 1
  3559. #define IR_RX_PIN 0
  3560. #define IR_BUTTON_SET 5
  3561. // -----------------------------------------------------------------------------
  3562. // eHomeDIY WT02
  3563. // https://github.com/eHomeDIY/WT02-hardware
  3564. // -----------------------------------------------------------------------------
  3565. #elif defined(EHOMEDIY_WT02)
  3566. // Info
  3567. #define MANUFACTURER "EHOMEDIY"
  3568. #define DEVICE "WT02"
  3569. #define I2C_SDA_PIN 0
  3570. #define I2C_SCL_PIN 2
  3571. #define BMX280_SUPPORT 1
  3572. // #define SI7021_SUPPORT 1
  3573. // -----------------------------------------------------------------------------
  3574. // eHomeDIY WT03
  3575. // https://github.com/eHomeDIY/WT03-hardware
  3576. // -----------------------------------------------------------------------------
  3577. #elif defined(EHOMEDIY_WT03)
  3578. // Info
  3579. #define MANUFACTURER "EHOMEDIY"
  3580. #define DEVICE "WT03"
  3581. #define I2C_SDA_PIN 2
  3582. #define I2C_SCL_PIN 0
  3583. #define BMX280_SUPPORT 1
  3584. // #define SI7021_SUPPORT 1
  3585. // -----------------------------------------------------------------------------
  3586. // Linksprite R4
  3587. // http://linksprite.com/wiki/index.php?title=LinkNode_R4:_Arduino-compatible_WiFi_relay_controller
  3588. // -----------------------------------------------------------------------------
  3589. #elif defined(LINKSPRITE_LINKNODE_R4)
  3590. // Info
  3591. #define MANUFACTURER "LINKSPRITE"
  3592. #define DEVICE "LINKNODE_R4"
  3593. // Relays
  3594. #define RELAY1_PIN 12
  3595. #define RELAY2_PIN 13
  3596. #define RELAY3_PIN 14
  3597. #define RELAY4_PIN 16
  3598. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  3599. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  3600. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  3601. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  3602. // -----------------------------------------------------------------------------
  3603. #else
  3604. #error "UNSUPPORTED HARDWARE!!"
  3605. #endif