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.

1075 lines
30 KiB

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. // RELAY#_LED: LED number that will be bind to the n-th relay (1-based)
  17. // LED#_PIN: GPIO for the n-th LED (1-based, up to 4 LEDs)
  18. // LED#_PIN_INVERSE: LED has inversed logic (lit when pulled down)
  19. //
  20. // Besides, other hardware specific information should be stated here
  21. // -----------------------------------------------------------------------------
  22. // Development boards
  23. // -----------------------------------------------------------------------------
  24. #if defined(NODEMCU_LOLIN)
  25. // Info
  26. #define MANUFACTURER "NODEMCU"
  27. #define DEVICE "LOLIN"
  28. // Buttons
  29. #define BUTTON1_PIN 0
  30. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  31. #define BUTTON1_RELAY 1
  32. // Relays
  33. #define RELAY1_PIN 12
  34. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  35. // LEDs
  36. #define LED1_PIN 2
  37. #define LED1_PIN_INVERSE 1
  38. #elif defined(WEMOS_D1_MINI_RELAYSHIELD)
  39. // Info
  40. #define MANUFACTURER "WEMOS"
  41. #define DEVICE "D1_MINI_RELAYSHIELD"
  42. // Buttons
  43. // No buttons on the D1 MINI
  44. // Relays
  45. #define RELAY1_PIN 5
  46. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  47. // LEDs
  48. #define LED1_PIN 2
  49. #define LED1_PIN_INVERSE 1
  50. // -----------------------------------------------------------------------------
  51. // ESPurna
  52. // -----------------------------------------------------------------------------
  53. #elif defined(TINKERMAN_ESPURNA_H)
  54. // Info
  55. #define MANUFACTURER "TINKERMAN"
  56. #define DEVICE "ESPURNA_H"
  57. // Buttons
  58. #define BUTTON1_PIN 4
  59. #define BUTTON1_RELAY 1
  60. // Normal pushbutton
  61. //#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  62. // Touch button
  63. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  64. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  65. #define BUTTON1_CLICK BUTTON_MODE_NONE
  66. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  67. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  68. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  69. // Relays
  70. #define RELAY1_PIN 12
  71. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  72. // LEDs
  73. #define LED1_PIN 5
  74. #define LED1_PIN_INVERSE 0
  75. // HLW8012
  76. #define POWER_PROVIDER POWER_PROVIDER_HLW8012
  77. #define HLW8012_SEL_PIN 2
  78. #define HLW8012_CF1_PIN 13
  79. #define HLW8012_CF_PIN 14
  80. // -----------------------------------------------------------------------------
  81. // Itead Studio boards
  82. // -----------------------------------------------------------------------------
  83. #elif defined(ITEAD_SONOFF_BASIC)
  84. // Info
  85. #define MANUFACTURER "ITEAD"
  86. #define DEVICE "SONOFF_BASIC"
  87. // Buttons
  88. #define BUTTON1_PIN 0
  89. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  90. #define BUTTON1_RELAY 1
  91. // Relays
  92. #define RELAY1_PIN 12
  93. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  94. // LEDs
  95. #define LED1_PIN 13
  96. #define LED1_PIN_INVERSE 1
  97. #elif defined(ITEAD_SONOFF_RF)
  98. // Info
  99. #define MANUFACTURER "ITEAD"
  100. #define DEVICE "SONOFF_RF"
  101. // Buttons
  102. #define BUTTON1_PIN 0
  103. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  104. #define BUTTON1_RELAY 1
  105. // Relays
  106. #define RELAY1_PIN 12
  107. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  108. // LEDs
  109. #define LED1_PIN 13
  110. #define LED1_PIN_INVERSE 1
  111. #elif defined(ITEAD_SONOFF_TH)
  112. // Info
  113. #define MANUFACTURER "ITEAD"
  114. #define DEVICE "SONOFF_TH"
  115. // Buttons
  116. #define BUTTON1_PIN 0
  117. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  118. #define BUTTON1_RELAY 1
  119. // Relays
  120. #define RELAY1_PIN 12
  121. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  122. // LEDs
  123. #define LED1_PIN 13
  124. #define LED1_PIN_INVERSE 1
  125. #elif defined(ITEAD_SONOFF_SV)
  126. // Info
  127. #define MANUFACTURER "ITEAD"
  128. #define DEVICE "SONOFF_SV"
  129. // Buttons
  130. #define BUTTON1_PIN 0
  131. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  132. #define BUTTON1_RELAY 1
  133. // Relays
  134. #define RELAY1_PIN 12
  135. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  136. // LEDs
  137. #define LED1_PIN 13
  138. #define LED1_PIN_INVERSE 1
  139. #elif defined(ITEAD_SLAMPHER)
  140. // Info
  141. #define MANUFACTURER "ITEAD"
  142. #define DEVICE "SLAMPHER"
  143. // Buttons
  144. #define BUTTON1_PIN 0
  145. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  146. #define BUTTON1_RELAY 1
  147. // Relays
  148. #define RELAY1_PIN 12
  149. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  150. // LEDs
  151. #define LED1_PIN 13
  152. #define LED1_PIN_INVERSE 1
  153. #elif defined(ITEAD_S20)
  154. // Info
  155. #define MANUFACTURER "ITEAD"
  156. #define DEVICE "S20"
  157. // Buttons
  158. #define BUTTON1_PIN 0
  159. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  160. #define BUTTON1_RELAY 1
  161. // Relays
  162. #define RELAY1_PIN 12
  163. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  164. // LEDs
  165. #define LED1_PIN 13
  166. #define LED1_PIN_INVERSE 1
  167. #elif defined(ITEAD_SONOFF_TOUCH)
  168. // Info
  169. #define MANUFACTURER "ITEAD"
  170. #define DEVICE "SONOFF_TOUCH"
  171. // Buttons
  172. #define BUTTON1_PIN 0
  173. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  174. #define BUTTON1_RELAY 1
  175. // Relays
  176. #define RELAY1_PIN 12
  177. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  178. // LEDs
  179. #define LED1_PIN 13
  180. #define LED1_PIN_INVERSE 1
  181. #elif defined(ITEAD_SONOFF_POW)
  182. // Info
  183. #define MANUFACTURER "ITEAD"
  184. #define DEVICE "SONOFF_POW"
  185. // Buttons
  186. #define BUTTON1_PIN 0
  187. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  188. #define BUTTON1_RELAY 1
  189. // Relays
  190. #define RELAY1_PIN 12
  191. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  192. // LEDs
  193. #define LED1_PIN 15
  194. #define LED1_PIN_INVERSE 0
  195. // HLW8012
  196. #define POWER_PROVIDER POWER_PROVIDER_HLW8012
  197. #define HLW8012_SEL_PIN 5
  198. #define HLW8012_CF1_PIN 13
  199. #define HLW8012_CF_PIN 14
  200. #elif defined(ITEAD_SONOFF_DUAL)
  201. // Info
  202. #define MANUFACTURER "ITEAD"
  203. #define DEVICE "SONOFF_DUAL"
  204. #define SERIAL_BAUDRATE 19230
  205. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  206. #define DUMMY_RELAY_COUNT 2
  207. #define DEBUG_SERIAL_SUPPORT 0
  208. #define TERMINAL_SUPPORT 0
  209. // Buttons
  210. #define BUTTON3_RELAY 1
  211. // LEDs
  212. #define LED1_PIN 13
  213. #define LED1_PIN_INVERSE 1
  214. #elif defined(ITEAD_SONOFF_4CH)
  215. // Info
  216. #define MANUFACTURER "ITEAD"
  217. #define DEVICE "SONOFF_4CH"
  218. // Buttons
  219. #define BUTTON1_PIN 0
  220. #define BUTTON2_PIN 9
  221. #define BUTTON3_PIN 10
  222. #define BUTTON4_PIN 14
  223. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  224. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  225. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  226. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  227. #define BUTTON1_RELAY 1
  228. #define BUTTON2_RELAY 2
  229. #define BUTTON3_RELAY 3
  230. #define BUTTON4_RELAY 4
  231. // Relays
  232. #define RELAY1_PIN 12
  233. #define RELAY2_PIN 5
  234. #define RELAY3_PIN 4
  235. #define RELAY4_PIN 15
  236. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  237. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  238. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  239. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  240. // LEDs
  241. #define LED1_PIN 13
  242. #define LED1_PIN_INVERSE 1
  243. #elif defined(ITEAD_SONOFF_4CH_PRO)
  244. // Info
  245. #define MANUFACTURER "ITEAD"
  246. #define DEVICE "SONOFF_4CH_PRO"
  247. // Buttons
  248. #define BUTTON1_PIN 0
  249. #define BUTTON2_PIN 9
  250. #define BUTTON3_PIN 10
  251. #define BUTTON4_PIN 14
  252. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  253. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  254. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  255. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  256. #define BUTTON1_RELAY 1
  257. #define BUTTON2_RELAY 2
  258. #define BUTTON3_RELAY 3
  259. #define BUTTON4_RELAY 4
  260. // Relays
  261. #define RELAY1_PIN 12
  262. #define RELAY2_PIN 5
  263. #define RELAY3_PIN 4
  264. #define RELAY4_PIN 15
  265. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  266. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  267. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  268. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  269. // LEDs
  270. #define LED1_PIN 13
  271. #define LED1_PIN_INVERSE 1
  272. #elif defined(ITEAD_1CH_INCHING)
  273. // The inching functionality is managed by a misterious IC in the board.
  274. // You cannot control the inching button and functionality from the ESP8266
  275. // Besides, enabling the inching functionality using the hardware button
  276. // will result in the relay switching on and off continuously.
  277. // Fortunately the unkown IC keeps memory of the hardware inching status
  278. // so you can just disable it and forget. The inching LED must be lit.
  279. // You can still use the pulse options from the web interface
  280. // without problem.
  281. // Info
  282. #define MANUFACTURER "ITEAD"
  283. #define DEVICE "1CH_INCHING"
  284. // Buttons
  285. #define BUTTON1_PIN 0
  286. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  287. #define BUTTON1_RELAY 1
  288. // Relays
  289. #define RELAY1_PIN 12
  290. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  291. // LEDs
  292. #define LED1_PIN 13
  293. #define LED1_PIN_INVERSE 1
  294. #elif defined(ITEAD_MOTOR)
  295. // Info
  296. #define MANUFACTURER "ITEAD"
  297. #define DEVICE "MOTOR"
  298. // Buttons
  299. #define BUTTON1_PIN 0
  300. #define BUTTON1_RELAY 1
  301. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  302. // Relays
  303. #define RELAY1_PIN 12
  304. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  305. // LEDs
  306. #define LED1_PIN 13
  307. #define LED1_PIN_INVERSE 1
  308. #elif defined(ITEAD_BNSZ01)
  309. // Info
  310. #define MANUFACTURER "ITEAD"
  311. #define DEVICE "BNSZ01"
  312. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  313. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  314. #define DUMMY_RELAY_COUNT 1
  315. // LEDs
  316. #define LED1_PIN 13
  317. #define LED1_PIN_INVERSE 1
  318. // Channels
  319. #define LIGHT_CH1_PIN 12
  320. #define LIGHT_CH1_INVERSE 0
  321. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  322. // Info
  323. #define MANUFACTURER "ITEAD"
  324. #define DEVICE "SONOFF_RFBRIDGE"
  325. #define SERIAL_BAUDRATE 19200
  326. #define RELAY_PROVIDER RELAY_PROVIDER_RFBRIDGE
  327. #ifndef DUMMY_RELAY_COUNT
  328. #define DUMMY_RELAY_COUNT 6
  329. #endif
  330. #define TRACK_RELAY_STATUS 0
  331. // Buttons
  332. #define BUTTON1_PIN 0
  333. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  334. // LEDs
  335. #define LED1_PIN 13
  336. #define LED1_PIN_INVERSE 1
  337. #elif defined(ITEAD_SONOFF_B1)
  338. // Info
  339. #define MANUFACTURER "ITEAD"
  340. #define DEVICE "SONOFF_B1"
  341. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  342. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192
  343. #define DUMMY_RELAY_COUNT 1
  344. #define MY9291_DI_PIN 12
  345. #define MY9291_DCKI_PIN 14
  346. #define MY9291_COMMAND MY9291_COMMAND_DEFAULT
  347. #define MY9291_CHANNELS 5
  348. #elif defined(ITEAD_SONOFF_LED)
  349. // Info
  350. #define MANUFACTURER "ITEAD"
  351. #define DEVICE "SONOFF_LED"
  352. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  353. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  354. #define DUMMY_RELAY_COUNT 1
  355. // LEDs
  356. #define LED1_PIN 13
  357. #define LED1_PIN_INVERSE 1
  358. // Channels
  359. #define LIGHT_CH1_PIN 12 // Cold white
  360. #define LIGHT_CH2_PIN 14 // Warm white
  361. #define LIGHT_CH1_INVERSE 0
  362. #define LIGHT_CH2_INVERSE 0
  363. #elif defined(ITEAD_SONOFF_T1_1CH)
  364. // Info
  365. #define MANUFACTURER "ITEAD"
  366. #define DEVICE "SONOFF_T1_1CH"
  367. // Buttons
  368. #define BUTTON1_PIN 9
  369. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  370. #define BUTTON1_RELAY 1
  371. // Relays
  372. #define RELAY1_PIN 5
  373. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  374. // LEDs
  375. #define LED1_PIN 13
  376. #define LED1_PIN_INVERSE 1
  377. #elif defined(ITEAD_SONOFF_T1_2CH)
  378. // Info
  379. #define MANUFACTURER "ITEAD"
  380. #define DEVICE "SONOFF_T1_2CH"
  381. // Buttons
  382. #define BUTTON1_PIN 0
  383. #define BUTTON2_PIN 10
  384. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  385. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  386. #define BUTTON1_RELAY 1
  387. #define BUTTON2_RELAY 2
  388. // Relays
  389. #define RELAY1_PIN 12
  390. #define RELAY2_PIN 4
  391. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  392. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  393. // LEDs
  394. #define LED1_PIN 13
  395. #define LED1_PIN_INVERSE 1
  396. #elif defined(ITEAD_SONOFF_T1_3CH)
  397. // Info
  398. #define MANUFACTURER "ITEAD"
  399. #define DEVICE "SONOFF_T1_3CH"
  400. // Buttons
  401. #define BUTTON1_PIN 0
  402. #define BUTTON2_PIN 9
  403. #define BUTTON3_PIN 10
  404. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  405. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  406. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  407. #define BUTTON1_RELAY 1
  408. #define BUTTON2_RELAY 2
  409. #define BUTTON3_RELAY 3
  410. // Relays
  411. #define RELAY1_PIN 12
  412. #define RELAY2_PIN 5
  413. #define RELAY3_PIN 4
  414. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  415. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  416. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  417. // LEDs
  418. #define LED1_PIN 13
  419. #define LED1_PIN_INVERSE 1
  420. // -----------------------------------------------------------------------------
  421. // Electrodragon boards
  422. // -----------------------------------------------------------------------------
  423. #elif defined(ELECTRODRAGON_WIFI_IOT)
  424. // Info
  425. #define MANUFACTURER "ELECTRODRAGON"
  426. #define DEVICE "WIFI_IOT"
  427. // Buttons
  428. #define BUTTON1_PIN 0
  429. #define BUTTON2_PIN 2
  430. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  431. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  432. #define BUTTON1_RELAY 1
  433. #define BUTTON2_RELAY 2
  434. // Relays
  435. #define RELAY1_PIN 12
  436. #define RELAY2_PIN 13
  437. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  438. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  439. // LEDs
  440. #define LED1_PIN 16
  441. #define LED1_PIN_INVERSE 0
  442. // -----------------------------------------------------------------------------
  443. // WorkChoice ecoPlug
  444. // -----------------------------------------------------------------------------
  445. #elif defined(WORKCHOICE_ECOPLUG)
  446. // Info
  447. #define MANUFACTURER "WORKCHOICE"
  448. #define DEVICE "ECOPLUG"
  449. // Buttons
  450. #define BUTTON1_PIN 13
  451. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  452. #define BUTTON1_RELAY 1
  453. // Relays
  454. #define RELAY1_PIN 15
  455. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  456. // LEDs
  457. #define LED1_PIN 2
  458. #define LED1_PIN_INVERSE 0
  459. // -----------------------------------------------------------------------------
  460. // AI Thinker
  461. // -----------------------------------------------------------------------------
  462. #elif defined(AITHINKER_AI_LIGHT)
  463. // Info
  464. #define MANUFACTURER "AITHINKER"
  465. #define DEVICE "AI_LIGHT"
  466. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  467. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192
  468. #define DUMMY_RELAY_COUNT 1
  469. #define MY9291_DI_PIN 13
  470. #define MY9291_DCKI_PIN 15
  471. #define MY9291_COMMAND MY9291_COMMAND_DEFAULT
  472. #define MY9291_CHANNELS 4
  473. // -----------------------------------------------------------------------------
  474. // LED Controller
  475. // -----------------------------------------------------------------------------
  476. #elif defined(MAGICHOME_LED_CONTROLLER)
  477. // Info
  478. #define MANUFACTURER "MAGICHOME"
  479. #define DEVICE "LED_CONTROLLER"
  480. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  481. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  482. #define DUMMY_RELAY_COUNT 1
  483. // LEDs
  484. #define LED1_PIN 2
  485. #define LED1_PIN_INVERSE 1
  486. // Channels
  487. #define LIGHT_CH1_PIN 14 // RED
  488. #define LIGHT_CH2_PIN 5 // GREEN
  489. #define LIGHT_CH3_PIN 12 // BLUE
  490. #define LIGHT_CH4_PIN 13 // WHITE
  491. #define LIGHT_CH1_INVERSE 0
  492. #define LIGHT_CH2_INVERSE 0
  493. #define LIGHT_CH3_INVERSE 0
  494. #define LIGHT_CH4_INVERSE 0
  495. // -----------------------------------------------------------------------------
  496. // LED Controller With IR
  497. // -----------------------------------------------------------------------------
  498. #elif defined(MAGICHOME_LED_CONTROLLER_IR)
  499. // Info
  500. #define MANUFACTURER "MAGICHOME"
  501. #define DEVICE "LED_CONTROLLER_IR"
  502. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  503. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  504. #define DUMMY_RELAY_COUNT 1
  505. // LEDs
  506. #define LED1_PIN 2
  507. #define LED1_PIN_INVERSE 1
  508. // Channels
  509. #define LIGHT_CH1_PIN 5 // RED
  510. #define LIGHT_CH2_PIN 12 // GREEN
  511. #define LIGHT_CH3_PIN 13 // BLUE
  512. //#define LIGHT_CH4_PIN 13 // WHITE
  513. #define LIGHT_IR_PIN 14 // IR LED ?
  514. #define LIGHT_CH1_INVERSE 0
  515. #define LIGHT_CH2_INVERSE 0
  516. #define LIGHT_CH3_INVERSE 0
  517. #define LIGHT_CH4_INVERSE 0
  518. // -----------------------------------------------------------------------------
  519. // HUACANXING H801
  520. // -----------------------------------------------------------------------------
  521. #elif defined(HUACANXING_H801)
  522. // Info
  523. #define MANUFACTURER "HUACANXING"
  524. #define DEVICE "H801"
  525. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  526. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  527. #define DUMMY_RELAY_COUNT 1
  528. // LEDs
  529. #define LED1_PIN 5
  530. #define LED1_PIN_INVERSE 1
  531. // Channels
  532. #define LIGHT_CH1_PIN 15 // RED
  533. #define LIGHT_CH2_PIN 13 // GREEN
  534. #define LIGHT_CH3_PIN 12 // BLUE
  535. #define LIGHT_CH4_PIN 14 // WHITE1
  536. #define LIGHT_CH5_PIN 4 // WHITE2
  537. #define LIGHT_CH1_INVERSE 0
  538. #define LIGHT_CH2_INVERSE 0
  539. #define LIGHT_CH3_INVERSE 0
  540. #define LIGHT_CH4_INVERSE 0
  541. #define LIGHT_CH5_INVERSE 0
  542. // -----------------------------------------------------------------------------
  543. // Jan Goedeke Wifi Relay
  544. // https://github.com/JanGoe/esp8266-wifi-relay
  545. // -----------------------------------------------------------------------------
  546. #elif defined(JANGOE_WIFI_RELAY_NC)
  547. // Info
  548. #define MANUFACTURER "JANGOE"
  549. #define DEVICE "WIFI_RELAY_NC"
  550. // Buttons
  551. #define BUTTON1_PIN 12
  552. #define BUTTON2_PIN 13
  553. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  554. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  555. #define BUTTON1_RELAY 1
  556. #define BUTTON2_RELAY 2
  557. // Relays
  558. #define RELAY1_PIN 2
  559. #define RELAY2_PIN 14
  560. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  561. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  562. #elif defined(JANGOE_WIFI_RELAY_NO)
  563. // Info
  564. #define MANUFACTURER "JANGOE"
  565. #define DEVICE "WIFI_RELAY_NO"
  566. // Buttons
  567. #define BUTTON1_PIN 12
  568. #define BUTTON2_PIN 13
  569. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  570. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  571. #define BUTTON1_RELAY 1
  572. #define BUTTON2_RELAY 2
  573. // Relays
  574. #define RELAY1_PIN 2
  575. #define RELAY2_PIN 14
  576. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  577. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  578. // -----------------------------------------------------------------------------
  579. // Jorge García Wifi+Relays Board Kit
  580. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  581. // https://github.com/jorgegarciadev/wifikit
  582. // -----------------------------------------------------------------------------
  583. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  584. // Info
  585. #define MANUFACTURER "JORGEGARCIA"
  586. #define DEVICE "WIFI_RELAYS"
  587. // Relays
  588. #define RELAY1_PIN 0
  589. #define RELAY2_PIN 2
  590. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  591. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  592. // -----------------------------------------------------------------------------
  593. // WiFi MQTT Relay / Thermostat
  594. // -----------------------------------------------------------------------------
  595. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  596. // Info
  597. #define MANUFACTURER "OPENENERGYMONITOR"
  598. #define DEVICE "MQTT_RELAY"
  599. // Buttons
  600. #define BUTTON1_PIN 0
  601. #define BUTTON1_RELAY 1
  602. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  603. // Relays
  604. #define RELAY1_PIN 12
  605. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  606. // LEDs
  607. #define LED1_PIN 16
  608. #define LED1_PIN_INVERSE 0
  609. // -----------------------------------------------------------------------------
  610. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  611. // 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
  612. // 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
  613. // -----------------------------------------------------------------------------
  614. #elif defined(WION_50055)
  615. // Currently untested, does not support energy monitoring
  616. // Info
  617. #define MANUFACTURER "WION"
  618. #define DEVICE "50055"
  619. // Buttons
  620. #define BUTTON1_PIN 13
  621. #define BUTTON1_RELAY 1
  622. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  623. // Relays
  624. #define RELAY1_PIN 15
  625. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  626. // LEDs
  627. #define LED1_PIN 2
  628. #define LED1_PIN_INVERSE 0
  629. // -----------------------------------------------------------------------------
  630. // EX-Store Wifi Relay v3.1
  631. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  632. // -----------------------------------------------------------------------------
  633. #elif defined(EXS_WIFI_RELAY_V31)
  634. // Untested
  635. // Info
  636. #define MANUFACTURER "EXS"
  637. #define DEVICE "WIFI_RELAY_V31"
  638. // Buttons
  639. #define BUTTON1_PIN 0
  640. #define BUTTON1_RELAY 1
  641. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  642. // Relays
  643. #define RELAY1_PIN 13
  644. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  645. #define RELAY1_RESET_PIN 12
  646. // -----------------------------------------------------------------------------
  647. // HUACANXING H802
  648. // -----------------------------------------------------------------------------
  649. #elif defined(HUACANXING_H802)
  650. // Info
  651. #define MANUFACTURER "HUACANXING"
  652. #define DEVICE "H802"
  653. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  654. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  655. #define DUMMY_RELAY_COUNT 1
  656. // Channels
  657. #define LIGHT_CH1_PIN 12 // RED
  658. #define LIGHT_CH2_PIN 14 // GREEN
  659. #define LIGHT_CH3_PIN 13 // BLUE
  660. #define LIGHT_CH4_PIN 15 // WHITE
  661. #define LIGHT_CH1_INVERSE 0
  662. #define LIGHT_CH2_INVERSE 0
  663. #define LIGHT_CH3_INVERSE 0
  664. #define LIGHT_CH4_INVERSE 0
  665. // -----------------------------------------------------------------------------
  666. // V9261F
  667. // -----------------------------------------------------------------------------
  668. #elif defined(GENERIC_V9261F)
  669. // Info
  670. #define MANUFACTURER "GENERIC"
  671. #define DEVICE "V9261F"
  672. // V9261F
  673. #define POWER_PROVIDER POWER_PROVIDER_V9261F
  674. #define V9261F_PIN 2
  675. #define V9261F_PIN_INVERSE 1
  676. // -----------------------------------------------------------------------------
  677. // ECH1560
  678. // -----------------------------------------------------------------------------
  679. #elif defined(GENERIC_ECH1560)
  680. // Info
  681. #define MANUFACTURER "GENERIC"
  682. #define DEVICE "ECH1560"
  683. // ECH1560
  684. #define POWER_PROVIDER POWER_PROVIDER_ECH1560
  685. #define ECH1560_CLK_PIN 4
  686. #define ECH1560_MISO_PIN 5
  687. #define ECH1560_INVERTED 0
  688. // -----------------------------------------------------------------------------
  689. // Unknown hardware
  690. // -----------------------------------------------------------------------------
  691. #else
  692. #error "UNSUPPORTED HARDWARE!"
  693. #endif
  694. // -----------------------------------------------------------------------------
  695. // Default values
  696. // -----------------------------------------------------------------------------
  697. #ifndef BUTTON1_PRESS
  698. #define BUTTON1_PRESS BUTTON_MODE_NONE
  699. #endif
  700. #ifndef BUTTON2_PRESS
  701. #define BUTTON2_PRESS BUTTON_MODE_NONE
  702. #endif
  703. #ifndef BUTTON3_PRESS
  704. #define BUTTON3_PRESS BUTTON_MODE_NONE
  705. #endif
  706. #ifndef BUTTON4_PRESS
  707. #define BUTTON4_PRESS BUTTON_MODE_NONE
  708. #endif
  709. #ifndef BUTTON1_CLICK
  710. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  711. #endif
  712. #ifndef BUTTON2_CLICK
  713. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  714. #endif
  715. #ifndef BUTTON3_CLICK
  716. #define BUTTON3_CLICK BUTTON_MODE_TOGGLE
  717. #endif
  718. #ifndef BUTTON4_CLICK
  719. #define BUTTON4_CLICK BUTTON_MODE_TOGGLE
  720. #endif
  721. #ifndef BUTTON1_DBLCLICK
  722. #define BUTTON1_DBLCLICK BUTTON_MODE_AP
  723. #endif
  724. #ifndef BUTTON2_DBLCLICK
  725. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  726. #endif
  727. #ifndef BUTTON3_DBLCLICK
  728. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  729. #endif
  730. #ifndef BUTTON4_DBLCLICK
  731. #define BUTTON4_DBLCLICK BUTTON_MODE_NONE
  732. #endif
  733. #ifndef BUTTON1_LNGCLICK
  734. #define BUTTON1_LNGCLICK BUTTON_MODE_RESET
  735. #endif
  736. #ifndef BUTTON2_LNGCLICK
  737. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  738. #endif
  739. #ifndef BUTTON3_LNGCLICK
  740. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  741. #endif
  742. #ifndef BUTTON4_LNGCLICK
  743. #define BUTTON4_LNGCLICK BUTTON_MODE_NONE
  744. #endif
  745. #ifndef BUTTON1_LNGLNGCLICK
  746. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_FACTORY
  747. #endif
  748. #ifndef BUTTON2_LNGLNGCLICK
  749. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  750. #endif
  751. #ifndef BUTTON3_LNGLNGCLICK
  752. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_NONE
  753. #endif
  754. #ifndef BUTTON4_LNGLNGCLICK
  755. #define BUTTON4_LNGLNGCLICK BUTTON_MODE_NONE
  756. #endif
  757. #ifndef BUTTON1_RELAY
  758. #define BUTTON1_RELAY 0
  759. #endif
  760. #ifndef BUTTON2_RELAY
  761. #define BUTTON2_RELAY 0
  762. #endif
  763. #ifndef BUTTON3_RELAY
  764. #define BUTTON3_RELAY 0
  765. #endif
  766. #ifndef BUTTON4_RELAY
  767. #define BUTTON4_RELAY 0
  768. #endif
  769. #ifndef RELAY1_RESET_PIN
  770. #define RELAY1_RESET_PIN 0
  771. #endif
  772. #ifndef RELAY2_RESET_PIN
  773. #define RELAY2_RESET_PIN 0
  774. #endif
  775. #ifndef RELAY3_RESET_PIN
  776. #define RELAY3_RESET_PIN 0
  777. #endif
  778. #ifndef RELAY4_RESET_PIN
  779. #define RELAY4_RESET_PIN 0
  780. #endif
  781. #ifndef RELAY1_DELAY_ON
  782. #define RELAY1_DELAY_ON 0
  783. #endif
  784. #ifndef RELAY2_DELAY_ON
  785. #define RELAY2_DELAY_ON 0
  786. #endif
  787. #ifndef RELAY3_DELAY_ON
  788. #define RELAY3_DELAY_ON 0
  789. #endif
  790. #ifndef RELAY4_DELAY_ON
  791. #define RELAY4_DELAY_ON 0
  792. #endif
  793. #ifndef RELAY1_DELAY_OFF
  794. #define RELAY1_DELAY_OFF 0
  795. #endif
  796. #ifndef RELAY2_DELAY_OFF
  797. #define RELAY2_DELAY_OFF 0
  798. #endif
  799. #ifndef RELAY3_DELAY_OFF
  800. #define RELAY3_DELAY_OFF 0
  801. #endif
  802. #ifndef RELAY4_DELAY_OFF
  803. #define RELAY4_DELAY_OFF 0
  804. #endif
  805. #ifndef RELAY1_LED
  806. #define RELAY1_LED 0
  807. #endif
  808. #ifndef RELAY2_LED
  809. #define RELAY2_LED 0
  810. #endif
  811. #ifndef RELAY3_LED
  812. #define RELAY3_LED 0
  813. #endif
  814. #ifndef RELAY4_LED
  815. #define RELAY4_LED 0
  816. #endif
  817. // Needed for ESP8285 boards under Windows using PlatformIO (?)
  818. #ifndef BUTTON_PUSHBUTTON
  819. #define BUTTON_PUSHBUTTON 0
  820. #define BUTTON_SWITCH 1
  821. #define BUTTON_DEFAULT_HIGH 2
  822. #define BUTTON_SET_PULLUP 4
  823. #endif
  824. // Does the board track the relay status?
  825. #ifndef TRACK_RELAY_STATUS
  826. #define TRACK_RELAY_STATUS 1
  827. #endif
  828. // Serial baudrate
  829. #ifndef SERIAL_BAUDRATE
  830. #define SERIAL_BAUDRATE 115200
  831. #endif
  832. // Relay providers
  833. #ifndef RELAY_PROVIDER
  834. #define RELAY_PROVIDER RELAY_PROVIDER_RELAY
  835. #endif
  836. // Light provider
  837. #ifndef LIGHT_PROVIDER
  838. #define LIGHT_PROVIDER LIGHT_PROVIDER_NONE
  839. #endif