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

  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. #define HLW8012_SUPPORT 1
  58. // Buttons
  59. #define BUTTON1_PIN 4
  60. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  61. #define BUTTON1_RELAY 1
  62. // Relays
  63. #define RELAY1_PIN 12
  64. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  65. // LEDs
  66. #define LED1_PIN 5
  67. #define LED1_PIN_INVERSE 0
  68. // HLW8012
  69. #define HLW8012_SUPPORT 1
  70. #define HLW8012_SEL_PIN 2
  71. #define HLW8012_CF1_PIN 13
  72. #define HLW8012_CF_PIN 14
  73. // -----------------------------------------------------------------------------
  74. // Itead Studio boards
  75. // -----------------------------------------------------------------------------
  76. #elif defined(ITEAD_SONOFF_BASIC)
  77. // Info
  78. #define MANUFACTURER "ITEAD_STUDIO"
  79. #define DEVICE "SONOFF_BASIC"
  80. // Buttons
  81. #define BUTTON1_PIN 0
  82. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  83. #define BUTTON1_RELAY 1
  84. // Relays
  85. #define RELAY1_PIN 12
  86. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  87. // LEDs
  88. #define LED1_PIN 13
  89. #define LED1_PIN_INVERSE 1
  90. #elif defined(ITEAD_SONOFF_RF)
  91. // Info
  92. #define MANUFACTURER "ITEAD_STUDIO"
  93. #define DEVICE "SONOFF_RF"
  94. // Buttons
  95. #define BUTTON1_PIN 0
  96. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  97. #define BUTTON1_RELAY 1
  98. // Relays
  99. #define RELAY1_PIN 12
  100. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  101. // LEDs
  102. #define LED1_PIN 13
  103. #define LED1_PIN_INVERSE 1
  104. #elif defined(ITEAD_SONOFF_TH)
  105. // Info
  106. #define MANUFACTURER "ITEAD_STUDIO"
  107. #define DEVICE "SONOFF_TH"
  108. // Buttons
  109. #define BUTTON1_PIN 0
  110. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  111. #define BUTTON1_RELAY 1
  112. // Relays
  113. #define RELAY1_PIN 12
  114. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  115. // LEDs
  116. #define LED1_PIN 13
  117. #define LED1_PIN_INVERSE 1
  118. #elif defined(ITEAD_SONOFF_SV)
  119. // Info
  120. #define MANUFACTURER "ITEAD_STUDIO"
  121. #define DEVICE "SONOFF_SV"
  122. // Buttons
  123. #define BUTTON1_PIN 0
  124. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  125. #define BUTTON1_RELAY 1
  126. // Relays
  127. #define RELAY1_PIN 12
  128. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  129. // LEDs
  130. #define LED1_PIN 13
  131. #define LED1_PIN_INVERSE 1
  132. #elif defined(ITEAD_SLAMPHER)
  133. // Info
  134. #define MANUFACTURER "ITEAD_STUDIO"
  135. #define DEVICE "SLAMPHER"
  136. // Buttons
  137. #define BUTTON1_PIN 0
  138. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  139. #define BUTTON1_RELAY 1
  140. // Relays
  141. #define RELAY1_PIN 12
  142. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  143. // LEDs
  144. #define LED1_PIN 13
  145. #define LED1_PIN_INVERSE 1
  146. #elif defined(ITEAD_S20)
  147. // Info
  148. #define MANUFACTURER "ITEAD_STUDIO"
  149. #define DEVICE "S20"
  150. // Buttons
  151. #define BUTTON1_PIN 0
  152. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  153. #define BUTTON1_RELAY 1
  154. // Relays
  155. #define RELAY1_PIN 12
  156. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  157. // LEDs
  158. #define LED1_PIN 13
  159. #define LED1_PIN_INVERSE 1
  160. #elif defined(ITEAD_SONOFF_TOUCH)
  161. // Info
  162. #define MANUFACTURER "ITEAD_STUDIO"
  163. #define DEVICE "SONOFF_TOUCH"
  164. // Buttons
  165. #define BUTTON1_PIN 0
  166. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  167. #define BUTTON1_RELAY 1
  168. // Relays
  169. #define RELAY1_PIN 12
  170. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  171. // LEDs
  172. #define LED1_PIN 13
  173. #define LED1_PIN_INVERSE 1
  174. #elif defined(ITEAD_SONOFF_POW)
  175. // Info
  176. #define MANUFACTURER "ITEAD_STUDIO"
  177. #define DEVICE "SONOFF_POW"
  178. #define HLW8012_SUPPORT 1
  179. // Buttons
  180. #define BUTTON1_PIN 0
  181. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  182. #define BUTTON1_RELAY 1
  183. // Relays
  184. #define RELAY1_PIN 12
  185. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  186. // LEDs
  187. #define LED1_PIN 15
  188. #define LED1_PIN_INVERSE 0
  189. // HLW8012
  190. #define HLW8012_SUPPORT 1
  191. #define HLW8012_SEL_PIN 5
  192. #define HLW8012_CF1_PIN 13
  193. #define HLW8012_CF_PIN 14
  194. #elif defined(ITEAD_SONOFF_DUAL)
  195. // Info
  196. #define MANUFACTURER "ITEAD_STUDIO"
  197. #define DEVICE "SONOFF_DUAL"
  198. #define SERIAL_BAUDRATE 19230
  199. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  200. #define DUMMY_RELAY_COUNT 2
  201. #define DEBUG_SERIAL_SUPPORT 0
  202. #define TERMINAL_SUPPORT 0
  203. // Buttons
  204. #define BUTTON3_RELAY 1
  205. // LEDs
  206. #define LED1_PIN 13
  207. #define LED1_PIN_INVERSE 1
  208. #elif defined(ITEAD_SONOFF_4CH)
  209. // Info
  210. #define MANUFACTURER "ITEAD_STUDIO"
  211. #define DEVICE "SONOFF_4CH"
  212. // Buttons
  213. #define BUTTON1_PIN 0
  214. #define BUTTON2_PIN 9
  215. #define BUTTON3_PIN 10
  216. #define BUTTON4_PIN 14
  217. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  218. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  219. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  220. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  221. #define BUTTON1_RELAY 1
  222. #define BUTTON2_RELAY 2
  223. #define BUTTON3_RELAY 3
  224. #define BUTTON4_RELAY 4
  225. // Relays
  226. #define RELAY1_PIN 12
  227. #define RELAY2_PIN 5
  228. #define RELAY3_PIN 4
  229. #define RELAY4_PIN 15
  230. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  231. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  232. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  233. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  234. // LEDs
  235. #define LED1_PIN 13
  236. #define LED1_PIN_INVERSE 1
  237. #elif defined(ITEAD_SONOFF_4CH_PRO)
  238. // Info
  239. #define MANUFACTURER "ITEAD_STUDIO"
  240. #define DEVICE "SONOFF_4CH_PRO"
  241. // Buttons
  242. #define BUTTON1_PIN 0
  243. #define BUTTON2_PIN 9
  244. #define BUTTON3_PIN 10
  245. #define BUTTON4_PIN 14
  246. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  247. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  248. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  249. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  250. #define BUTTON1_RELAY 1
  251. #define BUTTON2_RELAY 2
  252. #define BUTTON3_RELAY 3
  253. #define BUTTON4_RELAY 4
  254. // Relays
  255. #define RELAY1_PIN 12
  256. #define RELAY2_PIN 5
  257. #define RELAY3_PIN 4
  258. #define RELAY4_PIN 15
  259. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  260. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  261. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  262. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  263. // LEDs
  264. #define LED1_PIN 13
  265. #define LED1_PIN_INVERSE 1
  266. #elif defined(ITEAD_1CH_INCHING)
  267. // The inching functionality is managed by a misterious IC in the board.
  268. // You cannot control the inching button and functionality from the ESP8266
  269. // Besides, enabling the inching functionality using the hardware button
  270. // will result in the relay switching on and off continuously.
  271. // Fortunately the unkown IC keeps memory of the hardware inching status
  272. // so you can just disable it and forget. The inching LED must be lit.
  273. // You can still use the pulse options from the web interface
  274. // without problem.
  275. // Info
  276. #define MANUFACTURER "ITEAD_STUDIO"
  277. #define DEVICE "1CH_INCHING"
  278. // Buttons
  279. #define BUTTON1_PIN 0
  280. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  281. #define BUTTON1_RELAY 1
  282. // Relays
  283. #define RELAY1_PIN 12
  284. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  285. // LEDs
  286. #define LED1_PIN 13
  287. #define LED1_PIN_INVERSE 1
  288. #elif defined(ITEAD_MOTOR)
  289. // Info
  290. #define MANUFACTURER "ITEAD_STUDIO"
  291. #define DEVICE "MOTOR"
  292. // Buttons
  293. #define BUTTON1_PIN 0
  294. #define BUTTON1_RELAY 1
  295. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  296. // Relays
  297. #define RELAY1_PIN 12
  298. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  299. // LEDs
  300. #define LED1_PIN 13
  301. #define LED1_PIN_INVERSE 1
  302. #elif defined(ITEAD_BN_SZ01)
  303. // Info
  304. #define MANUFACTURER "ITEAD_STUDIO"
  305. #define DEVICE "BN-SZ01"
  306. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  307. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  308. #define DUMMY_RELAY_COUNT 1
  309. // LEDs
  310. #define LED1_PIN 13
  311. #define LED1_PIN_INVERSE 1
  312. // Channels
  313. #define LIGHT_CH1_PIN 12
  314. #define LIGHT_CH1_INVERSE 0
  315. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  316. // Info
  317. #define MANUFACTURER "ITEAD_STUDIO"
  318. #define DEVICE "SONOFF_RFBRIDGE"
  319. #define SERIAL_BAUDRATE 19200
  320. #define RELAY_PROVIDER RELAY_PROVIDER_RFBRIDGE
  321. #define TRACK_RELAY_STATUS 0
  322. #define TERMINAL_SUPPORT 0
  323. #ifndef DUMMY_RELAY_COUNT
  324. #define DUMMY_RELAY_COUNT 6
  325. #endif
  326. // Buttons
  327. #define BUTTON1_PIN 0
  328. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  329. // LEDs
  330. #define LED1_PIN 13
  331. #define LED1_PIN_INVERSE 1
  332. #elif defined(ITEAD_SONOFF_B1)
  333. // Info
  334. #define MANUFACTURER "ITEAD_STUDIO"
  335. #define DEVICE "SONOFF_B1"
  336. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  337. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192
  338. #define DUMMY_RELAY_COUNT 1
  339. #define MY9291_DI_PIN 13
  340. #define MY9291_DCKI_PIN 15
  341. #define MY9291_COMMAND MY9291_COMMAND_DEFAULT
  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. // -----------------------------------------------------------------------------
  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