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.

1010 lines
28 KiB

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