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.

1036 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 V9261F_SUPPORT 1
  656. #define V9261F_PIN 2
  657. #define V9261F_PIN_INVERSE 1
  658. // -----------------------------------------------------------------------------
  659. // Unknown hardware
  660. // -----------------------------------------------------------------------------
  661. #else
  662. #error "UNSUPPORTED HARDWARE!"
  663. #endif
  664. // -----------------------------------------------------------------------------
  665. // Default values
  666. // -----------------------------------------------------------------------------
  667. #ifndef BUTTON1_PRESS
  668. #define BUTTON1_PRESS BUTTON_MODE_NONE
  669. #endif
  670. #ifndef BUTTON2_PRESS
  671. #define BUTTON2_PRESS BUTTON_MODE_NONE
  672. #endif
  673. #ifndef BUTTON3_PRESS
  674. #define BUTTON3_PRESS BUTTON_MODE_NONE
  675. #endif
  676. #ifndef BUTTON4_PRESS
  677. #define BUTTON4_PRESS BUTTON_MODE_NONE
  678. #endif
  679. #ifndef BUTTON1_CLICK
  680. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  681. #endif
  682. #ifndef BUTTON2_CLICK
  683. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  684. #endif
  685. #ifndef BUTTON3_CLICK
  686. #define BUTTON3_CLICK BUTTON_MODE_TOGGLE
  687. #endif
  688. #ifndef BUTTON4_CLICK
  689. #define BUTTON4_CLICK BUTTON_MODE_TOGGLE
  690. #endif
  691. #ifndef BUTTON1_DBLCLICK
  692. #define BUTTON1_DBLCLICK BUTTON_MODE_AP
  693. #endif
  694. #ifndef BUTTON2_DBLCLICK
  695. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  696. #endif
  697. #ifndef BUTTON3_DBLCLICK
  698. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  699. #endif
  700. #ifndef BUTTON4_DBLCLICK
  701. #define BUTTON4_DBLCLICK BUTTON_MODE_NONE
  702. #endif
  703. #ifndef BUTTON1_LNGCLICK
  704. #define BUTTON1_LNGCLICK BUTTON_MODE_RESET
  705. #endif
  706. #ifndef BUTTON2_LNGCLICK
  707. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  708. #endif
  709. #ifndef BUTTON3_LNGCLICK
  710. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  711. #endif
  712. #ifndef BUTTON4_LNGCLICK
  713. #define BUTTON4_LNGCLICK BUTTON_MODE_NONE
  714. #endif
  715. #ifndef BUTTON1_LNGLNGCLICK
  716. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_FACTORY
  717. #endif
  718. #ifndef BUTTON2_LNGLNGCLICK
  719. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  720. #endif
  721. #ifndef BUTTON3_LNGLNGCLICK
  722. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_NONE
  723. #endif
  724. #ifndef BUTTON4_LNGLNGCLICK
  725. #define BUTTON4_LNGLNGCLICK BUTTON_MODE_NONE
  726. #endif
  727. #ifndef BUTTON1_RELAY
  728. #define BUTTON1_RELAY 0
  729. #endif
  730. #ifndef BUTTON2_RELAY
  731. #define BUTTON2_RELAY 0
  732. #endif
  733. #ifndef BUTTON3_RELAY
  734. #define BUTTON3_RELAY 0
  735. #endif
  736. #ifndef BUTTON4_RELAY
  737. #define BUTTON4_RELAY 0
  738. #endif
  739. #ifndef RELAY1_RESET_PIN
  740. #define RELAY1_RESET_PIN 0
  741. #endif
  742. #ifndef RELAY2_RESET_PIN
  743. #define RELAY2_RESET_PIN 0
  744. #endif
  745. #ifndef RELAY3_RESET_PIN
  746. #define RELAY3_RESET_PIN 0
  747. #endif
  748. #ifndef RELAY4_RESET_PIN
  749. #define RELAY4_RESET_PIN 0
  750. #endif
  751. #ifndef RELAY1_DELAY_ON
  752. #define RELAY1_DELAY_ON 0
  753. #endif
  754. #ifndef RELAY2_DELAY_ON
  755. #define RELAY2_DELAY_ON 0
  756. #endif
  757. #ifndef RELAY3_DELAY_ON
  758. #define RELAY3_DELAY_ON 0
  759. #endif
  760. #ifndef RELAY4_DELAY_ON
  761. #define RELAY4_DELAY_ON 0
  762. #endif
  763. #ifndef RELAY1_DELAY_OFF
  764. #define RELAY1_DELAY_OFF 0
  765. #endif
  766. #ifndef RELAY2_DELAY_OFF
  767. #define RELAY2_DELAY_OFF 0
  768. #endif
  769. #ifndef RELAY3_DELAY_OFF
  770. #define RELAY3_DELAY_OFF 0
  771. #endif
  772. #ifndef RELAY4_DELAY_OFF
  773. #define RELAY4_DELAY_OFF 0
  774. #endif
  775. #ifndef RELAY1_LED
  776. #define RELAY1_LED 0
  777. #endif
  778. #ifndef RELAY2_LED
  779. #define RELAY2_LED 0
  780. #endif
  781. #ifndef RELAY3_LED
  782. #define RELAY3_LED 0
  783. #endif
  784. #ifndef RELAY4_LED
  785. #define RELAY4_LED 0
  786. #endif
  787. // Needed for ESP8285 boards under Windows using PlatformIO (?)
  788. #ifndef BUTTON_PUSHBUTTON
  789. #define BUTTON_PUSHBUTTON 0
  790. #define BUTTON_SWITCH 1
  791. #define BUTTON_DEFAULT_HIGH 2
  792. #define BUTTON_SET_PULLUP 4
  793. #endif
  794. // Does the board track the relay status?
  795. #ifndef TRACK_RELAY_STATUS
  796. #define TRACK_RELAY_STATUS 1
  797. #endif
  798. // Serial baudrate
  799. #ifndef SERIAL_BAUDRATE
  800. #define SERIAL_BAUDRATE 115200
  801. #endif
  802. // Relay providers
  803. #ifndef RELAY_PROVIDER
  804. #define RELAY_PROVIDER RELAY_PROVIDER_RELAY
  805. #endif
  806. // Light provider
  807. #ifndef LIGHT_PROVIDER
  808. #define LIGHT_PROVIDER LIGHT_PROVIDER_NONE
  809. #endif