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.

982 lines
28 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#_PIN_INVERSE: Relay has inversed logic (closed or ON when pulled down)
  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. #define DEBUG_SERIAL_SUPPORT 0
  324. #define TERMINAL_SUPPORT 0
  325. // Buttons
  326. #define BUTTON1_PIN 0
  327. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  328. // LEDs
  329. #define LED1_PIN 13
  330. #define LED1_PIN_INVERSE 1
  331. #elif defined(ITEAD_SONOFF_B1)
  332. // Info
  333. #define MANUFACTURER "ITEAD_STUDIO"
  334. #define DEVICE "SONOFF_B1"
  335. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  336. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192
  337. #define DUMMY_RELAY_COUNT 1
  338. #define MY9291_DI_PIN 12
  339. #define MY9291_DCKI_PIN 14
  340. #define MY9291_COMMAND MY9291_COMMAND_DEFAULT
  341. #define MY9291_CHANNELS 5
  342. #elif defined(ITEAD_SONOFF_LED)
  343. // Info
  344. #define MANUFACTURER "ITEAD_STUDIO"
  345. #define DEVICE "SONOFF_LED"
  346. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  347. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  348. #define DUMMY_RELAY_COUNT 1
  349. // LEDs
  350. #define LED1_PIN 13
  351. #define LED1_PIN_INVERSE 1
  352. // Channels
  353. #define LIGHT_CH1_PIN 12 // Cold white
  354. #define LIGHT_CH2_PIN 14 // Warm white
  355. #define LIGHT_CH1_INVERSE 0
  356. #define LIGHT_CH2_INVERSE 0
  357. #elif defined(ITEAD_SONOFF_T1_1CH)
  358. // Info
  359. #define MANUFACTURER "ITEAD_STUDIO"
  360. #define DEVICE "SONOFF_T1_1CH"
  361. // Buttons
  362. #define BUTTON1_PIN 9
  363. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  364. #define BUTTON1_RELAY 1
  365. // Relays
  366. #define RELAY1_PIN 5
  367. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  368. // LEDs
  369. #define LED1_PIN 13
  370. #define LED1_PIN_INVERSE 1
  371. #elif defined(ITEAD_SONOFF_T1_2CH)
  372. // Info
  373. #define MANUFACTURER "ITEAD_STUDIO"
  374. #define DEVICE "SONOFF_T1_2CH"
  375. // Buttons
  376. #define BUTTON1_PIN 0
  377. #define BUTTON2_PIN 10
  378. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  379. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  380. #define BUTTON1_RELAY 1
  381. #define BUTTON2_RELAY 2
  382. // Relays
  383. #define RELAY1_PIN 12
  384. #define RELAY2_PIN 4
  385. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  386. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  387. // LEDs
  388. #define LED1_PIN 13
  389. #define LED1_PIN_INVERSE 1
  390. #elif defined(ITEAD_SONOFF_T1_3CH)
  391. // Info
  392. #define MANUFACTURER "ITEAD_STUDIO"
  393. #define DEVICE "SONOFF_T1_3CH"
  394. // Buttons
  395. #define BUTTON1_PIN 0
  396. #define BUTTON2_PIN 9
  397. #define BUTTON3_PIN 10
  398. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  399. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  400. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  401. #define BUTTON1_RELAY 1
  402. #define BUTTON2_RELAY 2
  403. #define BUTTON3_RELAY 3
  404. // Relays
  405. #define RELAY1_PIN 12
  406. #define RELAY2_PIN 5
  407. #define RELAY3_PIN 4
  408. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  409. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  410. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  411. // LEDs
  412. #define LED1_PIN 13
  413. #define LED1_PIN_INVERSE 1
  414. // -----------------------------------------------------------------------------
  415. // Electrodragon boards
  416. // -----------------------------------------------------------------------------
  417. #elif defined(ELECTRODRAGON_WIFI_IOT)
  418. // Info
  419. #define MANUFACTURER "ELECTRODRAGON"
  420. #define DEVICE "WIFI_IOT"
  421. // Buttons
  422. #define BUTTON1_PIN 0
  423. #define BUTTON2_PIN 2
  424. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  425. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  426. #define BUTTON1_RELAY 1
  427. #define BUTTON2_RELAY 2
  428. // Relays
  429. #define RELAY1_PIN 12
  430. #define RELAY2_PIN 13
  431. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  432. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  433. // LEDs
  434. #define LED1_PIN 16
  435. #define LED1_PIN_INVERSE 0
  436. // -----------------------------------------------------------------------------
  437. // WorkChoice ecoPlug
  438. // -----------------------------------------------------------------------------
  439. #elif defined(WORKCHOICE_ECOPLUG)
  440. // Info
  441. #define MANUFACTURER "WORKCHOICE"
  442. #define DEVICE "ECOPLUG"
  443. // Buttons
  444. #define BUTTON1_PIN 13
  445. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  446. #define BUTTON1_RELAY 1
  447. // Relays
  448. #define RELAY1_PIN 15
  449. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  450. // LEDs
  451. #define LED1_PIN 2
  452. #define LED1_PIN_INVERSE 0
  453. // -----------------------------------------------------------------------------
  454. // AI Thinker
  455. // -----------------------------------------------------------------------------
  456. #elif defined(AITHINKER_AI_LIGHT)
  457. // Info
  458. #define MANUFACTURER "AI_THINKER"
  459. #define DEVICE "AI_LIGHT"
  460. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  461. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192
  462. #define DUMMY_RELAY_COUNT 1
  463. #define MY9291_DI_PIN 13
  464. #define MY9291_DCKI_PIN 15
  465. #define MY9291_COMMAND MY9291_COMMAND_DEFAULT
  466. #define MY9291_CHANNELS 4
  467. // -----------------------------------------------------------------------------
  468. // LED Controller
  469. // -----------------------------------------------------------------------------
  470. #elif defined(MAGICHOME_LED_CONTROLLER)
  471. // Info
  472. #define MANUFACTURER "MAGIC_HOME"
  473. #define DEVICE "LED_CONTROLLER"
  474. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  475. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  476. #define DUMMY_RELAY_COUNT 1
  477. // LEDs
  478. #define LED1_PIN 2
  479. #define LED1_PIN_INVERSE 1
  480. // Channels
  481. #define LIGHT_CH1_PIN 14 // RED
  482. #define LIGHT_CH2_PIN 5 // GREEN
  483. #define LIGHT_CH3_PIN 12 // BLUE
  484. #define LIGHT_CH4_PIN 13 // WHITE
  485. #define LIGHT_CH1_INVERSE 0
  486. #define LIGHT_CH2_INVERSE 0
  487. #define LIGHT_CH3_INVERSE 0
  488. #define LIGHT_CH4_INVERSE 0
  489. // -----------------------------------------------------------------------------
  490. // HUACANXING H801
  491. // -----------------------------------------------------------------------------
  492. #elif defined(HUACANXING_H801)
  493. // Info
  494. #define MANUFACTURER "HUACANXING"
  495. #define DEVICE "H801"
  496. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  497. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  498. #define DUMMY_RELAY_COUNT 1
  499. // LEDs
  500. #define LED1_PIN 5
  501. #define LED1_PIN_INVERSE 1
  502. // Channels
  503. #define LIGHT_CH1_PIN 15 // RED
  504. #define LIGHT_CH2_PIN 13 // GREEN
  505. #define LIGHT_CH3_PIN 12 // BLUE
  506. #define LIGHT_CH4_PIN 14 // WHITE1
  507. #define LIGHT_CH5_PIN 4 // WHITE2
  508. #define LIGHT_CH1_INVERSE 0
  509. #define LIGHT_CH2_INVERSE 0
  510. #define LIGHT_CH3_INVERSE 0
  511. #define LIGHT_CH4_INVERSE 0
  512. #define LIGHT_CH5_INVERSE 0
  513. // -----------------------------------------------------------------------------
  514. // Jan Goedeke Wifi Relay
  515. // https://github.com/JanGoe/esp8266-wifi-relay
  516. // -----------------------------------------------------------------------------
  517. #elif defined(JANGOE_WIFI_RELAY_NC)
  518. // Info
  519. #define MANUFACTURER "JAN_GOEDEKE"
  520. #define DEVICE "WIFI_RELAY_NC"
  521. // Buttons
  522. #define BUTTON1_PIN 12
  523. #define BUTTON2_PIN 13
  524. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  525. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  526. #define BUTTON1_RELAY 1
  527. #define BUTTON2_RELAY 2
  528. // Relays
  529. #define RELAY1_PIN 2
  530. #define RELAY2_PIN 14
  531. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  532. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  533. #elif defined(JANGOE_WIFI_RELAY_NO)
  534. // Info
  535. #define MANUFACTURER "JAN_GOEDEKE"
  536. #define DEVICE "WIFI_RELAY_NO"
  537. // Buttons
  538. #define BUTTON1_PIN 12
  539. #define BUTTON2_PIN 13
  540. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  541. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  542. #define BUTTON1_RELAY 1
  543. #define BUTTON2_RELAY 2
  544. // Relays
  545. #define RELAY1_PIN 2
  546. #define RELAY2_PIN 14
  547. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  548. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  549. // -----------------------------------------------------------------------------
  550. // Jorge García Wifi+Relays Board Kit
  551. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  552. // https://github.com/jorgegarciadev/wifikit
  553. // -----------------------------------------------------------------------------
  554. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  555. // Info
  556. #define MANUFACTURER "JORGE_GARCIA"
  557. #define DEVICE "WIFI_RELAYS"
  558. // Relays
  559. #define RELAY1_PIN 0
  560. #define RELAY2_PIN 2
  561. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  562. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  563. // -----------------------------------------------------------------------------
  564. // WiFi MQTT Relay / Thermostat
  565. // -----------------------------------------------------------------------------
  566. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  567. // Info
  568. #define MANUFACTURER "OPENENERGYMONITOR"
  569. #define DEVICE "MQTT_RELAY"
  570. // Buttons
  571. #define BUTTON1_PIN 0
  572. #define BUTTON1_RELAY 1
  573. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  574. // Relays
  575. #define RELAY1_PIN 12
  576. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  577. // LEDs
  578. #define LED1_PIN 16
  579. #define LED1_PIN_INVERSE 0
  580. // -----------------------------------------------------------------------------
  581. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  582. // 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
  583. // 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
  584. // -----------------------------------------------------------------------------
  585. #elif defined(WION_50055)
  586. // Currently untested, does not support energy monitoring
  587. // Info
  588. #define MANUFACTURER "WION"
  589. #define DEVICE "50055"
  590. // Buttons
  591. #define BUTTON1_PIN 13
  592. #define BUTTON1_RELAY 1
  593. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  594. // Relays
  595. #define RELAY1_PIN 15
  596. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  597. // LEDs
  598. #define LED1_PIN 2
  599. #define LED1_PIN_INVERSE 0
  600. // -----------------------------------------------------------------------------
  601. // EX-Store Wifi Relay v3.1
  602. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  603. // -----------------------------------------------------------------------------
  604. #elif defined(EXS_WIFI_RELAY_V31)
  605. // Untested
  606. // Info
  607. #define MANUFACTURER "EXS"
  608. #define DEVICE "WIFI_RELAY_V31"
  609. // Buttons
  610. #define BUTTON1_PIN 0
  611. #define BUTTON1_RELAY 1
  612. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  613. // Relays
  614. #define RELAY1_PIN 13
  615. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  616. #define RELAY1_RESET_PIN 12
  617. // -----------------------------------------------------------------------------
  618. // Unknown hardware
  619. // -----------------------------------------------------------------------------
  620. #else
  621. #error "UNSUPPORTED HARDWARE!"
  622. #endif
  623. // -----------------------------------------------------------------------------
  624. // Default values
  625. // -----------------------------------------------------------------------------
  626. #ifndef BUTTON1_PRESS
  627. #define BUTTON1_PRESS BUTTON_MODE_NONE
  628. #endif
  629. #ifndef BUTTON2_PRESS
  630. #define BUTTON2_PRESS BUTTON_MODE_NONE
  631. #endif
  632. #ifndef BUTTON3_PRESS
  633. #define BUTTON3_PRESS BUTTON_MODE_NONE
  634. #endif
  635. #ifndef BUTTON4_PRESS
  636. #define BUTTON4_PRESS BUTTON_MODE_NONE
  637. #endif
  638. #ifndef BUTTON1_CLICK
  639. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  640. #endif
  641. #ifndef BUTTON2_CLICK
  642. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  643. #endif
  644. #ifndef BUTTON3_CLICK
  645. #define BUTTON3_CLICK BUTTON_MODE_TOGGLE
  646. #endif
  647. #ifndef BUTTON4_CLICK
  648. #define BUTTON4_CLICK BUTTON_MODE_TOGGLE
  649. #endif
  650. #ifndef BUTTON1_DBLCLICK
  651. #define BUTTON1_DBLCLICK BUTTON_MODE_AP
  652. #endif
  653. #ifndef BUTTON2_DBLCLICK
  654. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  655. #endif
  656. #ifndef BUTTON3_DBLCLICK
  657. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  658. #endif
  659. #ifndef BUTTON4_DBLCLICK
  660. #define BUTTON4_DBLCLICK BUTTON_MODE_NONE
  661. #endif
  662. #ifndef BUTTON1_LNGCLICK
  663. #define BUTTON1_LNGCLICK BUTTON_MODE_RESET
  664. #endif
  665. #ifndef BUTTON2_LNGCLICK
  666. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  667. #endif
  668. #ifndef BUTTON3_LNGCLICK
  669. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  670. #endif
  671. #ifndef BUTTON4_LNGCLICK
  672. #define BUTTON4_LNGCLICK BUTTON_MODE_NONE
  673. #endif
  674. #ifndef BUTTON1_LNGLNGCLICK
  675. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_FACTORY
  676. #endif
  677. #ifndef BUTTON2_LNGLNGCLICK
  678. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  679. #endif
  680. #ifndef BUTTON3_LNGLNGCLICK
  681. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_NONE
  682. #endif
  683. #ifndef BUTTON4_LNGLNGCLICK
  684. #define BUTTON4_LNGLNGCLICK BUTTON_MODE_NONE
  685. #endif
  686. #ifndef BUTTON1_RELAY
  687. #define BUTTON1_RELAY 0
  688. #endif
  689. #ifndef BUTTON2_RELAY
  690. #define BUTTON2_RELAY 0
  691. #endif
  692. #ifndef BUTTON3_RELAY
  693. #define BUTTON3_RELAY 0
  694. #endif
  695. #ifndef BUTTON4_RELAY
  696. #define BUTTON4_RELAY 0
  697. #endif
  698. #ifndef RELAY1_RESET_PIN
  699. #define RELAY1_RESET_PIN 0
  700. #endif
  701. #ifndef RELAY2_RESET_PIN
  702. #define RELAY2_RESET_PIN 0
  703. #endif
  704. #ifndef RELAY3_RESET_PIN
  705. #define RELAY3_RESET_PIN 0
  706. #endif
  707. #ifndef RELAY4_RESET_PIN
  708. #define RELAY4_RESET_PIN 0
  709. #endif
  710. #ifndef RELAY1_DELAY_ON
  711. #define RELAY1_DELAY_ON 0
  712. #endif
  713. #ifndef RELAY2_DELAY_ON
  714. #define RELAY2_DELAY_ON 0
  715. #endif
  716. #ifndef RELAY3_DELAY_ON
  717. #define RELAY3_DELAY_ON 0
  718. #endif
  719. #ifndef RELAY4_DELAY_ON
  720. #define RELAY4_DELAY_ON 0
  721. #endif
  722. #ifndef RELAY1_DELAY_OFF
  723. #define RELAY1_DELAY_OFF 0
  724. #endif
  725. #ifndef RELAY2_DELAY_OFF
  726. #define RELAY2_DELAY_OFF 0
  727. #endif
  728. #ifndef RELAY3_DELAY_OFF
  729. #define RELAY3_DELAY_OFF 0
  730. #endif
  731. #ifndef RELAY4_DELAY_OFF
  732. #define RELAY4_DELAY_OFF 0
  733. #endif
  734. #ifndef RELAY1_LED
  735. #define RELAY1_LED 0
  736. #endif
  737. #ifndef RELAY2_LED
  738. #define RELAY2_LED 0
  739. #endif
  740. #ifndef RELAY3_LED
  741. #define RELAY3_LED 0
  742. #endif
  743. #ifndef RELAY4_LED
  744. #define RELAY4_LED 0
  745. #endif
  746. // Needed for ESP8285 boards under Windows using PlatformIO (?)
  747. #ifndef BUTTON_PUSHBUTTON
  748. #define BUTTON_PUSHBUTTON 0
  749. #define BUTTON_SWITCH 1
  750. #define BUTTON_DEFAULT_HIGH 2
  751. #define BUTTON_SET_PULLUP 4
  752. #endif
  753. // Does the board track the relay status?
  754. #ifndef TRACK_RELAY_STATUS
  755. #define TRACK_RELAY_STATUS 1
  756. #endif
  757. // Serial baudrate
  758. #ifndef SERIAL_BAUDRATE
  759. #define SERIAL_BAUDRATE 115200
  760. #endif
  761. // Relay providers
  762. #ifndef RELAY_PROVIDER
  763. #define RELAY_PROVIDER RELAY_PROVIDER_RELAY
  764. #endif
  765. // Light provider
  766. #ifndef LIGHT_PROVIDER
  767. #define LIGHT_PROVIDER LIGHT_PROVIDER_NONE
  768. #endif