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.

1075 lines
30 KiB

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 POWER_PROVIDER POWER_PROVIDER_HLW8012
  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 POWER_PROVIDER POWER_PROVIDER_HLW8012
  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 TERMINAL_SUPPORT 0
  331. #define TRACK_RELAY_STATUS 0
  332. // Buttons
  333. #define BUTTON1_PIN 0
  334. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  335. // LEDs
  336. #define LED1_PIN 13
  337. #define LED1_PIN_INVERSE 1
  338. #elif defined(ITEAD_SONOFF_B1)
  339. // Info
  340. #define MANUFACTURER "ITEAD"
  341. #define DEVICE "SONOFF_B1"
  342. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  343. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192
  344. #define DUMMY_RELAY_COUNT 1
  345. #define MY9291_DI_PIN 12
  346. #define MY9291_DCKI_PIN 14
  347. #define MY9291_COMMAND MY9291_COMMAND_DEFAULT
  348. #define MY9291_CHANNELS 5
  349. #elif defined(ITEAD_SONOFF_LED)
  350. // Info
  351. #define MANUFACTURER "ITEAD"
  352. #define DEVICE "SONOFF_LED"
  353. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  354. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  355. #define DUMMY_RELAY_COUNT 1
  356. // LEDs
  357. #define LED1_PIN 13
  358. #define LED1_PIN_INVERSE 1
  359. // Channels
  360. #define LIGHT_CH1_PIN 12 // Cold white
  361. #define LIGHT_CH2_PIN 14 // Warm white
  362. #define LIGHT_CH1_INVERSE 0
  363. #define LIGHT_CH2_INVERSE 0
  364. #elif defined(ITEAD_SONOFF_T1_1CH)
  365. // Info
  366. #define MANUFACTURER "ITEAD"
  367. #define DEVICE "SONOFF_T1_1CH"
  368. // Buttons
  369. #define BUTTON1_PIN 9
  370. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  371. #define BUTTON1_RELAY 1
  372. // Relays
  373. #define RELAY1_PIN 5
  374. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  375. // LEDs
  376. #define LED1_PIN 13
  377. #define LED1_PIN_INVERSE 1
  378. #elif defined(ITEAD_SONOFF_T1_2CH)
  379. // Info
  380. #define MANUFACTURER "ITEAD"
  381. #define DEVICE "SONOFF_T1_2CH"
  382. // Buttons
  383. #define BUTTON1_PIN 0
  384. #define BUTTON2_PIN 10
  385. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  386. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  387. #define BUTTON1_RELAY 1
  388. #define BUTTON2_RELAY 2
  389. // Relays
  390. #define RELAY1_PIN 12
  391. #define RELAY2_PIN 4
  392. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  393. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  394. // LEDs
  395. #define LED1_PIN 13
  396. #define LED1_PIN_INVERSE 1
  397. #elif defined(ITEAD_SONOFF_T1_3CH)
  398. // Info
  399. #define MANUFACTURER "ITEAD"
  400. #define DEVICE "SONOFF_T1_3CH"
  401. // Buttons
  402. #define BUTTON1_PIN 0
  403. #define BUTTON2_PIN 9
  404. #define BUTTON3_PIN 10
  405. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  406. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  407. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  408. #define BUTTON1_RELAY 1
  409. #define BUTTON2_RELAY 2
  410. #define BUTTON3_RELAY 3
  411. // Relays
  412. #define RELAY1_PIN 12
  413. #define RELAY2_PIN 5
  414. #define RELAY3_PIN 4
  415. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  416. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  417. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  418. // LEDs
  419. #define LED1_PIN 13
  420. #define LED1_PIN_INVERSE 1
  421. // -----------------------------------------------------------------------------
  422. // Electrodragon boards
  423. // -----------------------------------------------------------------------------
  424. #elif defined(ELECTRODRAGON_WIFI_IOT)
  425. // Info
  426. #define MANUFACTURER "ELECTRODRAGON"
  427. #define DEVICE "WIFI_IOT"
  428. // Buttons
  429. #define BUTTON1_PIN 0
  430. #define BUTTON2_PIN 2
  431. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  432. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  433. #define BUTTON1_RELAY 1
  434. #define BUTTON2_RELAY 2
  435. // Relays
  436. #define RELAY1_PIN 12
  437. #define RELAY2_PIN 13
  438. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  439. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  440. // LEDs
  441. #define LED1_PIN 16
  442. #define LED1_PIN_INVERSE 0
  443. // -----------------------------------------------------------------------------
  444. // WorkChoice ecoPlug
  445. // -----------------------------------------------------------------------------
  446. #elif defined(WORKCHOICE_ECOPLUG)
  447. // Info
  448. #define MANUFACTURER "WORKCHOICE"
  449. #define DEVICE "ECOPLUG"
  450. // Buttons
  451. #define BUTTON1_PIN 13
  452. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  453. #define BUTTON1_RELAY 1
  454. // Relays
  455. #define RELAY1_PIN 15
  456. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  457. // LEDs
  458. #define LED1_PIN 2
  459. #define LED1_PIN_INVERSE 0
  460. // -----------------------------------------------------------------------------
  461. // AI Thinker
  462. // -----------------------------------------------------------------------------
  463. #elif defined(AITHINKER_AI_LIGHT)
  464. // Info
  465. #define MANUFACTURER "AITHINKER"
  466. #define DEVICE "AI_LIGHT"
  467. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  468. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192
  469. #define DUMMY_RELAY_COUNT 1
  470. #define MY9291_DI_PIN 13
  471. #define MY9291_DCKI_PIN 15
  472. #define MY9291_COMMAND MY9291_COMMAND_DEFAULT
  473. #define MY9291_CHANNELS 4
  474. // -----------------------------------------------------------------------------
  475. // LED Controller
  476. // -----------------------------------------------------------------------------
  477. #elif defined(MAGICHOME_LED_CONTROLLER)
  478. // Info
  479. #define MANUFACTURER "MAGICHOME"
  480. #define DEVICE "LED_CONTROLLER"
  481. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  482. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  483. #define DUMMY_RELAY_COUNT 1
  484. // LEDs
  485. #define LED1_PIN 2
  486. #define LED1_PIN_INVERSE 1
  487. // Channels
  488. #define LIGHT_CH1_PIN 14 // RED
  489. #define LIGHT_CH2_PIN 5 // GREEN
  490. #define LIGHT_CH3_PIN 12 // BLUE
  491. #define LIGHT_CH4_PIN 13 // WHITE
  492. #define LIGHT_CH1_INVERSE 0
  493. #define LIGHT_CH2_INVERSE 0
  494. #define LIGHT_CH3_INVERSE 0
  495. #define LIGHT_CH4_INVERSE 0
  496. // -----------------------------------------------------------------------------
  497. // HUACANXING H801
  498. // -----------------------------------------------------------------------------
  499. #elif defined(HUACANXING_H801)
  500. // Info
  501. #define MANUFACTURER "HUACANXING"
  502. #define DEVICE "H801"
  503. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  504. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  505. #define DUMMY_RELAY_COUNT 1
  506. // LEDs
  507. #define LED1_PIN 5
  508. #define LED1_PIN_INVERSE 1
  509. // Channels
  510. #define LIGHT_CH1_PIN 15 // RED
  511. #define LIGHT_CH2_PIN 13 // GREEN
  512. #define LIGHT_CH3_PIN 12 // BLUE
  513. #define LIGHT_CH4_PIN 14 // WHITE1
  514. #define LIGHT_CH5_PIN 4 // WHITE2
  515. #define LIGHT_CH1_INVERSE 0
  516. #define LIGHT_CH2_INVERSE 0
  517. #define LIGHT_CH3_INVERSE 0
  518. #define LIGHT_CH4_INVERSE 0
  519. #define LIGHT_CH5_INVERSE 0
  520. // -----------------------------------------------------------------------------
  521. // Jan Goedeke Wifi Relay
  522. // https://github.com/JanGoe/esp8266-wifi-relay
  523. // -----------------------------------------------------------------------------
  524. #elif defined(JANGOE_WIFI_RELAY_NC)
  525. // Info
  526. #define MANUFACTURER "JANGOE"
  527. #define DEVICE "WIFI_RELAY_NC"
  528. // Buttons
  529. #define BUTTON1_PIN 12
  530. #define BUTTON2_PIN 13
  531. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  532. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  533. #define BUTTON1_RELAY 1
  534. #define BUTTON2_RELAY 2
  535. // Relays
  536. #define RELAY1_PIN 2
  537. #define RELAY2_PIN 14
  538. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  539. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  540. #elif defined(JANGOE_WIFI_RELAY_NO)
  541. // Info
  542. #define MANUFACTURER "JANGOE"
  543. #define DEVICE "WIFI_RELAY_NO"
  544. // Buttons
  545. #define BUTTON1_PIN 12
  546. #define BUTTON2_PIN 13
  547. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  548. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  549. #define BUTTON1_RELAY 1
  550. #define BUTTON2_RELAY 2
  551. // Relays
  552. #define RELAY1_PIN 2
  553. #define RELAY2_PIN 14
  554. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  555. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  556. // -----------------------------------------------------------------------------
  557. // Jorge García Wifi+Relays Board Kit
  558. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  559. // https://github.com/jorgegarciadev/wifikit
  560. // -----------------------------------------------------------------------------
  561. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  562. // Info
  563. #define MANUFACTURER "JORGEGARCIA"
  564. #define DEVICE "WIFI_RELAYS"
  565. // Relays
  566. #define RELAY1_PIN 0
  567. #define RELAY2_PIN 2
  568. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  569. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  570. // -----------------------------------------------------------------------------
  571. // WiFi MQTT Relay / Thermostat
  572. // -----------------------------------------------------------------------------
  573. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  574. // Info
  575. #define MANUFACTURER "OPENENERGYMONITOR"
  576. #define DEVICE "MQTT_RELAY"
  577. // Buttons
  578. #define BUTTON1_PIN 0
  579. #define BUTTON1_RELAY 1
  580. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  581. // Relays
  582. #define RELAY1_PIN 12
  583. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  584. // LEDs
  585. #define LED1_PIN 16
  586. #define LED1_PIN_INVERSE 0
  587. // -----------------------------------------------------------------------------
  588. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  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-50050-Indoor-Wi-Fi-Outlet-Wireless-Switch-Programmable-Timer-%2F263112281551
  590. // 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
  591. // -----------------------------------------------------------------------------
  592. #elif defined(WION_50055)
  593. // Currently untested, does not support energy monitoring
  594. // Info
  595. #define MANUFACTURER "WION"
  596. #define DEVICE "50055"
  597. // Buttons
  598. #define BUTTON1_PIN 13
  599. #define BUTTON1_RELAY 1
  600. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  601. // Relays
  602. #define RELAY1_PIN 15
  603. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  604. // LEDs
  605. #define LED1_PIN 2
  606. #define LED1_PIN_INVERSE 0
  607. // -----------------------------------------------------------------------------
  608. // EX-Store Wifi Relay v3.1
  609. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  610. // -----------------------------------------------------------------------------
  611. #elif defined(EXS_WIFI_RELAY_V31)
  612. // Untested
  613. // Info
  614. #define MANUFACTURER "EXS"
  615. #define DEVICE "WIFI_RELAY_V31"
  616. // Buttons
  617. #define BUTTON1_PIN 0
  618. #define BUTTON1_RELAY 1
  619. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  620. // Relays
  621. #define RELAY1_PIN 13
  622. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  623. #define RELAY1_RESET_PIN 12
  624. // -----------------------------------------------------------------------------
  625. // HUACANXING H802
  626. // -----------------------------------------------------------------------------
  627. #elif defined(HUACANXING_H802)
  628. // Info
  629. #define MANUFACTURER "HUACANXING"
  630. #define DEVICE "H802"
  631. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  632. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  633. #define DUMMY_RELAY_COUNT 1
  634. // Channels
  635. #define LIGHT_CH1_PIN 12 // RED
  636. #define LIGHT_CH2_PIN 14 // GREEN
  637. #define LIGHT_CH3_PIN 13 // BLUE
  638. #define LIGHT_CH4_PIN 15 // WHITE
  639. #define LIGHT_CH1_INVERSE 0
  640. #define LIGHT_CH2_INVERSE 0
  641. #define LIGHT_CH3_INVERSE 0
  642. #define LIGHT_CH4_INVERSE 0
  643. // -----------------------------------------------------------------------------
  644. // V9261F
  645. // -----------------------------------------------------------------------------
  646. #elif defined(GENERIC_V9261F)
  647. // Info
  648. #define MANUFACTURER "GENERIC"
  649. #define DEVICE "V9261F"
  650. // V9261F
  651. #define POWER_PROVIDER POWER_PROVIDER_V9261F
  652. #define V9261F_PIN 2
  653. #define V9261F_PIN_INVERSE 1
  654. // -----------------------------------------------------------------------------
  655. // ECH1560
  656. // -----------------------------------------------------------------------------
  657. #elif defined(GENERIC_ECH1560)
  658. // Info
  659. #define MANUFACTURER "GENERIC"
  660. #define DEVICE "ECH1560"
  661. // ECH1560
  662. #define POWER_PROVIDER POWER_PROVIDER_ECH1560
  663. #define ECH1560_CLK_PIN 4
  664. #define ECH1560_MISO_PIN 5
  665. #define ECH1560_INVERTED 0
  666. // -----------------------------------------------------------------------------
  667. // ESPLive
  668. // https://github.com/ManCaveMade/ESP-Live
  669. // -----------------------------------------------------------------------------
  670. #elif defined(ESPLIVE)
  671. // Info
  672. #define MANUFACTURER "ManCave Made"
  673. #define DEVICE "ESPLIVE"
  674. // Buttons
  675. #define BUTTON1_PIN 4
  676. #define BUTTON2_PIN 5
  677. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  678. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  679. #define BUTTON1_RELAY 1
  680. #define BUTTON2_RELAY 2
  681. // Relays
  682. #define RELAY1_PIN 12
  683. #define RELAY2_PIN 13
  684. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  685. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  686. // -----------------------------------------------------------------------------
  687. // Unknown hardware
  688. // -----------------------------------------------------------------------------
  689. #else
  690. #error "UNSUPPORTED HARDWARE!"
  691. #endif
  692. // -----------------------------------------------------------------------------
  693. // Default values
  694. // -----------------------------------------------------------------------------
  695. #ifndef BUTTON1_PRESS
  696. #define BUTTON1_PRESS BUTTON_MODE_NONE
  697. #endif
  698. #ifndef BUTTON2_PRESS
  699. #define BUTTON2_PRESS BUTTON_MODE_NONE
  700. #endif
  701. #ifndef BUTTON3_PRESS
  702. #define BUTTON3_PRESS BUTTON_MODE_NONE
  703. #endif
  704. #ifndef BUTTON4_PRESS
  705. #define BUTTON4_PRESS BUTTON_MODE_NONE
  706. #endif
  707. #ifndef BUTTON1_CLICK
  708. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  709. #endif
  710. #ifndef BUTTON2_CLICK
  711. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  712. #endif
  713. #ifndef BUTTON3_CLICK
  714. #define BUTTON3_CLICK BUTTON_MODE_TOGGLE
  715. #endif
  716. #ifndef BUTTON4_CLICK
  717. #define BUTTON4_CLICK BUTTON_MODE_TOGGLE
  718. #endif
  719. #ifndef BUTTON1_DBLCLICK
  720. #define BUTTON1_DBLCLICK BUTTON_MODE_AP
  721. #endif
  722. #ifndef BUTTON2_DBLCLICK
  723. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  724. #endif
  725. #ifndef BUTTON3_DBLCLICK
  726. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  727. #endif
  728. #ifndef BUTTON4_DBLCLICK
  729. #define BUTTON4_DBLCLICK BUTTON_MODE_NONE
  730. #endif
  731. #ifndef BUTTON1_LNGCLICK
  732. #define BUTTON1_LNGCLICK BUTTON_MODE_RESET
  733. #endif
  734. #ifndef BUTTON2_LNGCLICK
  735. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  736. #endif
  737. #ifndef BUTTON3_LNGCLICK
  738. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  739. #endif
  740. #ifndef BUTTON4_LNGCLICK
  741. #define BUTTON4_LNGCLICK BUTTON_MODE_NONE
  742. #endif
  743. #ifndef BUTTON1_LNGLNGCLICK
  744. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_FACTORY
  745. #endif
  746. #ifndef BUTTON2_LNGLNGCLICK
  747. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  748. #endif
  749. #ifndef BUTTON3_LNGLNGCLICK
  750. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_NONE
  751. #endif
  752. #ifndef BUTTON4_LNGLNGCLICK
  753. #define BUTTON4_LNGLNGCLICK BUTTON_MODE_NONE
  754. #endif
  755. #ifndef BUTTON1_RELAY
  756. #define BUTTON1_RELAY 0
  757. #endif
  758. #ifndef BUTTON2_RELAY
  759. #define BUTTON2_RELAY 0
  760. #endif
  761. #ifndef BUTTON3_RELAY
  762. #define BUTTON3_RELAY 0
  763. #endif
  764. #ifndef BUTTON4_RELAY
  765. #define BUTTON4_RELAY 0
  766. #endif
  767. #ifndef RELAY1_RESET_PIN
  768. #define RELAY1_RESET_PIN 0
  769. #endif
  770. #ifndef RELAY2_RESET_PIN
  771. #define RELAY2_RESET_PIN 0
  772. #endif
  773. #ifndef RELAY3_RESET_PIN
  774. #define RELAY3_RESET_PIN 0
  775. #endif
  776. #ifndef RELAY4_RESET_PIN
  777. #define RELAY4_RESET_PIN 0
  778. #endif
  779. #ifndef RELAY1_DELAY_ON
  780. #define RELAY1_DELAY_ON 0
  781. #endif
  782. #ifndef RELAY2_DELAY_ON
  783. #define RELAY2_DELAY_ON 0
  784. #endif
  785. #ifndef RELAY3_DELAY_ON
  786. #define RELAY3_DELAY_ON 0
  787. #endif
  788. #ifndef RELAY4_DELAY_ON
  789. #define RELAY4_DELAY_ON 0
  790. #endif
  791. #ifndef RELAY1_DELAY_OFF
  792. #define RELAY1_DELAY_OFF 0
  793. #endif
  794. #ifndef RELAY2_DELAY_OFF
  795. #define RELAY2_DELAY_OFF 0
  796. #endif
  797. #ifndef RELAY3_DELAY_OFF
  798. #define RELAY3_DELAY_OFF 0
  799. #endif
  800. #ifndef RELAY4_DELAY_OFF
  801. #define RELAY4_DELAY_OFF 0
  802. #endif
  803. #ifndef RELAY1_LED
  804. #define RELAY1_LED 0
  805. #endif
  806. #ifndef RELAY2_LED
  807. #define RELAY2_LED 0
  808. #endif
  809. #ifndef RELAY3_LED
  810. #define RELAY3_LED 0
  811. #endif
  812. #ifndef RELAY4_LED
  813. #define RELAY4_LED 0
  814. #endif
  815. // Needed for ESP8285 boards under Windows using PlatformIO (?)
  816. #ifndef BUTTON_PUSHBUTTON
  817. #define BUTTON_PUSHBUTTON 0
  818. #define BUTTON_SWITCH 1
  819. #define BUTTON_DEFAULT_HIGH 2
  820. #define BUTTON_SET_PULLUP 4
  821. #endif
  822. // Does the board track the relay status?
  823. #ifndef TRACK_RELAY_STATUS
  824. #define TRACK_RELAY_STATUS 1
  825. #endif
  826. // Serial baudrate
  827. #ifndef SERIAL_BAUDRATE
  828. #define SERIAL_BAUDRATE 115200
  829. #endif
  830. // Relay providers
  831. #ifndef RELAY_PROVIDER
  832. #define RELAY_PROVIDER RELAY_PROVIDER_RELAY
  833. #endif
  834. // Light provider
  835. #ifndef LIGHT_PROVIDER
  836. #define LIGHT_PROVIDER LIGHT_PROVIDER_NONE
  837. #endif