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.

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