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.

980 lines
27 KiB

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