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.

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