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.

4067 lines
129 KiB

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