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.

1920 lines
59 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
6 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 8 relays)
  15. // RELAY#_TYPE: Relay can be RELAY_TYPE_NORMAL, RELAY_TYPE_INVERSE, RELAY_TYPE_LATCHED or RELAY_TYPE_LATCHED_INVERSE
  16. // LED#_PIN: GPIO for the n-th LED (1-based, up to 8 LEDs)
  17. // LED#_PIN_INVERSE: LED has inversed logic (lit when pulled down)
  18. // LED#_MODE: Check general.h for LED_MODE_%
  19. // LED#_RELAY: Linked relay (1-based)
  20. //
  21. // Besides, other hardware specific information should be stated here
  22. // -----------------------------------------------------------------------------
  23. // ESPurna Core
  24. // -----------------------------------------------------------------------------
  25. #if defined(ESPURNA_CORE)
  26. // This is a special device targeted to generate a light-weight binary image
  27. // meant to be able to do two-step-updates:
  28. // https://github.com/xoseperez/espurna/wiki/TwoStepUpdates
  29. // Info
  30. #define MANUFACTURER "ESPRESSIF"
  31. #define DEVICE "ESPURNA_CORE"
  32. // Disable non-core modules
  33. #define ALEXA_SUPPORT 0
  34. #define BROKER_SUPPORT 0
  35. #define DOMOTICZ_SUPPORT 0
  36. #define HOMEASSISTANT_SUPPORT 0
  37. #define I2C_SUPPORT 0
  38. #define MQTT_SUPPORT 0
  39. #define NTP_SUPPORT 0
  40. #define SCHEDULER_SUPPORT 0
  41. #define SENSOR_SUPPORT 0
  42. #define THINGSPEAK_SUPPORT 0
  43. #define WEB_SUPPORT 0
  44. // -----------------------------------------------------------------------------
  45. // Development boards
  46. // -----------------------------------------------------------------------------
  47. #elif defined(SWIFITCH)
  48. // https://github.com/ArnieX/swifitch
  49. // Info
  50. #define MANUFACTURER "SWIFITCH"
  51. #define DEVICE "SWIFITCH"
  52. // Buttons
  53. #define BUTTON1_PIN 4 // D2
  54. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  55. #define BUTTON1_RELAY 1
  56. #define BUTTON1_PRESS BUTTON_MODE_NONE
  57. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  58. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  59. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  60. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  61. // Relays
  62. #define RELAY1_PIN 5 // D1
  63. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  64. // LEDs
  65. #define LED1_PIN 12 // D6
  66. #define LED1_PIN_INVERSE 1
  67. #elif defined(NODEMCU_LOLIN)
  68. // Info
  69. #define MANUFACTURER "NODEMCU"
  70. #define DEVICE "LOLIN"
  71. // Buttons
  72. #define BUTTON1_PIN 0
  73. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  74. #define BUTTON1_RELAY 1
  75. // Relays
  76. #define RELAY1_PIN 12
  77. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  78. // LEDs
  79. #define LED1_PIN 2
  80. #define LED1_PIN_INVERSE 1
  81. #elif defined(WEMOS_D1_MINI_RELAYSHIELD)
  82. // Info
  83. #define MANUFACTURER "WEMOS"
  84. #define DEVICE "D1_MINI_RELAYSHIELD"
  85. // Buttons
  86. // No buttons on the D1 MINI alone, but defining it without adding a button doen't create problems
  87. #define BUTTON1_PIN 0 // Connect a pushbutton between D3 and GND,
  88. // it's the same as using a Wemos one button shield
  89. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  90. #define BUTTON1_RELAY 1
  91. // Relays
  92. #define RELAY1_PIN 5
  93. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  94. // LEDs
  95. #define LED1_PIN 2
  96. #define LED1_PIN_INVERSE 1
  97. // When Wemos relay shield is connected GPIO5 (D1) is used for relay,
  98. // so I2C must be remapped to other pins
  99. #define I2C_SDA_PIN 12 // D6
  100. #define I2C_SCL_PIN 14 // D5
  101. #elif defined(WEMOS_D1_TARPUNA_SHIELD)
  102. // Info
  103. #define MANUFACTURER "WEMOS"
  104. #define DEVICE "D1_TARPUNA_SHIELD"
  105. // -----------------------------------------------------------------------------
  106. // ESPurna
  107. // -----------------------------------------------------------------------------
  108. #elif defined(TINKERMAN_ESPURNA_H06)
  109. // Info
  110. #define MANUFACTURER "TINKERMAN"
  111. #define DEVICE "ESPURNA_H06"
  112. // Buttons
  113. #define BUTTON1_PIN 4
  114. #define BUTTON1_RELAY 1
  115. // Normal pushbutton
  116. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  117. // Relays
  118. #define RELAY1_PIN 12
  119. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  120. // LEDs
  121. #define LED1_PIN 2
  122. #define LED1_PIN_INVERSE 1
  123. // HLW8012
  124. #ifndef HLW8012_SUPPORT
  125. #define HLW8012_SUPPORT 1
  126. #endif
  127. #define HLW8012_SEL_PIN 2
  128. #define HLW8012_CF1_PIN 13
  129. #define HLW8012_CF_PIN 14
  130. #elif defined(TINKERMAN_ESPURNA_H08)
  131. // Info
  132. #define MANUFACTURER "TINKERMAN"
  133. #define DEVICE "ESPURNA_H08"
  134. // Buttons
  135. #define BUTTON1_PIN 4
  136. #define BUTTON1_RELAY 1
  137. // Normal pushbutton
  138. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  139. // Relays
  140. #define RELAY1_PIN 12
  141. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  142. // LEDs
  143. #define LED1_PIN 2
  144. #define LED1_PIN_INVERSE 0
  145. // HLW8012
  146. #ifndef HLW8012_SUPPORT
  147. #define HLW8012_SUPPORT 1
  148. #endif
  149. #define HLW8012_SEL_PIN 5
  150. #define HLW8012_CF1_PIN 13
  151. #define HLW8012_CF_PIN 14
  152. #elif defined(TINKERMAN_ESPURNA_SWITCH)
  153. // Info
  154. #define MANUFACTURER "TINKERMAN"
  155. #define DEVICE "ESPURNA_SWITCH"
  156. // Buttons
  157. #define BUTTON1_PIN 4
  158. #define BUTTON1_RELAY 1
  159. // Touch button
  160. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  161. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  162. #define BUTTON1_CLICK BUTTON_MODE_NONE
  163. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  164. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  165. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  166. // LEDs
  167. #define LED1_PIN 2
  168. #define LED1_PIN_INVERSE 0
  169. // Relays
  170. #define RELAY1_PIN 12
  171. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  172. // -----------------------------------------------------------------------------
  173. // Itead Studio boards
  174. // -----------------------------------------------------------------------------
  175. #elif defined(ITEAD_SONOFF_BASIC)
  176. // Info
  177. #define MANUFACTURER "ITEAD"
  178. #define DEVICE "SONOFF_BASIC"
  179. // Buttons
  180. #define BUTTON1_PIN 0
  181. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  182. #define BUTTON1_RELAY 1
  183. #define BUTTON2_PIN 14
  184. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  185. #define BUTTON2_RELAY 1
  186. // Relays
  187. #define RELAY1_PIN 12
  188. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  189. // LEDs
  190. #define LED1_PIN 13
  191. #define LED1_PIN_INVERSE 1
  192. #elif defined(ITEAD_SONOFF_RF)
  193. // Info
  194. #define MANUFACTURER "ITEAD"
  195. #define DEVICE "SONOFF_RF"
  196. // Buttons
  197. #define BUTTON1_PIN 0
  198. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  199. #define BUTTON1_RELAY 1
  200. #define BUTTON2_PIN 14
  201. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  202. #define BUTTON2_RELAY 1
  203. // Relays
  204. #define RELAY1_PIN 12
  205. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  206. // LEDs
  207. #define LED1_PIN 13
  208. #define LED1_PIN_INVERSE 1
  209. #elif defined(ITEAD_SONOFF_TH)
  210. // Info
  211. #define MANUFACTURER "ITEAD"
  212. #define DEVICE "SONOFF_TH"
  213. // Buttons
  214. #define BUTTON1_PIN 0
  215. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  216. #define BUTTON1_RELAY 1
  217. // Relays
  218. #define RELAY1_PIN 12
  219. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  220. // LEDs
  221. #define LED1_PIN 13
  222. #define LED1_PIN_INVERSE 1
  223. // Jack is connected to GPIO14 (and with a small hack to GPIO4)
  224. #ifndef DALLAS_SUPPORT
  225. #define DALLAS_SUPPORT 1
  226. #endif
  227. #define DALLAS_PIN 14
  228. #ifndef DHT_SUPPORT
  229. #define DHT_SUPPORT 1
  230. #endif
  231. #define DHT_PIN 14
  232. //#define I2C_SDA_PIN 4
  233. //#define I2C_SCL_PIN 14
  234. #elif defined(ITEAD_SONOFF_SV)
  235. // Info
  236. #define MANUFACTURER "ITEAD"
  237. #define DEVICE "SONOFF_SV"
  238. // Buttons
  239. #define BUTTON1_PIN 0
  240. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  241. #define BUTTON1_RELAY 1
  242. // Relays
  243. #define RELAY1_PIN 12
  244. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  245. // LEDs
  246. #define LED1_PIN 13
  247. #define LED1_PIN_INVERSE 1
  248. #elif defined(ITEAD_SLAMPHER)
  249. // Info
  250. #define MANUFACTURER "ITEAD"
  251. #define DEVICE "SLAMPHER"
  252. // Buttons
  253. #define BUTTON1_PIN 0
  254. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  255. #define BUTTON1_RELAY 1
  256. // Relays
  257. #define RELAY1_PIN 12
  258. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  259. // LEDs
  260. #define LED1_PIN 13
  261. #define LED1_PIN_INVERSE 1
  262. #elif defined(ITEAD_S20)
  263. // Info
  264. #define MANUFACTURER "ITEAD"
  265. #define DEVICE "S20"
  266. // Buttons
  267. #define BUTTON1_PIN 0
  268. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  269. #define BUTTON1_RELAY 1
  270. // Relays
  271. #define RELAY1_PIN 12
  272. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  273. // LEDs
  274. #define LED1_PIN 13
  275. #define LED1_PIN_INVERSE 1
  276. #elif defined(ITEAD_SONOFF_TOUCH)
  277. // Info
  278. #define MANUFACTURER "ITEAD"
  279. #define DEVICE "SONOFF_TOUCH"
  280. // Buttons
  281. #define BUTTON1_PIN 0
  282. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  283. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  284. #define BUTTON1_CLICK BUTTON_MODE_NONE
  285. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  286. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  287. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  288. #define BUTTON1_RELAY 1
  289. // Relays
  290. #define RELAY1_PIN 12
  291. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  292. // LEDs
  293. #define LED1_PIN 13
  294. #define LED1_PIN_INVERSE 1
  295. #elif defined(ITEAD_SONOFF_POW)
  296. // Info
  297. #define MANUFACTURER "ITEAD"
  298. #define DEVICE "SONOFF_POW"
  299. // Buttons
  300. #define BUTTON1_PIN 0
  301. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  302. #define BUTTON1_RELAY 1
  303. // Relays
  304. #define RELAY1_PIN 12
  305. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  306. // LEDs
  307. #define LED1_PIN 15
  308. #define LED1_PIN_INVERSE 0
  309. // HLW8012
  310. #ifndef HLW8012_SUPPORT
  311. #define HLW8012_SUPPORT 1
  312. #endif
  313. #define HLW8012_SEL_PIN 5
  314. #define HLW8012_CF1_PIN 13
  315. #define HLW8012_CF_PIN 14
  316. #elif defined(ITEAD_SONOFF_DUAL)
  317. // Info
  318. #define MANUFACTURER "ITEAD"
  319. #define DEVICE "SONOFF_DUAL"
  320. #define SERIAL_BAUDRATE 19230
  321. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  322. #define DUMMY_RELAY_COUNT 2
  323. #define DEBUG_SERIAL_SUPPORT 0
  324. #define TERMINAL_SUPPORT 0
  325. // Buttons
  326. #define BUTTON3_RELAY 1
  327. // LEDs
  328. #define LED1_PIN 13
  329. #define LED1_PIN_INVERSE 1
  330. #elif defined(ITEAD_SONOFF_DUAL_R2)
  331. #define MANUFACTURER "ITEAD"
  332. #define DEVICE "SONOFF_DUAL_R2"
  333. // Buttons
  334. #define BUTTON1_PIN 0 // Button 0 on header
  335. #define BUTTON2_PIN 9 // Button 1 on header
  336. #define BUTTON3_PIN 10 // Physical button
  337. #define BUTTON1_RELAY 1
  338. #define BUTTON2_RELAY 2
  339. #define BUTTON3_RELAY 1
  340. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  341. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  342. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  343. // Relays
  344. #define RELAY1_PIN 12
  345. #define RELAY2_PIN 5
  346. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  347. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  348. // LEDs
  349. #define LED1_PIN 13
  350. #define LED1_PIN_INVERSE 1
  351. #elif defined(ITEAD_SONOFF_4CH)
  352. // Info
  353. #define MANUFACTURER "ITEAD"
  354. #define DEVICE "SONOFF_4CH"
  355. // Buttons
  356. #define BUTTON1_PIN 0
  357. #define BUTTON2_PIN 9
  358. #define BUTTON3_PIN 10
  359. #define BUTTON4_PIN 14
  360. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  361. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  362. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  363. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  364. #define BUTTON1_RELAY 1
  365. #define BUTTON2_RELAY 2
  366. #define BUTTON3_RELAY 3
  367. #define BUTTON4_RELAY 4
  368. // Relays
  369. #define RELAY1_PIN 12
  370. #define RELAY2_PIN 5
  371. #define RELAY3_PIN 4
  372. #define RELAY4_PIN 15
  373. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  374. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  375. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  376. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  377. // LEDs
  378. #define LED1_PIN 13
  379. #define LED1_PIN_INVERSE 1
  380. #elif defined(ITEAD_SONOFF_4CH_PRO)
  381. // Info
  382. #define MANUFACTURER "ITEAD"
  383. #define DEVICE "SONOFF_4CH_PRO"
  384. // Buttons
  385. #define BUTTON1_PIN 0
  386. #define BUTTON2_PIN 9
  387. #define BUTTON3_PIN 10
  388. #define BUTTON4_PIN 14
  389. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  390. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  391. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  392. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  393. #define BUTTON1_RELAY 1
  394. #define BUTTON2_RELAY 2
  395. #define BUTTON3_RELAY 3
  396. #define BUTTON4_RELAY 4
  397. // Sonoff 4CH Pro uses a secondary STM32 microcontroller to handle
  398. // buttons and relays, but it also forwards button presses to the ESP8285.
  399. // This allows ESPurna to handle button presses -almost- the same way
  400. // as with other devices except:
  401. // * Double click seems to break/disable the button on the STM32 side
  402. // * With S6 switch to 1 (self-locking and inching modes) everything's OK
  403. // * With S6 switch to 0 (interlock mode) if there is a relay ON
  404. // and you click on another relay button, the STM32 sends a "press"
  405. // event for the button of the first relay (to turn it OFF) but it
  406. // does not send a "release" event. It's like it's holding the
  407. // button down since you can see it is still LOW.
  408. // Whatever reason the result is that it may actually perform a
  409. // long click or long-long click.
  410. // The configuration below make the button toggle the relay on press events
  411. // and disables any possibly harmful combination with S6 set to 0.
  412. // If you are sure you will only use S6 to 1 you can comment the
  413. // BUTTON1_LNGCLICK and BUTTON1_LNGLNGCLICK options below to recover the
  414. // reset mode and factory reset functionalities, or link other actions like
  415. // AP mode in the commented line below.
  416. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  417. #define BUTTON1_CLICK BUTTON_MODE_NONE
  418. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  419. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  420. //#define BUTTON1_LNGCLICK BUTTON_MODE_AP
  421. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  422. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  423. #define BUTTON2_CLICK BUTTON_MODE_NONE
  424. #define BUTTON3_PRESS BUTTON_MODE_TOGGLE
  425. #define BUTTON3_CLICK BUTTON_MODE_NONE
  426. #define BUTTON4_PRESS BUTTON_MODE_TOGGLE
  427. #define BUTTON4_CLICK BUTTON_MODE_NONE
  428. // Relays
  429. #define RELAY1_PIN 12
  430. #define RELAY2_PIN 5
  431. #define RELAY3_PIN 4
  432. #define RELAY4_PIN 15
  433. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  434. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  435. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  436. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  437. // LEDs
  438. #define LED1_PIN 13
  439. #define LED1_PIN_INVERSE 1
  440. #elif defined(ITEAD_1CH_INCHING)
  441. // The inching functionality is managed by a misterious IC in the board.
  442. // You cannot control the inching button and functionality from the ESP8266
  443. // Besides, enabling the inching functionality using the hardware button
  444. // will result in the relay switching on and off continuously.
  445. // Fortunately the unkown IC keeps memory of the hardware inching status
  446. // so you can just disable it and forget. The inching LED must be lit.
  447. // You can still use the pulse options from the web interface
  448. // without problem.
  449. // Info
  450. #define MANUFACTURER "ITEAD"
  451. #define DEVICE "1CH_INCHING"
  452. // Buttons
  453. #define BUTTON1_PIN 0
  454. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  455. #define BUTTON1_RELAY 1
  456. // Relays
  457. #define RELAY1_PIN 12
  458. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  459. // LEDs
  460. #define LED1_PIN 13
  461. #define LED1_PIN_INVERSE 1
  462. #elif defined(ITEAD_MOTOR)
  463. // Info
  464. #define MANUFACTURER "ITEAD"
  465. #define DEVICE "MOTOR"
  466. // Buttons
  467. #define BUTTON1_PIN 0
  468. #define BUTTON1_RELAY 1
  469. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  470. // Relays
  471. #define RELAY1_PIN 12
  472. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  473. // LEDs
  474. #define LED1_PIN 13
  475. #define LED1_PIN_INVERSE 1
  476. #elif defined(ITEAD_BNSZ01)
  477. // Info
  478. #define MANUFACTURER "ITEAD"
  479. #define DEVICE "BNSZ01"
  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 13
  485. #define LED1_PIN_INVERSE 1
  486. // Light
  487. #define LIGHT_CHANNELS 1
  488. #define LIGHT_CH1_PIN 12
  489. #define LIGHT_CH1_INVERSE 0
  490. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  491. // Info
  492. #define MANUFACTURER "ITEAD"
  493. #define DEVICE "SONOFF_RFBRIDGE"
  494. #define SERIAL_BAUDRATE 19200
  495. #define RELAY_PROVIDER RELAY_PROVIDER_RFBRIDGE
  496. #ifndef DUMMY_RELAY_COUNT
  497. #define DUMMY_RELAY_COUNT 8
  498. #endif
  499. // Remove UART noise on serial line
  500. #define TERMINAL_SUPPORT 0
  501. #define DEBUG_SERIAL_SUPPORT 0
  502. // Buttons
  503. #define BUTTON1_PIN 0
  504. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  505. // LEDs
  506. #define LED1_PIN 13
  507. #define LED1_PIN_INVERSE 1
  508. #elif defined(ITEAD_SONOFF_B1)
  509. // Info
  510. #define MANUFACTURER "ITEAD"
  511. #define DEVICE "SONOFF_B1"
  512. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  513. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  514. #define DUMMY_RELAY_COUNT 1
  515. // Light
  516. #define LIGHT_CHANNELS 5
  517. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  518. #define MY92XX_CHIPS 2
  519. #define MY92XX_DI_PIN 12
  520. #define MY92XX_DCKI_PIN 14
  521. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  522. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  523. #elif defined(ITEAD_SONOFF_LED)
  524. // Info
  525. #define MANUFACTURER "ITEAD"
  526. #define DEVICE "SONOFF_LED"
  527. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  528. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  529. #define DUMMY_RELAY_COUNT 1
  530. // LEDs
  531. #define LED1_PIN 13
  532. #define LED1_PIN_INVERSE 1
  533. // Light
  534. #define LIGHT_CHANNELS 2
  535. #define LIGHT_CH1_PIN 12 // Cold white
  536. #define LIGHT_CH2_PIN 14 // Warm white
  537. #define LIGHT_CH1_INVERSE 0
  538. #define LIGHT_CH2_INVERSE 0
  539. #elif defined(ITEAD_SONOFF_T1_1CH)
  540. // Info
  541. #define MANUFACTURER "ITEAD"
  542. #define DEVICE "SONOFF_T1_1CH"
  543. // Buttons
  544. #define BUTTON1_PIN 0
  545. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  546. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  547. #define BUTTON1_CLICK BUTTON_MODE_NONE
  548. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  549. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  550. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  551. #define BUTTON1_RELAY 1
  552. // Relays
  553. #define RELAY1_PIN 12
  554. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  555. // LEDs
  556. #define LED1_PIN 13
  557. #define LED1_PIN_INVERSE 1
  558. #elif defined(ITEAD_SONOFF_T1_2CH)
  559. // Info
  560. #define MANUFACTURER "ITEAD"
  561. #define DEVICE "SONOFF_T1_2CH"
  562. // Buttons
  563. #define BUTTON1_PIN 0
  564. #define BUTTON2_PIN 9
  565. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  566. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  567. #define BUTTON1_CLICK BUTTON_MODE_NONE
  568. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  569. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  570. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  571. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  572. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  573. #define BUTTON2_CLICK BUTTON_MODE_NONE
  574. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  575. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  576. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  577. #define BUTTON1_RELAY 1
  578. #define BUTTON2_RELAY 2
  579. // Relays
  580. #define RELAY1_PIN 12
  581. #define RELAY2_PIN 5
  582. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  583. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  584. // LEDs
  585. #define LED1_PIN 13
  586. #define LED1_PIN_INVERSE 1
  587. #elif defined(ITEAD_SONOFF_T1_3CH)
  588. // Info
  589. #define MANUFACTURER "ITEAD"
  590. #define DEVICE "SONOFF_T1_3CH"
  591. // Buttons
  592. #define BUTTON1_PIN 0
  593. #define BUTTON2_PIN 9
  594. #define BUTTON3_PIN 10
  595. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  596. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  597. #define BUTTON1_CLICK BUTTON_MODE_NONE
  598. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  599. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  600. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  601. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  602. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  603. #define BUTTON2_CLICK BUTTON_MODE_NONE
  604. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  605. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  606. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  607. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  608. #define BUTTON3_PRESS BUTTON_MODE_TOGGLE
  609. #define BUTTON3_CLICK BUTTON_MODE_NONE
  610. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  611. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  612. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_RESET
  613. #define BUTTON1_RELAY 1
  614. #define BUTTON2_RELAY 2
  615. #define BUTTON3_RELAY 3
  616. // Relays
  617. #define RELAY1_PIN 12
  618. #define RELAY2_PIN 5
  619. #define RELAY3_PIN 4
  620. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  621. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  622. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  623. // LEDs
  624. #define LED1_PIN 13
  625. #define LED1_PIN_INVERSE 1
  626. // -----------------------------------------------------------------------------
  627. // YJZK
  628. // -----------------------------------------------------------------------------
  629. #elif defined(YJZK_SWITCH_2CH)
  630. // Info
  631. #define MANUFACTURER "YJZK"
  632. #define DEVICE "SWITCH_2CH"
  633. // Buttons
  634. #define BUTTON1_PIN 0
  635. #define BUTTON2_PIN 9
  636. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  637. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  638. #define BUTTON1_RELAY 1
  639. #define BUTTON2_RELAY 2
  640. // Relays
  641. #define RELAY1_PIN 12
  642. #define RELAY2_PIN 5
  643. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  644. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  645. // LEDs
  646. #define LED1_PIN 13
  647. #define LED1_PIN_INVERSE 0
  648. // -----------------------------------------------------------------------------
  649. // Electrodragon boards
  650. // -----------------------------------------------------------------------------
  651. #elif defined(ELECTRODRAGON_WIFI_IOT)
  652. // Info
  653. #define MANUFACTURER "ELECTRODRAGON"
  654. #define DEVICE "WIFI_IOT"
  655. // Buttons
  656. #define BUTTON1_PIN 0
  657. #define BUTTON2_PIN 2
  658. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  659. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  660. #define BUTTON1_RELAY 1
  661. #define BUTTON2_RELAY 2
  662. // Relays
  663. #define RELAY1_PIN 12
  664. #define RELAY2_PIN 13
  665. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  666. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  667. // LEDs
  668. #define LED1_PIN 16
  669. #define LED1_PIN_INVERSE 0
  670. // -----------------------------------------------------------------------------
  671. // WorkChoice ecoPlug
  672. // -----------------------------------------------------------------------------
  673. #elif defined(WORKCHOICE_ECOPLUG)
  674. // Info
  675. #define MANUFACTURER "WORKCHOICE"
  676. #define DEVICE "ECOPLUG"
  677. // Buttons
  678. #define BUTTON1_PIN 13
  679. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  680. #define BUTTON1_RELAY 1
  681. // Relays
  682. #define RELAY1_PIN 15
  683. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  684. // LEDs
  685. #define LED1_PIN 2
  686. #define LED1_PIN_INVERSE 0
  687. // -----------------------------------------------------------------------------
  688. // AI Thinker
  689. // -----------------------------------------------------------------------------
  690. #elif defined(AITHINKER_AI_LIGHT)
  691. // Info
  692. #define MANUFACTURER "AITHINKER"
  693. #define DEVICE "AI_LIGHT"
  694. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  695. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  696. #define DUMMY_RELAY_COUNT 1
  697. // Light
  698. #define LIGHT_CHANNELS 4
  699. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  700. #define MY92XX_CHIPS 1
  701. #define MY92XX_DI_PIN 13
  702. #define MY92XX_DCKI_PIN 15
  703. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  704. #define MY92XX_MAPPING 0, 1, 2, 3
  705. // -----------------------------------------------------------------------------
  706. // LED Controller
  707. // -----------------------------------------------------------------------------
  708. #elif defined(MAGICHOME_LED_CONTROLLER)
  709. // Info
  710. #define MANUFACTURER "MAGICHOME"
  711. #define DEVICE "LED_CONTROLLER"
  712. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  713. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  714. #define DUMMY_RELAY_COUNT 1
  715. // LEDs
  716. #define LED1_PIN 2
  717. #define LED1_PIN_INVERSE 1
  718. // Light
  719. #define LIGHT_CHANNELS 4
  720. #define LIGHT_CH1_PIN 14 // RED
  721. #define LIGHT_CH2_PIN 5 // GREEN
  722. #define LIGHT_CH3_PIN 12 // BLUE
  723. #define LIGHT_CH4_PIN 13 // WHITE
  724. #define LIGHT_CH1_INVERSE 0
  725. #define LIGHT_CH2_INVERSE 0
  726. #define LIGHT_CH3_INVERSE 0
  727. #define LIGHT_CH4_INVERSE 0
  728. // IR
  729. #define IR_SUPPORT 1
  730. #define IR_PIN 4
  731. #define IR_BUTTON_SET 1
  732. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  733. // Info
  734. #define MANUFACTURER "MAGICHOME"
  735. #define DEVICE "LED_CONTROLLER_20"
  736. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  737. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  738. #define DUMMY_RELAY_COUNT 1
  739. // LEDs
  740. #define LED1_PIN 2
  741. #define LED1_PIN_INVERSE 1
  742. // Light
  743. #define LIGHT_CHANNELS 4
  744. #define LIGHT_CH1_PIN 5 // RED
  745. #define LIGHT_CH2_PIN 12 // GREEN
  746. #define LIGHT_CH3_PIN 13 // BLUE
  747. #define LIGHT_CH4_PIN 15 // WHITE
  748. #define LIGHT_CH1_INVERSE 0
  749. #define LIGHT_CH2_INVERSE 0
  750. #define LIGHT_CH3_INVERSE 0
  751. #define LIGHT_CH4_INVERSE 0
  752. // IR
  753. #define IR_SUPPORT 1
  754. #define IR_PIN 4
  755. #define IR_BUTTON_SET 1
  756. // -----------------------------------------------------------------------------
  757. // HUACANXING H801 & H802
  758. // -----------------------------------------------------------------------------
  759. #elif defined(HUACANXING_H801)
  760. // Info
  761. #define MANUFACTURER "HUACANXING"
  762. #define DEVICE "H801"
  763. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  764. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  765. #define DUMMY_RELAY_COUNT 1
  766. #define DEBUG_PORT Serial1
  767. #define SERIAL_RX_ENABLED 1
  768. // LEDs
  769. #define LED1_PIN 5
  770. #define LED1_PIN_INVERSE 1
  771. // Light
  772. #define LIGHT_CHANNELS 5
  773. #define LIGHT_CH1_PIN 15 // RED
  774. #define LIGHT_CH2_PIN 13 // GREEN
  775. #define LIGHT_CH3_PIN 12 // BLUE
  776. #define LIGHT_CH4_PIN 14 // WHITE1
  777. #define LIGHT_CH5_PIN 4 // WHITE2
  778. #define LIGHT_CH1_INVERSE 0
  779. #define LIGHT_CH2_INVERSE 0
  780. #define LIGHT_CH3_INVERSE 0
  781. #define LIGHT_CH4_INVERSE 0
  782. #define LIGHT_CH5_INVERSE 0
  783. #elif defined(HUACANXING_H802)
  784. // Info
  785. #define MANUFACTURER "HUACANXING"
  786. #define DEVICE "H802"
  787. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  788. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  789. #define DUMMY_RELAY_COUNT 1
  790. #define DEBUG_PORT Serial1
  791. #define SERIAL_RX_ENABLED 1
  792. // Light
  793. #define LIGHT_CHANNELS 4
  794. #define LIGHT_CH1_PIN 12 // RED
  795. #define LIGHT_CH2_PIN 14 // GREEN
  796. #define LIGHT_CH3_PIN 13 // BLUE
  797. #define LIGHT_CH4_PIN 15 // WHITE
  798. #define LIGHT_CH1_INVERSE 0
  799. #define LIGHT_CH2_INVERSE 0
  800. #define LIGHT_CH3_INVERSE 0
  801. #define LIGHT_CH4_INVERSE 0
  802. // -----------------------------------------------------------------------------
  803. // Jan Goedeke Wifi Relay
  804. // https://github.com/JanGoe/esp8266-wifi-relay
  805. // -----------------------------------------------------------------------------
  806. #elif defined(JANGOE_WIFI_RELAY_NC)
  807. // Info
  808. #define MANUFACTURER "JANGOE"
  809. #define DEVICE "WIFI_RELAY_NC"
  810. // Buttons
  811. #define BUTTON1_PIN 12
  812. #define BUTTON2_PIN 13
  813. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  814. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  815. #define BUTTON1_RELAY 1
  816. #define BUTTON2_RELAY 2
  817. // Relays
  818. #define RELAY1_PIN 2
  819. #define RELAY2_PIN 14
  820. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  821. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  822. #elif defined(JANGOE_WIFI_RELAY_NO)
  823. // Info
  824. #define MANUFACTURER "JANGOE"
  825. #define DEVICE "WIFI_RELAY_NO"
  826. // Buttons
  827. #define BUTTON1_PIN 12
  828. #define BUTTON2_PIN 13
  829. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  830. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  831. #define BUTTON1_RELAY 1
  832. #define BUTTON2_RELAY 2
  833. // Relays
  834. #define RELAY1_PIN 2
  835. #define RELAY2_PIN 14
  836. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  837. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  838. // -----------------------------------------------------------------------------
  839. // Jorge García Wifi+Relays Board Kit
  840. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  841. // https://github.com/jorgegarciadev/wifikit
  842. // -----------------------------------------------------------------------------
  843. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  844. // Info
  845. #define MANUFACTURER "JORGEGARCIA"
  846. #define DEVICE "WIFI_RELAYS"
  847. // Relays
  848. #define RELAY1_PIN 0
  849. #define RELAY2_PIN 2
  850. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  851. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  852. // -----------------------------------------------------------------------------
  853. // WiFi MQTT Relay / Thermostat
  854. // -----------------------------------------------------------------------------
  855. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  856. // Info
  857. #define MANUFACTURER "OPENENERGYMONITOR"
  858. #define DEVICE "MQTT_RELAY"
  859. // Buttons
  860. #define BUTTON1_PIN 0
  861. #define BUTTON1_RELAY 1
  862. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  863. // Relays
  864. #define RELAY1_PIN 12
  865. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  866. // LEDs
  867. #define LED1_PIN 16
  868. #define LED1_PIN_INVERSE 0
  869. // -----------------------------------------------------------------------------
  870. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  871. // 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
  872. // 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
  873. // -----------------------------------------------------------------------------
  874. #elif defined(WION_50055)
  875. // Currently untested, does not support energy monitoring
  876. // Info
  877. #define MANUFACTURER "WION"
  878. #define DEVICE "50055"
  879. // Buttons
  880. #define BUTTON1_PIN 13
  881. #define BUTTON1_RELAY 1
  882. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  883. // Relays
  884. #define RELAY1_PIN 15
  885. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  886. // LEDs
  887. #define LED1_PIN 2
  888. #define LED1_PIN_INVERSE 0
  889. // -----------------------------------------------------------------------------
  890. // EX-Store Wifi Relay v3.1
  891. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  892. // -----------------------------------------------------------------------------
  893. #elif defined(EXS_WIFI_RELAY_V31)
  894. // Untested
  895. // Info
  896. #define MANUFACTURER "EXS"
  897. #define DEVICE "WIFI_RELAY_V31"
  898. // Buttons
  899. #define BUTTON1_PIN 0
  900. #define BUTTON1_RELAY 1
  901. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  902. // Relays
  903. #define RELAY1_PIN 13
  904. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  905. #define RELAY1_RESET_PIN 12
  906. // -----------------------------------------------------------------------------
  907. // V9261F
  908. // -----------------------------------------------------------------------------
  909. #elif defined(GENERIC_V9261F)
  910. // Info
  911. #define MANUFACTURER "GENERIC"
  912. #define DEVICE "V9261F"
  913. #define ALEXA_SUPPORT 0
  914. // V9261F
  915. #define V9261F_SUPPORT 1
  916. #define V9261F_PIN 2
  917. #define V9261F_PIN_INVERSE 1
  918. // -----------------------------------------------------------------------------
  919. // ECH1560
  920. // -----------------------------------------------------------------------------
  921. #elif defined(GENERIC_ECH1560)
  922. // Info
  923. #define MANUFACTURER "GENERIC"
  924. #define DEVICE "ECH1560"
  925. #define ALEXA_SUPPORT 0
  926. // ECH1560
  927. #define ECH1560_SUPPORT 1
  928. #define ECH1560_CLK_PIN 4
  929. #define ECH1560_MISO_PIN 5
  930. #define ECH1560_INVERTED 0
  931. // -----------------------------------------------------------------------------
  932. // ESPLive
  933. // https://github.com/ManCaveMade/ESP-Live
  934. // -----------------------------------------------------------------------------
  935. #elif defined(MANCAVEMADE_ESPLIVE)
  936. // Info
  937. #define MANUFACTURER "MANCAVEMADE"
  938. #define DEVICE "ESPLIVE"
  939. // Buttons
  940. #define BUTTON1_PIN 4
  941. #define BUTTON2_PIN 5
  942. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  943. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  944. #define BUTTON1_RELAY 1
  945. #define BUTTON2_RELAY 2
  946. // Relays
  947. #define RELAY1_PIN 12
  948. #define RELAY2_PIN 13
  949. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  950. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  951. // DB18B20
  952. #ifndef DALLAS_SUPPORT
  953. #define DALLAS_SUPPORT 1
  954. #endif
  955. #define DALLAS_PIN 2
  956. #define DALLAS_UPDATE_INTERVAL 5000
  957. #define TEMPERATURE_MIN_CHANGE 1.0
  958. // -----------------------------------------------------------------------------
  959. // QuinLED
  960. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  961. // -----------------------------------------------------------------------------
  962. #elif defined(INTERMITTECH_QUINLED)
  963. // Info
  964. #define MANUFACTURER "INTERMITTECH"
  965. #define DEVICE "QUINLED"
  966. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  967. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  968. #define DUMMY_RELAY_COUNT 1
  969. // LEDs
  970. #define LED1_PIN 5
  971. #define LED1_PIN_INVERSE 1
  972. // Light
  973. #define LIGHT_CHANNELS 2
  974. #define LIGHT_CH1_PIN 0
  975. #define LIGHT_CH2_PIN 2
  976. #define LIGHT_CH1_INVERSE 0
  977. #define LIGHT_CH2_INVERSE 0
  978. // -----------------------------------------------------------------------------
  979. // Arilux AL-LC06
  980. // -----------------------------------------------------------------------------
  981. #elif defined(ARILUX_AL_LC01)
  982. // Info
  983. #define MANUFACTURER "ARILUX"
  984. #define DEVICE "AL_LC01"
  985. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  986. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  987. #define DUMMY_RELAY_COUNT 1
  988. // Light
  989. #define LIGHT_CHANNELS 4
  990. #define LIGHT_CH1_PIN 5 // RED
  991. #define LIGHT_CH2_PIN 12 // GREEN
  992. #define LIGHT_CH3_PIN 13 // BLUE
  993. #define LIGHT_CH4_PIN 14 // WHITE1
  994. #define LIGHT_CH1_INVERSE 0
  995. #define LIGHT_CH2_INVERSE 0
  996. #define LIGHT_CH3_INVERSE 0
  997. #define LIGHT_CH4_INVERSE 0
  998. #elif defined(ARILUX_AL_LC02)
  999. // Info
  1000. #define MANUFACTURER "ARILUX"
  1001. #define DEVICE "AL_LC02"
  1002. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1003. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1004. #define DUMMY_RELAY_COUNT 1
  1005. // Light
  1006. #define LIGHT_CHANNELS 4
  1007. #define LIGHT_CH1_PIN 12 // RED
  1008. #define LIGHT_CH2_PIN 5 // GREEN
  1009. #define LIGHT_CH3_PIN 13 // BLUE
  1010. #define LIGHT_CH4_PIN 15 // WHITE1
  1011. #define LIGHT_CH1_INVERSE 0
  1012. #define LIGHT_CH2_INVERSE 0
  1013. #define LIGHT_CH3_INVERSE 0
  1014. #define LIGHT_CH4_INVERSE 0
  1015. #elif defined(ARILUX_AL_LC06)
  1016. // Info
  1017. #define MANUFACTURER "ARILUX"
  1018. #define DEVICE "AL_LC06"
  1019. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1020. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1021. #define DUMMY_RELAY_COUNT 1
  1022. // Light
  1023. #define LIGHT_CHANNELS 5
  1024. #define LIGHT_CH1_PIN 14 // RED
  1025. #define LIGHT_CH2_PIN 12 // GREEN
  1026. #define LIGHT_CH3_PIN 13 // BLUE
  1027. #define LIGHT_CH4_PIN 15 // WHITE1
  1028. #define LIGHT_CH5_PIN 5 // WHITE2
  1029. #define LIGHT_CH1_INVERSE 0
  1030. #define LIGHT_CH2_INVERSE 0
  1031. #define LIGHT_CH3_INVERSE 0
  1032. #define LIGHT_CH4_INVERSE 0
  1033. #define LIGHT_CH5_INVERSE 0
  1034. #elif defined(ARILUX_AL_LC11)
  1035. // Info
  1036. #define MANUFACTURER "ARILUX"
  1037. #define DEVICE "AL_LC11"
  1038. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1039. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1040. #define DUMMY_RELAY_COUNT 1
  1041. // Light
  1042. #define LIGHT_CHANNELS 5
  1043. #define LIGHT_CH1_PIN 5 // RED
  1044. #define LIGHT_CH2_PIN 4 // GREEN
  1045. #define LIGHT_CH3_PIN 14 // BLUE
  1046. #define LIGHT_CH4_PIN 13 // WHITE1
  1047. #define LIGHT_CH5_PIN 12 // WHITE1
  1048. #define LIGHT_CH1_INVERSE 0
  1049. #define LIGHT_CH2_INVERSE 0
  1050. #define LIGHT_CH3_INVERSE 0
  1051. #define LIGHT_CH4_INVERSE 0
  1052. #define LIGHT_CH5_INVERSE 0
  1053. #elif defined(ARILUX_E27)
  1054. // Info
  1055. #define MANUFACTURER "ARILUX"
  1056. #define DEVICE "E27"
  1057. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1058. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1059. #define DUMMY_RELAY_COUNT 1
  1060. // Light
  1061. #define LIGHT_CHANNELS 4
  1062. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  1063. #define MY92XX_CHIPS 1
  1064. #define MY92XX_DI_PIN 13
  1065. #define MY92XX_DCKI_PIN 15
  1066. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1067. #define MY92XX_MAPPING 0, 1, 2, 3
  1068. // -----------------------------------------------------------------------------
  1069. // XENON SM-PW701U
  1070. // -----------------------------------------------------------------------------
  1071. #elif defined(XENON_SM_PW702U)
  1072. // Info
  1073. #define MANUFACTURER "XENON"
  1074. #define DEVICE "SM_PW702U"
  1075. // Buttons
  1076. #define BUTTON1_PIN 13
  1077. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1078. #define BUTTON1_RELAY 1
  1079. // Relays
  1080. #define RELAY1_PIN 12
  1081. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1082. // LEDs
  1083. #define LED1_PIN 4
  1084. #define LED1_PIN_INVERSE 1
  1085. // -----------------------------------------------------------------------------
  1086. // AUTHOMETION LYT8266
  1087. // https://authometion.com/shop/en/home/13-lyt8266.html
  1088. // -----------------------------------------------------------------------------
  1089. #elif defined(AUTHOMETION_LYT8266)
  1090. // Info
  1091. #define MANUFACTURER "AUTHOMETION"
  1092. #define DEVICE "LYT8266"
  1093. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1094. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1095. #define DUMMY_RELAY_COUNT 1
  1096. // Light
  1097. #define LIGHT_CHANNELS 4
  1098. #define LIGHT_CH1_PIN 13 // RED
  1099. #define LIGHT_CH2_PIN 12 // GREEN
  1100. #define LIGHT_CH3_PIN 14 // BLUE
  1101. #define LIGHT_CH4_PIN 2 // WHITE
  1102. #define LIGHT_CH1_INVERSE 0
  1103. #define LIGHT_CH2_INVERSE 0
  1104. #define LIGHT_CH3_INVERSE 0
  1105. #define LIGHT_CH4_INVERSE 0
  1106. #define LIGHT_ENABLE_PIN 15
  1107. #elif defined(GIZWITS_WITTY_CLOUD)
  1108. // Info
  1109. #define MANUFACTURER "GIZWITS"
  1110. #define DEVICE "WITTY_CLOUD"
  1111. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1112. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1113. #define DUMMY_RELAY_COUNT 1
  1114. // Buttons
  1115. #define BUTTON1_PIN 4
  1116. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1117. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  1118. #define BUTTON1_CLICK BUTTON_MODE_NONE
  1119. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1120. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1121. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  1122. #define ANALOG_SUPPORT 1
  1123. // LEDs
  1124. #define LED1_PIN 2 // BLUE build-in
  1125. #define LED1_PIN_INVERSE 1
  1126. // Light
  1127. #define LIGHT_CHANNELS 3
  1128. #define LIGHT_CH1_PIN 15 // RED
  1129. #define LIGHT_CH2_PIN 12 // GREEN
  1130. #define LIGHT_CH3_PIN 13 // BLUE
  1131. #define LIGHT_CH1_INVERSE 0
  1132. #define LIGHT_CH2_INVERSE 0
  1133. #define LIGHT_CH3_INVERSE 0
  1134. // -----------------------------------------------------------------------------
  1135. // KMC 70011
  1136. // https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
  1137. // -----------------------------------------------------------------------------
  1138. #elif defined(KMC_70011)
  1139. // Info
  1140. #define MANUFACTURER "KMC"
  1141. #define DEVICE "70011"
  1142. // Buttons
  1143. #define BUTTON1_PIN 0
  1144. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1145. #define BUTTON1_RELAY 1
  1146. // Relays
  1147. #define RELAY1_PIN 14
  1148. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1149. // LEDs
  1150. #define LED1_PIN 13
  1151. #define LED1_PIN_INVERSE 0
  1152. // HLW8012
  1153. #ifndef HLW8012_SUPPORT
  1154. #define HLW8012_SUPPORT 1
  1155. #endif
  1156. #define HLW8012_SEL_PIN 12
  1157. #define HLW8012_CF1_PIN 5
  1158. #define HLW8012_CF_PIN 4
  1159. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1160. // -----------------------------------------------------------------------------
  1161. // Euromate (?) Wifi Stecker Shuko
  1162. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  1163. // Thanks to @Geitde
  1164. // -----------------------------------------------------------------------------
  1165. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  1166. // Info
  1167. #define MANUFACTURER "EUROMATE"
  1168. #define DEVICE "WIFI_STECKER_SCHUKO"
  1169. // Buttons
  1170. #define BUTTON1_PIN 14
  1171. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1172. #define BUTTON1_RELAY 1
  1173. // The relay in the device is not a bistable (latched) relay.
  1174. // The device is reported to have a flip-flop circuit to drive the relay
  1175. // So @Geitde hack is still the only possible
  1176. // Hack: drive GPIO12 low and use GPIO5 as normal relay pin:
  1177. #define RELAY1_PIN 5
  1178. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1179. #define LED2_PIN 12 /* DUMMY: exploit default off state for GPIO12=low */
  1180. #define LED2_PIN_INVERSE 0
  1181. // LEDs
  1182. #define LED1_PIN 4
  1183. #define LED1_PIN_INVERSE 0
  1184. // -----------------------------------------------------------------------------
  1185. // Generic 8CH
  1186. // -----------------------------------------------------------------------------
  1187. #elif defined(GENERIC_8CH)
  1188. // Info
  1189. #define MANUFACTURER "GENERIC"
  1190. #define DEVICE "8CH"
  1191. // Relays
  1192. #define RELAY1_PIN 0
  1193. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1194. #define RELAY2_PIN 2
  1195. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1196. #define RELAY3_PIN 4
  1197. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1198. #define RELAY4_PIN 5
  1199. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1200. #define RELAY5_PIN 12
  1201. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1202. #define RELAY6_PIN 13
  1203. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  1204. #define RELAY7_PIN 14
  1205. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  1206. #define RELAY8_PIN 15
  1207. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  1208. // -----------------------------------------------------------------------------
  1209. // STM RELAY
  1210. // -----------------------------------------------------------------------------
  1211. #elif defined(STM_RELAY)
  1212. // Info
  1213. #define MANUFACTURER "STM_RELAY"
  1214. #define DEVICE "2CH"
  1215. // Relays
  1216. #define DUMMY_RELAY_COUNT 2
  1217. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  1218. // Remove UART noise on serial line
  1219. #define TERMINAL_SUPPORT 0
  1220. #define DEBUG_SERIAL_SUPPORT 0
  1221. // -----------------------------------------------------------------------------
  1222. // Tonbux Powerstrip02
  1223. // -----------------------------------------------------------------------------
  1224. #elif defined(TONBUX_POWERSTRIP02)
  1225. // Info
  1226. #define MANUFACTURER "TONBUX"
  1227. #define DEVICE "POWERSTRIP02"
  1228. // Buttons
  1229. #define BUTTON1_PIN 5
  1230. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1231. #define BUTTON1_RELAY 0
  1232. // Relays
  1233. #define RELAY1_PIN 4
  1234. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1235. #define RELAY2_PIN 13
  1236. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1237. #define RELAY3_PIN 12
  1238. #define RELAY3_TYPE RELAY_TYPE_INVERSE
  1239. #define RELAY4_PIN 14
  1240. #define RELAY4_TYPE RELAY_TYPE_INVERSE
  1241. // Not a relay. USB ports on/off
  1242. #define RELAY5_PIN 16
  1243. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1244. // LEDs
  1245. #define LED1_PIN 0 // 1 blue led
  1246. #define LED1_PIN_INVERSE 1
  1247. #define LED2_PIN 3 // 3 red leds
  1248. #define LED2_PIN_INVERSE 1
  1249. // -----------------------------------------------------------------------------
  1250. // Lingan SWA1
  1251. // -----------------------------------------------------------------------------
  1252. #elif defined(LINGAN_SWA1)
  1253. // Info
  1254. #define MANUFACTURER "LINGAN"
  1255. #define DEVICE "SWA1"
  1256. // Buttons
  1257. #define BUTTON1_PIN 13
  1258. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1259. #define BUTTON1_RELAY 1
  1260. // Relays
  1261. #define RELAY1_PIN 5
  1262. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1263. // LEDs
  1264. #define LED1_PIN 4
  1265. #define LED1_PIN_INVERSE 1
  1266. // -----------------------------------------------------------------------------
  1267. // HEYGO HY02
  1268. // -----------------------------------------------------------------------------
  1269. #elif defined(HEYGO_HY02)
  1270. // Info
  1271. #define MANUFACTURER "HEYGO"
  1272. #define DEVICE "HY02"
  1273. // Buttons
  1274. #define BUTTON1_PIN 13
  1275. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1276. #define BUTTON1_RELAY 1
  1277. // Relays
  1278. #define RELAY1_PIN 12
  1279. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1280. // LEDs
  1281. #define LED1_PIN 4
  1282. #define LED1_PIN_INVERSE 0
  1283. // -----------------------------------------------------------------------------
  1284. // Maxcio W-US002S
  1285. // -----------------------------------------------------------------------------
  1286. #elif defined(MAXCIO_WUS002S)
  1287. // Info
  1288. #define MANUFACTURER "MAXCIO"
  1289. #define DEVICE "WUS002S"
  1290. // Buttons
  1291. #define BUTTON1_PIN 2
  1292. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1293. #define BUTTON1_RELAY 1
  1294. // Relays
  1295. #define RELAY1_PIN 13
  1296. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1297. // LEDs
  1298. #define LED1_PIN 3
  1299. #define LED1_PIN_INVERSE 0
  1300. // HLW8012
  1301. #ifndef HLW8012_SUPPORT
  1302. #define HLW8012_SUPPORT 1
  1303. #endif
  1304. #define HLW8012_SEL_PIN 12
  1305. #define HLW8012_CF1_PIN 5
  1306. #define HLW8012_CF_PIN 4
  1307. #define HLW8012_CURRENT_R 0.002 // Current resistor
  1308. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1309. // -----------------------------------------------------------------------------
  1310. // YiDian XS-SSA05
  1311. // -----------------------------------------------------------------------------
  1312. #elif defined(YIDIAN_XSSSA05)
  1313. // Info
  1314. #define MANUFACTURER "YIDIAN"
  1315. #define DEVICE "XSSSA05"
  1316. // Buttons
  1317. #define BUTTON1_PIN 13
  1318. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1319. #define BUTTON1_RELAY 1
  1320. // Relays
  1321. #define RELAY1_PIN 12
  1322. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1323. // LEDs
  1324. #define LED1_PIN 4
  1325. #define LED1_PIN_INVERSE 0
  1326. // HLW8012
  1327. #ifndef HLW8012_SUPPORT
  1328. #define HLW8012_SUPPORT 1
  1329. #endif
  1330. #define HLW8012_SEL_PIN 3
  1331. #define HLW8012_CF1_PIN 14
  1332. #define HLW8012_CF_PIN 5
  1333. #define HLW8012_CURRENT_R 0.001 // Current resistor
  1334. #define HLW8012_VOLTAGE_R_UP ( 2 * 1200000 ) // Upstream voltage resistor
  1335. // -----------------------------------------------------------------------------
  1336. // TONBUX XS-SSA06
  1337. // -----------------------------------------------------------------------------
  1338. #elif defined(TONBUX_XSSSA06)
  1339. // Info
  1340. #define MANUFACTURER "TONBUX"
  1341. #define DEVICE "XSSSA06"
  1342. // Buttons
  1343. #define BUTTON1_PIN 13
  1344. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1345. #define BUTTON1_RELAY 1
  1346. // Relays
  1347. #define RELAY1_PIN 15
  1348. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1349. // LEDs
  1350. #define LED1_PIN 0 // R - 8 rgb led ring
  1351. #define LED1_PIN_INVERSE 0
  1352. #define LED2_PIN 5 // G
  1353. #define LED2_PIN_INVERSE 0
  1354. #define LED3_PIN 2 // B
  1355. #define LED3_PIN_INVERSE 0
  1356. // -----------------------------------------------------------------------------
  1357. // GREEN ESP8266 RELAY MODULE
  1358. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1359. // -----------------------------------------------------------------------------
  1360. #elif defined(GREEN_ESP8266RELAY)
  1361. // Info
  1362. #define MANUFACTURER "GREEN"
  1363. #define DEVICE "ESP8266RELAY"
  1364. // Buttons
  1365. // Not a button but input via Optocoupler
  1366. #define BUTTON1_PIN 5
  1367. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1368. #define BUTTON1_RELAY 1
  1369. // Relays
  1370. #define RELAY1_PIN 4
  1371. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1372. // LEDs
  1373. #define LED1_PIN 2
  1374. #define LED1_PIN_INVERSE 1
  1375. // -----------------------------------------------------------------------------
  1376. // Henrique Gravina ESPIKE
  1377. // https://github.com/Henriquegravina/Espike
  1378. // -----------------------------------------------------------------------------
  1379. #elif defined(IKE_ESPIKE)
  1380. #define MANUFACTURER "IKE"
  1381. #define DEVICE "ESPIKE"
  1382. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1383. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1384. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1385. #define BUTTON1_PIN 13
  1386. #define BUTTON1_RELAY 1
  1387. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1388. #define BUTTON2_PIN 12
  1389. #define BUTTON2_RELAY 2
  1390. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1391. #define BUTTON3_PIN 14
  1392. #define BUTTON3_RELAY 2
  1393. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1394. #define RELAY1_PIN 4
  1395. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1396. #define RELAY2_PIN 5
  1397. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1398. #define RELAY3_PIN 16
  1399. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1400. #define LED1_PIN 2
  1401. #define LED1_PIN_INVERSE 1
  1402. // -----------------------------------------------------------------------------
  1403. // TEST boards (do not use!!)
  1404. // -----------------------------------------------------------------------------
  1405. #elif defined(TRAVIS01)
  1406. // Info
  1407. #define MANUFACTURER "TravisCI"
  1408. #define DEVICE "Virtual board 01"
  1409. // Some buttons - pin 0
  1410. #define BUTTON1_PIN 0
  1411. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1412. #define BUTTON1_RELAY 1
  1413. // Some relays - pin 1
  1414. #define RELAY1_PIN 1
  1415. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1416. // Some LEDs - pin 2
  1417. #define LED1_PIN 2
  1418. #define LED1_PIN_INVERSE 1
  1419. // A bit of I2C - pins 3,4
  1420. #define I2C_SDA_PIN 3
  1421. #define I2C_SCL_PIN 4
  1422. // And, as they say in "From Dusk till Dawn":
  1423. // This is a sensor blow out!
  1424. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  1425. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  1426. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  1427. // C'mon, you want sensor, come on in sensor lovers!
  1428. // If we don’t got it, you don't want it!
  1429. #define BH1750_SUPPORT 1
  1430. #define BMX280_SUPPORT 1
  1431. #define SHT3X_I2C_SUPPORT 1
  1432. #define EMON_ADC121_SUPPORT 1
  1433. #define EMON_ADS1X15_SUPPORT 1
  1434. #define SHT3X_I2C_SUPPORT 1
  1435. #define SI7021_SUPPORT 1
  1436. // A bit of lights - pin 5
  1437. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1438. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1439. #define DUMMY_RELAY_COUNT 1
  1440. #define LIGHT_CHANNELS 1
  1441. #define LIGHT_CH1_PIN 5
  1442. #define LIGHT_CH1_INVERSE 0
  1443. // A bit of HLW8012 - pins 6,7,8
  1444. #ifndef HLW8012_SUPPORT
  1445. #define HLW8012_SUPPORT 1
  1446. #endif
  1447. #define HLW8012_SEL_PIN 6
  1448. #define HLW8012_CF1_PIN 7
  1449. #define HLW8012_CF_PIN 8
  1450. // A bit of Dallas - pin 9
  1451. #ifndef DALLAS_SUPPORT
  1452. #define DALLAS_SUPPORT 1
  1453. #endif
  1454. #define DALLAS_PIN 9
  1455. // A bit of ECH1560 - pins 10,11, 12
  1456. #ifndef ECH1560_SUPPORT
  1457. #define ECH1560_SUPPORT 1
  1458. #endif
  1459. #define ECH1560_CLK_PIN 10
  1460. #define ECH1560_MISO_PIN 11
  1461. #define ECH1560_INVERTED 12
  1462. #elif defined(TRAVIS02)
  1463. // Relay provider dual
  1464. #define MANUFACTURER "TravisCI"
  1465. #define DEVICE "Virtual board 02"
  1466. // A bit of DHT - pin 1
  1467. #ifndef DHT_SUPPORT
  1468. #define DHT_SUPPORT 1
  1469. #endif
  1470. #define DHT_PIN 1
  1471. // Relay type dual - pins 2,3
  1472. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  1473. #define RELAY1_PIN 2
  1474. #define RELAY2_PIN 3
  1475. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1476. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1477. // IR - pin 4
  1478. #define IR_SUPPORT 1
  1479. #define IR_PIN 4
  1480. #define IR_BUTTON_SET 1
  1481. #elif defined(TRAVIS03)
  1482. // Relay provider light/my92XX
  1483. #define MANUFACTURER "TravisCI"
  1484. #define DEVICE "Virtual board 03"
  1485. // MY9231 Light - pins 1,2
  1486. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1487. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1488. #define DUMMY_RELAY_COUNT 1
  1489. #define LIGHT_CHANNELS 5
  1490. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  1491. #define MY92XX_CHIPS 2
  1492. #define MY92XX_DI_PIN 1
  1493. #define MY92XX_DCKI_PIN 2
  1494. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1495. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  1496. #endif
  1497. // -----------------------------------------------------------------------------
  1498. // Check definitions
  1499. // -----------------------------------------------------------------------------
  1500. #if not defined(MANUFACTURER) || not defined(DEVICE)
  1501. #error "UNSUPPORTED HARDWARE!!"
  1502. #endif