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.

956 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 ENABLE_HLW8012 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 ENABLE_HLW8012 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 ENABLE_HLW8012 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 ENABLE_HLW8012 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 ENABLE_SERIAL_DEBUG 0
  202. #define ENABLE_TERMINAL 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 DUMMY_RELAY_COUNT 6
  322. #define TRACK_RELAY_STATUS 0
  323. #define ENABLE_TERMINAL 0
  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. // Unknown hardware
  599. // -----------------------------------------------------------------------------
  600. #else
  601. #error "UNSUPPORTED HARDWARE!"
  602. #endif
  603. // -----------------------------------------------------------------------------
  604. // Default values
  605. // -----------------------------------------------------------------------------
  606. #ifndef BUTTON1_PRESS
  607. #define BUTTON1_PRESS BUTTON_MODE_NONE
  608. #endif
  609. #ifndef BUTTON2_PRESS
  610. #define BUTTON2_PRESS BUTTON_MODE_NONE
  611. #endif
  612. #ifndef BUTTON3_PRESS
  613. #define BUTTON3_PRESS BUTTON_MODE_NONE
  614. #endif
  615. #ifndef BUTTON4_PRESS
  616. #define BUTTON4_PRESS BUTTON_MODE_NONE
  617. #endif
  618. #ifndef BUTTON1_CLICK
  619. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  620. #endif
  621. #ifndef BUTTON2_CLICK
  622. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  623. #endif
  624. #ifndef BUTTON3_CLICK
  625. #define BUTTON3_CLICK BUTTON_MODE_TOGGLE
  626. #endif
  627. #ifndef BUTTON4_CLICK
  628. #define BUTTON4_CLICK BUTTON_MODE_TOGGLE
  629. #endif
  630. #ifndef BUTTON1_DBLCLICK
  631. #define BUTTON1_DBLCLICK BUTTON_MODE_AP
  632. #endif
  633. #ifndef BUTTON2_DBLCLICK
  634. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  635. #endif
  636. #ifndef BUTTON3_DBLCLICK
  637. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  638. #endif
  639. #ifndef BUTTON4_DBLCLICK
  640. #define BUTTON4_DBLCLICK BUTTON_MODE_NONE
  641. #endif
  642. #ifndef BUTTON1_LNGCLICK
  643. #define BUTTON1_LNGCLICK BUTTON_MODE_RESET
  644. #endif
  645. #ifndef BUTTON2_LNGCLICK
  646. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  647. #endif
  648. #ifndef BUTTON3_LNGCLICK
  649. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  650. #endif
  651. #ifndef BUTTON4_LNGCLICK
  652. #define BUTTON4_LNGCLICK BUTTON_MODE_NONE
  653. #endif
  654. #ifndef BUTTON1_LNGLNGCLICK
  655. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_FACTORY
  656. #endif
  657. #ifndef BUTTON2_LNGLNGCLICK
  658. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  659. #endif
  660. #ifndef BUTTON3_LNGLNGCLICK
  661. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_NONE
  662. #endif
  663. #ifndef BUTTON4_LNGLNGCLICK
  664. #define BUTTON4_LNGLNGCLICK BUTTON_MODE_NONE
  665. #endif
  666. #ifndef BUTTON1_RELAY
  667. #define BUTTON1_RELAY 0
  668. #endif
  669. #ifndef BUTTON2_RELAY
  670. #define BUTTON2_RELAY 0
  671. #endif
  672. #ifndef BUTTON3_RELAY
  673. #define BUTTON3_RELAY 0
  674. #endif
  675. #ifndef BUTTON4_RELAY
  676. #define BUTTON4_RELAY 0
  677. #endif
  678. #ifndef RELAY1_RESET_PIN
  679. #define RELAY1_RESET_PIN 0
  680. #endif
  681. #ifndef RELAY2_RESET_PIN
  682. #define RELAY2_RESET_PIN 0
  683. #endif
  684. #ifndef RELAY3_RESET_PIN
  685. #define RELAY3_RESET_PIN 0
  686. #endif
  687. #ifndef RELAY4_RESET_PIN
  688. #define RELAY4_RESET_PIN 0
  689. #endif
  690. #ifndef RELAY1_DELAY_ON
  691. #define RELAY1_DELAY_ON 0
  692. #endif
  693. #ifndef RELAY2_DELAY_ON
  694. #define RELAY2_DELAY_ON 0
  695. #endif
  696. #ifndef RELAY3_DELAY_ON
  697. #define RELAY3_DELAY_ON 0
  698. #endif
  699. #ifndef RELAY4_DELAY_ON
  700. #define RELAY4_DELAY_ON 0
  701. #endif
  702. #ifndef RELAY1_DELAY_OFF
  703. #define RELAY1_DELAY_OFF 0
  704. #endif
  705. #ifndef RELAY2_DELAY_OFF
  706. #define RELAY2_DELAY_OFF 0
  707. #endif
  708. #ifndef RELAY3_DELAY_OFF
  709. #define RELAY3_DELAY_OFF 0
  710. #endif
  711. #ifndef RELAY4_DELAY_OFF
  712. #define RELAY4_DELAY_OFF 0
  713. #endif
  714. #ifndef RELAY1_LED
  715. #define RELAY1_LED 0
  716. #endif
  717. #ifndef RELAY2_LED
  718. #define RELAY2_LED 0
  719. #endif
  720. #ifndef RELAY3_LED
  721. #define RELAY3_LED 0
  722. #endif
  723. #ifndef RELAY4_LED
  724. #define RELAY4_LED 0
  725. #endif
  726. // Needed for ESP8285 boards under Windows using PlatformIO (?)
  727. #ifndef BUTTON_PUSHBUTTON
  728. #define BUTTON_PUSHBUTTON 0
  729. #define BUTTON_SWITCH 1
  730. #define BUTTON_DEFAULT_HIGH 2
  731. #define BUTTON_SET_PULLUP 4
  732. #endif
  733. // Does the board track the relay status?
  734. #ifndef TRACK_RELAY_STATUS
  735. #define TRACK_RELAY_STATUS 1
  736. #endif
  737. // Serial baudrate
  738. #ifndef SERIAL_BAUDRATE
  739. #define SERIAL_BAUDRATE 115200
  740. #endif
  741. // Relay providers
  742. #ifndef RELAY_PROVIDER
  743. #define RELAY_PROVIDER RELAY_PROVIDER_RELAY
  744. #endif
  745. // Light provider
  746. #ifndef LIGHT_PROVIDER
  747. #define LIGHT_PROVIDER LIGHT_PROVIDER_NONE
  748. #endif