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.

914 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 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_PIN_INVERSE 0
  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_PIN_INVERSE 0
  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_PIN_INVERSE 0
  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_PIN_INVERSE 0
  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_PIN_INVERSE 0
  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_PIN_INVERSE 0
  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_PIN_INVERSE 0
  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. #define ENABLE_HLW8012 1
  178. // Buttons
  179. #define BUTTON1_PIN 0
  180. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  181. #define BUTTON1_RELAY 1
  182. // Relays
  183. #define RELAY1_PIN 12
  184. #define RELAY1_PIN_INVERSE 0
  185. // LEDs
  186. #define LED1_PIN 15
  187. #define LED1_PIN_INVERSE 0
  188. // HLW8012
  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 ENABLE_SERIAL_DEBUG 0
  200. #define ENABLE_TERMINAL 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_PIN_INVERSE 0
  229. #define RELAY2_PIN_INVERSE 0
  230. #define RELAY3_PIN_INVERSE 0
  231. #define RELAY4_PIN_INVERSE 0
  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_PIN_INVERSE 0
  258. #define RELAY2_PIN_INVERSE 0
  259. #define RELAY3_PIN_INVERSE 0
  260. #define RELAY4_PIN_INVERSE 0
  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_PIN_INVERSE 0
  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_PIN_INVERSE 0
  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 DUMMY_RELAY_COUNT 6
  320. #define TRACK_RELAY_STATUS 0
  321. #define ENABLE_TERMINAL 0
  322. // Buttons
  323. #define BUTTON1_PIN 0
  324. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  325. // LEDs
  326. #define LED1_PIN 13
  327. #define LED1_PIN_INVERSE 1
  328. #elif defined(ITEAD_SONOFF_B1)
  329. // Info
  330. #define MANUFACTURER "ITEAD_STUDIO"
  331. #define DEVICE "SONOFF_B1"
  332. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  333. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192
  334. #define DUMMY_RELAY_COUNT 1
  335. #define MY9291_DI_PIN 13
  336. #define MY9291_DCKI_PIN 15
  337. #define MY9291_COMMAND MY9291_COMMAND_DEFAULT
  338. #elif defined(ITEAD_SONOFF_LED)
  339. // Info
  340. #define MANUFACTURER "ITEAD_STUDIO"
  341. #define DEVICE "SONOFF_LED"
  342. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  343. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  344. #define DUMMY_RELAY_COUNT 1
  345. // LEDs
  346. #define LED1_PIN 13
  347. #define LED1_PIN_INVERSE 1
  348. // Channels
  349. #define LIGHT_CH1_PIN 12 // Cold white
  350. #define LIGHT_CH2_PIN 14 // Warm white
  351. #define LIGHT_CH1_INVERSE 0
  352. #define LIGHT_CH2_INVERSE 0
  353. #elif defined(ITEAD_SONOFF_T1_1CH)
  354. // Info
  355. #define MANUFACTURER "ITEAD_STUDIO"
  356. #define DEVICE "SONOFF_T1_1CH"
  357. // Buttons
  358. #define BUTTON1_PIN 9
  359. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  360. #define BUTTON1_RELAY 1
  361. // Relays
  362. #define RELAY1_PIN 5
  363. #define RELAY1_PIN_INVERSE 0
  364. // LEDs
  365. #define LED1_PIN 13
  366. #define LED1_PIN_INVERSE 1
  367. #elif defined(ITEAD_SONOFF_T1_2CH)
  368. // Info
  369. #define MANUFACTURER "ITEAD_STUDIO"
  370. #define DEVICE "SONOFF_T1_2CH"
  371. // Buttons
  372. #define BUTTON1_PIN 0
  373. #define BUTTON2_PIN 10
  374. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  375. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  376. #define BUTTON1_RELAY 1
  377. #define BUTTON2_RELAY 2
  378. // Relays
  379. #define RELAY1_PIN 12
  380. #define RELAY2_PIN 4
  381. #define RELAY1_PIN_INVERSE 0
  382. #define RELAY2_PIN_INVERSE 0
  383. // LEDs
  384. #define LED1_PIN 13
  385. #define LED1_PIN_INVERSE 1
  386. #elif defined(ITEAD_SONOFF_T1_3CH)
  387. // Info
  388. #define MANUFACTURER "ITEAD_STUDIO"
  389. #define DEVICE "SONOFF_T1_3CH"
  390. // Buttons
  391. #define BUTTON1_PIN 0
  392. #define BUTTON2_PIN 9
  393. #define BUTTON3_PIN 10
  394. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  395. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  396. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  397. #define BUTTON1_RELAY 1
  398. #define BUTTON2_RELAY 2
  399. #define BUTTON3_RELAY 3
  400. // Relays
  401. #define RELAY1_PIN 12
  402. #define RELAY2_PIN 5
  403. #define RELAY3_PIN 4
  404. #define RELAY1_PIN_INVERSE 0
  405. #define RELAY2_PIN_INVERSE 0
  406. #define RELAY3_PIN_INVERSE 0
  407. // LEDs
  408. #define LED1_PIN 13
  409. #define LED1_PIN_INVERSE 1
  410. // -----------------------------------------------------------------------------
  411. // Electrodragon boards
  412. // -----------------------------------------------------------------------------
  413. #elif defined(ELECTRODRAGON_WIFI_IOT)
  414. // Info
  415. #define MANUFACTURER "ELECTRODRAGON"
  416. #define DEVICE "WIFI_IOT"
  417. // Buttons
  418. #define BUTTON1_PIN 0
  419. #define BUTTON2_PIN 2
  420. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  421. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  422. #define BUTTON1_RELAY 1
  423. #define BUTTON2_RELAY 2
  424. // Relays
  425. #define RELAY1_PIN 12
  426. #define RELAY2_PIN 13
  427. #define RELAY1_PIN_INVERSE 0
  428. #define RELAY2_PIN_INVERSE 0
  429. // LEDs
  430. #define LED1_PIN 16
  431. #define LED1_PIN_INVERSE 0
  432. // -----------------------------------------------------------------------------
  433. // WorkChoice ecoPlug
  434. // -----------------------------------------------------------------------------
  435. #elif defined(WORKCHOICE_ECOPLUG)
  436. // Info
  437. #define MANUFACTURER "WORKCHOICE"
  438. #define DEVICE "ECOPLUG"
  439. // Buttons
  440. #define BUTTON1_PIN 13
  441. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  442. #define BUTTON1_RELAY 1
  443. // Relays
  444. #define RELAY1_PIN 15
  445. #define RELAY1_PIN_INVERSE 0
  446. // LEDs
  447. #define LED1_PIN 2
  448. #define LED1_PIN_INVERSE 0
  449. // -----------------------------------------------------------------------------
  450. // AI Thinker
  451. // -----------------------------------------------------------------------------
  452. #elif defined(AITHINKER_AI_LIGHT)
  453. // Info
  454. #define MANUFACTURER "AI_THINKER"
  455. #define DEVICE "AI_LIGHT"
  456. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  457. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192
  458. #define DUMMY_RELAY_COUNT 1
  459. #define MY9291_DI_PIN 13
  460. #define MY9291_DCKI_PIN 15
  461. #define MY9291_COMMAND MY9291_COMMAND_DEFAULT
  462. // -----------------------------------------------------------------------------
  463. // LED Controller
  464. // -----------------------------------------------------------------------------
  465. #elif defined(MAGICHOME_LED_CONTROLLER)
  466. // Info
  467. #define MANUFACTURER "MAGIC_HOME"
  468. #define DEVICE "LED_CONTROLLER"
  469. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  470. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  471. #define DUMMY_RELAY_COUNT 1
  472. // LEDs
  473. #define LED1_PIN 2
  474. #define LED1_PIN_INVERSE 1
  475. // Channels
  476. #define LIGHT_CH1_PIN 14 // RED
  477. #define LIGHT_CH2_PIN 5 // GREEN
  478. #define LIGHT_CH3_PIN 12 // BLUE
  479. #define LIGHT_CH4_PIN 13 // WHITE
  480. #define LIGHT_CH1_INVERSE 0
  481. #define LIGHT_CH2_INVERSE 0
  482. #define LIGHT_CH3_INVERSE 0
  483. #define LIGHT_CH4_INVERSE 0
  484. // -----------------------------------------------------------------------------
  485. // HUACANXING H801
  486. // -----------------------------------------------------------------------------
  487. #elif defined(HUACANXING_H801)
  488. // Info
  489. #define MANUFACTURER "HUACANXING"
  490. #define DEVICE "H801"
  491. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  492. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  493. #define DUMMY_RELAY_COUNT 1
  494. // LEDs
  495. #define LED1_PIN 5
  496. #define LED1_PIN_INVERSE 1
  497. // Channels
  498. #define LIGHT_CH1_PIN 15 // RED
  499. #define LIGHT_CH2_PIN 13 // GREEN
  500. #define LIGHT_CH3_PIN 12 // BLUE
  501. #define LIGHT_CH4_PIN 14 // WHITE1
  502. #define LIGHT_CH5_PIN 4 // WHITE2
  503. #define LIGHT_CH1_INVERSE 0
  504. #define LIGHT_CH2_INVERSE 0
  505. #define LIGHT_CH3_INVERSE 0
  506. #define LIGHT_CH4_INVERSE 0
  507. #define LIGHT_CH5_INVERSE 0
  508. // -----------------------------------------------------------------------------
  509. // Jan Goedeke Wifi Relay
  510. // https://github.com/JanGoe/esp8266-wifi-relay
  511. // -----------------------------------------------------------------------------
  512. #elif defined(JANGOE_WIFI_RELAY_NC)
  513. // Info
  514. #define MANUFACTURER "JAN_GOEDEKE"
  515. #define DEVICE "WIFI_RELAY_NC"
  516. // Buttons
  517. #define BUTTON1_PIN 12
  518. #define BUTTON2_PIN 13
  519. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  520. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  521. #define BUTTON1_RELAY 1
  522. #define BUTTON2_RELAY 2
  523. // Relays
  524. #define RELAY1_PIN 2
  525. #define RELAY2_PIN 14
  526. #define RELAY1_PIN_INVERSE 1
  527. #define RELAY2_PIN_INVERSE 1
  528. #elif defined(JANGOE_WIFI_RELAY_NO)
  529. // Info
  530. #define MANUFACTURER "JAN_GOEDEKE"
  531. #define DEVICE "WIFI_RELAY_NO"
  532. // Buttons
  533. #define BUTTON1_PIN 12
  534. #define BUTTON2_PIN 13
  535. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  536. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  537. #define BUTTON1_RELAY 1
  538. #define BUTTON2_RELAY 2
  539. // Relays
  540. #define RELAY1_PIN 2
  541. #define RELAY2_PIN 14
  542. #define RELAY1_PIN_INVERSE 0
  543. #define RELAY2_PIN_INVERSE 0
  544. // -----------------------------------------------------------------------------
  545. // Jorge García Wifi+Relays Board Kit
  546. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  547. // https://github.com/jorgegarciadev/wifikit
  548. // -----------------------------------------------------------------------------
  549. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  550. // Info
  551. #define MANUFACTURER "JORGE_GARCIA"
  552. #define DEVICE "WIFI_RELAYS"
  553. // Relays
  554. #define RELAY1_PIN 0
  555. #define RELAY2_PIN 2
  556. #define RELAY1_PIN_INVERSE 1
  557. #define RELAY2_PIN_INVERSE 1
  558. // -----------------------------------------------------------------------------
  559. // WiFi MQTT Relay / Thermostat
  560. // -----------------------------------------------------------------------------
  561. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  562. // Info
  563. #define MANUFACTURER "OPENENERGYMONITOR"
  564. #define DEVICE "MQTT_RELAY"
  565. // Buttons
  566. #define BUTTON1_PIN 0
  567. #define BUTTON1_RELAY 1
  568. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  569. // Relays
  570. #define RELAY1_PIN 12
  571. #define RELAY1_PIN_INVERSE 0
  572. // LEDs
  573. #define LED1_PIN 16
  574. #define LED1_PIN_INVERSE 0
  575. // -----------------------------------------------------------------------------
  576. // Unknown hardware
  577. // -----------------------------------------------------------------------------
  578. #else
  579. #error "UNSUPPORTED HARDWARE!"
  580. #endif
  581. // -----------------------------------------------------------------------------
  582. // Default values
  583. // -----------------------------------------------------------------------------
  584. #ifndef BUTTON1_PRESS
  585. #define BUTTON1_PRESS BUTTON_MODE_NONE
  586. #endif
  587. #ifndef BUTTON2_PRESS
  588. #define BUTTON2_PRESS BUTTON_MODE_NONE
  589. #endif
  590. #ifndef BUTTON3_PRESS
  591. #define BUTTON3_PRESS BUTTON_MODE_NONE
  592. #endif
  593. #ifndef BUTTON4_PRESS
  594. #define BUTTON4_PRESS BUTTON_MODE_NONE
  595. #endif
  596. #ifndef BUTTON1_CLICK
  597. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  598. #endif
  599. #ifndef BUTTON2_CLICK
  600. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  601. #endif
  602. #ifndef BUTTON3_CLICK
  603. #define BUTTON3_CLICK BUTTON_MODE_TOGGLE
  604. #endif
  605. #ifndef BUTTON4_CLICK
  606. #define BUTTON4_CLICK BUTTON_MODE_TOGGLE
  607. #endif
  608. #ifndef BUTTON1_DBLCLICK
  609. #define BUTTON1_DBLCLICK BUTTON_MODE_AP
  610. #endif
  611. #ifndef BUTTON2_DBLCLICK
  612. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  613. #endif
  614. #ifndef BUTTON3_DBLCLICK
  615. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  616. #endif
  617. #ifndef BUTTON4_DBLCLICK
  618. #define BUTTON4_DBLCLICK BUTTON_MODE_NONE
  619. #endif
  620. #ifndef BUTTON1_LNGCLICK
  621. #define BUTTON1_LNGCLICK BUTTON_MODE_RESET
  622. #endif
  623. #ifndef BUTTON2_LNGCLICK
  624. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  625. #endif
  626. #ifndef BUTTON3_LNGCLICK
  627. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  628. #endif
  629. #ifndef BUTTON4_LNGCLICK
  630. #define BUTTON4_LNGCLICK BUTTON_MODE_NONE
  631. #endif
  632. #ifndef BUTTON1_LNGLNGCLICK
  633. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_FACTORY
  634. #endif
  635. #ifndef BUTTON2_LNGLNGCLICK
  636. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  637. #endif
  638. #ifndef BUTTON3_LNGLNGCLICK
  639. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_NONE
  640. #endif
  641. #ifndef BUTTON4_LNGLNGCLICK
  642. #define BUTTON4_LNGLNGCLICK BUTTON_MODE_NONE
  643. #endif
  644. #ifndef BUTTON1_RELAY
  645. #define BUTTON1_RELAY 0
  646. #endif
  647. #ifndef BUTTON2_RELAY
  648. #define BUTTON2_RELAY 0
  649. #endif
  650. #ifndef BUTTON3_RELAY
  651. #define BUTTON3_RELAY 0
  652. #endif
  653. #ifndef BUTTON4_RELAY
  654. #define BUTTON4_RELAY 0
  655. #endif
  656. #ifndef RELAY1_DELAY_ON
  657. #define RELAY1_DELAY_ON 0
  658. #endif
  659. #ifndef RELAY2_DELAY_ON
  660. #define RELAY2_DELAY_ON 0
  661. #endif
  662. #ifndef RELAY3_DELAY_ON
  663. #define RELAY3_DELAY_ON 0
  664. #endif
  665. #ifndef RELAY4_DELAY_ON
  666. #define RELAY4_DELAY_ON 0
  667. #endif
  668. #ifndef RELAY1_DELAY_OFF
  669. #define RELAY1_DELAY_OFF 0
  670. #endif
  671. #ifndef RELAY2_DELAY_OFF
  672. #define RELAY2_DELAY_OFF 0
  673. #endif
  674. #ifndef RELAY3_DELAY_OFF
  675. #define RELAY3_DELAY_OFF 0
  676. #endif
  677. #ifndef RELAY4_DELAY_OFF
  678. #define RELAY4_DELAY_OFF 0
  679. #endif
  680. #ifndef RELAY1_LED
  681. #define RELAY1_LED 0
  682. #endif
  683. #ifndef RELAY2_LED
  684. #define RELAY2_LED 0
  685. #endif
  686. #ifndef RELAY3_LED
  687. #define RELAY3_LED 0
  688. #endif
  689. #ifndef RELAY4_LED
  690. #define RELAY4_LED 0
  691. #endif
  692. // Needed for ESP8285 boards under Windows using PlatformIO (?)
  693. #ifndef BUTTON_PUSHBUTTON
  694. #define BUTTON_PUSHBUTTON 0
  695. #define BUTTON_SWITCH 1
  696. #define BUTTON_DEFAULT_HIGH 2
  697. #define BUTTON_SET_PULLUP 4
  698. #endif
  699. // Does the board track the relay status?
  700. #ifndef TRACK_RELAY_STATUS
  701. #define TRACK_RELAY_STATUS 1
  702. #endif
  703. // Serial baudrate
  704. #ifndef SERIAL_BAUDRATE
  705. #define SERIAL_BAUDRATE 115200
  706. #endif
  707. // Relay providers
  708. #ifndef RELAY_PROVIDER
  709. #define RELAY_PROVIDER RELAY_PROVIDER_RELAY
  710. #endif
  711. // Light provider
  712. #ifndef LIGHT_PROVIDER
  713. #define LIGHT_PROVIDER LIGHT_PROVIDER_NONE
  714. #endif