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.

1030 lines
29 KiB

7 years ago
7 years ago
7 years ago
  1. // -----------------------------------------------------------------------------
  2. // Configuration HELP
  3. // -----------------------------------------------------------------------------
  4. //
  5. // MANUFACTURER: Name of the manufacturer of the board ("string")
  6. // DEVICE: Name of the device ("string")
  7. // BUTTON#_PIN: GPIO for the n-th button (1-based, up to 4 buttons)
  8. // BUTTON#_RELAY: Relay number that will be bind to the n-th button (1-based)
  9. // BUTTON#_MODE: A mask of options (BUTTON_PUSHBUTTON and BUTTON_SWITCH cannot be together)
  10. // - BUTTON_PUSHBUTTON: button event is fired when released
  11. // - BUTTON_SWITCH: button event is fired when pressed or released
  12. // - BUTTON_DEFAULT_HIGH: there is a pull up in place
  13. // - BUTTON_SET_PULLUP: set pullup by software
  14. // RELAY#_PIN: GPIO for the n-th relay (1-based, up to 4 relays)
  15. // RELAY#_TYPE: Relay can be RELAY_TYPE_NORMAL, RELAY_TYPE_INVERSE or RELAY_TYPE_LATCHED
  16. // RELAY#_LED: LED number that will be bind to the n-th relay (1-based)
  17. // LED#_PIN: GPIO for the n-th LED (1-based, up to 4 LEDs)
  18. // LED#_PIN_INVERSE: LED has inversed logic (lit when pulled down)
  19. //
  20. // Besides, other hardware specific information should be stated here
  21. // -----------------------------------------------------------------------------
  22. // Development boards
  23. // -----------------------------------------------------------------------------
  24. #if defined(NODEMCU_LOLIN)
  25. // Info
  26. #define MANUFACTURER "NODEMCU"
  27. #define DEVICE "LOLIN"
  28. // Buttons
  29. #define BUTTON1_PIN 0
  30. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  31. #define BUTTON1_RELAY 1
  32. // Relays
  33. #define RELAY1_PIN 12
  34. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  35. // LEDs
  36. #define LED1_PIN 2
  37. #define LED1_PIN_INVERSE 1
  38. #elif defined(WEMOS_D1_MINI_RELAYSHIELD)
  39. // Info
  40. #define MANUFACTURER "WEMOS"
  41. #define DEVICE "D1_MINI_RELAYSHIELD"
  42. // Buttons
  43. // No buttons on the D1 MINI
  44. // Relays
  45. #define RELAY1_PIN 5
  46. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  47. // LEDs
  48. #define LED1_PIN 2
  49. #define LED1_PIN_INVERSE 1
  50. // -----------------------------------------------------------------------------
  51. // ESPurna
  52. // -----------------------------------------------------------------------------
  53. #elif defined(TINKERMAN_ESPURNA_H)
  54. // Info
  55. #define MANUFACTURER "TINKERMAN"
  56. #define DEVICE "ESPURNA_H"
  57. // Buttons
  58. #define BUTTON1_PIN 4
  59. #define BUTTON1_RELAY 1
  60. // Normal pushbutton
  61. //#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  62. // Touch button
  63. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  64. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  65. #define BUTTON1_CLICK BUTTON_MODE_NONE
  66. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  67. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  68. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  69. // Relays
  70. #define RELAY1_PIN 12
  71. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  72. // LEDs
  73. #define LED1_PIN 5
  74. #define LED1_PIN_INVERSE 0
  75. // HLW8012
  76. #define HLW8012_SUPPORT 1
  77. #define HLW8012_SEL_PIN 2
  78. #define HLW8012_CF1_PIN 13
  79. #define HLW8012_CF_PIN 14
  80. // -----------------------------------------------------------------------------
  81. // Itead Studio boards
  82. // -----------------------------------------------------------------------------
  83. #elif defined(ITEAD_SONOFF_BASIC)
  84. // Info
  85. #define MANUFACTURER "ITEAD"
  86. #define DEVICE "SONOFF_BASIC"
  87. // Buttons
  88. #define BUTTON1_PIN 0
  89. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  90. #define BUTTON1_RELAY 1
  91. // Relays
  92. #define RELAY1_PIN 12
  93. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  94. // LEDs
  95. #define LED1_PIN 13
  96. #define LED1_PIN_INVERSE 1
  97. #elif defined(ITEAD_SONOFF_RF)
  98. // Info
  99. #define MANUFACTURER "ITEAD"
  100. #define DEVICE "SONOFF_RF"
  101. // Buttons
  102. #define BUTTON1_PIN 0
  103. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  104. #define BUTTON1_RELAY 1
  105. // Relays
  106. #define RELAY1_PIN 12
  107. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  108. // LEDs
  109. #define LED1_PIN 13
  110. #define LED1_PIN_INVERSE 1
  111. #elif defined(ITEAD_SONOFF_TH)
  112. // Info
  113. #define MANUFACTURER "ITEAD"
  114. #define DEVICE "SONOFF_TH"
  115. // Buttons
  116. #define BUTTON1_PIN 0
  117. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  118. #define BUTTON1_RELAY 1
  119. // Relays
  120. #define RELAY1_PIN 12
  121. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  122. // LEDs
  123. #define LED1_PIN 13
  124. #define LED1_PIN_INVERSE 1
  125. #elif defined(ITEAD_SONOFF_SV)
  126. // Info
  127. #define MANUFACTURER "ITEAD"
  128. #define DEVICE "SONOFF_SV"
  129. // Buttons
  130. #define BUTTON1_PIN 0
  131. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  132. #define BUTTON1_RELAY 1
  133. // Relays
  134. #define RELAY1_PIN 12
  135. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  136. // LEDs
  137. #define LED1_PIN 13
  138. #define LED1_PIN_INVERSE 1
  139. #elif defined(ITEAD_SLAMPHER)
  140. // Info
  141. #define MANUFACTURER "ITEAD"
  142. #define DEVICE "SLAMPHER"
  143. // Buttons
  144. #define BUTTON1_PIN 0
  145. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  146. #define BUTTON1_RELAY 1
  147. // Relays
  148. #define RELAY1_PIN 12
  149. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  150. // LEDs
  151. #define LED1_PIN 13
  152. #define LED1_PIN_INVERSE 1
  153. #elif defined(ITEAD_S20)
  154. // Info
  155. #define MANUFACTURER "ITEAD"
  156. #define DEVICE "S20"
  157. // Buttons
  158. #define BUTTON1_PIN 0
  159. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  160. #define BUTTON1_RELAY 1
  161. // Relays
  162. #define RELAY1_PIN 12
  163. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  164. // LEDs
  165. #define LED1_PIN 13
  166. #define LED1_PIN_INVERSE 1
  167. #elif defined(ITEAD_SONOFF_TOUCH)
  168. // Info
  169. #define MANUFACTURER "ITEAD"
  170. #define DEVICE "SONOFF_TOUCH"
  171. // Buttons
  172. #define BUTTON1_PIN 0
  173. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  174. #define BUTTON1_RELAY 1
  175. // Relays
  176. #define RELAY1_PIN 12
  177. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  178. // LEDs
  179. #define LED1_PIN 13
  180. #define LED1_PIN_INVERSE 1
  181. #elif defined(ITEAD_SONOFF_POW)
  182. // Info
  183. #define MANUFACTURER "ITEAD"
  184. #define DEVICE "SONOFF_POW"
  185. // Buttons
  186. #define BUTTON1_PIN 0
  187. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  188. #define BUTTON1_RELAY 1
  189. // Relays
  190. #define RELAY1_PIN 12
  191. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  192. // LEDs
  193. #define LED1_PIN 15
  194. #define LED1_PIN_INVERSE 0
  195. // HLW8012
  196. #define HLW8012_SUPPORT 1
  197. #define HLW8012_SEL_PIN 5
  198. #define HLW8012_CF1_PIN 13
  199. #define HLW8012_CF_PIN 14
  200. #elif defined(ITEAD_SONOFF_DUAL)
  201. // Info
  202. #define MANUFACTURER "ITEAD"
  203. #define DEVICE "SONOFF_DUAL"
  204. #define SERIAL_BAUDRATE 19230
  205. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  206. #define DUMMY_RELAY_COUNT 2
  207. #define DEBUG_SERIAL_SUPPORT 0
  208. #define TERMINAL_SUPPORT 0
  209. // Buttons
  210. #define BUTTON3_RELAY 1
  211. // LEDs
  212. #define LED1_PIN 13
  213. #define LED1_PIN_INVERSE 1
  214. #elif defined(ITEAD_SONOFF_4CH)
  215. // Info
  216. #define MANUFACTURER "ITEAD"
  217. #define DEVICE "SONOFF_4CH"
  218. // Buttons
  219. #define BUTTON1_PIN 0
  220. #define BUTTON2_PIN 9
  221. #define BUTTON3_PIN 10
  222. #define BUTTON4_PIN 14
  223. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  224. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  225. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  226. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  227. #define BUTTON1_RELAY 1
  228. #define BUTTON2_RELAY 2
  229. #define BUTTON3_RELAY 3
  230. #define BUTTON4_RELAY 4
  231. // Relays
  232. #define RELAY1_PIN 12
  233. #define RELAY2_PIN 5
  234. #define RELAY3_PIN 4
  235. #define RELAY4_PIN 15
  236. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  237. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  238. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  239. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  240. // LEDs
  241. #define LED1_PIN 13
  242. #define LED1_PIN_INVERSE 1
  243. #elif defined(ITEAD_SONOFF_4CH_PRO)
  244. // Info
  245. #define MANUFACTURER "ITEAD"
  246. #define DEVICE "SONOFF_4CH_PRO"
  247. // Buttons
  248. #define BUTTON1_PIN 0
  249. #define BUTTON2_PIN 9
  250. #define BUTTON3_PIN 10
  251. #define BUTTON4_PIN 14
  252. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  253. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  254. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  255. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  256. #define BUTTON1_RELAY 1
  257. #define BUTTON2_RELAY 2
  258. #define BUTTON3_RELAY 3
  259. #define BUTTON4_RELAY 4
  260. // Relays
  261. #define RELAY1_PIN 12
  262. #define RELAY2_PIN 5
  263. #define RELAY3_PIN 4
  264. #define RELAY4_PIN 15
  265. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  266. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  267. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  268. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  269. // LEDs
  270. #define LED1_PIN 13
  271. #define LED1_PIN_INVERSE 1
  272. #elif defined(ITEAD_1CH_INCHING)
  273. // The inching functionality is managed by a misterious IC in the board.
  274. // You cannot control the inching button and functionality from the ESP8266
  275. // Besides, enabling the inching functionality using the hardware button
  276. // will result in the relay switching on and off continuously.
  277. // Fortunately the unkown IC keeps memory of the hardware inching status
  278. // so you can just disable it and forget. The inching LED must be lit.
  279. // You can still use the pulse options from the web interface
  280. // without problem.
  281. // Info
  282. #define MANUFACTURER "ITEAD"
  283. #define DEVICE "1CH_INCHING"
  284. // Buttons
  285. #define BUTTON1_PIN 0
  286. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  287. #define BUTTON1_RELAY 1
  288. // Relays
  289. #define RELAY1_PIN 12
  290. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  291. // LEDs
  292. #define LED1_PIN 13
  293. #define LED1_PIN_INVERSE 1
  294. #elif defined(ITEAD_MOTOR)
  295. // Info
  296. #define MANUFACTURER "ITEAD"
  297. #define DEVICE "MOTOR"
  298. // Buttons
  299. #define BUTTON1_PIN 0
  300. #define BUTTON1_RELAY 1
  301. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  302. // Relays
  303. #define RELAY1_PIN 12
  304. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  305. // LEDs
  306. #define LED1_PIN 13
  307. #define LED1_PIN_INVERSE 1
  308. #elif defined(ITEAD_BNSZ01)
  309. // Info
  310. #define MANUFACTURER "ITEAD"
  311. #define DEVICE "BNSZ01"
  312. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  313. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  314. #define DUMMY_RELAY_COUNT 1
  315. // LEDs
  316. #define LED1_PIN 13
  317. #define LED1_PIN_INVERSE 1
  318. // Channels
  319. #define LIGHT_CH1_PIN 12
  320. #define LIGHT_CH1_INVERSE 0
  321. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  322. // Info
  323. #define MANUFACTURER "ITEAD"
  324. #define DEVICE "SONOFF_RFBRIDGE"
  325. #define SERIAL_BAUDRATE 19200
  326. #define RELAY_PROVIDER RELAY_PROVIDER_RFBRIDGE
  327. #ifndef DUMMY_RELAY_COUNT
  328. #define DUMMY_RELAY_COUNT 6
  329. #endif
  330. #define TRACK_RELAY_STATUS 0
  331. // Buttons
  332. #define BUTTON1_PIN 0
  333. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  334. // LEDs
  335. #define LED1_PIN 13
  336. #define LED1_PIN_INVERSE 1
  337. #elif defined(ITEAD_SONOFF_B1)
  338. // Info
  339. #define MANUFACTURER "ITEAD"
  340. #define DEVICE "SONOFF_B1"
  341. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  342. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192
  343. #define DUMMY_RELAY_COUNT 1
  344. #define MY9291_DI_PIN 12
  345. #define MY9291_DCKI_PIN 14
  346. #define MY9291_COMMAND MY9291_COMMAND_DEFAULT
  347. #define MY9291_CHANNELS 5
  348. #elif defined(ITEAD_SONOFF_LED)
  349. // Info
  350. #define MANUFACTURER "ITEAD"
  351. #define DEVICE "SONOFF_LED"
  352. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  353. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  354. #define DUMMY_RELAY_COUNT 1
  355. // LEDs
  356. #define LED1_PIN 13
  357. #define LED1_PIN_INVERSE 1
  358. // Channels
  359. #define LIGHT_CH1_PIN 12 // Cold white
  360. #define LIGHT_CH2_PIN 14 // Warm white
  361. #define LIGHT_CH1_INVERSE 0
  362. #define LIGHT_CH2_INVERSE 0
  363. #elif defined(ITEAD_SONOFF_T1_1CH)
  364. // Info
  365. #define MANUFACTURER "ITEAD"
  366. #define DEVICE "SONOFF_T1_1CH"
  367. // Buttons
  368. #define BUTTON1_PIN 9
  369. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  370. #define BUTTON1_RELAY 1
  371. // Relays
  372. #define RELAY1_PIN 5
  373. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  374. // LEDs
  375. #define LED1_PIN 13
  376. #define LED1_PIN_INVERSE 1
  377. #elif defined(ITEAD_SONOFF_T1_2CH)
  378. // Info
  379. #define MANUFACTURER "ITEAD"
  380. #define DEVICE "SONOFF_T1_2CH"
  381. // Buttons
  382. #define BUTTON1_PIN 0
  383. #define BUTTON2_PIN 10
  384. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  385. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  386. #define BUTTON1_RELAY 1
  387. #define BUTTON2_RELAY 2
  388. // Relays
  389. #define RELAY1_PIN 12
  390. #define RELAY2_PIN 4
  391. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  392. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  393. // LEDs
  394. #define LED1_PIN 13
  395. #define LED1_PIN_INVERSE 1
  396. #elif defined(ITEAD_SONOFF_T1_3CH)
  397. // Info
  398. #define MANUFACTURER "ITEAD"
  399. #define DEVICE "SONOFF_T1_3CH"
  400. // Buttons
  401. #define BUTTON1_PIN 0
  402. #define BUTTON2_PIN 9
  403. #define BUTTON3_PIN 10
  404. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  405. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  406. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  407. #define BUTTON1_RELAY 1
  408. #define BUTTON2_RELAY 2
  409. #define BUTTON3_RELAY 3
  410. // Relays
  411. #define RELAY1_PIN 12
  412. #define RELAY2_PIN 5
  413. #define RELAY3_PIN 4
  414. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  415. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  416. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  417. // LEDs
  418. #define LED1_PIN 13
  419. #define LED1_PIN_INVERSE 1
  420. // -----------------------------------------------------------------------------
  421. // Electrodragon boards
  422. // -----------------------------------------------------------------------------
  423. #elif defined(ELECTRODRAGON_WIFI_IOT)
  424. // Info
  425. #define MANUFACTURER "ELECTRODRAGON"
  426. #define DEVICE "WIFI_IOT"
  427. // Buttons
  428. #define BUTTON1_PIN 0
  429. #define BUTTON2_PIN 2
  430. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  431. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  432. #define BUTTON1_RELAY 1
  433. #define BUTTON2_RELAY 2
  434. // Relays
  435. #define RELAY1_PIN 12
  436. #define RELAY2_PIN 13
  437. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  438. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  439. // LEDs
  440. #define LED1_PIN 16
  441. #define LED1_PIN_INVERSE 0
  442. // -----------------------------------------------------------------------------
  443. // WorkChoice ecoPlug
  444. // -----------------------------------------------------------------------------
  445. #elif defined(WORKCHOICE_ECOPLUG)
  446. // Info
  447. #define MANUFACTURER "WORKCHOICE"
  448. #define DEVICE "ECOPLUG"
  449. // Buttons
  450. #define BUTTON1_PIN 13
  451. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  452. #define BUTTON1_RELAY 1
  453. // Relays
  454. #define RELAY1_PIN 15
  455. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  456. // LEDs
  457. #define LED1_PIN 2
  458. #define LED1_PIN_INVERSE 0
  459. // -----------------------------------------------------------------------------
  460. // AI Thinker
  461. // -----------------------------------------------------------------------------
  462. #elif defined(AITHINKER_AI_LIGHT)
  463. // Info
  464. #define MANUFACTURER "AITHINKER"
  465. #define DEVICE "AI_LIGHT"
  466. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  467. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192
  468. #define DUMMY_RELAY_COUNT 1
  469. #define MY9291_DI_PIN 13
  470. #define MY9291_DCKI_PIN 15
  471. #define MY9291_COMMAND MY9291_COMMAND_DEFAULT
  472. #define MY9291_CHANNELS 4
  473. // -----------------------------------------------------------------------------
  474. // LED Controller
  475. // -----------------------------------------------------------------------------
  476. #elif defined(MAGICHOME_LED_CONTROLLER)
  477. // Info
  478. #define MANUFACTURER "MAGICHOME"
  479. #define DEVICE "LED_CONTROLLER"
  480. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  481. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  482. #define DUMMY_RELAY_COUNT 1
  483. // LEDs
  484. #define LED1_PIN 2
  485. #define LED1_PIN_INVERSE 1
  486. // Channels
  487. #define LIGHT_CH1_PIN 14 // RED
  488. #define LIGHT_CH2_PIN 5 // GREEN
  489. #define LIGHT_CH3_PIN 12 // BLUE
  490. #define LIGHT_CH4_PIN 13 // WHITE
  491. #define LIGHT_CH1_INVERSE 0
  492. #define LIGHT_CH2_INVERSE 0
  493. #define LIGHT_CH3_INVERSE 0
  494. #define LIGHT_CH4_INVERSE 0
  495. // -----------------------------------------------------------------------------
  496. // HUACANXING H801
  497. // -----------------------------------------------------------------------------
  498. #elif defined(HUACANXING_H801)
  499. // Info
  500. #define MANUFACTURER "HUACANXING"
  501. #define DEVICE "H801"
  502. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  503. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  504. #define DUMMY_RELAY_COUNT 1
  505. // LEDs
  506. #define LED1_PIN 5
  507. #define LED1_PIN_INVERSE 1
  508. // Channels
  509. #define LIGHT_CH1_PIN 15 // RED
  510. #define LIGHT_CH2_PIN 13 // GREEN
  511. #define LIGHT_CH3_PIN 12 // BLUE
  512. #define LIGHT_CH4_PIN 14 // WHITE1
  513. #define LIGHT_CH5_PIN 4 // WHITE2
  514. #define LIGHT_CH1_INVERSE 0
  515. #define LIGHT_CH2_INVERSE 0
  516. #define LIGHT_CH3_INVERSE 0
  517. #define LIGHT_CH4_INVERSE 0
  518. #define LIGHT_CH5_INVERSE 0
  519. // -----------------------------------------------------------------------------
  520. // Jan Goedeke Wifi Relay
  521. // https://github.com/JanGoe/esp8266-wifi-relay
  522. // -----------------------------------------------------------------------------
  523. #elif defined(JANGOE_WIFI_RELAY_NC)
  524. // Info
  525. #define MANUFACTURER "JANGOE"
  526. #define DEVICE "WIFI_RELAY_NC"
  527. // Buttons
  528. #define BUTTON1_PIN 12
  529. #define BUTTON2_PIN 13
  530. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  531. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  532. #define BUTTON1_RELAY 1
  533. #define BUTTON2_RELAY 2
  534. // Relays
  535. #define RELAY1_PIN 2
  536. #define RELAY2_PIN 14
  537. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  538. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  539. #elif defined(JANGOE_WIFI_RELAY_NO)
  540. // Info
  541. #define MANUFACTURER "JANGOE"
  542. #define DEVICE "WIFI_RELAY_NO"
  543. // Buttons
  544. #define BUTTON1_PIN 12
  545. #define BUTTON2_PIN 13
  546. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  547. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  548. #define BUTTON1_RELAY 1
  549. #define BUTTON2_RELAY 2
  550. // Relays
  551. #define RELAY1_PIN 2
  552. #define RELAY2_PIN 14
  553. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  554. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  555. // -----------------------------------------------------------------------------
  556. // Jorge García Wifi+Relays Board Kit
  557. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  558. // https://github.com/jorgegarciadev/wifikit
  559. // -----------------------------------------------------------------------------
  560. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  561. // Info
  562. #define MANUFACTURER "JORGEGARCIA"
  563. #define DEVICE "WIFI_RELAYS"
  564. // Relays
  565. #define RELAY1_PIN 0
  566. #define RELAY2_PIN 2
  567. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  568. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  569. // -----------------------------------------------------------------------------
  570. // WiFi MQTT Relay / Thermostat
  571. // -----------------------------------------------------------------------------
  572. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  573. // Info
  574. #define MANUFACTURER "OPENENERGYMONITOR"
  575. #define DEVICE "MQTT_RELAY"
  576. // Buttons
  577. #define BUTTON1_PIN 0
  578. #define BUTTON1_RELAY 1
  579. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  580. // Relays
  581. #define RELAY1_PIN 12
  582. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  583. // LEDs
  584. #define LED1_PIN 16
  585. #define LED1_PIN_INVERSE 0
  586. // -----------------------------------------------------------------------------
  587. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  588. // 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
  589. // 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
  590. // -----------------------------------------------------------------------------
  591. #elif defined(WION_50055)
  592. // Currently untested, does not support energy monitoring
  593. // Info
  594. #define MANUFACTURER "WION"
  595. #define DEVICE "50055"
  596. // Buttons
  597. #define BUTTON1_PIN 13
  598. #define BUTTON1_RELAY 1
  599. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  600. // Relays
  601. #define RELAY1_PIN 15
  602. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  603. // LEDs
  604. #define LED1_PIN 2
  605. #define LED1_PIN_INVERSE 0
  606. // -----------------------------------------------------------------------------
  607. // EX-Store Wifi Relay v3.1
  608. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  609. // -----------------------------------------------------------------------------
  610. #elif defined(EXS_WIFI_RELAY_V31)
  611. // Untested
  612. // Info
  613. #define MANUFACTURER "EXS"
  614. #define DEVICE "WIFI_RELAY_V31"
  615. // Buttons
  616. #define BUTTON1_PIN 0
  617. #define BUTTON1_RELAY 1
  618. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  619. // Relays
  620. #define RELAY1_PIN 13
  621. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  622. #define RELAY1_RESET_PIN 12
  623. // -----------------------------------------------------------------------------
  624. // HUACANXING H802
  625. // -----------------------------------------------------------------------------
  626. #elif defined(HUACANXING_H802)
  627. // Info
  628. #define MANUFACTURER "HUACANXING"
  629. #define DEVICE "H802"
  630. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  631. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  632. #define DUMMY_RELAY_COUNT 1
  633. // Channels
  634. #define LIGHT_CH1_PIN 12 // RED
  635. #define LIGHT_CH2_PIN 14 // GREEN
  636. #define LIGHT_CH3_PIN 13 // BLUE
  637. #define LIGHT_CH4_PIN 15 // WHITE
  638. #define LIGHT_CH1_INVERSE 0
  639. #define LIGHT_CH2_INVERSE 0
  640. #define LIGHT_CH3_INVERSE 0
  641. #define LIGHT_CH4_INVERSE 0
  642. // -----------------------------------------------------------------------------
  643. // V9261F
  644. // -----------------------------------------------------------------------------
  645. #elif defined(GENERIC_V9261F)
  646. // Info
  647. #define MANUFACTURER "GENERIC"
  648. #define DEVICE "V9261F"
  649. // V9261F
  650. #define V9261F_SUPPORT 1
  651. #define V9261F_PIN 2
  652. #define V9261F_PIN_INVERSE 1
  653. // -----------------------------------------------------------------------------
  654. // Unknown hardware
  655. // -----------------------------------------------------------------------------
  656. #else
  657. #error "UNSUPPORTED HARDWARE!"
  658. #endif
  659. // -----------------------------------------------------------------------------
  660. // Default values
  661. // -----------------------------------------------------------------------------
  662. #ifndef BUTTON1_PRESS
  663. #define BUTTON1_PRESS BUTTON_MODE_NONE
  664. #endif
  665. #ifndef BUTTON2_PRESS
  666. #define BUTTON2_PRESS BUTTON_MODE_NONE
  667. #endif
  668. #ifndef BUTTON3_PRESS
  669. #define BUTTON3_PRESS BUTTON_MODE_NONE
  670. #endif
  671. #ifndef BUTTON4_PRESS
  672. #define BUTTON4_PRESS BUTTON_MODE_NONE
  673. #endif
  674. #ifndef BUTTON1_CLICK
  675. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  676. #endif
  677. #ifndef BUTTON2_CLICK
  678. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  679. #endif
  680. #ifndef BUTTON3_CLICK
  681. #define BUTTON3_CLICK BUTTON_MODE_TOGGLE
  682. #endif
  683. #ifndef BUTTON4_CLICK
  684. #define BUTTON4_CLICK BUTTON_MODE_TOGGLE
  685. #endif
  686. #ifndef BUTTON1_DBLCLICK
  687. #define BUTTON1_DBLCLICK BUTTON_MODE_AP
  688. #endif
  689. #ifndef BUTTON2_DBLCLICK
  690. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  691. #endif
  692. #ifndef BUTTON3_DBLCLICK
  693. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  694. #endif
  695. #ifndef BUTTON4_DBLCLICK
  696. #define BUTTON4_DBLCLICK BUTTON_MODE_NONE
  697. #endif
  698. #ifndef BUTTON1_LNGCLICK
  699. #define BUTTON1_LNGCLICK BUTTON_MODE_RESET
  700. #endif
  701. #ifndef BUTTON2_LNGCLICK
  702. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  703. #endif
  704. #ifndef BUTTON3_LNGCLICK
  705. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  706. #endif
  707. #ifndef BUTTON4_LNGCLICK
  708. #define BUTTON4_LNGCLICK BUTTON_MODE_NONE
  709. #endif
  710. #ifndef BUTTON1_LNGLNGCLICK
  711. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_FACTORY
  712. #endif
  713. #ifndef BUTTON2_LNGLNGCLICK
  714. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  715. #endif
  716. #ifndef BUTTON3_LNGLNGCLICK
  717. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_NONE
  718. #endif
  719. #ifndef BUTTON4_LNGLNGCLICK
  720. #define BUTTON4_LNGLNGCLICK BUTTON_MODE_NONE
  721. #endif
  722. #ifndef BUTTON1_RELAY
  723. #define BUTTON1_RELAY 0
  724. #endif
  725. #ifndef BUTTON2_RELAY
  726. #define BUTTON2_RELAY 0
  727. #endif
  728. #ifndef BUTTON3_RELAY
  729. #define BUTTON3_RELAY 0
  730. #endif
  731. #ifndef BUTTON4_RELAY
  732. #define BUTTON4_RELAY 0
  733. #endif
  734. #ifndef RELAY1_RESET_PIN
  735. #define RELAY1_RESET_PIN 0
  736. #endif
  737. #ifndef RELAY2_RESET_PIN
  738. #define RELAY2_RESET_PIN 0
  739. #endif
  740. #ifndef RELAY3_RESET_PIN
  741. #define RELAY3_RESET_PIN 0
  742. #endif
  743. #ifndef RELAY4_RESET_PIN
  744. #define RELAY4_RESET_PIN 0
  745. #endif
  746. #ifndef RELAY1_DELAY_ON
  747. #define RELAY1_DELAY_ON 0
  748. #endif
  749. #ifndef RELAY2_DELAY_ON
  750. #define RELAY2_DELAY_ON 0
  751. #endif
  752. #ifndef RELAY3_DELAY_ON
  753. #define RELAY3_DELAY_ON 0
  754. #endif
  755. #ifndef RELAY4_DELAY_ON
  756. #define RELAY4_DELAY_ON 0
  757. #endif
  758. #ifndef RELAY1_DELAY_OFF
  759. #define RELAY1_DELAY_OFF 0
  760. #endif
  761. #ifndef RELAY2_DELAY_OFF
  762. #define RELAY2_DELAY_OFF 0
  763. #endif
  764. #ifndef RELAY3_DELAY_OFF
  765. #define RELAY3_DELAY_OFF 0
  766. #endif
  767. #ifndef RELAY4_DELAY_OFF
  768. #define RELAY4_DELAY_OFF 0
  769. #endif
  770. #ifndef RELAY1_LED
  771. #define RELAY1_LED 0
  772. #endif
  773. #ifndef RELAY2_LED
  774. #define RELAY2_LED 0
  775. #endif
  776. #ifndef RELAY3_LED
  777. #define RELAY3_LED 0
  778. #endif
  779. #ifndef RELAY4_LED
  780. #define RELAY4_LED 0
  781. #endif
  782. // Needed for ESP8285 boards under Windows using PlatformIO (?)
  783. #ifndef BUTTON_PUSHBUTTON
  784. #define BUTTON_PUSHBUTTON 0
  785. #define BUTTON_SWITCH 1
  786. #define BUTTON_DEFAULT_HIGH 2
  787. #define BUTTON_SET_PULLUP 4
  788. #endif
  789. // Does the board track the relay status?
  790. #ifndef TRACK_RELAY_STATUS
  791. #define TRACK_RELAY_STATUS 1
  792. #endif
  793. // Serial baudrate
  794. #ifndef SERIAL_BAUDRATE
  795. #define SERIAL_BAUDRATE 115200
  796. #endif
  797. // Relay providers
  798. #ifndef RELAY_PROVIDER
  799. #define RELAY_PROVIDER RELAY_PROVIDER_RELAY
  800. #endif
  801. // Light provider
  802. #ifndef LIGHT_PROVIDER
  803. #define LIGHT_PROVIDER LIGHT_PROVIDER_NONE
  804. #endif