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.

979 lines
27 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. #define TRACK_RELAY_STATUS 0
  320. #define TERMINAL_SUPPORT 0
  321. #ifndef DUMMY_RELAY_COUNT
  322. #define DUMMY_RELAY_COUNT 6
  323. #endif
  324. // Buttons
  325. #define BUTTON1_PIN 0
  326. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  327. // LEDs
  328. #define LED1_PIN 13
  329. #define LED1_PIN_INVERSE 1
  330. #elif defined(ITEAD_SONOFF_B1)
  331. // Info
  332. #define MANUFACTURER "ITEAD_STUDIO"
  333. #define DEVICE "SONOFF_B1"
  334. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  335. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192
  336. #define DUMMY_RELAY_COUNT 1
  337. #define MY9291_DI_PIN 13
  338. #define MY9291_DCKI_PIN 15
  339. #define MY9291_COMMAND MY9291_COMMAND_DEFAULT
  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. // -----------------------------------------------------------------------------
  465. // LED Controller
  466. // -----------------------------------------------------------------------------
  467. #elif defined(MAGICHOME_LED_CONTROLLER)
  468. // Info
  469. #define MANUFACTURER "MAGIC_HOME"
  470. #define DEVICE "LED_CONTROLLER"
  471. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  472. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  473. #define DUMMY_RELAY_COUNT 1
  474. // LEDs
  475. #define LED1_PIN 2
  476. #define LED1_PIN_INVERSE 1
  477. // Channels
  478. #define LIGHT_CH1_PIN 14 // RED
  479. #define LIGHT_CH2_PIN 5 // GREEN
  480. #define LIGHT_CH3_PIN 12 // BLUE
  481. #define LIGHT_CH4_PIN 13 // WHITE
  482. #define LIGHT_CH1_INVERSE 0
  483. #define LIGHT_CH2_INVERSE 0
  484. #define LIGHT_CH3_INVERSE 0
  485. #define LIGHT_CH4_INVERSE 0
  486. // -----------------------------------------------------------------------------
  487. // HUACANXING H801
  488. // -----------------------------------------------------------------------------
  489. #elif defined(HUACANXING_H801)
  490. // Info
  491. #define MANUFACTURER "HUACANXING"
  492. #define DEVICE "H801"
  493. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  494. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  495. #define DUMMY_RELAY_COUNT 1
  496. // LEDs
  497. #define LED1_PIN 5
  498. #define LED1_PIN_INVERSE 1
  499. // Channels
  500. #define LIGHT_CH1_PIN 15 // RED
  501. #define LIGHT_CH2_PIN 13 // GREEN
  502. #define LIGHT_CH3_PIN 12 // BLUE
  503. #define LIGHT_CH4_PIN 14 // WHITE1
  504. #define LIGHT_CH5_PIN 4 // WHITE2
  505. #define LIGHT_CH1_INVERSE 0
  506. #define LIGHT_CH2_INVERSE 0
  507. #define LIGHT_CH3_INVERSE 0
  508. #define LIGHT_CH4_INVERSE 0
  509. #define LIGHT_CH5_INVERSE 0
  510. // -----------------------------------------------------------------------------
  511. // Jan Goedeke Wifi Relay
  512. // https://github.com/JanGoe/esp8266-wifi-relay
  513. // -----------------------------------------------------------------------------
  514. #elif defined(JANGOE_WIFI_RELAY_NC)
  515. // Info
  516. #define MANUFACTURER "JAN_GOEDEKE"
  517. #define DEVICE "WIFI_RELAY_NC"
  518. // Buttons
  519. #define BUTTON1_PIN 12
  520. #define BUTTON2_PIN 13
  521. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  522. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  523. #define BUTTON1_RELAY 1
  524. #define BUTTON2_RELAY 2
  525. // Relays
  526. #define RELAY1_PIN 2
  527. #define RELAY2_PIN 14
  528. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  529. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  530. #elif defined(JANGOE_WIFI_RELAY_NO)
  531. // Info
  532. #define MANUFACTURER "JAN_GOEDEKE"
  533. #define DEVICE "WIFI_RELAY_NO"
  534. // Buttons
  535. #define BUTTON1_PIN 12
  536. #define BUTTON2_PIN 13
  537. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  538. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  539. #define BUTTON1_RELAY 1
  540. #define BUTTON2_RELAY 2
  541. // Relays
  542. #define RELAY1_PIN 2
  543. #define RELAY2_PIN 14
  544. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  545. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  546. // -----------------------------------------------------------------------------
  547. // Jorge García Wifi+Relays Board Kit
  548. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  549. // https://github.com/jorgegarciadev/wifikit
  550. // -----------------------------------------------------------------------------
  551. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  552. // Info
  553. #define MANUFACTURER "JORGE_GARCIA"
  554. #define DEVICE "WIFI_RELAYS"
  555. // Relays
  556. #define RELAY1_PIN 0
  557. #define RELAY2_PIN 2
  558. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  559. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  560. // -----------------------------------------------------------------------------
  561. // WiFi MQTT Relay / Thermostat
  562. // -----------------------------------------------------------------------------
  563. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  564. // Info
  565. #define MANUFACTURER "OPENENERGYMONITOR"
  566. #define DEVICE "MQTT_RELAY"
  567. // Buttons
  568. #define BUTTON1_PIN 0
  569. #define BUTTON1_RELAY 1
  570. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  571. // Relays
  572. #define RELAY1_PIN 12
  573. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  574. // LEDs
  575. #define LED1_PIN 16
  576. #define LED1_PIN_INVERSE 0
  577. // -----------------------------------------------------------------------------
  578. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  579. // 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
  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-50055-Indoor-Wi-Fi-Wall-Tap-Monitor-Energy-Usage-Wireless-Smart-Switch-%2F263020837777
  581. // -----------------------------------------------------------------------------
  582. #elif defined(WION_50055)
  583. // Currently untested, does not support energy monitoring
  584. // Info
  585. #define MANUFACTURER "WION"
  586. #define DEVICE "50055"
  587. // Buttons
  588. #define BUTTON1_PIN 13
  589. #define BUTTON1_RELAY 1
  590. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  591. // Relays
  592. #define RELAY1_PIN 15
  593. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  594. // LEDs
  595. #define LED1_PIN 2
  596. #define LED1_PIN_INVERSE 0
  597. // -----------------------------------------------------------------------------
  598. // EX-Store Wifi Relay v3.1
  599. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  600. // -----------------------------------------------------------------------------
  601. #elif defined(EXS_WIFI_RELAY_V31)
  602. // Untested
  603. // Info
  604. #define MANUFACTURER "EXS"
  605. #define DEVICE "WIFI_RELAY_V31"
  606. // Buttons
  607. #define BUTTON1_PIN 0
  608. #define BUTTON1_RELAY 1
  609. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  610. // Relays
  611. #define RELAY1_PIN 13
  612. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  613. #define RELAY1_RESET_PIN 12
  614. // -----------------------------------------------------------------------------
  615. // Unknown hardware
  616. // -----------------------------------------------------------------------------
  617. #else
  618. #error "UNSUPPORTED HARDWARE!"
  619. #endif
  620. // -----------------------------------------------------------------------------
  621. // Default values
  622. // -----------------------------------------------------------------------------
  623. #ifndef BUTTON1_PRESS
  624. #define BUTTON1_PRESS BUTTON_MODE_NONE
  625. #endif
  626. #ifndef BUTTON2_PRESS
  627. #define BUTTON2_PRESS BUTTON_MODE_NONE
  628. #endif
  629. #ifndef BUTTON3_PRESS
  630. #define BUTTON3_PRESS BUTTON_MODE_NONE
  631. #endif
  632. #ifndef BUTTON4_PRESS
  633. #define BUTTON4_PRESS BUTTON_MODE_NONE
  634. #endif
  635. #ifndef BUTTON1_CLICK
  636. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  637. #endif
  638. #ifndef BUTTON2_CLICK
  639. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  640. #endif
  641. #ifndef BUTTON3_CLICK
  642. #define BUTTON3_CLICK BUTTON_MODE_TOGGLE
  643. #endif
  644. #ifndef BUTTON4_CLICK
  645. #define BUTTON4_CLICK BUTTON_MODE_TOGGLE
  646. #endif
  647. #ifndef BUTTON1_DBLCLICK
  648. #define BUTTON1_DBLCLICK BUTTON_MODE_AP
  649. #endif
  650. #ifndef BUTTON2_DBLCLICK
  651. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  652. #endif
  653. #ifndef BUTTON3_DBLCLICK
  654. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  655. #endif
  656. #ifndef BUTTON4_DBLCLICK
  657. #define BUTTON4_DBLCLICK BUTTON_MODE_NONE
  658. #endif
  659. #ifndef BUTTON1_LNGCLICK
  660. #define BUTTON1_LNGCLICK BUTTON_MODE_RESET
  661. #endif
  662. #ifndef BUTTON2_LNGCLICK
  663. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  664. #endif
  665. #ifndef BUTTON3_LNGCLICK
  666. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  667. #endif
  668. #ifndef BUTTON4_LNGCLICK
  669. #define BUTTON4_LNGCLICK BUTTON_MODE_NONE
  670. #endif
  671. #ifndef BUTTON1_LNGLNGCLICK
  672. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_FACTORY
  673. #endif
  674. #ifndef BUTTON2_LNGLNGCLICK
  675. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  676. #endif
  677. #ifndef BUTTON3_LNGLNGCLICK
  678. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_NONE
  679. #endif
  680. #ifndef BUTTON4_LNGLNGCLICK
  681. #define BUTTON4_LNGLNGCLICK BUTTON_MODE_NONE
  682. #endif
  683. #ifndef BUTTON1_RELAY
  684. #define BUTTON1_RELAY 0
  685. #endif
  686. #ifndef BUTTON2_RELAY
  687. #define BUTTON2_RELAY 0
  688. #endif
  689. #ifndef BUTTON3_RELAY
  690. #define BUTTON3_RELAY 0
  691. #endif
  692. #ifndef BUTTON4_RELAY
  693. #define BUTTON4_RELAY 0
  694. #endif
  695. #ifndef RELAY1_RESET_PIN
  696. #define RELAY1_RESET_PIN 0
  697. #endif
  698. #ifndef RELAY2_RESET_PIN
  699. #define RELAY2_RESET_PIN 0
  700. #endif
  701. #ifndef RELAY3_RESET_PIN
  702. #define RELAY3_RESET_PIN 0
  703. #endif
  704. #ifndef RELAY4_RESET_PIN
  705. #define RELAY4_RESET_PIN 0
  706. #endif
  707. #ifndef RELAY1_DELAY_ON
  708. #define RELAY1_DELAY_ON 0
  709. #endif
  710. #ifndef RELAY2_DELAY_ON
  711. #define RELAY2_DELAY_ON 0
  712. #endif
  713. #ifndef RELAY3_DELAY_ON
  714. #define RELAY3_DELAY_ON 0
  715. #endif
  716. #ifndef RELAY4_DELAY_ON
  717. #define RELAY4_DELAY_ON 0
  718. #endif
  719. #ifndef RELAY1_DELAY_OFF
  720. #define RELAY1_DELAY_OFF 0
  721. #endif
  722. #ifndef RELAY2_DELAY_OFF
  723. #define RELAY2_DELAY_OFF 0
  724. #endif
  725. #ifndef RELAY3_DELAY_OFF
  726. #define RELAY3_DELAY_OFF 0
  727. #endif
  728. #ifndef RELAY4_DELAY_OFF
  729. #define RELAY4_DELAY_OFF 0
  730. #endif
  731. #ifndef RELAY1_LED
  732. #define RELAY1_LED 0
  733. #endif
  734. #ifndef RELAY2_LED
  735. #define RELAY2_LED 0
  736. #endif
  737. #ifndef RELAY3_LED
  738. #define RELAY3_LED 0
  739. #endif
  740. #ifndef RELAY4_LED
  741. #define RELAY4_LED 0
  742. #endif
  743. // Needed for ESP8285 boards under Windows using PlatformIO (?)
  744. #ifndef BUTTON_PUSHBUTTON
  745. #define BUTTON_PUSHBUTTON 0
  746. #define BUTTON_SWITCH 1
  747. #define BUTTON_DEFAULT_HIGH 2
  748. #define BUTTON_SET_PULLUP 4
  749. #endif
  750. // Does the board track the relay status?
  751. #ifndef TRACK_RELAY_STATUS
  752. #define TRACK_RELAY_STATUS 1
  753. #endif
  754. // Serial baudrate
  755. #ifndef SERIAL_BAUDRATE
  756. #define SERIAL_BAUDRATE 115200
  757. #endif
  758. // Relay providers
  759. #ifndef RELAY_PROVIDER
  760. #define RELAY_PROVIDER RELAY_PROVIDER_RELAY
  761. #endif
  762. // Light provider
  763. #ifndef LIGHT_PROVIDER
  764. #define LIGHT_PROVIDER LIGHT_PROVIDER_NONE
  765. #endif