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.

1037 lines
29 KiB

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