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.

916 lines
25 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_PIN_INVERSE 0
  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_PIN_INVERSE 0
  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_PIN_INVERSE 1
  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_PIN_INVERSE 0
  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_PIN_INVERSE 0
  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_PIN_INVERSE 0
  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_PIN_INVERSE 0
  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_PIN_INVERSE 0
  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_PIN_INVERSE 0
  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_PIN_INVERSE 0
  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_PIN_INVERSE 0
  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_PIN_INVERSE 0
  231. #define RELAY2_PIN_INVERSE 0
  232. #define RELAY3_PIN_INVERSE 0
  233. #define RELAY4_PIN_INVERSE 0
  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_PIN_INVERSE 0
  260. #define RELAY2_PIN_INVERSE 0
  261. #define RELAY3_PIN_INVERSE 0
  262. #define RELAY4_PIN_INVERSE 0
  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_PIN_INVERSE 0
  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_PIN_INVERSE 0
  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_PIN_INVERSE 0
  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_PIN_INVERSE 0
  384. #define RELAY2_PIN_INVERSE 0
  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_PIN_INVERSE 0
  407. #define RELAY2_PIN_INVERSE 0
  408. #define RELAY3_PIN_INVERSE 0
  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_PIN_INVERSE 0
  430. #define RELAY2_PIN_INVERSE 0
  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_PIN_INVERSE 0
  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_PIN_INVERSE 1
  529. #define RELAY2_PIN_INVERSE 1
  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_PIN_INVERSE 0
  545. #define RELAY2_PIN_INVERSE 0
  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_PIN_INVERSE 1
  559. #define RELAY2_PIN_INVERSE 1
  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_PIN_INVERSE 0
  574. // LEDs
  575. #define LED1_PIN 16
  576. #define LED1_PIN_INVERSE 0
  577. // -----------------------------------------------------------------------------
  578. // Unknown hardware
  579. // -----------------------------------------------------------------------------
  580. #else
  581. #error "UNSUPPORTED HARDWARE!"
  582. #endif
  583. // -----------------------------------------------------------------------------
  584. // Default values
  585. // -----------------------------------------------------------------------------
  586. #ifndef BUTTON1_PRESS
  587. #define BUTTON1_PRESS BUTTON_MODE_NONE
  588. #endif
  589. #ifndef BUTTON2_PRESS
  590. #define BUTTON2_PRESS BUTTON_MODE_NONE
  591. #endif
  592. #ifndef BUTTON3_PRESS
  593. #define BUTTON3_PRESS BUTTON_MODE_NONE
  594. #endif
  595. #ifndef BUTTON4_PRESS
  596. #define BUTTON4_PRESS BUTTON_MODE_NONE
  597. #endif
  598. #ifndef BUTTON1_CLICK
  599. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  600. #endif
  601. #ifndef BUTTON2_CLICK
  602. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  603. #endif
  604. #ifndef BUTTON3_CLICK
  605. #define BUTTON3_CLICK BUTTON_MODE_TOGGLE
  606. #endif
  607. #ifndef BUTTON4_CLICK
  608. #define BUTTON4_CLICK BUTTON_MODE_TOGGLE
  609. #endif
  610. #ifndef BUTTON1_DBLCLICK
  611. #define BUTTON1_DBLCLICK BUTTON_MODE_AP
  612. #endif
  613. #ifndef BUTTON2_DBLCLICK
  614. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  615. #endif
  616. #ifndef BUTTON3_DBLCLICK
  617. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  618. #endif
  619. #ifndef BUTTON4_DBLCLICK
  620. #define BUTTON4_DBLCLICK BUTTON_MODE_NONE
  621. #endif
  622. #ifndef BUTTON1_LNGCLICK
  623. #define BUTTON1_LNGCLICK BUTTON_MODE_RESET
  624. #endif
  625. #ifndef BUTTON2_LNGCLICK
  626. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  627. #endif
  628. #ifndef BUTTON3_LNGCLICK
  629. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  630. #endif
  631. #ifndef BUTTON4_LNGCLICK
  632. #define BUTTON4_LNGCLICK BUTTON_MODE_NONE
  633. #endif
  634. #ifndef BUTTON1_LNGLNGCLICK
  635. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_FACTORY
  636. #endif
  637. #ifndef BUTTON2_LNGLNGCLICK
  638. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  639. #endif
  640. #ifndef BUTTON3_LNGLNGCLICK
  641. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_NONE
  642. #endif
  643. #ifndef BUTTON4_LNGLNGCLICK
  644. #define BUTTON4_LNGLNGCLICK BUTTON_MODE_NONE
  645. #endif
  646. #ifndef BUTTON1_RELAY
  647. #define BUTTON1_RELAY 0
  648. #endif
  649. #ifndef BUTTON2_RELAY
  650. #define BUTTON2_RELAY 0
  651. #endif
  652. #ifndef BUTTON3_RELAY
  653. #define BUTTON3_RELAY 0
  654. #endif
  655. #ifndef BUTTON4_RELAY
  656. #define BUTTON4_RELAY 0
  657. #endif
  658. #ifndef RELAY1_DELAY_ON
  659. #define RELAY1_DELAY_ON 0
  660. #endif
  661. #ifndef RELAY2_DELAY_ON
  662. #define RELAY2_DELAY_ON 0
  663. #endif
  664. #ifndef RELAY3_DELAY_ON
  665. #define RELAY3_DELAY_ON 0
  666. #endif
  667. #ifndef RELAY4_DELAY_ON
  668. #define RELAY4_DELAY_ON 0
  669. #endif
  670. #ifndef RELAY1_DELAY_OFF
  671. #define RELAY1_DELAY_OFF 0
  672. #endif
  673. #ifndef RELAY2_DELAY_OFF
  674. #define RELAY2_DELAY_OFF 0
  675. #endif
  676. #ifndef RELAY3_DELAY_OFF
  677. #define RELAY3_DELAY_OFF 0
  678. #endif
  679. #ifndef RELAY4_DELAY_OFF
  680. #define RELAY4_DELAY_OFF 0
  681. #endif
  682. #ifndef RELAY1_LED
  683. #define RELAY1_LED 0
  684. #endif
  685. #ifndef RELAY2_LED
  686. #define RELAY2_LED 0
  687. #endif
  688. #ifndef RELAY3_LED
  689. #define RELAY3_LED 0
  690. #endif
  691. #ifndef RELAY4_LED
  692. #define RELAY4_LED 0
  693. #endif
  694. // Needed for ESP8285 boards under Windows using PlatformIO (?)
  695. #ifndef BUTTON_PUSHBUTTON
  696. #define BUTTON_PUSHBUTTON 0
  697. #define BUTTON_SWITCH 1
  698. #define BUTTON_DEFAULT_HIGH 2
  699. #define BUTTON_SET_PULLUP 4
  700. #endif
  701. // Does the board track the relay status?
  702. #ifndef TRACK_RELAY_STATUS
  703. #define TRACK_RELAY_STATUS 1
  704. #endif
  705. // Serial baudrate
  706. #ifndef SERIAL_BAUDRATE
  707. #define SERIAL_BAUDRATE 115200
  708. #endif
  709. // Relay providers
  710. #ifndef RELAY_PROVIDER
  711. #define RELAY_PROVIDER RELAY_PROVIDER_RELAY
  712. #endif
  713. // Light provider
  714. #ifndef LIGHT_PROVIDER
  715. #define LIGHT_PROVIDER LIGHT_PROVIDER_NONE
  716. #endif