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.

1213 lines
36 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 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 4 relays)
  15. // RELAY#_TYPE: Relay can be RELAY_TYPE_NORMAL, RELAY_TYPE_INVERSE or RELAY_TYPE_LATCHED
  16. // LED#_PIN: GPIO for the n-th LED (1-based, up to 4 LEDs)
  17. // LED#_PIN_INVERSE: LED has inversed logic (lit when pulled down)
  18. // LED#_MODE: Check hardware.h for LED_MODE_%
  19. // LED#_RELAY: Linked relay (1-based)
  20. //
  21. // Besides, other hardware specific information should be stated here
  22. // -----------------------------------------------------------------------------
  23. // Development boards
  24. // -----------------------------------------------------------------------------
  25. #if defined(NODEMCU_LOLIN)
  26. // Info
  27. #define MANUFACTURER "NODEMCU"
  28. #define DEVICE "LOLIN"
  29. // Buttons
  30. #define BUTTON1_PIN 0
  31. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  32. #define BUTTON1_RELAY 1
  33. // Relays
  34. #define RELAY1_PIN 12
  35. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  36. // LEDs
  37. #define LED1_PIN 2
  38. #define LED1_PIN_INVERSE 1
  39. #elif defined(WEMOS_D1_MINI_RELAYSHIELD)
  40. // Info
  41. #define MANUFACTURER "WEMOS"
  42. #define DEVICE "D1_MINI_RELAYSHIELD"
  43. // Buttons
  44. // No buttons on the D1 MINI alone, but defining it without adding a button doen't create problems
  45. #define BUTTON1_PIN 0 // Connect a pushbutton between D3 and GND,
  46. // it's the same as using a Wemos one button shield
  47. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  48. #define BUTTON1_RELAY 1
  49. // Relays
  50. #define RELAY1_PIN 5
  51. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  52. // LEDs
  53. #define LED1_PIN 2
  54. #define LED1_PIN_INVERSE 1
  55. // -----------------------------------------------------------------------------
  56. // ESPurna
  57. // -----------------------------------------------------------------------------
  58. #elif defined(TINKERMAN_ESPURNA_H06)
  59. // Info
  60. #define MANUFACTURER "TINKERMAN"
  61. #define DEVICE "ESPURNA_H06"
  62. // Buttons
  63. #define BUTTON1_PIN 4
  64. #define BUTTON1_RELAY 1
  65. #ifdef USE_TOUCH_BUTTON
  66. // Touch button
  67. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  68. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  69. #define BUTTON1_CLICK BUTTON_MODE_NONE
  70. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  71. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  72. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  73. #else
  74. // Normal pushbutton
  75. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  76. #endif
  77. // Relays
  78. #define RELAY1_PIN 12
  79. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  80. // LEDs
  81. #define LED1_PIN 2
  82. #define LED1_PIN_INVERSE 1
  83. // HLW8012
  84. #define HLW8012_SUPPORT 1
  85. #define HLW8012_SEL_PIN 2
  86. #define HLW8012_CF1_PIN 13
  87. #define HLW8012_CF_PIN 14
  88. #elif defined(TINKERMAN_ESPURNA_H08)
  89. // Info
  90. #define MANUFACTURER "TINKERMAN"
  91. #define DEVICE "ESPURNA_H08"
  92. // Buttons
  93. #define BUTTON1_PIN 4
  94. #define BUTTON1_RELAY 1
  95. #ifdef USE_TOUCH_BUTTON
  96. // Touch button
  97. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  98. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  99. #define BUTTON1_CLICK BUTTON_MODE_NONE
  100. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  101. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  102. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  103. #else
  104. // Normal pushbutton
  105. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  106. #endif
  107. // Relays
  108. #define RELAY1_PIN 12
  109. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  110. // LEDs
  111. #define LED1_PIN 2
  112. #define LED1_PIN_INVERSE 0
  113. // HLW8012
  114. #define HLW8012_SUPPORT 1
  115. #define HLW8012_SEL_PIN 5
  116. #define HLW8012_CF1_PIN 13
  117. #define HLW8012_CF_PIN 14
  118. // -----------------------------------------------------------------------------
  119. // Itead Studio boards
  120. // -----------------------------------------------------------------------------
  121. #elif defined(ITEAD_SONOFF_BASIC)
  122. // Info
  123. #define MANUFACTURER "ITEAD"
  124. #define DEVICE "SONOFF_BASIC"
  125. // Buttons
  126. #define BUTTON1_PIN 0
  127. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  128. #define BUTTON1_RELAY 1
  129. #define BUTTON2_PIN 14
  130. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP
  131. #define BUTTON2_RELAY 1
  132. // Relays
  133. #define RELAY1_PIN 12
  134. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  135. // LEDs
  136. #define LED1_PIN 13
  137. #define LED1_PIN_INVERSE 1
  138. #elif defined(ITEAD_SONOFF_RF)
  139. // Info
  140. #define MANUFACTURER "ITEAD"
  141. #define DEVICE "SONOFF_RF"
  142. // Buttons
  143. #define BUTTON1_PIN 0
  144. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  145. #define BUTTON1_RELAY 1
  146. #define BUTTON2_PIN 14
  147. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP
  148. #define BUTTON2_RELAY 1
  149. // Relays
  150. #define RELAY1_PIN 12
  151. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  152. // LEDs
  153. #define LED1_PIN 13
  154. #define LED1_PIN_INVERSE 1
  155. #elif defined(ITEAD_SONOFF_TH)
  156. // Info
  157. #define MANUFACTURER "ITEAD"
  158. #define DEVICE "SONOFF_TH"
  159. // Buttons
  160. #define BUTTON1_PIN 0
  161. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  162. #define BUTTON1_RELAY 1
  163. // Relays
  164. #define RELAY1_PIN 12
  165. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  166. // LEDs
  167. #define LED1_PIN 13
  168. #define LED1_PIN_INVERSE 1
  169. // Jack is connected to GPIO14 (and with a small hack to GPIO4)
  170. #define DALLAS_SUPPORT 1
  171. #define DALLAS_PIN 14
  172. #define DHT_SUPPORT 1
  173. #define DHT_PIN 14
  174. //#define I2C_SDA_PIN 4
  175. //#define I2C_SCL_PIN 14
  176. #elif defined(ITEAD_SONOFF_SV)
  177. // Info
  178. #define MANUFACTURER "ITEAD"
  179. #define DEVICE "SONOFF_SV"
  180. // Buttons
  181. #define BUTTON1_PIN 0
  182. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  183. #define BUTTON1_RELAY 1
  184. // Relays
  185. #define RELAY1_PIN 12
  186. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  187. // LEDs
  188. #define LED1_PIN 13
  189. #define LED1_PIN_INVERSE 1
  190. #elif defined(ITEAD_SLAMPHER)
  191. // Info
  192. #define MANUFACTURER "ITEAD"
  193. #define DEVICE "SLAMPHER"
  194. // Buttons
  195. #define BUTTON1_PIN 0
  196. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  197. #define BUTTON1_RELAY 1
  198. // Relays
  199. #define RELAY1_PIN 12
  200. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  201. // LEDs
  202. #define LED1_PIN 13
  203. #define LED1_PIN_INVERSE 1
  204. #elif defined(ITEAD_S20)
  205. // Info
  206. #define MANUFACTURER "ITEAD"
  207. #define DEVICE "S20"
  208. // Buttons
  209. #define BUTTON1_PIN 0
  210. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  211. #define BUTTON1_RELAY 1
  212. // Relays
  213. #define RELAY1_PIN 12
  214. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  215. // LEDs
  216. #define LED1_PIN 13
  217. #define LED1_PIN_INVERSE 1
  218. #elif defined(ITEAD_SONOFF_TOUCH)
  219. // Info
  220. #define MANUFACTURER "ITEAD"
  221. #define DEVICE "SONOFF_TOUCH"
  222. // Buttons
  223. #define BUTTON1_PIN 0
  224. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  225. #define BUTTON1_RELAY 1
  226. // Relays
  227. #define RELAY1_PIN 12
  228. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  229. // LEDs
  230. #define LED1_PIN 13
  231. #define LED1_PIN_INVERSE 1
  232. #elif defined(ITEAD_SONOFF_POW)
  233. // Info
  234. #define MANUFACTURER "ITEAD"
  235. #define DEVICE "SONOFF_POW"
  236. // Buttons
  237. #define BUTTON1_PIN 0
  238. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  239. #define BUTTON1_RELAY 1
  240. // Relays
  241. #define RELAY1_PIN 12
  242. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  243. // LEDs
  244. #define LED1_PIN 15
  245. #define LED1_PIN_INVERSE 0
  246. // HLW8012
  247. #define HLW8012_SUPPORT 1
  248. #define HLW8012_SEL_PIN 5
  249. #define HLW8012_CF1_PIN 13
  250. #define HLW8012_CF_PIN 14
  251. #elif defined(ITEAD_SONOFF_DUAL)
  252. // Info
  253. #define MANUFACTURER "ITEAD"
  254. #define DEVICE "SONOFF_DUAL"
  255. #define SERIAL_BAUDRATE 19230
  256. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  257. #define DUMMY_RELAY_COUNT 2
  258. #define DEBUG_SERIAL_SUPPORT 0
  259. #define TERMINAL_SUPPORT 0
  260. // Buttons
  261. #define BUTTON3_RELAY 1
  262. // LEDs
  263. #define LED1_PIN 13
  264. #define LED1_PIN_INVERSE 1
  265. #elif defined(ITEAD_SONOFF_DUAL_R2)
  266. #define MANUFACTURER "ITEAD"
  267. #define DEVICE "SONOFF_DUAL_R2"
  268. // Buttons
  269. #define BUTTON1_PIN 0
  270. #define BUTTON2_PIN 9
  271. #define BUTTON3_PIN 10
  272. #define BUTTON1_RELAY 1
  273. #define BUTTON2_RELAY 2
  274. #define BUTTON3_RELAY 1
  275. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP
  276. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP
  277. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  278. // Relays
  279. #define RELAY1_PIN 12
  280. #define RELAY2_PIN 5
  281. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  282. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  283. // LEDs
  284. #define LED1_PIN 13
  285. #define LED1_PIN_INVERSE 1
  286. #elif defined(ITEAD_SONOFF_4CH)
  287. // Info
  288. #define MANUFACTURER "ITEAD"
  289. #define DEVICE "SONOFF_4CH"
  290. // Buttons
  291. #define BUTTON1_PIN 0
  292. #define BUTTON2_PIN 9
  293. #define BUTTON3_PIN 10
  294. #define BUTTON4_PIN 14
  295. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  296. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  297. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  298. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  299. #define BUTTON1_RELAY 1
  300. #define BUTTON2_RELAY 2
  301. #define BUTTON3_RELAY 3
  302. #define BUTTON4_RELAY 4
  303. // Relays
  304. #define RELAY1_PIN 12
  305. #define RELAY2_PIN 5
  306. #define RELAY3_PIN 4
  307. #define RELAY4_PIN 15
  308. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  309. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  310. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  311. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  312. // LEDs
  313. #define LED1_PIN 13
  314. #define LED1_PIN_INVERSE 1
  315. #elif defined(ITEAD_SONOFF_4CH_PRO)
  316. // Info
  317. #define MANUFACTURER "ITEAD"
  318. #define DEVICE "SONOFF_4CH_PRO"
  319. // Buttons
  320. #define BUTTON1_PIN 0
  321. #define BUTTON2_PIN 9
  322. #define BUTTON3_PIN 10
  323. #define BUTTON4_PIN 14
  324. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  325. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  326. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  327. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  328. #define BUTTON1_RELAY 1
  329. #define BUTTON2_RELAY 2
  330. #define BUTTON3_RELAY 3
  331. #define BUTTON4_RELAY 4
  332. // Relays
  333. #define RELAY1_PIN 12
  334. #define RELAY2_PIN 5
  335. #define RELAY3_PIN 4
  336. #define RELAY4_PIN 15
  337. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  338. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  339. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  340. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  341. // LEDs
  342. #define LED1_PIN 13
  343. #define LED1_PIN_INVERSE 1
  344. #elif defined(ITEAD_1CH_INCHING)
  345. // The inching functionality is managed by a misterious IC in the board.
  346. // You cannot control the inching button and functionality from the ESP8266
  347. // Besides, enabling the inching functionality using the hardware button
  348. // will result in the relay switching on and off continuously.
  349. // Fortunately the unkown IC keeps memory of the hardware inching status
  350. // so you can just disable it and forget. The inching LED must be lit.
  351. // You can still use the pulse options from the web interface
  352. // without problem.
  353. // Info
  354. #define MANUFACTURER "ITEAD"
  355. #define DEVICE "1CH_INCHING"
  356. // Buttons
  357. #define BUTTON1_PIN 0
  358. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  359. #define BUTTON1_RELAY 1
  360. // Relays
  361. #define RELAY1_PIN 12
  362. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  363. // LEDs
  364. #define LED1_PIN 13
  365. #define LED1_PIN_INVERSE 1
  366. #elif defined(ITEAD_MOTOR)
  367. // Info
  368. #define MANUFACTURER "ITEAD"
  369. #define DEVICE "MOTOR"
  370. // Buttons
  371. #define BUTTON1_PIN 0
  372. #define BUTTON1_RELAY 1
  373. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  374. // Relays
  375. #define RELAY1_PIN 12
  376. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  377. // LEDs
  378. #define LED1_PIN 13
  379. #define LED1_PIN_INVERSE 1
  380. #elif defined(ITEAD_BNSZ01)
  381. // Info
  382. #define MANUFACTURER "ITEAD"
  383. #define DEVICE "BNSZ01"
  384. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  385. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  386. #define DUMMY_RELAY_COUNT 1
  387. // LEDs
  388. #define LED1_PIN 13
  389. #define LED1_PIN_INVERSE 1
  390. // Light
  391. #define LIGHT_CHANNELS 1
  392. #define LIGHT_CH1_PIN 12
  393. #define LIGHT_CH1_INVERSE 0
  394. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  395. // Info
  396. #define MANUFACTURER "ITEAD"
  397. #define DEVICE "SONOFF_RFBRIDGE"
  398. #define SERIAL_BAUDRATE 19200
  399. #define RELAY_PROVIDER RELAY_PROVIDER_RFBRIDGE
  400. #ifndef DUMMY_RELAY_COUNT
  401. #define DUMMY_RELAY_COUNT 8
  402. #endif
  403. // Remove UART noise on serial line
  404. #define TERMINAL_SUPPORT 0
  405. #define DEBUG_SERIAL_SUPPORT 0
  406. // Buttons
  407. #define BUTTON1_PIN 0
  408. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  409. // LEDs
  410. #define LED1_PIN 13
  411. #define LED1_PIN_INVERSE 1
  412. #elif defined(ITEAD_SONOFF_B1)
  413. // Info
  414. #define MANUFACTURER "ITEAD"
  415. #define DEVICE "SONOFF_B1"
  416. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  417. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  418. #define DUMMY_RELAY_COUNT 1
  419. // Light
  420. #define LIGHT_CHANNELS 5
  421. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  422. #define MY92XX_CHIPS 2
  423. #define MY92XX_DI_PIN 12
  424. #define MY92XX_DCKI_PIN 14
  425. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  426. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  427. #elif defined(ITEAD_SONOFF_LED)
  428. // Info
  429. #define MANUFACTURER "ITEAD"
  430. #define DEVICE "SONOFF_LED"
  431. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  432. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  433. #define DUMMY_RELAY_COUNT 1
  434. // LEDs
  435. #define LED1_PIN 13
  436. #define LED1_PIN_INVERSE 1
  437. // Light
  438. #define LIGHT_CHANNELS 2
  439. #define LIGHT_CH1_PIN 12 // Cold white
  440. #define LIGHT_CH2_PIN 14 // Warm white
  441. #define LIGHT_CH1_INVERSE 0
  442. #define LIGHT_CH2_INVERSE 0
  443. #elif defined(ITEAD_SONOFF_T1_1CH)
  444. // Info
  445. #define MANUFACTURER "ITEAD"
  446. #define DEVICE "SONOFF_T1_1CH"
  447. // Buttons
  448. #define BUTTON1_PIN 0
  449. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  450. #define BUTTON1_RELAY 1
  451. // Relays
  452. #define RELAY1_PIN 12
  453. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  454. // LEDs
  455. #define LED1_PIN 13
  456. #define LED1_PIN_INVERSE 1
  457. #elif defined(ITEAD_SONOFF_T1_2CH)
  458. // Info
  459. #define MANUFACTURER "ITEAD"
  460. #define DEVICE "SONOFF_T1_2CH"
  461. // Buttons
  462. #define BUTTON1_PIN 0
  463. #define BUTTON2_PIN 9
  464. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  465. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  466. #define BUTTON1_RELAY 1
  467. #define BUTTON2_RELAY 2
  468. // Relays
  469. #define RELAY1_PIN 12
  470. #define RELAY2_PIN 5
  471. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  472. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  473. // LEDs
  474. #define LED1_PIN 13
  475. #define LED1_PIN_INVERSE 1
  476. #elif defined(ITEAD_SONOFF_T1_3CH)
  477. // Info
  478. #define MANUFACTURER "ITEAD"
  479. #define DEVICE "SONOFF_T1_3CH"
  480. // Buttons
  481. #define BUTTON1_PIN 0
  482. #define BUTTON2_PIN 9
  483. #define BUTTON3_PIN 10
  484. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  485. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  486. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  487. #define BUTTON1_RELAY 1
  488. #define BUTTON2_RELAY 2
  489. #define BUTTON3_RELAY 3
  490. // Relays
  491. #define RELAY1_PIN 12
  492. #define RELAY2_PIN 5
  493. #define RELAY3_PIN 4
  494. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  495. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  496. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  497. // LEDs
  498. #define LED1_PIN 13
  499. #define LED1_PIN_INVERSE 1
  500. // -----------------------------------------------------------------------------
  501. // YJZK
  502. // -----------------------------------------------------------------------------
  503. #elif defined(YJZK_SWITCH_2CH)
  504. // Info
  505. #define MANUFACTURER "YJZK"
  506. #define DEVICE "SWITCH_2CH"
  507. // Buttons
  508. #define BUTTON1_PIN 0
  509. #define BUTTON2_PIN 9
  510. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  511. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  512. #define BUTTON1_RELAY 1
  513. #define BUTTON2_RELAY 2
  514. // Relays
  515. #define RELAY1_PIN 12
  516. #define RELAY2_PIN 5
  517. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  518. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  519. // LEDs
  520. #define LED1_PIN 13
  521. #define LED1_PIN_INVERSE 0
  522. #define LED_WIFI 0
  523. // -----------------------------------------------------------------------------
  524. // Electrodragon boards
  525. // -----------------------------------------------------------------------------
  526. #elif defined(ELECTRODRAGON_WIFI_IOT)
  527. // Info
  528. #define MANUFACTURER "ELECTRODRAGON"
  529. #define DEVICE "WIFI_IOT"
  530. // Buttons
  531. #define BUTTON1_PIN 0
  532. #define BUTTON2_PIN 2
  533. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  534. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  535. #define BUTTON1_RELAY 1
  536. #define BUTTON2_RELAY 2
  537. // Relays
  538. #define RELAY1_PIN 12
  539. #define RELAY2_PIN 13
  540. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  541. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  542. // LEDs
  543. #define LED1_PIN 16
  544. #define LED1_PIN_INVERSE 0
  545. // -----------------------------------------------------------------------------
  546. // WorkChoice ecoPlug
  547. // -----------------------------------------------------------------------------
  548. #elif defined(WORKCHOICE_ECOPLUG)
  549. // Info
  550. #define MANUFACTURER "WORKCHOICE"
  551. #define DEVICE "ECOPLUG"
  552. // Buttons
  553. #define BUTTON1_PIN 13
  554. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  555. #define BUTTON1_RELAY 1
  556. // Relays
  557. #define RELAY1_PIN 15
  558. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  559. // LEDs
  560. #define LED1_PIN 2
  561. #define LED1_PIN_INVERSE 0
  562. // -----------------------------------------------------------------------------
  563. // AI Thinker
  564. // -----------------------------------------------------------------------------
  565. #elif defined(AITHINKER_AI_LIGHT)
  566. // Info
  567. #define MANUFACTURER "AITHINKER"
  568. #define DEVICE "AI_LIGHT"
  569. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  570. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  571. #define DUMMY_RELAY_COUNT 1
  572. // Light
  573. #define LIGHT_CHANNELS 4
  574. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  575. #define MY92XX_CHIPS 1
  576. #define MY92XX_DI_PIN 13
  577. #define MY92XX_DCKI_PIN 15
  578. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  579. #define MY92XX_MAPPING 0, 1, 2, 3
  580. // -----------------------------------------------------------------------------
  581. // LED Controller
  582. // -----------------------------------------------------------------------------
  583. #elif defined(MAGICHOME_LED_CONTROLLER)
  584. // Info
  585. #define MANUFACTURER "MAGICHOME"
  586. #define DEVICE "LED_CONTROLLER"
  587. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  588. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  589. #define DUMMY_RELAY_COUNT 1
  590. // LEDs
  591. #define LED1_PIN 2
  592. #define LED1_PIN_INVERSE 1
  593. // Light
  594. #define LIGHT_CHANNELS 4
  595. #define LIGHT_CH1_PIN 14 // RED
  596. #define LIGHT_CH2_PIN 5 // GREEN
  597. #define LIGHT_CH3_PIN 12 // BLUE
  598. #define LIGHT_CH4_PIN 13 // WHITE
  599. #define LIGHT_CH1_INVERSE 0
  600. #define LIGHT_CH2_INVERSE 0
  601. #define LIGHT_CH3_INVERSE 0
  602. #define LIGHT_CH4_INVERSE 0
  603. // IR
  604. #define IR_SUPPORT 1
  605. #define IR_PIN 4
  606. #define IR_BUTTON_SET 1
  607. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  608. // Info
  609. #define MANUFACTURER "MAGICHOME"
  610. #define DEVICE "LED_CONTROLLER_20"
  611. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  612. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  613. #define DUMMY_RELAY_COUNT 1
  614. // LEDs
  615. #define LED1_PIN 2
  616. #define LED1_PIN_INVERSE 1
  617. // Light
  618. #define LIGHT_CHANNELS 4
  619. #define LIGHT_CH1_PIN 5 // RED
  620. #define LIGHT_CH2_PIN 12 // GREEN
  621. #define LIGHT_CH3_PIN 13 // BLUE
  622. #define LIGHT_CH4_PIN 15 // WHITE
  623. #define LIGHT_CH1_INVERSE 0
  624. #define LIGHT_CH2_INVERSE 0
  625. #define LIGHT_CH3_INVERSE 0
  626. #define LIGHT_CH4_INVERSE 0
  627. // IR
  628. #define IR_SUPPORT 1
  629. #define IR_PIN 4
  630. #define IR_BUTTON_SET 1
  631. // -----------------------------------------------------------------------------
  632. // HUACANXING H801 & H802
  633. // -----------------------------------------------------------------------------
  634. #elif defined(HUACANXING_H801)
  635. // Info
  636. #define MANUFACTURER "HUACANXING"
  637. #define DEVICE "H801"
  638. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  639. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  640. #define DUMMY_RELAY_COUNT 1
  641. #define DEBUG_PORT Serial1
  642. // LEDs
  643. #define LED1_PIN 5
  644. #define LED1_PIN_INVERSE 1
  645. // Light
  646. #define LIGHT_CHANNELS 5
  647. #define LIGHT_CH1_PIN 15 // RED
  648. #define LIGHT_CH2_PIN 13 // GREEN
  649. #define LIGHT_CH3_PIN 12 // BLUE
  650. #define LIGHT_CH4_PIN 14 // WHITE1
  651. #define LIGHT_CH5_PIN 4 // WHITE2
  652. #define LIGHT_CH1_INVERSE 0
  653. #define LIGHT_CH2_INVERSE 0
  654. #define LIGHT_CH3_INVERSE 0
  655. #define LIGHT_CH4_INVERSE 0
  656. #define LIGHT_CH5_INVERSE 0
  657. #elif defined(HUACANXING_H802)
  658. // Info
  659. #define MANUFACTURER "HUACANXING"
  660. #define DEVICE "H802"
  661. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  662. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  663. #define DUMMY_RELAY_COUNT 1
  664. #define DEBUG_PORT Serial1
  665. // Light
  666. #define LIGHT_CHANNELS 4
  667. #define LIGHT_CH1_PIN 12 // RED
  668. #define LIGHT_CH2_PIN 14 // GREEN
  669. #define LIGHT_CH3_PIN 13 // BLUE
  670. #define LIGHT_CH4_PIN 15 // WHITE
  671. #define LIGHT_CH1_INVERSE 0
  672. #define LIGHT_CH2_INVERSE 0
  673. #define LIGHT_CH3_INVERSE 0
  674. #define LIGHT_CH4_INVERSE 0
  675. // -----------------------------------------------------------------------------
  676. // Jan Goedeke Wifi Relay
  677. // https://github.com/JanGoe/esp8266-wifi-relay
  678. // -----------------------------------------------------------------------------
  679. #elif defined(JANGOE_WIFI_RELAY_NC)
  680. // Info
  681. #define MANUFACTURER "JANGOE"
  682. #define DEVICE "WIFI_RELAY_NC"
  683. // Buttons
  684. #define BUTTON1_PIN 12
  685. #define BUTTON2_PIN 13
  686. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  687. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  688. #define BUTTON1_RELAY 1
  689. #define BUTTON2_RELAY 2
  690. // Relays
  691. #define RELAY1_PIN 2
  692. #define RELAY2_PIN 14
  693. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  694. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  695. #elif defined(JANGOE_WIFI_RELAY_NO)
  696. // Info
  697. #define MANUFACTURER "JANGOE"
  698. #define DEVICE "WIFI_RELAY_NO"
  699. // Buttons
  700. #define BUTTON1_PIN 12
  701. #define BUTTON2_PIN 13
  702. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  703. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  704. #define BUTTON1_RELAY 1
  705. #define BUTTON2_RELAY 2
  706. // Relays
  707. #define RELAY1_PIN 2
  708. #define RELAY2_PIN 14
  709. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  710. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  711. // -----------------------------------------------------------------------------
  712. // Jorge García Wifi+Relays Board Kit
  713. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  714. // https://github.com/jorgegarciadev/wifikit
  715. // -----------------------------------------------------------------------------
  716. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  717. // Info
  718. #define MANUFACTURER "JORGEGARCIA"
  719. #define DEVICE "WIFI_RELAYS"
  720. // Relays
  721. #define RELAY1_PIN 0
  722. #define RELAY2_PIN 2
  723. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  724. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  725. // -----------------------------------------------------------------------------
  726. // WiFi MQTT Relay / Thermostat
  727. // -----------------------------------------------------------------------------
  728. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  729. // Info
  730. #define MANUFACTURER "OPENENERGYMONITOR"
  731. #define DEVICE "MQTT_RELAY"
  732. // Buttons
  733. #define BUTTON1_PIN 0
  734. #define BUTTON1_RELAY 1
  735. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  736. // Relays
  737. #define RELAY1_PIN 12
  738. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  739. // LEDs
  740. #define LED1_PIN 16
  741. #define LED1_PIN_INVERSE 0
  742. // -----------------------------------------------------------------------------
  743. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  744. // 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
  745. // 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
  746. // -----------------------------------------------------------------------------
  747. #elif defined(WION_50055)
  748. // Currently untested, does not support energy monitoring
  749. // Info
  750. #define MANUFACTURER "WION"
  751. #define DEVICE "50055"
  752. // Buttons
  753. #define BUTTON1_PIN 13
  754. #define BUTTON1_RELAY 1
  755. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  756. // Relays
  757. #define RELAY1_PIN 15
  758. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  759. // LEDs
  760. #define LED1_PIN 2
  761. #define LED1_PIN_INVERSE 0
  762. // -----------------------------------------------------------------------------
  763. // EX-Store Wifi Relay v3.1
  764. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  765. // -----------------------------------------------------------------------------
  766. #elif defined(EXS_WIFI_RELAY_V31)
  767. // Untested
  768. // Info
  769. #define MANUFACTURER "EXS"
  770. #define DEVICE "WIFI_RELAY_V31"
  771. // Buttons
  772. #define BUTTON1_PIN 0
  773. #define BUTTON1_RELAY 1
  774. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  775. // Relays
  776. #define RELAY1_PIN 13
  777. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  778. #define RELAY1_RESET_PIN 12
  779. // -----------------------------------------------------------------------------
  780. // V9261F
  781. // -----------------------------------------------------------------------------
  782. #elif defined(GENERIC_V9261F)
  783. // Info
  784. #define MANUFACTURER "GENERIC"
  785. #define DEVICE "V9261F"
  786. #define ALEXA_SUPPORT 0
  787. // V9261F
  788. #define V9261F_SUPPORT 1
  789. #define V9261F_PIN 2
  790. #define V9261F_PIN_INVERSE 1
  791. // -----------------------------------------------------------------------------
  792. // ECH1560
  793. // -----------------------------------------------------------------------------
  794. #elif defined(GENERIC_ECH1560)
  795. // Info
  796. #define MANUFACTURER "GENERIC"
  797. #define DEVICE "ECH1560"
  798. #define ALEXA_SUPPORT 0
  799. // ECH1560
  800. #define ECH1560_SUPPORT 1
  801. #define ECH1560_CLK_PIN 4
  802. #define ECH1560_MISO_PIN 5
  803. #define ECH1560_INVERTED 0
  804. // -----------------------------------------------------------------------------
  805. // ESPLive
  806. // https://github.com/ManCaveMade/ESP-Live
  807. // -----------------------------------------------------------------------------
  808. #elif defined(MANCAVEMADE_ESPLIVE)
  809. // Info
  810. #define MANUFACTURER "MANCAVEMADE"
  811. #define DEVICE "ESPLIVE"
  812. // Buttons
  813. #define BUTTON1_PIN 4
  814. #define BUTTON2_PIN 5
  815. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  816. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  817. #define BUTTON1_RELAY 1
  818. #define BUTTON2_RELAY 2
  819. // Relays
  820. #define RELAY1_PIN 12
  821. #define RELAY2_PIN 13
  822. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  823. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  824. // DB18B20
  825. #define DALLAS_SUPPORT 1
  826. #define DALLAS_PIN 2
  827. #define DALLAS_UPDATE_INTERVAL 5000
  828. #define TEMPERATURE_MIN_CHANGE 1.0
  829. // -----------------------------------------------------------------------------
  830. // QuinLED
  831. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  832. // -----------------------------------------------------------------------------
  833. #elif defined(INTERMITTECH_QUINLED)
  834. // Info
  835. #define MANUFACTURER "INTERMITTECH"
  836. #define DEVICE "QUINLED"
  837. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  838. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  839. #define DUMMY_RELAY_COUNT 1
  840. // LEDs
  841. #define LED1_PIN 5
  842. #define LED1_PIN_INVERSE 1
  843. // Light
  844. #define LIGHT_CHANNELS 2
  845. #define LIGHT_CH1_PIN 0
  846. #define LIGHT_CH2_PIN 2
  847. #define LIGHT_CH1_INVERSE 0
  848. #define LIGHT_CH2_INVERSE 0
  849. // -----------------------------------------------------------------------------
  850. // Arilux AL-LC06
  851. // -----------------------------------------------------------------------------
  852. #elif defined(ARILUX_AL_LC06)
  853. // Info
  854. #define MANUFACTURER "ARILUX"
  855. #define DEVICE "AL_LC06"
  856. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  857. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  858. #define DUMMY_RELAY_COUNT 1
  859. // Light
  860. #define LIGHT_CHANNELS 5
  861. #define LIGHT_CH1_PIN 14 // RED
  862. #define LIGHT_CH2_PIN 12 // GREEN
  863. #define LIGHT_CH3_PIN 13 // BLUE
  864. #define LIGHT_CH4_PIN 15 // WHITE1
  865. #define LIGHT_CH5_PIN 5 // WHITE2
  866. #define LIGHT_CH1_INVERSE 0
  867. #define LIGHT_CH2_INVERSE 0
  868. #define LIGHT_CH3_INVERSE 0
  869. #define LIGHT_CH4_INVERSE 0
  870. #define LIGHT_CH5_INVERSE 0
  871. #elif defined(ARILUX_E27)
  872. // Info
  873. #define MANUFACTURER "ARILUX"
  874. #define DEVICE "E27"
  875. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  876. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  877. #define DUMMY_RELAY_COUNT 1
  878. // Light
  879. #define LIGHT_CHANNELS 4
  880. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  881. #define MY92XX_CHIPS 1
  882. #define MY92XX_DI_PIN 13
  883. #define MY92XX_DCKI_PIN 15
  884. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  885. #define MY92XX_MAPPING 0, 1, 2, 3
  886. // -----------------------------------------------------------------------------
  887. // XENON SM-PW701U
  888. // -----------------------------------------------------------------------------
  889. #elif defined(XENON_SM_PW702U)
  890. // Info
  891. #define MANUFACTURER "XENON"
  892. #define DEVICE "SM_PW702U"
  893. // Buttons
  894. #define BUTTON1_PIN 13
  895. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  896. #define BUTTON1_RELAY 1
  897. // Relays
  898. #define RELAY1_PIN 12
  899. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  900. // LEDs
  901. #define LED1_PIN 4
  902. #define LED1_PIN_INVERSE 1
  903. // -----------------------------------------------------------------------------
  904. // AUTHOMETION LYT8266
  905. // https://authometion.com/shop/en/home/13-lyt8266.html
  906. // -----------------------------------------------------------------------------
  907. #elif defined(AUTHOMETION_LYT8266)
  908. // Info
  909. #define MANUFACTURER "AUTHOMETION"
  910. #define DEVICE "LYT8266"
  911. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  912. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  913. #define DUMMY_RELAY_COUNT 1
  914. // Light
  915. #define LIGHT_CHANNELS 4
  916. #define LIGHT_CH1_PIN 13 // RED
  917. #define LIGHT_CH2_PIN 12 // GREEN
  918. #define LIGHT_CH3_PIN 14 // BLUE
  919. #define LIGHT_CH4_PIN 2 // WHITE
  920. #define LIGHT_CH1_INVERSE 0
  921. #define LIGHT_CH2_INVERSE 0
  922. #define LIGHT_CH3_INVERSE 0
  923. #define LIGHT_CH4_INVERSE 0
  924. #define LIGHT_ENABLE_PIN 15
  925. // -----------------------------------------------------------------------------
  926. // Unknown hardware
  927. // -----------------------------------------------------------------------------
  928. #else
  929. #error "UNSUPPORTED HARDWARE!"
  930. #endif