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.

2042 lines
63 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 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 general.h for LED_MODE_%
  19. // LED#_RELAY: Linked relay (1-based)
  20. //
  21. // Besides, other hardware specific information should be stated here
  22. // -----------------------------------------------------------------------------
  23. // ESPurna Core
  24. // -----------------------------------------------------------------------------
  25. #if defined(ESPURNA_CORE)
  26. // This is a special device targeted to generate a light-weight binary image
  27. // meant to be able to do two-step-updates:
  28. // https://github.com/xoseperez/espurna/wiki/TwoStepUpdates
  29. // Info
  30. #define MANUFACTURER "ESPRESSIF"
  31. #define DEVICE "ESPURNA_CORE"
  32. // Disable non-core modules
  33. #define ALEXA_SUPPORT 0
  34. #define BROKER_SUPPORT 0
  35. #define DOMOTICZ_SUPPORT 0
  36. #define HOMEASSISTANT_SUPPORT 0
  37. #define I2C_SUPPORT 0
  38. #define MQTT_SUPPORT 0
  39. #define NTP_SUPPORT 0
  40. #define SCHEDULER_SUPPORT 0
  41. #define SENSOR_SUPPORT 0
  42. #define THINGSPEAK_SUPPORT 0
  43. #define WEB_SUPPORT 0
  44. // -----------------------------------------------------------------------------
  45. // Development boards
  46. // -----------------------------------------------------------------------------
  47. #elif defined(NODEMCU_LOLIN)
  48. // Info
  49. #define MANUFACTURER "NODEMCU"
  50. #define DEVICE "LOLIN"
  51. // Buttons
  52. #define BUTTON1_PIN 0
  53. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  54. #define BUTTON1_RELAY 1
  55. // Relays
  56. #define RELAY1_PIN 12
  57. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  58. // LEDs
  59. #define LED1_PIN 2
  60. #define LED1_PIN_INVERSE 1
  61. #elif defined(WEMOS_D1_MINI_RELAYSHIELD)
  62. // Info
  63. #define MANUFACTURER "WEMOS"
  64. #define DEVICE "D1_MINI_RELAYSHIELD"
  65. // Buttons
  66. // No buttons on the D1 MINI alone, but defining it without adding a button doen't create problems
  67. #define BUTTON1_PIN 0 // Connect a pushbutton between D3 and GND,
  68. // it's the same as using a Wemos one button shield
  69. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  70. #define BUTTON1_RELAY 1
  71. // Relays
  72. #define RELAY1_PIN 5
  73. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  74. // LEDs
  75. #define LED1_PIN 2
  76. #define LED1_PIN_INVERSE 1
  77. // When Wemos relay shield is connected GPIO5 (D1) is used for relay,
  78. // so I2C must be remapped to other pins
  79. #define I2C_SDA_PIN 12 // D6
  80. #define I2C_SCL_PIN 14 // D5
  81. #elif defined(WEMOS_D1_TARPUNA_SHIELD)
  82. // Info
  83. #define MANUFACTURER "WEMOS"
  84. #define DEVICE "D1_TARPUNA_SHIELD"
  85. // -----------------------------------------------------------------------------
  86. // ESPurna
  87. // -----------------------------------------------------------------------------
  88. #elif defined(TINKERMAN_ESPURNA_H06)
  89. // Info
  90. #define MANUFACTURER "TINKERMAN"
  91. #define DEVICE "ESPURNA_H06"
  92. // Buttons
  93. #define BUTTON1_PIN 4
  94. #define BUTTON1_RELAY 1
  95. // Normal pushbutton
  96. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  97. // Relays
  98. #define RELAY1_PIN 12
  99. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  100. // LEDs
  101. #define LED1_PIN 2
  102. #define LED1_PIN_INVERSE 1
  103. // HLW8012
  104. #ifndef HLW8012_SUPPORT
  105. #define HLW8012_SUPPORT 1
  106. #endif
  107. #define HLW8012_SEL_PIN 2
  108. #define HLW8012_CF1_PIN 13
  109. #define HLW8012_CF_PIN 14
  110. #elif defined(TINKERMAN_ESPURNA_H08)
  111. // Info
  112. #define MANUFACTURER "TINKERMAN"
  113. #define DEVICE "ESPURNA_H08"
  114. // Buttons
  115. #define BUTTON1_PIN 4
  116. #define BUTTON1_RELAY 1
  117. // Normal pushbutton
  118. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  119. // Relays
  120. #define RELAY1_PIN 12
  121. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  122. // LEDs
  123. #define LED1_PIN 2
  124. #define LED1_PIN_INVERSE 0
  125. // HLW8012
  126. #ifndef HLW8012_SUPPORT
  127. #define HLW8012_SUPPORT 1
  128. #endif
  129. #define HLW8012_SEL_PIN 5
  130. #define HLW8012_CF1_PIN 13
  131. #define HLW8012_CF_PIN 14
  132. #elif defined(TINKERMAN_ESPURNA_SWITCH)
  133. // Info
  134. #define MANUFACTURER "TINKERMAN"
  135. #define DEVICE "ESPURNA_SWITCH"
  136. // Buttons
  137. #define BUTTON1_PIN 4
  138. #define BUTTON1_RELAY 1
  139. // Touch button
  140. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  141. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  142. #define BUTTON1_CLICK BUTTON_MODE_NONE
  143. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  144. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  145. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  146. // LEDs
  147. #define LED1_PIN 2
  148. #define LED1_PIN_INVERSE 0
  149. // Relays
  150. #define RELAY1_PIN 12
  151. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  152. // -----------------------------------------------------------------------------
  153. // Itead Studio boards
  154. // -----------------------------------------------------------------------------
  155. #elif defined(ITEAD_SONOFF_BASIC)
  156. // Info
  157. #define MANUFACTURER "ITEAD"
  158. #define DEVICE "SONOFF_BASIC"
  159. // Buttons
  160. #define BUTTON1_PIN 0
  161. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  162. #define BUTTON1_RELAY 1
  163. #define BUTTON2_PIN 14
  164. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  165. #define BUTTON2_RELAY 1
  166. // Relays
  167. #define RELAY1_PIN 12
  168. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  169. // LEDs
  170. #define LED1_PIN 13
  171. #define LED1_PIN_INVERSE 1
  172. #elif defined(ITEAD_SONOFF_RF)
  173. // Info
  174. #define MANUFACTURER "ITEAD"
  175. #define DEVICE "SONOFF_RF"
  176. // Buttons
  177. #define BUTTON1_PIN 0
  178. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  179. #define BUTTON1_RELAY 1
  180. #define BUTTON2_PIN 14
  181. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  182. #define BUTTON2_RELAY 1
  183. // Relays
  184. #define RELAY1_PIN 12
  185. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  186. // LEDs
  187. #define LED1_PIN 13
  188. #define LED1_PIN_INVERSE 1
  189. #elif defined(ITEAD_SONOFF_TH)
  190. // Info
  191. #define MANUFACTURER "ITEAD"
  192. #define DEVICE "SONOFF_TH"
  193. // Buttons
  194. #define BUTTON1_PIN 0
  195. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  196. #define BUTTON1_RELAY 1
  197. // Relays
  198. #define RELAY1_PIN 12
  199. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  200. // LEDs
  201. #define LED1_PIN 13
  202. #define LED1_PIN_INVERSE 1
  203. // Jack is connected to GPIO14 (and with a small hack to GPIO4)
  204. #ifndef DALLAS_SUPPORT
  205. #define DALLAS_SUPPORT 1
  206. #endif
  207. #define DALLAS_PIN 14
  208. #ifndef DHT_SUPPORT
  209. #define DHT_SUPPORT 1
  210. #endif
  211. #define DHT_PIN 14
  212. //#define I2C_SDA_PIN 4
  213. //#define I2C_SCL_PIN 14
  214. #elif defined(ITEAD_SONOFF_SV)
  215. // Info
  216. #define MANUFACTURER "ITEAD"
  217. #define DEVICE "SONOFF_SV"
  218. // Buttons
  219. #define BUTTON1_PIN 0
  220. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  221. #define BUTTON1_RELAY 1
  222. // Relays
  223. #define RELAY1_PIN 12
  224. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  225. // LEDs
  226. #define LED1_PIN 13
  227. #define LED1_PIN_INVERSE 1
  228. #elif defined(ITEAD_SLAMPHER)
  229. // Info
  230. #define MANUFACTURER "ITEAD"
  231. #define DEVICE "SLAMPHER"
  232. // Buttons
  233. #define BUTTON1_PIN 0
  234. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  235. #define BUTTON1_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_S20)
  243. // Info
  244. #define MANUFACTURER "ITEAD"
  245. #define DEVICE "S20"
  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. #elif defined(ITEAD_SONOFF_TOUCH)
  257. // Info
  258. #define MANUFACTURER "ITEAD"
  259. #define DEVICE "SONOFF_TOUCH"
  260. // Buttons
  261. #define BUTTON1_PIN 0
  262. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  263. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  264. #define BUTTON1_CLICK BUTTON_MODE_NONE
  265. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  266. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  267. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  268. #define BUTTON1_RELAY 1
  269. // Relays
  270. #define RELAY1_PIN 12
  271. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  272. // LEDs
  273. #define LED1_PIN 13
  274. #define LED1_PIN_INVERSE 1
  275. #elif defined(ITEAD_SONOFF_POW)
  276. // Info
  277. #define MANUFACTURER "ITEAD"
  278. #define DEVICE "SONOFF_POW"
  279. // Buttons
  280. #define BUTTON1_PIN 0
  281. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  282. #define BUTTON1_RELAY 1
  283. // Relays
  284. #define RELAY1_PIN 12
  285. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  286. // LEDs
  287. #define LED1_PIN 15
  288. #define LED1_PIN_INVERSE 0
  289. // HLW8012
  290. #ifndef HLW8012_SUPPORT
  291. #define HLW8012_SUPPORT 1
  292. #endif
  293. #define HLW8012_SEL_PIN 5
  294. #define HLW8012_CF1_PIN 13
  295. #define HLW8012_CF_PIN 14
  296. #elif defined(ITEAD_SONOFF_DUAL)
  297. // Info
  298. #define MANUFACTURER "ITEAD"
  299. #define DEVICE "SONOFF_DUAL"
  300. #define SERIAL_BAUDRATE 19230
  301. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  302. #define DUMMY_RELAY_COUNT 2
  303. #define DEBUG_SERIAL_SUPPORT 0
  304. // Buttons
  305. #define BUTTON3_RELAY 1
  306. // LEDs
  307. #define LED1_PIN 13
  308. #define LED1_PIN_INVERSE 1
  309. #elif defined(ITEAD_SONOFF_DUAL_R2)
  310. #define MANUFACTURER "ITEAD"
  311. #define DEVICE "SONOFF_DUAL_R2"
  312. // Buttons
  313. #define BUTTON1_PIN 0 // Button 0 on header
  314. #define BUTTON2_PIN 9 // Button 1 on header
  315. #define BUTTON3_PIN 10 // Physical button
  316. #define BUTTON1_RELAY 1
  317. #define BUTTON2_RELAY 2
  318. #define BUTTON3_RELAY 1
  319. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  320. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  321. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  322. // Relays
  323. #define RELAY1_PIN 12
  324. #define RELAY2_PIN 5
  325. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  326. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  327. // LEDs
  328. #define LED1_PIN 13
  329. #define LED1_PIN_INVERSE 1
  330. #elif defined(ITEAD_SONOFF_4CH)
  331. // Info
  332. #define MANUFACTURER "ITEAD"
  333. #define DEVICE "SONOFF_4CH"
  334. // Buttons
  335. #define BUTTON1_PIN 0
  336. #define BUTTON2_PIN 9
  337. #define BUTTON3_PIN 10
  338. #define BUTTON4_PIN 14
  339. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  340. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  341. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  342. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  343. #define BUTTON1_RELAY 1
  344. #define BUTTON2_RELAY 2
  345. #define BUTTON3_RELAY 3
  346. #define BUTTON4_RELAY 4
  347. // Relays
  348. #define RELAY1_PIN 12
  349. #define RELAY2_PIN 5
  350. #define RELAY3_PIN 4
  351. #define RELAY4_PIN 15
  352. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  353. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  354. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  355. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  356. // LEDs
  357. #define LED1_PIN 13
  358. #define LED1_PIN_INVERSE 1
  359. #elif defined(ITEAD_SONOFF_4CH_PRO)
  360. // Info
  361. #define MANUFACTURER "ITEAD"
  362. #define DEVICE "SONOFF_4CH_PRO"
  363. // Buttons
  364. #define BUTTON1_PIN 0
  365. #define BUTTON2_PIN 9
  366. #define BUTTON3_PIN 10
  367. #define BUTTON4_PIN 14
  368. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  369. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  370. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  371. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  372. #define BUTTON1_RELAY 1
  373. #define BUTTON2_RELAY 2
  374. #define BUTTON3_RELAY 3
  375. #define BUTTON4_RELAY 4
  376. // Sonoff 4CH Pro uses a secondary STM32 microcontroller to handle
  377. // buttons and relays, but it also forwards button presses to the ESP8285.
  378. // This allows ESPurna to handle button presses -almost- the same way
  379. // as with other devices except:
  380. // * Double click seems to break/disable the button on the STM32 side
  381. // * With S6 switch to 1 (self-locking and inching modes) everything's OK
  382. // * With S6 switch to 0 (interlock mode) if there is a relay ON
  383. // and you click on another relay button, the STM32 sends a "press"
  384. // event for the button of the first relay (to turn it OFF) but it
  385. // does not send a "release" event. It's like it's holding the
  386. // button down since you can see it is still LOW.
  387. // Whatever reason the result is that it may actually perform a
  388. // long click or long-long click.
  389. // The configuration below make the button toggle the relay on press events
  390. // and disables any possibly harmful combination with S6 set to 0.
  391. // If you are sure you will only use S6 to 1 you can comment the
  392. // BUTTON1_LNGCLICK and BUTTON1_LNGLNGCLICK options below to recover the
  393. // reset mode and factory reset functionalities, or link other actions like
  394. // AP mode in the commented line below.
  395. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  396. #define BUTTON1_CLICK BUTTON_MODE_NONE
  397. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  398. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  399. //#define BUTTON1_LNGCLICK BUTTON_MODE_AP
  400. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  401. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  402. #define BUTTON2_CLICK BUTTON_MODE_NONE
  403. #define BUTTON3_PRESS BUTTON_MODE_TOGGLE
  404. #define BUTTON3_CLICK BUTTON_MODE_NONE
  405. #define BUTTON4_PRESS BUTTON_MODE_TOGGLE
  406. #define BUTTON4_CLICK BUTTON_MODE_NONE
  407. // Relays
  408. #define RELAY1_PIN 12
  409. #define RELAY2_PIN 5
  410. #define RELAY3_PIN 4
  411. #define RELAY4_PIN 15
  412. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  413. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  414. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  415. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  416. // LEDs
  417. #define LED1_PIN 13
  418. #define LED1_PIN_INVERSE 1
  419. #elif defined(ITEAD_1CH_INCHING)
  420. // The inching functionality is managed by a misterious IC in the board.
  421. // You cannot control the inching button and functionality from the ESP8266
  422. // Besides, enabling the inching functionality using the hardware button
  423. // will result in the relay switching on and off continuously.
  424. // Fortunately the unkown IC keeps memory of the hardware inching status
  425. // so you can just disable it and forget. The inching LED must be lit.
  426. // You can still use the pulse options from the web interface
  427. // without problem.
  428. // Info
  429. #define MANUFACTURER "ITEAD"
  430. #define DEVICE "1CH_INCHING"
  431. // Buttons
  432. #define BUTTON1_PIN 0
  433. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  434. #define BUTTON1_RELAY 1
  435. // Relays
  436. #define RELAY1_PIN 12
  437. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  438. // LEDs
  439. #define LED1_PIN 13
  440. #define LED1_PIN_INVERSE 1
  441. #elif defined(ITEAD_MOTOR)
  442. // Info
  443. #define MANUFACTURER "ITEAD"
  444. #define DEVICE "MOTOR"
  445. // Buttons
  446. #define BUTTON1_PIN 0
  447. #define BUTTON1_RELAY 1
  448. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  449. // Relays
  450. #define RELAY1_PIN 12
  451. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  452. // LEDs
  453. #define LED1_PIN 13
  454. #define LED1_PIN_INVERSE 1
  455. #elif defined(ITEAD_BNSZ01)
  456. // Info
  457. #define MANUFACTURER "ITEAD"
  458. #define DEVICE "BNSZ01"
  459. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  460. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  461. #define DUMMY_RELAY_COUNT 1
  462. // LEDs
  463. #define LED1_PIN 13
  464. #define LED1_PIN_INVERSE 1
  465. // Light
  466. #define LIGHT_CHANNELS 1
  467. #define LIGHT_CH1_PIN 12
  468. #define LIGHT_CH1_INVERSE 0
  469. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  470. // Info
  471. #define MANUFACTURER "ITEAD"
  472. #define DEVICE "SONOFF_RFBRIDGE"
  473. #define SERIAL_BAUDRATE 19200
  474. #define RELAY_PROVIDER RELAY_PROVIDER_RFBRIDGE
  475. #ifndef DUMMY_RELAY_COUNT
  476. #define DUMMY_RELAY_COUNT 8
  477. #endif
  478. // Remove UART noise on serial line
  479. #define DEBUG_SERIAL_SUPPORT 0
  480. // Buttons
  481. #define BUTTON1_PIN 0
  482. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  483. // LEDs
  484. #define LED1_PIN 13
  485. #define LED1_PIN_INVERSE 1
  486. #elif defined(ITEAD_SONOFF_B1)
  487. // Info
  488. #define MANUFACTURER "ITEAD"
  489. #define DEVICE "SONOFF_B1"
  490. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  491. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  492. #define DUMMY_RELAY_COUNT 1
  493. // Light
  494. #define LIGHT_CHANNELS 5
  495. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  496. #define MY92XX_CHIPS 2
  497. #define MY92XX_DI_PIN 12
  498. #define MY92XX_DCKI_PIN 14
  499. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  500. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  501. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  502. #elif defined(ITEAD_SONOFF_LED)
  503. // Info
  504. #define MANUFACTURER "ITEAD"
  505. #define DEVICE "SONOFF_LED"
  506. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  507. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  508. #define DUMMY_RELAY_COUNT 1
  509. // LEDs
  510. #define LED1_PIN 13
  511. #define LED1_PIN_INVERSE 1
  512. // Light
  513. #define LIGHT_CHANNELS 2
  514. #define LIGHT_CH1_PIN 12 // Cold white
  515. #define LIGHT_CH2_PIN 14 // Warm white
  516. #define LIGHT_CH1_INVERSE 0
  517. #define LIGHT_CH2_INVERSE 0
  518. #elif defined(ITEAD_SONOFF_T1_1CH)
  519. // Info
  520. #define MANUFACTURER "ITEAD"
  521. #define DEVICE "SONOFF_T1_1CH"
  522. // Buttons
  523. #define BUTTON1_PIN 0
  524. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  525. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  526. #define BUTTON1_CLICK BUTTON_MODE_NONE
  527. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  528. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  529. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  530. #define BUTTON1_RELAY 1
  531. // Relays
  532. #define RELAY1_PIN 12
  533. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  534. // LEDs
  535. #define LED1_PIN 13
  536. #define LED1_PIN_INVERSE 1
  537. #elif defined(ITEAD_SONOFF_T1_2CH)
  538. // Info
  539. #define MANUFACTURER "ITEAD"
  540. #define DEVICE "SONOFF_T1_2CH"
  541. // Buttons
  542. #define BUTTON1_PIN 0
  543. #define BUTTON2_PIN 9
  544. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  545. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  546. #define BUTTON1_CLICK BUTTON_MODE_NONE
  547. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  548. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  549. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  550. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  551. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  552. #define BUTTON2_CLICK BUTTON_MODE_NONE
  553. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  554. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  555. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  556. #define BUTTON1_RELAY 1
  557. #define BUTTON2_RELAY 2
  558. // Relays
  559. #define RELAY1_PIN 12
  560. #define RELAY2_PIN 5
  561. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  562. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  563. // LEDs
  564. #define LED1_PIN 13
  565. #define LED1_PIN_INVERSE 1
  566. #elif defined(ITEAD_SONOFF_T1_3CH)
  567. // Info
  568. #define MANUFACTURER "ITEAD"
  569. #define DEVICE "SONOFF_T1_3CH"
  570. // Buttons
  571. #define BUTTON1_PIN 0
  572. #define BUTTON2_PIN 9
  573. #define BUTTON3_PIN 10
  574. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  575. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  576. #define BUTTON1_CLICK BUTTON_MODE_NONE
  577. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  578. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  579. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  580. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  581. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  582. #define BUTTON2_CLICK BUTTON_MODE_NONE
  583. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  584. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  585. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  586. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  587. #define BUTTON3_PRESS BUTTON_MODE_TOGGLE
  588. #define BUTTON3_CLICK BUTTON_MODE_NONE
  589. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  590. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  591. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_RESET
  592. #define BUTTON1_RELAY 1
  593. #define BUTTON2_RELAY 2
  594. #define BUTTON3_RELAY 3
  595. // Relays
  596. #define RELAY1_PIN 12
  597. #define RELAY2_PIN 5
  598. #define RELAY3_PIN 4
  599. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  600. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  601. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  602. // LEDs
  603. #define LED1_PIN 13
  604. #define LED1_PIN_INVERSE 1
  605. #elif defined(ITEAD_SONOFF_S31)
  606. // Info
  607. #define MANUFACTURER "ITEAD"
  608. #define DEVICE "SONOFF_S31"
  609. // Buttons
  610. #define BUTTON1_PIN 0
  611. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  612. #define BUTTON1_RELAY 1
  613. // Relays
  614. #define RELAY1_PIN 12
  615. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  616. // LEDs
  617. #define LED1_PIN 13
  618. #define LED1_PIN_INVERSE 1
  619. // Disable UART noise
  620. #define DEBUG_SERIAL_SUPPORT 0
  621. // CSE7766
  622. #define CSE7766_SUPPORT 1
  623. #define CSE7766_PIN 1
  624. // -----------------------------------------------------------------------------
  625. // YJZK
  626. // -----------------------------------------------------------------------------
  627. #elif defined(YJZK_SWITCH_2CH)
  628. // Info
  629. #define MANUFACTURER "YJZK"
  630. #define DEVICE "SWITCH_2CH"
  631. // Buttons
  632. #define BUTTON1_PIN 0
  633. #define BUTTON2_PIN 9
  634. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  635. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  636. #define BUTTON1_RELAY 1
  637. #define BUTTON2_RELAY 2
  638. // Relays
  639. #define RELAY1_PIN 12
  640. #define RELAY2_PIN 5
  641. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  642. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  643. // LEDs
  644. #define LED1_PIN 13
  645. #define LED1_PIN_INVERSE 0
  646. // -----------------------------------------------------------------------------
  647. // Electrodragon boards
  648. // -----------------------------------------------------------------------------
  649. #elif defined(ELECTRODRAGON_WIFI_IOT)
  650. // Info
  651. #define MANUFACTURER "ELECTRODRAGON"
  652. #define DEVICE "WIFI_IOT"
  653. // Buttons
  654. #define BUTTON1_PIN 0
  655. #define BUTTON2_PIN 2
  656. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  657. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  658. #define BUTTON1_RELAY 1
  659. #define BUTTON2_RELAY 2
  660. // Relays
  661. #define RELAY1_PIN 12
  662. #define RELAY2_PIN 13
  663. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  664. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  665. // LEDs
  666. #define LED1_PIN 16
  667. #define LED1_PIN_INVERSE 0
  668. // -----------------------------------------------------------------------------
  669. // WorkChoice ecoPlug
  670. // -----------------------------------------------------------------------------
  671. #elif defined(WORKCHOICE_ECOPLUG)
  672. // Info
  673. #define MANUFACTURER "WORKCHOICE"
  674. #define DEVICE "ECOPLUG"
  675. // Buttons
  676. #define BUTTON1_PIN 13
  677. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  678. #define BUTTON1_RELAY 1
  679. // Relays
  680. #define RELAY1_PIN 15
  681. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  682. // LEDs
  683. #define LED1_PIN 2
  684. #define LED1_PIN_INVERSE 0
  685. // -----------------------------------------------------------------------------
  686. // AI Thinker
  687. // -----------------------------------------------------------------------------
  688. #elif defined(AITHINKER_AI_LIGHT)
  689. // Info
  690. #define MANUFACTURER "AITHINKER"
  691. #define DEVICE "AI_LIGHT"
  692. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  693. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  694. #define DUMMY_RELAY_COUNT 1
  695. // Light
  696. #define LIGHT_CHANNELS 4
  697. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  698. #define MY92XX_CHIPS 1
  699. #define MY92XX_DI_PIN 13
  700. #define MY92XX_DCKI_PIN 15
  701. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  702. #define MY92XX_MAPPING 0, 1, 2, 3
  703. // -----------------------------------------------------------------------------
  704. // LED Controller
  705. // -----------------------------------------------------------------------------
  706. #elif defined(MAGICHOME_LED_CONTROLLER)
  707. // Info
  708. #define MANUFACTURER "MAGICHOME"
  709. #define DEVICE "LED_CONTROLLER"
  710. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  711. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  712. #define DUMMY_RELAY_COUNT 1
  713. // LEDs
  714. #define LED1_PIN 2
  715. #define LED1_PIN_INVERSE 1
  716. // Light
  717. #define LIGHT_CHANNELS 4
  718. #define LIGHT_CH1_PIN 14 // RED
  719. #define LIGHT_CH2_PIN 5 // GREEN
  720. #define LIGHT_CH3_PIN 12 // BLUE
  721. #define LIGHT_CH4_PIN 13 // WHITE
  722. #define LIGHT_CH1_INVERSE 0
  723. #define LIGHT_CH2_INVERSE 0
  724. #define LIGHT_CH3_INVERSE 0
  725. #define LIGHT_CH4_INVERSE 0
  726. // IR
  727. #define IR_SUPPORT 1
  728. #define IR_PIN 4
  729. #define IR_BUTTON_SET 1
  730. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  731. // Info
  732. #define MANUFACTURER "MAGICHOME"
  733. #define DEVICE "LED_CONTROLLER_20"
  734. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  735. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  736. #define DUMMY_RELAY_COUNT 1
  737. // LEDs
  738. #define LED1_PIN 2
  739. #define LED1_PIN_INVERSE 1
  740. // Light
  741. #define LIGHT_CHANNELS 4
  742. #define LIGHT_CH1_PIN 5 // RED
  743. #define LIGHT_CH2_PIN 12 // GREEN
  744. #define LIGHT_CH3_PIN 13 // BLUE
  745. #define LIGHT_CH4_PIN 15 // WHITE
  746. #define LIGHT_CH1_INVERSE 0
  747. #define LIGHT_CH2_INVERSE 0
  748. #define LIGHT_CH3_INVERSE 0
  749. #define LIGHT_CH4_INVERSE 0
  750. // IR
  751. #define IR_SUPPORT 1
  752. #define IR_PIN 4
  753. #define IR_BUTTON_SET 1
  754. // -----------------------------------------------------------------------------
  755. // HUACANXING H801 & H802
  756. // -----------------------------------------------------------------------------
  757. #elif defined(HUACANXING_H801)
  758. // Info
  759. #define MANUFACTURER "HUACANXING"
  760. #define DEVICE "H801"
  761. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  762. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  763. #define DUMMY_RELAY_COUNT 1
  764. #define DEBUG_PORT Serial1
  765. #define SERIAL_RX_ENABLED 1
  766. // LEDs
  767. #define LED1_PIN 5
  768. #define LED1_PIN_INVERSE 1
  769. // Light
  770. #define LIGHT_CHANNELS 5
  771. #define LIGHT_CH1_PIN 15 // RED
  772. #define LIGHT_CH2_PIN 13 // GREEN
  773. #define LIGHT_CH3_PIN 12 // BLUE
  774. #define LIGHT_CH4_PIN 14 // WHITE1
  775. #define LIGHT_CH5_PIN 4 // WHITE2
  776. #define LIGHT_CH1_INVERSE 0
  777. #define LIGHT_CH2_INVERSE 0
  778. #define LIGHT_CH3_INVERSE 0
  779. #define LIGHT_CH4_INVERSE 0
  780. #define LIGHT_CH5_INVERSE 0
  781. #elif defined(HUACANXING_H802)
  782. // Info
  783. #define MANUFACTURER "HUACANXING"
  784. #define DEVICE "H802"
  785. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  786. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  787. #define DUMMY_RELAY_COUNT 1
  788. #define DEBUG_PORT Serial1
  789. #define SERIAL_RX_ENABLED 1
  790. // Light
  791. #define LIGHT_CHANNELS 4
  792. #define LIGHT_CH1_PIN 12 // RED
  793. #define LIGHT_CH2_PIN 14 // GREEN
  794. #define LIGHT_CH3_PIN 13 // BLUE
  795. #define LIGHT_CH4_PIN 15 // WHITE
  796. #define LIGHT_CH1_INVERSE 0
  797. #define LIGHT_CH2_INVERSE 0
  798. #define LIGHT_CH3_INVERSE 0
  799. #define LIGHT_CH4_INVERSE 0
  800. // -----------------------------------------------------------------------------
  801. // Jan Goedeke Wifi Relay
  802. // https://github.com/JanGoe/esp8266-wifi-relay
  803. // -----------------------------------------------------------------------------
  804. #elif defined(JANGOE_WIFI_RELAY_NC)
  805. // Info
  806. #define MANUFACTURER "JANGOE"
  807. #define DEVICE "WIFI_RELAY_NC"
  808. // Buttons
  809. #define BUTTON1_PIN 12
  810. #define BUTTON2_PIN 13
  811. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  812. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  813. #define BUTTON1_RELAY 1
  814. #define BUTTON2_RELAY 2
  815. // Relays
  816. #define RELAY1_PIN 2
  817. #define RELAY2_PIN 14
  818. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  819. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  820. #elif defined(JANGOE_WIFI_RELAY_NO)
  821. // Info
  822. #define MANUFACTURER "JANGOE"
  823. #define DEVICE "WIFI_RELAY_NO"
  824. // Buttons
  825. #define BUTTON1_PIN 12
  826. #define BUTTON2_PIN 13
  827. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  828. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  829. #define BUTTON1_RELAY 1
  830. #define BUTTON2_RELAY 2
  831. // Relays
  832. #define RELAY1_PIN 2
  833. #define RELAY2_PIN 14
  834. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  835. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  836. // -----------------------------------------------------------------------------
  837. // Jorge García Wifi+Relays Board Kit
  838. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  839. // https://github.com/jorgegarciadev/wifikit
  840. // -----------------------------------------------------------------------------
  841. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  842. // Info
  843. #define MANUFACTURER "JORGEGARCIA"
  844. #define DEVICE "WIFI_RELAYS"
  845. // Relays
  846. #define RELAY1_PIN 0
  847. #define RELAY2_PIN 2
  848. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  849. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  850. // -----------------------------------------------------------------------------
  851. // WiFi MQTT Relay / Thermostat
  852. // -----------------------------------------------------------------------------
  853. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  854. // Info
  855. #define MANUFACTURER "OPENENERGYMONITOR"
  856. #define DEVICE "MQTT_RELAY"
  857. // Buttons
  858. #define BUTTON1_PIN 0
  859. #define BUTTON1_RELAY 1
  860. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  861. // Relays
  862. #define RELAY1_PIN 12
  863. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  864. // LEDs
  865. #define LED1_PIN 16
  866. #define LED1_PIN_INVERSE 0
  867. // -----------------------------------------------------------------------------
  868. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  869. // 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
  870. // 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
  871. // -----------------------------------------------------------------------------
  872. #elif defined(WION_50055)
  873. // Currently untested, does not support energy monitoring
  874. // Info
  875. #define MANUFACTURER "WION"
  876. #define DEVICE "50055"
  877. // Buttons
  878. #define BUTTON1_PIN 13
  879. #define BUTTON1_RELAY 1
  880. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  881. // Relays
  882. #define RELAY1_PIN 15
  883. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  884. // LEDs
  885. #define LED1_PIN 2
  886. #define LED1_PIN_INVERSE 0
  887. // -----------------------------------------------------------------------------
  888. // EX-Store Wifi Relay v3.1
  889. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  890. // -----------------------------------------------------------------------------
  891. #elif defined(EXS_WIFI_RELAY_V31)
  892. // Untested
  893. // Info
  894. #define MANUFACTURER "EXS"
  895. #define DEVICE "WIFI_RELAY_V31"
  896. // Buttons
  897. #define BUTTON1_PIN 0
  898. #define BUTTON1_RELAY 1
  899. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  900. // Relays
  901. #define RELAY1_PIN 13
  902. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  903. #define RELAY1_RESET_PIN 12
  904. // -----------------------------------------------------------------------------
  905. // V9261F
  906. // -----------------------------------------------------------------------------
  907. #elif defined(GENERIC_V9261F)
  908. // Info
  909. #define MANUFACTURER "GENERIC"
  910. #define DEVICE "V9261F"
  911. #define ALEXA_SUPPORT 0
  912. // V9261F
  913. #define V9261F_SUPPORT 1
  914. #define V9261F_PIN 2
  915. #define V9261F_PIN_INVERSE 1
  916. // -----------------------------------------------------------------------------
  917. // ECH1560
  918. // -----------------------------------------------------------------------------
  919. #elif defined(GENERIC_ECH1560)
  920. // Info
  921. #define MANUFACTURER "GENERIC"
  922. #define DEVICE "ECH1560"
  923. #define ALEXA_SUPPORT 0
  924. // ECH1560
  925. #define ECH1560_SUPPORT 1
  926. #define ECH1560_CLK_PIN 4
  927. #define ECH1560_MISO_PIN 5
  928. #define ECH1560_INVERTED 0
  929. // -----------------------------------------------------------------------------
  930. // ESPLive
  931. // https://github.com/ManCaveMade/ESP-Live
  932. // -----------------------------------------------------------------------------
  933. #elif defined(MANCAVEMADE_ESPLIVE)
  934. // Info
  935. #define MANUFACTURER "MANCAVEMADE"
  936. #define DEVICE "ESPLIVE"
  937. // Buttons
  938. #define BUTTON1_PIN 4
  939. #define BUTTON2_PIN 5
  940. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  941. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  942. #define BUTTON1_RELAY 1
  943. #define BUTTON2_RELAY 2
  944. // Relays
  945. #define RELAY1_PIN 12
  946. #define RELAY2_PIN 13
  947. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  948. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  949. // DS18B20
  950. #ifndef DALLAS_SUPPORT
  951. #define DALLAS_SUPPORT 1
  952. #endif
  953. #define DALLAS_PIN 2
  954. #define DALLAS_UPDATE_INTERVAL 5000
  955. #define TEMPERATURE_MIN_CHANGE 1.0
  956. // -----------------------------------------------------------------------------
  957. // QuinLED
  958. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  959. // -----------------------------------------------------------------------------
  960. #elif defined(INTERMITTECH_QUINLED)
  961. // Info
  962. #define MANUFACTURER "INTERMITTECH"
  963. #define DEVICE "QUINLED"
  964. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  965. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  966. #define DUMMY_RELAY_COUNT 1
  967. // LEDs
  968. #define LED1_PIN 5
  969. #define LED1_PIN_INVERSE 1
  970. // Light
  971. #define LIGHT_CHANNELS 2
  972. #define LIGHT_CH1_PIN 0
  973. #define LIGHT_CH2_PIN 2
  974. #define LIGHT_CH1_INVERSE 0
  975. #define LIGHT_CH2_INVERSE 0
  976. // -----------------------------------------------------------------------------
  977. // Arilux AL-LC06
  978. // -----------------------------------------------------------------------------
  979. #elif defined(ARILUX_AL_LC01)
  980. // Info
  981. #define MANUFACTURER "ARILUX"
  982. #define DEVICE "AL_LC01"
  983. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  984. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  985. #define DUMMY_RELAY_COUNT 1
  986. // Light
  987. #define LIGHT_CHANNELS 3
  988. #define LIGHT_CH1_PIN 5 // RED
  989. #define LIGHT_CH2_PIN 12 // GREEN
  990. #define LIGHT_CH3_PIN 13 // BLUE
  991. #define LIGHT_CH1_INVERSE 0
  992. #define LIGHT_CH2_INVERSE 0
  993. #define LIGHT_CH3_INVERSE 0
  994. #elif defined(ARILUX_AL_LC02)
  995. // Info
  996. #define MANUFACTURER "ARILUX"
  997. #define DEVICE "AL_LC02"
  998. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  999. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1000. #define DUMMY_RELAY_COUNT 1
  1001. // Light
  1002. #define LIGHT_CHANNELS 4
  1003. #define LIGHT_CH1_PIN 12 // RED
  1004. #define LIGHT_CH2_PIN 5 // GREEN
  1005. #define LIGHT_CH3_PIN 13 // BLUE
  1006. #define LIGHT_CH4_PIN 15 // WHITE1
  1007. #define LIGHT_CH1_INVERSE 0
  1008. #define LIGHT_CH2_INVERSE 0
  1009. #define LIGHT_CH3_INVERSE 0
  1010. #define LIGHT_CH4_INVERSE 0
  1011. #elif defined(ARILUX_AL_LC06)
  1012. // Info
  1013. #define MANUFACTURER "ARILUX"
  1014. #define DEVICE "AL_LC06"
  1015. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1016. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1017. #define DUMMY_RELAY_COUNT 1
  1018. // Light
  1019. #define LIGHT_CHANNELS 5
  1020. #define LIGHT_CH1_PIN 14 // RED
  1021. #define LIGHT_CH2_PIN 12 // GREEN
  1022. #define LIGHT_CH3_PIN 13 // BLUE
  1023. #define LIGHT_CH4_PIN 15 // WHITE1
  1024. #define LIGHT_CH5_PIN 5 // WHITE2
  1025. #define LIGHT_CH1_INVERSE 0
  1026. #define LIGHT_CH2_INVERSE 0
  1027. #define LIGHT_CH3_INVERSE 0
  1028. #define LIGHT_CH4_INVERSE 0
  1029. #define LIGHT_CH5_INVERSE 0
  1030. #elif defined(ARILUX_AL_LC11)
  1031. // Info
  1032. #define MANUFACTURER "ARILUX"
  1033. #define DEVICE "AL_LC11"
  1034. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1035. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1036. #define DUMMY_RELAY_COUNT 1
  1037. // Light
  1038. #define LIGHT_CHANNELS 5
  1039. #define LIGHT_CH1_PIN 5 // RED
  1040. #define LIGHT_CH2_PIN 4 // GREEN
  1041. #define LIGHT_CH3_PIN 14 // BLUE
  1042. #define LIGHT_CH4_PIN 13 // WHITE1
  1043. #define LIGHT_CH5_PIN 12 // WHITE1
  1044. #define LIGHT_CH1_INVERSE 0
  1045. #define LIGHT_CH2_INVERSE 0
  1046. #define LIGHT_CH3_INVERSE 0
  1047. #define LIGHT_CH4_INVERSE 0
  1048. #define LIGHT_CH5_INVERSE 0
  1049. #elif defined(ARILUX_E27)
  1050. // Info
  1051. #define MANUFACTURER "ARILUX"
  1052. #define DEVICE "E27"
  1053. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1054. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1055. #define DUMMY_RELAY_COUNT 1
  1056. // Light
  1057. #define LIGHT_CHANNELS 4
  1058. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  1059. #define MY92XX_CHIPS 1
  1060. #define MY92XX_DI_PIN 13
  1061. #define MY92XX_DCKI_PIN 15
  1062. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1063. #define MY92XX_MAPPING 0, 1, 2, 3
  1064. // -----------------------------------------------------------------------------
  1065. // XENON SM-PW701U
  1066. // -----------------------------------------------------------------------------
  1067. #elif defined(XENON_SM_PW702U)
  1068. // Info
  1069. #define MANUFACTURER "XENON"
  1070. #define DEVICE "SM_PW702U"
  1071. // Buttons
  1072. #define BUTTON1_PIN 13
  1073. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1074. #define BUTTON1_RELAY 1
  1075. // Relays
  1076. #define RELAY1_PIN 12
  1077. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1078. // LEDs
  1079. #define LED1_PIN 4
  1080. #define LED1_PIN_INVERSE 1
  1081. // -----------------------------------------------------------------------------
  1082. // AUTHOMETION LYT8266
  1083. // https://authometion.com/shop/en/home/13-lyt8266.html
  1084. // -----------------------------------------------------------------------------
  1085. #elif defined(AUTHOMETION_LYT8266)
  1086. // Info
  1087. #define MANUFACTURER "AUTHOMETION"
  1088. #define DEVICE "LYT8266"
  1089. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1090. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1091. #define DUMMY_RELAY_COUNT 1
  1092. // Light
  1093. #define LIGHT_CHANNELS 4
  1094. #define LIGHT_CH1_PIN 13 // RED
  1095. #define LIGHT_CH2_PIN 12 // GREEN
  1096. #define LIGHT_CH3_PIN 14 // BLUE
  1097. #define LIGHT_CH4_PIN 2 // WHITE
  1098. #define LIGHT_CH1_INVERSE 0
  1099. #define LIGHT_CH2_INVERSE 0
  1100. #define LIGHT_CH3_INVERSE 0
  1101. #define LIGHT_CH4_INVERSE 0
  1102. #define LIGHT_ENABLE_PIN 15
  1103. #elif defined(GIZWITS_WITTY_CLOUD)
  1104. // Info
  1105. #define MANUFACTURER "GIZWITS"
  1106. #define DEVICE "WITTY_CLOUD"
  1107. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1108. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1109. #define DUMMY_RELAY_COUNT 1
  1110. // Buttons
  1111. #define BUTTON1_PIN 4
  1112. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1113. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  1114. #define BUTTON1_CLICK BUTTON_MODE_NONE
  1115. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1116. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1117. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  1118. #define ANALOG_SUPPORT 1
  1119. // LEDs
  1120. #define LED1_PIN 2 // BLUE build-in
  1121. #define LED1_PIN_INVERSE 1
  1122. // Light
  1123. #define LIGHT_CHANNELS 3
  1124. #define LIGHT_CH1_PIN 15 // RED
  1125. #define LIGHT_CH2_PIN 12 // GREEN
  1126. #define LIGHT_CH3_PIN 13 // BLUE
  1127. #define LIGHT_CH1_INVERSE 0
  1128. #define LIGHT_CH2_INVERSE 0
  1129. #define LIGHT_CH3_INVERSE 0
  1130. // -----------------------------------------------------------------------------
  1131. // KMC 70011
  1132. // https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
  1133. // -----------------------------------------------------------------------------
  1134. #elif defined(KMC_70011)
  1135. // Info
  1136. #define MANUFACTURER "KMC"
  1137. #define DEVICE "70011"
  1138. // Buttons
  1139. #define BUTTON1_PIN 0
  1140. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1141. #define BUTTON1_RELAY 1
  1142. // Relays
  1143. #define RELAY1_PIN 14
  1144. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1145. // LEDs
  1146. #define LED1_PIN 13
  1147. #define LED1_PIN_INVERSE 0
  1148. // HLW8012
  1149. #ifndef HLW8012_SUPPORT
  1150. #define HLW8012_SUPPORT 1
  1151. #endif
  1152. #define HLW8012_SEL_PIN 12
  1153. #define HLW8012_CF1_PIN 5
  1154. #define HLW8012_CF_PIN 4
  1155. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1156. // -----------------------------------------------------------------------------
  1157. // Euromate (?) Wifi Stecker Shuko
  1158. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  1159. // Thanks to @Geitde
  1160. // -----------------------------------------------------------------------------
  1161. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  1162. // Info
  1163. #define MANUFACTURER "EUROMATE"
  1164. #define DEVICE "WIFI_STECKER_SCHUKO"
  1165. // Buttons
  1166. #define BUTTON1_PIN 14
  1167. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1168. #define BUTTON1_RELAY 1
  1169. // The relay in the device is not a bistable (latched) relay.
  1170. // The device is reported to have a flip-flop circuit to drive the relay
  1171. // So @Geitde hack is still the only possible
  1172. // Hack: drive GPIO12 low and use GPIO5 as normal relay pin:
  1173. #define RELAY1_PIN 5
  1174. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1175. #define LED2_PIN 12 /* DUMMY: exploit default off state for GPIO12=low */
  1176. #define LED2_PIN_INVERSE 0
  1177. // LEDs
  1178. #define LED1_PIN 4
  1179. #define LED1_PIN_INVERSE 0
  1180. // -----------------------------------------------------------------------------
  1181. // Generic 8CH
  1182. // -----------------------------------------------------------------------------
  1183. #elif defined(GENERIC_8CH)
  1184. // Info
  1185. #define MANUFACTURER "GENERIC"
  1186. #define DEVICE "8CH"
  1187. // Relays
  1188. #define RELAY1_PIN 0
  1189. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1190. #define RELAY2_PIN 2
  1191. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1192. #define RELAY3_PIN 4
  1193. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1194. #define RELAY4_PIN 5
  1195. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1196. #define RELAY5_PIN 12
  1197. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1198. #define RELAY6_PIN 13
  1199. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  1200. #define RELAY7_PIN 14
  1201. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  1202. #define RELAY8_PIN 15
  1203. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  1204. // -----------------------------------------------------------------------------
  1205. // STM RELAY
  1206. // -----------------------------------------------------------------------------
  1207. #elif defined(STM_RELAY)
  1208. // Info
  1209. #define MANUFACTURER "STM_RELAY"
  1210. #define DEVICE "2CH"
  1211. // Relays
  1212. #define DUMMY_RELAY_COUNT 2
  1213. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  1214. // Remove UART noise on serial line
  1215. #define DEBUG_SERIAL_SUPPORT 0
  1216. // -----------------------------------------------------------------------------
  1217. // Tonbux Powerstrip02
  1218. // -----------------------------------------------------------------------------
  1219. #elif defined(TONBUX_POWERSTRIP02)
  1220. // Info
  1221. #define MANUFACTURER "TONBUX"
  1222. #define DEVICE "POWERSTRIP02"
  1223. // Buttons
  1224. #define BUTTON1_PIN 5
  1225. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1226. #define BUTTON1_RELAY 0
  1227. // Relays
  1228. #define RELAY1_PIN 4
  1229. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1230. #define RELAY2_PIN 13
  1231. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1232. #define RELAY3_PIN 12
  1233. #define RELAY3_TYPE RELAY_TYPE_INVERSE
  1234. #define RELAY4_PIN 14
  1235. #define RELAY4_TYPE RELAY_TYPE_INVERSE
  1236. // Not a relay. USB ports on/off
  1237. #define RELAY5_PIN 16
  1238. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1239. // LEDs
  1240. #define LED1_PIN 0 // 1 blue led
  1241. #define LED1_PIN_INVERSE 1
  1242. #define LED2_PIN 3 // 3 red leds
  1243. #define LED2_PIN_INVERSE 1
  1244. // -----------------------------------------------------------------------------
  1245. // Lingan SWA1
  1246. // -----------------------------------------------------------------------------
  1247. #elif defined(LINGAN_SWA1)
  1248. // Info
  1249. #define MANUFACTURER "LINGAN"
  1250. #define DEVICE "SWA1"
  1251. // Buttons
  1252. #define BUTTON1_PIN 13
  1253. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1254. #define BUTTON1_RELAY 1
  1255. // Relays
  1256. #define RELAY1_PIN 5
  1257. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1258. // LEDs
  1259. #define LED1_PIN 4
  1260. #define LED1_PIN_INVERSE 1
  1261. // -----------------------------------------------------------------------------
  1262. // HEYGO HY02
  1263. // -----------------------------------------------------------------------------
  1264. #elif defined(HEYGO_HY02)
  1265. // Info
  1266. #define MANUFACTURER "HEYGO"
  1267. #define DEVICE "HY02"
  1268. // Buttons
  1269. #define BUTTON1_PIN 13
  1270. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1271. #define BUTTON1_RELAY 1
  1272. // Relays
  1273. #define RELAY1_PIN 12
  1274. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1275. // LEDs
  1276. #define LED1_PIN 4
  1277. #define LED1_PIN_INVERSE 0
  1278. // -----------------------------------------------------------------------------
  1279. // Maxcio W-US002S
  1280. // -----------------------------------------------------------------------------
  1281. #elif defined(MAXCIO_WUS002S)
  1282. // Info
  1283. #define MANUFACTURER "MAXCIO"
  1284. #define DEVICE "WUS002S"
  1285. // Buttons
  1286. #define BUTTON1_PIN 2
  1287. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1288. #define BUTTON1_RELAY 1
  1289. // Relays
  1290. #define RELAY1_PIN 13
  1291. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1292. // LEDs
  1293. #define LED1_PIN 3
  1294. #define LED1_PIN_INVERSE 0
  1295. // HLW8012
  1296. #ifndef HLW8012_SUPPORT
  1297. #define HLW8012_SUPPORT 1
  1298. #endif
  1299. #define HLW8012_SEL_PIN 12
  1300. #define HLW8012_CF1_PIN 5
  1301. #define HLW8012_CF_PIN 4
  1302. #define HLW8012_CURRENT_R 0.002 // Current resistor
  1303. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1304. // -----------------------------------------------------------------------------
  1305. // YiDian XS-SSA05
  1306. // -----------------------------------------------------------------------------
  1307. #elif defined(YIDIAN_XSSSA05)
  1308. // Info
  1309. #define MANUFACTURER "YIDIAN"
  1310. #define DEVICE "XSSSA05"
  1311. // Buttons
  1312. #define BUTTON1_PIN 13
  1313. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1314. #define BUTTON1_RELAY 1
  1315. // Relays
  1316. #define RELAY1_PIN 12
  1317. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1318. // LEDs
  1319. #define LED1_PIN 4
  1320. #define LED1_PIN_INVERSE 0
  1321. // HLW8012
  1322. #ifndef HLW8012_SUPPORT
  1323. #define HLW8012_SUPPORT 1
  1324. #endif
  1325. #define HLW8012_SEL_PIN 3
  1326. #define HLW8012_CF1_PIN 14
  1327. #define HLW8012_CF_PIN 5
  1328. #define HLW8012_CURRENT_R 0.001 // Current resistor
  1329. #define HLW8012_VOLTAGE_R_UP ( 2 * 1200000 ) // Upstream voltage resistor
  1330. // -----------------------------------------------------------------------------
  1331. // TONBUX XS-SSA06
  1332. // -----------------------------------------------------------------------------
  1333. #elif defined(TONBUX_XSSSA06)
  1334. // Info
  1335. #define MANUFACTURER "TONBUX"
  1336. #define DEVICE "XSSSA06"
  1337. // Buttons
  1338. #define BUTTON1_PIN 13
  1339. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1340. #define BUTTON1_RELAY 1
  1341. // Relays
  1342. #define RELAY1_PIN 15
  1343. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1344. // LEDs
  1345. #define LED1_PIN 0 // R - 8 rgb led ring
  1346. #define LED1_PIN_INVERSE 0
  1347. #define LED2_PIN 5 // G
  1348. #define LED2_PIN_INVERSE 0
  1349. #define LED3_PIN 2 // B
  1350. #define LED3_PIN_INVERSE 0
  1351. // -----------------------------------------------------------------------------
  1352. // GREEN ESP8266 RELAY MODULE
  1353. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1354. // -----------------------------------------------------------------------------
  1355. #elif defined(GREEN_ESP8266RELAY)
  1356. // Info
  1357. #define MANUFACTURER "GREEN"
  1358. #define DEVICE "ESP8266RELAY"
  1359. // Buttons
  1360. // Not a button but input via Optocoupler
  1361. #define BUTTON1_PIN 5
  1362. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1363. #define BUTTON1_RELAY 1
  1364. // Relays
  1365. #define RELAY1_PIN 4
  1366. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1367. // LEDs
  1368. #define LED1_PIN 2
  1369. #define LED1_PIN_INVERSE 1
  1370. // -----------------------------------------------------------------------------
  1371. // Henrique Gravina ESPIKE
  1372. // https://github.com/Henriquegravina/Espike
  1373. // -----------------------------------------------------------------------------
  1374. #elif defined(IKE_ESPIKE)
  1375. #define MANUFACTURER "IKE"
  1376. #define DEVICE "ESPIKE"
  1377. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1378. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1379. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1380. #define BUTTON1_PIN 13
  1381. #define BUTTON1_RELAY 1
  1382. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1383. #define BUTTON2_PIN 12
  1384. #define BUTTON2_RELAY 2
  1385. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1386. #define BUTTON3_PIN 14
  1387. #define BUTTON3_RELAY 2
  1388. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1389. #define RELAY1_PIN 4
  1390. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1391. #define RELAY2_PIN 5
  1392. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1393. #define RELAY3_PIN 16
  1394. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1395. #define LED1_PIN 2
  1396. #define LED1_PIN_INVERSE 1
  1397. // -----------------------------------------------------------------------------
  1398. // SWIFITCH
  1399. // https://github.com/ArnieX/swifitch
  1400. // -----------------------------------------------------------------------------
  1401. #elif defined(ARNIEX_SWIFITCH)
  1402. // Info
  1403. #define MANUFACTURER "ARNIEX"
  1404. #define DEVICE "SWIFITCH"
  1405. // Buttons
  1406. #define BUTTON1_PIN 4 // D2
  1407. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1408. #define BUTTON1_RELAY 1
  1409. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1410. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1411. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1412. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1413. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1414. // Relays
  1415. #define RELAY1_PIN 5 // D1
  1416. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1417. // LEDs
  1418. #define LED1_PIN 12 // D6
  1419. #define LED1_PIN_INVERSE 1
  1420. // -----------------------------------------------------------------------------
  1421. // ESP-01S RELAY v4.0
  1422. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  1423. // -----------------------------------------------------------------------------
  1424. #elif defined(GENERIC_ESP01S_RELAY_V40)
  1425. // Info
  1426. #define MANUFACTURER "GENERIC"
  1427. #define DEVICE "ESP01S_RELAY_40"
  1428. // Relays
  1429. #define RELAY1_PIN 0
  1430. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1431. // LEDs
  1432. #define LED1_PIN 2
  1433. #define LED1_PIN_INVERSE 0
  1434. // -----------------------------------------------------------------------------
  1435. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  1436. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  1437. // -----------------------------------------------------------------------------
  1438. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  1439. // Info
  1440. #define MANUFACTURER "GENERIC"
  1441. #define DEVICE "ESP01S_RGBLED_10"
  1442. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  1443. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  1444. // Buttons
  1445. //#define BUTTON1_PIN 2
  1446. // Relays
  1447. //#define RELAY1_PIN 2
  1448. // LEDs
  1449. #define LED1_PIN 2
  1450. // -----------------------------------------------------------------------------
  1451. // ESP-01S DHT11 v1.0
  1452. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  1453. // -----------------------------------------------------------------------------
  1454. #elif defined(GENERIC_ESP01S_DHT11_V10)
  1455. // Info
  1456. #define MANUFACTURER "GENERIC"
  1457. #define DEVICE "ESP01S_DHT11_10"
  1458. // DHT11
  1459. #ifndef DHT_SUPPORT
  1460. #define DHT_SUPPORT 1
  1461. #endif
  1462. #define DHT_PIN 2
  1463. // -----------------------------------------------------------------------------
  1464. // ESP-01S DS18B20 v1.0
  1465. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  1466. // -----------------------------------------------------------------------------
  1467. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  1468. // Info
  1469. #define MANUFACTURER "GENERIC"
  1470. #define DEVICE "ESP01S_DS18B20_10"
  1471. // DB18B20
  1472. #ifndef DALLAS_SUPPORT
  1473. #define DALLAS_SUPPORT 1
  1474. #endif
  1475. #define DALLAS_PIN 2
  1476. // -----------------------------------------------------------------------------
  1477. // Heltec Touch Relay
  1478. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  1479. // -----------------------------------------------------------------------------
  1480. #elif defined(HELTEC_TOUCHRELAY)
  1481. // Info
  1482. #define MANUFACTURER "HELTEC"
  1483. #define DEVICE "TOUCH_RELAY"
  1484. // Buttons
  1485. #define BUTTON1_PIN 14
  1486. #define BUTTON1_RELAY 1
  1487. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1488. // Relays
  1489. #define RELAY1_PIN 12
  1490. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1491. // -----------------------------------------------------------------------------
  1492. // TEST boards (do not use!!)
  1493. // -----------------------------------------------------------------------------
  1494. #elif defined(TRAVIS01)
  1495. // Info
  1496. #define MANUFACTURER "TravisCI"
  1497. #define DEVICE "Virtual board 01"
  1498. // Some buttons - pin 0
  1499. #define BUTTON1_PIN 0
  1500. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1501. #define BUTTON1_RELAY 1
  1502. // Some relays - pin 1
  1503. #define RELAY1_PIN 1
  1504. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1505. // Some LEDs - pin 2
  1506. #define LED1_PIN 2
  1507. #define LED1_PIN_INVERSE 1
  1508. // A bit of I2C - pins 3,4
  1509. #define I2C_SDA_PIN 3
  1510. #define I2C_SCL_PIN 4
  1511. // And, as they say in "From Dusk till Dawn":
  1512. // This is a sensor blow out!
  1513. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  1514. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  1515. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  1516. // C'mon, you want sensor, come on in sensor lovers!
  1517. // If we don’t got it, you don't want it!
  1518. #define BH1750_SUPPORT 1
  1519. #define BMX280_SUPPORT 1
  1520. #define SHT3X_I2C_SUPPORT 1
  1521. #define EMON_ADC121_SUPPORT 1
  1522. #define EMON_ADS1X15_SUPPORT 1
  1523. #define SHT3X_I2C_SUPPORT 1
  1524. #define SI7021_SUPPORT 1
  1525. // A bit of lights - pin 5
  1526. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1527. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1528. #define DUMMY_RELAY_COUNT 1
  1529. #define LIGHT_CHANNELS 1
  1530. #define LIGHT_CH1_PIN 5
  1531. #define LIGHT_CH1_INVERSE 0
  1532. // A bit of HLW8012 - pins 6,7,8
  1533. #ifndef HLW8012_SUPPORT
  1534. #define HLW8012_SUPPORT 1
  1535. #endif
  1536. #define HLW8012_SEL_PIN 6
  1537. #define HLW8012_CF1_PIN 7
  1538. #define HLW8012_CF_PIN 8
  1539. // A bit of Dallas - pin 9
  1540. #ifndef DALLAS_SUPPORT
  1541. #define DALLAS_SUPPORT 1
  1542. #endif
  1543. #define DALLAS_PIN 9
  1544. // A bit of ECH1560 - pins 10,11, 12
  1545. #ifndef ECH1560_SUPPORT
  1546. #define ECH1560_SUPPORT 1
  1547. #endif
  1548. #define ECH1560_CLK_PIN 10
  1549. #define ECH1560_MISO_PIN 11
  1550. #define ECH1560_INVERTED 12
  1551. #elif defined(TRAVIS02)
  1552. // Relay provider dual
  1553. #define MANUFACTURER "TravisCI"
  1554. #define DEVICE "Virtual board 02"
  1555. // A bit of DHT - pin 1
  1556. #ifndef DHT_SUPPORT
  1557. #define DHT_SUPPORT 1
  1558. #endif
  1559. #define DHT_PIN 1
  1560. // Relay type dual - pins 2,3
  1561. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  1562. #define RELAY1_PIN 2
  1563. #define RELAY2_PIN 3
  1564. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1565. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1566. // IR - pin 4
  1567. #define IR_SUPPORT 1
  1568. #define IR_PIN 4
  1569. #define IR_BUTTON_SET 1
  1570. #elif defined(TRAVIS03)
  1571. // Relay provider light/my92XX
  1572. #define MANUFACTURER "TravisCI"
  1573. #define DEVICE "Virtual board 03"
  1574. // MY9231 Light - pins 1,2
  1575. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1576. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1577. #define DUMMY_RELAY_COUNT 1
  1578. #define LIGHT_CHANNELS 5
  1579. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  1580. #define MY92XX_CHIPS 2
  1581. #define MY92XX_DI_PIN 1
  1582. #define MY92XX_DCKI_PIN 2
  1583. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1584. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  1585. #endif
  1586. // -----------------------------------------------------------------------------
  1587. // Check definitions
  1588. // -----------------------------------------------------------------------------
  1589. #if not defined(MANUFACTURER) || not defined(DEVICE)
  1590. #error "UNSUPPORTED HARDWARE!!"
  1591. #endif