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.

1713 lines
53 KiB

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