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.

1047 lines
29 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. // Unknown hardware
  668. // -----------------------------------------------------------------------------
  669. #else
  670. #error "UNSUPPORTED HARDWARE!"
  671. #endif
  672. // -----------------------------------------------------------------------------
  673. // Default values
  674. // -----------------------------------------------------------------------------
  675. #ifndef BUTTON1_PRESS
  676. #define BUTTON1_PRESS BUTTON_MODE_NONE
  677. #endif
  678. #ifndef BUTTON2_PRESS
  679. #define BUTTON2_PRESS BUTTON_MODE_NONE
  680. #endif
  681. #ifndef BUTTON3_PRESS
  682. #define BUTTON3_PRESS BUTTON_MODE_NONE
  683. #endif
  684. #ifndef BUTTON4_PRESS
  685. #define BUTTON4_PRESS BUTTON_MODE_NONE
  686. #endif
  687. #ifndef BUTTON1_CLICK
  688. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  689. #endif
  690. #ifndef BUTTON2_CLICK
  691. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  692. #endif
  693. #ifndef BUTTON3_CLICK
  694. #define BUTTON3_CLICK BUTTON_MODE_TOGGLE
  695. #endif
  696. #ifndef BUTTON4_CLICK
  697. #define BUTTON4_CLICK BUTTON_MODE_TOGGLE
  698. #endif
  699. #ifndef BUTTON1_DBLCLICK
  700. #define BUTTON1_DBLCLICK BUTTON_MODE_AP
  701. #endif
  702. #ifndef BUTTON2_DBLCLICK
  703. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  704. #endif
  705. #ifndef BUTTON3_DBLCLICK
  706. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  707. #endif
  708. #ifndef BUTTON4_DBLCLICK
  709. #define BUTTON4_DBLCLICK BUTTON_MODE_NONE
  710. #endif
  711. #ifndef BUTTON1_LNGCLICK
  712. #define BUTTON1_LNGCLICK BUTTON_MODE_RESET
  713. #endif
  714. #ifndef BUTTON2_LNGCLICK
  715. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  716. #endif
  717. #ifndef BUTTON3_LNGCLICK
  718. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  719. #endif
  720. #ifndef BUTTON4_LNGCLICK
  721. #define BUTTON4_LNGCLICK BUTTON_MODE_NONE
  722. #endif
  723. #ifndef BUTTON1_LNGLNGCLICK
  724. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_FACTORY
  725. #endif
  726. #ifndef BUTTON2_LNGLNGCLICK
  727. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  728. #endif
  729. #ifndef BUTTON3_LNGLNGCLICK
  730. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_NONE
  731. #endif
  732. #ifndef BUTTON4_LNGLNGCLICK
  733. #define BUTTON4_LNGLNGCLICK BUTTON_MODE_NONE
  734. #endif
  735. #ifndef BUTTON1_RELAY
  736. #define BUTTON1_RELAY 0
  737. #endif
  738. #ifndef BUTTON2_RELAY
  739. #define BUTTON2_RELAY 0
  740. #endif
  741. #ifndef BUTTON3_RELAY
  742. #define BUTTON3_RELAY 0
  743. #endif
  744. #ifndef BUTTON4_RELAY
  745. #define BUTTON4_RELAY 0
  746. #endif
  747. #ifndef RELAY1_RESET_PIN
  748. #define RELAY1_RESET_PIN 0
  749. #endif
  750. #ifndef RELAY2_RESET_PIN
  751. #define RELAY2_RESET_PIN 0
  752. #endif
  753. #ifndef RELAY3_RESET_PIN
  754. #define RELAY3_RESET_PIN 0
  755. #endif
  756. #ifndef RELAY4_RESET_PIN
  757. #define RELAY4_RESET_PIN 0
  758. #endif
  759. #ifndef RELAY1_DELAY_ON
  760. #define RELAY1_DELAY_ON 0
  761. #endif
  762. #ifndef RELAY2_DELAY_ON
  763. #define RELAY2_DELAY_ON 0
  764. #endif
  765. #ifndef RELAY3_DELAY_ON
  766. #define RELAY3_DELAY_ON 0
  767. #endif
  768. #ifndef RELAY4_DELAY_ON
  769. #define RELAY4_DELAY_ON 0
  770. #endif
  771. #ifndef RELAY1_DELAY_OFF
  772. #define RELAY1_DELAY_OFF 0
  773. #endif
  774. #ifndef RELAY2_DELAY_OFF
  775. #define RELAY2_DELAY_OFF 0
  776. #endif
  777. #ifndef RELAY3_DELAY_OFF
  778. #define RELAY3_DELAY_OFF 0
  779. #endif
  780. #ifndef RELAY4_DELAY_OFF
  781. #define RELAY4_DELAY_OFF 0
  782. #endif
  783. #ifndef RELAY1_LED
  784. #define RELAY1_LED 0
  785. #endif
  786. #ifndef RELAY2_LED
  787. #define RELAY2_LED 0
  788. #endif
  789. #ifndef RELAY3_LED
  790. #define RELAY3_LED 0
  791. #endif
  792. #ifndef RELAY4_LED
  793. #define RELAY4_LED 0
  794. #endif
  795. // Needed for ESP8285 boards under Windows using PlatformIO (?)
  796. #ifndef BUTTON_PUSHBUTTON
  797. #define BUTTON_PUSHBUTTON 0
  798. #define BUTTON_SWITCH 1
  799. #define BUTTON_DEFAULT_HIGH 2
  800. #define BUTTON_SET_PULLUP 4
  801. #endif
  802. // Does the board track the relay status?
  803. #ifndef TRACK_RELAY_STATUS
  804. #define TRACK_RELAY_STATUS 1
  805. #endif
  806. // Serial baudrate
  807. #ifndef SERIAL_BAUDRATE
  808. #define SERIAL_BAUDRATE 115200
  809. #endif
  810. // Relay providers
  811. #ifndef RELAY_PROVIDER
  812. #define RELAY_PROVIDER RELAY_PROVIDER_RELAY
  813. #endif
  814. // Light provider
  815. #ifndef LIGHT_PROVIDER
  816. #define LIGHT_PROVIDER LIGHT_PROVIDER_NONE
  817. #endif