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.

2600 lines
82 KiB

7 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
6 years ago
6 years ago
6 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 BUTTON_SUPPORT 0
  36. #define DOMOTICZ_SUPPORT 0
  37. #define HOMEASSISTANT_SUPPORT 0
  38. #define I2C_SUPPORT 0
  39. #define MDNS_SERVER_SUPPORT 0
  40. #define MQTT_SUPPORT 0
  41. #define NTP_SUPPORT 0
  42. #define SCHEDULER_SUPPORT 0
  43. #define SENSOR_SUPPORT 0
  44. #define THINGSPEAK_SUPPORT 0
  45. #define WEB_SUPPORT 0
  46. // Extra light-weight image
  47. //#define DEBUG_SERIAL_SUPPORT 0
  48. //#define DEBUG_TELNET_SUPPORT 0
  49. //#define DEBUG_WEB_SUPPORT 0
  50. //#define LED_SUPPORT 0
  51. //#define TELNET_SUPPORT 0
  52. //#define TERMINAL_SUPPORT 0
  53. // -----------------------------------------------------------------------------
  54. // Development boards
  55. // -----------------------------------------------------------------------------
  56. #elif defined(NODEMCU_LOLIN)
  57. #include "devices/002_nodemcu_lolin.json.h"
  58. #elif defined(WEMOS_D1_MINI_RELAYSHIELD)
  59. #include "devices/003_wemos_d1_mini_relayshield.json.h"
  60. // -----------------------------------------------------------------------------
  61. // ESPurna
  62. // -----------------------------------------------------------------------------
  63. #elif defined(TINKERMAN_ESPURNA_H06)
  64. #include "devices/023_tinkerman_espurna_h06.json.h"
  65. // HLW8012
  66. #ifndef HLW8012_SUPPORT
  67. #define HLW8012_SUPPORT 1
  68. #endif
  69. #define HLW8012_SEL_PIN 2
  70. #define HLW8012_CF1_PIN 13
  71. #define HLW8012_CF_PIN 14
  72. #elif defined(TINKERMAN_ESPURNA_H08)
  73. // Info
  74. #define MANUFACTURER "TINKERMAN"
  75. #define DEVICE "ESPURNA_H08"
  76. // Buttons
  77. #define BUTTON1_PIN 4
  78. #define BUTTON1_RELAY 1
  79. // Normal pushbutton
  80. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  81. // Relays
  82. #define RELAY1_PIN 12
  83. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  84. // LEDs
  85. #define LED1_PIN 2
  86. #define LED1_PIN_INVERSE 0
  87. // HLW8012
  88. #ifndef HLW8012_SUPPORT
  89. #define HLW8012_SUPPORT 1
  90. #endif
  91. #define HLW8012_SEL_PIN 5
  92. #define HLW8012_CF1_PIN 13
  93. #define HLW8012_CF_PIN 14
  94. #elif defined(TINKERMAN_ESPURNA_SWITCH)
  95. // Info
  96. #define MANUFACTURER "TINKERMAN"
  97. #define DEVICE "ESPURNA_SWITCH"
  98. // Buttons
  99. #define BUTTON1_PIN 4
  100. #define BUTTON1_RELAY 1
  101. // Touch button
  102. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  103. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  104. #define BUTTON1_CLICK BUTTON_MODE_NONE
  105. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  106. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  107. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  108. // LEDs
  109. #define LED1_PIN 2
  110. #define LED1_PIN_INVERSE 0
  111. // Relays
  112. #define RELAY1_PIN 12
  113. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  114. // Check http://tinkerman.cat/rfm69-wifi-gateway/
  115. #elif defined(TINKERMAN_RFM69GW)
  116. // Info
  117. #define MANUFACTURER "TINKERMAN"
  118. #define DEVICE "RFM69GW"
  119. // Buttons
  120. #define BUTTON1_PIN 0
  121. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  122. // RFM69GW
  123. #define RFM69_SUPPORT 1
  124. // Disable non-core modules
  125. #define ALEXA_SUPPORT 0
  126. #define DOMOTICZ_SUPPORT 0
  127. #define HOMEASSISTANT_SUPPORT 0
  128. #define I2C_SUPPORT 0
  129. #define SCHEDULER_SUPPORT 0
  130. #define SENSOR_SUPPORT 0
  131. #define THINGSPEAK_SUPPORT 0
  132. // -----------------------------------------------------------------------------
  133. // Itead Studio boards
  134. // -----------------------------------------------------------------------------
  135. #elif defined(ITEAD_SONOFF_BASIC)
  136. // Info
  137. #define MANUFACTURER "ITEAD"
  138. #define DEVICE "SONOFF_BASIC"
  139. // Buttons
  140. #define BUTTON1_PIN 0
  141. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  142. #define BUTTON1_RELAY 1
  143. #define BUTTON2_PIN 14
  144. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  145. #define BUTTON2_RELAY 1
  146. // Relays
  147. #define RELAY1_PIN 12
  148. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  149. // LEDs
  150. #define LED1_PIN 13
  151. #define LED1_PIN_INVERSE 1
  152. #elif defined(ITEAD_SONOFF_RF)
  153. // Info
  154. #define MANUFACTURER "ITEAD"
  155. #define DEVICE "SONOFF_RF"
  156. // Buttons
  157. #define BUTTON1_PIN 0
  158. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  159. #define BUTTON1_RELAY 1
  160. #define BUTTON2_PIN 14
  161. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  162. #define BUTTON2_RELAY 1
  163. // Relays
  164. #define RELAY1_PIN 12
  165. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  166. // LEDs
  167. #define LED1_PIN 13
  168. #define LED1_PIN_INVERSE 1
  169. #elif defined(ITEAD_SONOFF_TH)
  170. // Info
  171. #define MANUFACTURER "ITEAD"
  172. #define DEVICE "SONOFF_TH"
  173. // Buttons
  174. #define BUTTON1_PIN 0
  175. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  176. #define BUTTON1_RELAY 1
  177. // Relays
  178. #define RELAY1_PIN 12
  179. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  180. // LEDs
  181. #define LED1_PIN 13
  182. #define LED1_PIN_INVERSE 1
  183. // Jack is connected to GPIO14 (and with a small hack to GPIO4)
  184. #ifndef DALLAS_SUPPORT
  185. #define DALLAS_SUPPORT 1
  186. #endif
  187. #define DALLAS_PIN 14
  188. #ifndef DHT_SUPPORT
  189. #define DHT_SUPPORT 1
  190. #endif
  191. #define DHT_PIN 14
  192. //#define I2C_SDA_PIN 4
  193. //#define I2C_SCL_PIN 14
  194. #elif defined(ITEAD_SONOFF_SV)
  195. // Info
  196. #define MANUFACTURER "ITEAD"
  197. #define DEVICE "SONOFF_SV"
  198. // Buttons
  199. #define BUTTON1_PIN 0
  200. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  201. #define BUTTON1_RELAY 1
  202. // Relays
  203. #define RELAY1_PIN 12
  204. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  205. // LEDs
  206. #define LED1_PIN 13
  207. #define LED1_PIN_INVERSE 1
  208. #elif defined(ITEAD_SLAMPHER)
  209. // Info
  210. #define MANUFACTURER "ITEAD"
  211. #define DEVICE "SLAMPHER"
  212. // Buttons
  213. #define BUTTON1_PIN 0
  214. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  215. #define BUTTON1_RELAY 1
  216. // Relays
  217. #define RELAY1_PIN 12
  218. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  219. // LEDs
  220. #define LED1_PIN 13
  221. #define LED1_PIN_INVERSE 1
  222. #elif defined(ITEAD_S20)
  223. // Info
  224. #define MANUFACTURER "ITEAD"
  225. #define DEVICE "S20"
  226. // Buttons
  227. #define BUTTON1_PIN 0
  228. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  229. #define BUTTON1_RELAY 1
  230. // Relays
  231. #define RELAY1_PIN 12
  232. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  233. // LEDs
  234. #define LED1_PIN 13
  235. #define LED1_PIN_INVERSE 1
  236. #elif defined(ITEAD_SONOFF_TOUCH)
  237. // Info
  238. #define MANUFACTURER "ITEAD"
  239. #define DEVICE "SONOFF_TOUCH"
  240. // Buttons
  241. #define BUTTON1_PIN 0
  242. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  243. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  244. #define BUTTON1_CLICK BUTTON_MODE_NONE
  245. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  246. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  247. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  248. #define BUTTON1_RELAY 1
  249. // Relays
  250. #define RELAY1_PIN 12
  251. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  252. // LEDs
  253. #define LED1_PIN 13
  254. #define LED1_PIN_INVERSE 1
  255. #elif defined(ITEAD_SONOFF_POW)
  256. // Info
  257. #define MANUFACTURER "ITEAD"
  258. #define DEVICE "SONOFF_POW"
  259. // Buttons
  260. #define BUTTON1_PIN 0
  261. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  262. #define BUTTON1_RELAY 1
  263. // Relays
  264. #define RELAY1_PIN 12
  265. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  266. // LEDs
  267. #define LED1_PIN 15
  268. #define LED1_PIN_INVERSE 0
  269. // HLW8012
  270. #ifndef HLW8012_SUPPORT
  271. #define HLW8012_SUPPORT 1
  272. #endif
  273. #define HLW8012_SEL_PIN 5
  274. #define HLW8012_CF1_PIN 13
  275. #define HLW8012_CF_PIN 14
  276. #elif defined(ITEAD_SONOFF_POW_R2)
  277. // Info
  278. #define MANUFACTURER "ITEAD"
  279. #define DEVICE "SONOFF_POW_R2"
  280. // Buttons
  281. #define BUTTON1_PIN 0
  282. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  283. #define BUTTON1_RELAY 1
  284. // Relays
  285. #define RELAY1_PIN 12
  286. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  287. // LEDs
  288. #define LED1_PIN 13
  289. #define LED1_PIN_INVERSE 1
  290. // Disable UART noise
  291. #define DEBUG_SERIAL_SUPPORT 0
  292. // CSE7766
  293. #ifndef CSE7766_SUPPORT
  294. #define CSE7766_SUPPORT 1
  295. #endif
  296. #define CSE7766_PIN 1
  297. #elif defined(ITEAD_SONOFF_DUAL)
  298. // Info
  299. #define MANUFACTURER "ITEAD"
  300. #define DEVICE "SONOFF_DUAL"
  301. #define SERIAL_BAUDRATE 19230
  302. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  303. #define DUMMY_RELAY_COUNT 2
  304. #define DEBUG_SERIAL_SUPPORT 0
  305. // Buttons
  306. #define BUTTON3_RELAY 1
  307. // LEDs
  308. #define LED1_PIN 13
  309. #define LED1_PIN_INVERSE 1
  310. #elif defined(ITEAD_SONOFF_DUAL_R2)
  311. #define MANUFACTURER "ITEAD"
  312. #define DEVICE "SONOFF_DUAL_R2"
  313. // Buttons
  314. #define BUTTON1_PIN 0 // Button 0 on header
  315. #define BUTTON2_PIN 9 // Button 1 on header
  316. #define BUTTON3_PIN 10 // Physical button
  317. #define BUTTON1_RELAY 1
  318. #define BUTTON2_RELAY 2
  319. #define BUTTON3_RELAY 1
  320. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  321. #define BUTTON2_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  322. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  323. // Relays
  324. #define RELAY1_PIN 12
  325. #define RELAY2_PIN 5
  326. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  327. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  328. // LEDs
  329. #define LED1_PIN 13
  330. #define LED1_PIN_INVERSE 1
  331. #elif defined(ITEAD_SONOFF_4CH)
  332. // Info
  333. #define MANUFACTURER "ITEAD"
  334. #define DEVICE "SONOFF_4CH"
  335. // Buttons
  336. #define BUTTON1_PIN 0
  337. #define BUTTON2_PIN 9
  338. #define BUTTON3_PIN 10
  339. #define BUTTON4_PIN 14
  340. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  341. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  342. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  343. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  344. #define BUTTON1_RELAY 1
  345. #define BUTTON2_RELAY 2
  346. #define BUTTON3_RELAY 3
  347. #define BUTTON4_RELAY 4
  348. // Relays
  349. #define RELAY1_PIN 12
  350. #define RELAY2_PIN 5
  351. #define RELAY3_PIN 4
  352. #define RELAY4_PIN 15
  353. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  354. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  355. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  356. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  357. // LEDs
  358. #define LED1_PIN 13
  359. #define LED1_PIN_INVERSE 1
  360. #elif defined(ITEAD_SONOFF_4CH_PRO)
  361. // Info
  362. #define MANUFACTURER "ITEAD"
  363. #define DEVICE "SONOFF_4CH_PRO"
  364. // Buttons
  365. #define BUTTON1_PIN 0
  366. #define BUTTON2_PIN 9
  367. #define BUTTON3_PIN 10
  368. #define BUTTON4_PIN 14
  369. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  370. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  371. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  372. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  373. #define BUTTON1_RELAY 1
  374. #define BUTTON2_RELAY 2
  375. #define BUTTON3_RELAY 3
  376. #define BUTTON4_RELAY 4
  377. // Sonoff 4CH Pro uses a secondary STM32 microcontroller to handle
  378. // buttons and relays, but it also forwards button presses to the ESP8285.
  379. // This allows ESPurna to handle button presses -almost- the same way
  380. // as with other devices except:
  381. // * Double click seems to break/disable the button on the STM32 side
  382. // * With S6 switch to 1 (self-locking and inching modes) everything's OK
  383. // * With S6 switch to 0 (interlock mode) if there is a relay ON
  384. // and you click on another relay button, the STM32 sends a "press"
  385. // event for the button of the first relay (to turn it OFF) but it
  386. // does not send a "release" event. It's like it's holding the
  387. // button down since you can see it is still LOW.
  388. // Whatever reason the result is that it may actually perform a
  389. // long click or long-long click.
  390. // The configuration below make the button toggle the relay on press events
  391. // and disables any possibly harmful combination with S6 set to 0.
  392. // If you are sure you will only use S6 to 1 you can comment the
  393. // BUTTON1_LNGCLICK and BUTTON1_LNGLNGCLICK options below to recover the
  394. // reset mode and factory reset functionalities, or link other actions like
  395. // AP mode in the commented line below.
  396. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  397. #define BUTTON1_CLICK BUTTON_MODE_NONE
  398. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  399. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  400. //#define BUTTON1_LNGCLICK BUTTON_MODE_AP
  401. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  402. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  403. #define BUTTON2_CLICK BUTTON_MODE_NONE
  404. #define BUTTON3_PRESS BUTTON_MODE_TOGGLE
  405. #define BUTTON3_CLICK BUTTON_MODE_NONE
  406. #define BUTTON4_PRESS BUTTON_MODE_TOGGLE
  407. #define BUTTON4_CLICK BUTTON_MODE_NONE
  408. // Relays
  409. #define RELAY1_PIN 12
  410. #define RELAY2_PIN 5
  411. #define RELAY3_PIN 4
  412. #define RELAY4_PIN 15
  413. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  414. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  415. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  416. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  417. // LEDs
  418. #define LED1_PIN 13
  419. #define LED1_PIN_INVERSE 1
  420. #elif defined(ITEAD_1CH_INCHING)
  421. // The inching functionality is managed by a misterious IC in the board.
  422. // You cannot control the inching button and functionality from the ESP8266
  423. // Besides, enabling the inching functionality using the hardware button
  424. // will result in the relay switching on and off continuously.
  425. // Fortunately the unkown IC keeps memory of the hardware inching status
  426. // so you can just disable it and forget. The inching LED must be lit.
  427. // You can still use the pulse options from the web interface
  428. // without problem.
  429. // Info
  430. #define MANUFACTURER "ITEAD"
  431. #define DEVICE "1CH_INCHING"
  432. // Buttons
  433. #define BUTTON1_PIN 0
  434. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  435. #define BUTTON1_RELAY 1
  436. // Relays
  437. #define RELAY1_PIN 12
  438. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  439. // LEDs
  440. #define LED1_PIN 13
  441. #define LED1_PIN_INVERSE 1
  442. #elif defined(ITEAD_MOTOR)
  443. // Info
  444. #define MANUFACTURER "ITEAD"
  445. #define DEVICE "MOTOR"
  446. // Buttons
  447. #define BUTTON1_PIN 0
  448. #define BUTTON1_RELAY 1
  449. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  450. // Relays
  451. #define RELAY1_PIN 12
  452. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  453. // LEDs
  454. #define LED1_PIN 13
  455. #define LED1_PIN_INVERSE 1
  456. #elif defined(ITEAD_BNSZ01)
  457. // Info
  458. #define MANUFACTURER "ITEAD"
  459. #define DEVICE "BNSZ01"
  460. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  461. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  462. #define DUMMY_RELAY_COUNT 1
  463. // LEDs
  464. #define LED1_PIN 13
  465. #define LED1_PIN_INVERSE 1
  466. // Light
  467. #define LIGHT_CHANNELS 1
  468. #define LIGHT_CH1_PIN 12
  469. #define LIGHT_CH1_INVERSE 0
  470. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  471. // Info
  472. #define MANUFACTURER "ITEAD"
  473. #define DEVICE "SONOFF_RFBRIDGE"
  474. #define RELAY_PROVIDER RELAY_PROVIDER_RFBRIDGE
  475. // Number of virtual switches
  476. #ifndef DUMMY_RELAY_COUNT
  477. #define DUMMY_RELAY_COUNT 8
  478. #endif
  479. // Buttons
  480. #define BUTTON1_PIN 0
  481. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  482. // LEDs
  483. #define LED1_PIN 13
  484. #define LED1_PIN_INVERSE 1
  485. // RFB Direct hack thanks to @wildwiz
  486. // https://github.com/xoseperez/espurna/wiki/Hardware-Itead-Sonoff-RF-Bridge---Direct-Hack
  487. #ifndef RFB_DIRECT
  488. #define RFB_DIRECT 0
  489. #endif
  490. #ifndef RFB_RX_PIN
  491. #define RFB_RX_PIN 4 // GPIO for RX when RFB_DIRECT
  492. #endif
  493. #ifndef RFB_TX_PIN
  494. #define RFB_TX_PIN 5 // GPIO for TX when RFB_DIRECT
  495. #endif
  496. // When using un-modified harware, ESPurna communicates with the secondary
  497. // MCU EFM8BB1 via UART at 19200 bps so we need to change the speed of
  498. // the port and remove UART noise on serial line
  499. #if not RFB_DIRECT
  500. #define SERIAL_BAUDRATE 19200
  501. #define DEBUG_SERIAL_SUPPORT 0
  502. #endif
  503. #elif defined(ITEAD_SONOFF_B1)
  504. // Info
  505. #define MANUFACTURER "ITEAD"
  506. #define DEVICE "SONOFF_B1"
  507. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  508. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  509. #define DUMMY_RELAY_COUNT 1
  510. // Light
  511. #define LIGHT_CHANNELS 5
  512. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  513. #define MY92XX_CHIPS 2
  514. #define MY92XX_DI_PIN 12
  515. #define MY92XX_DCKI_PIN 14
  516. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  517. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  518. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  519. #elif defined(ITEAD_SONOFF_LED)
  520. // Info
  521. #define MANUFACTURER "ITEAD"
  522. #define DEVICE "SONOFF_LED"
  523. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  524. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  525. #define DUMMY_RELAY_COUNT 1
  526. // LEDs
  527. #define LED1_PIN 13
  528. #define LED1_PIN_INVERSE 1
  529. // Light
  530. #define LIGHT_CHANNELS 2
  531. #define LIGHT_CH1_PIN 12 // Cold white
  532. #define LIGHT_CH2_PIN 14 // Warm white
  533. #define LIGHT_CH1_INVERSE 0
  534. #define LIGHT_CH2_INVERSE 0
  535. #elif defined(ITEAD_SONOFF_T1_1CH)
  536. // Info
  537. #define MANUFACTURER "ITEAD"
  538. #define DEVICE "SONOFF_T1_1CH"
  539. // Buttons
  540. #define BUTTON1_PIN 0
  541. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  542. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  543. #define BUTTON1_CLICK BUTTON_MODE_NONE
  544. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  545. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  546. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  547. #define BUTTON1_RELAY 1
  548. // Relays
  549. #define RELAY1_PIN 12
  550. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  551. // LEDs
  552. #define LED1_PIN 13
  553. #define LED1_PIN_INVERSE 1
  554. #elif defined(ITEAD_SONOFF_T1_2CH)
  555. // Info
  556. #define MANUFACTURER "ITEAD"
  557. #define DEVICE "SONOFF_T1_2CH"
  558. // Buttons
  559. #define BUTTON1_PIN 0
  560. #define BUTTON2_PIN 9
  561. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  562. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  563. #define BUTTON1_CLICK BUTTON_MODE_NONE
  564. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  565. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  566. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  567. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  568. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  569. #define BUTTON2_CLICK BUTTON_MODE_NONE
  570. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  571. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  572. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  573. #define BUTTON1_RELAY 1
  574. #define BUTTON2_RELAY 2
  575. // Relays
  576. #define RELAY1_PIN 12
  577. #define RELAY2_PIN 5
  578. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  579. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  580. // LEDs
  581. #define LED1_PIN 13
  582. #define LED1_PIN_INVERSE 1
  583. #elif defined(ITEAD_SONOFF_T1_3CH)
  584. // Info
  585. #define MANUFACTURER "ITEAD"
  586. #define DEVICE "SONOFF_T1_3CH"
  587. // Buttons
  588. #define BUTTON1_PIN 0
  589. #define BUTTON2_PIN 9
  590. #define BUTTON3_PIN 10
  591. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  592. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  593. #define BUTTON1_CLICK BUTTON_MODE_NONE
  594. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  595. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  596. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  597. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  598. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  599. #define BUTTON2_CLICK BUTTON_MODE_NONE
  600. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  601. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  602. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_RESET
  603. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  604. #define BUTTON3_PRESS BUTTON_MODE_TOGGLE
  605. #define BUTTON3_CLICK BUTTON_MODE_NONE
  606. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  607. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  608. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_RESET
  609. #define BUTTON1_RELAY 1
  610. #define BUTTON2_RELAY 2
  611. #define BUTTON3_RELAY 3
  612. // Relays
  613. #define RELAY1_PIN 12
  614. #define RELAY2_PIN 5
  615. #define RELAY3_PIN 4
  616. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  617. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  618. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  619. // LEDs
  620. #define LED1_PIN 13
  621. #define LED1_PIN_INVERSE 1
  622. #elif defined(ITEAD_SONOFF_S31)
  623. // Info
  624. #define MANUFACTURER "ITEAD"
  625. #define DEVICE "SONOFF_S31"
  626. // Buttons
  627. #define BUTTON1_PIN 0
  628. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  629. #define BUTTON1_RELAY 1
  630. // Relays
  631. #define RELAY1_PIN 12
  632. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  633. // LEDs
  634. #define LED1_PIN 13
  635. #define LED1_PIN_INVERSE 1
  636. // Disable UART noise
  637. #define DEBUG_SERIAL_SUPPORT 0
  638. // CSE7766
  639. #define CSE7766_SUPPORT 1
  640. #define CSE7766_PIN 1
  641. #elif defined(ITEAD_SONOFF_IFAN02)
  642. // Info
  643. #define MANUFACTURER "ITEAD"
  644. #define DEVICE "SONOFF_IFAN02"
  645. // These are virtual buttons triggered by the remote
  646. #define BUTTON1_PIN 0
  647. #define BUTTON2_PIN 9
  648. #define BUTTON3_PIN 10
  649. #define BUTTON4_PIN 14
  650. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  651. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  652. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  653. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  654. // Relays
  655. #define RELAY1_PIN 12
  656. #define RELAY2_PIN 5
  657. #define RELAY3_PIN 4
  658. #define RELAY4_PIN 15
  659. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  660. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  661. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  662. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  663. // LEDs
  664. #define LED1_PIN 13
  665. #define LED1_PIN_INVERSE 1
  666. // -----------------------------------------------------------------------------
  667. // YJZK
  668. // -----------------------------------------------------------------------------
  669. #elif defined(YJZK_SWITCH_2CH)
  670. // Info
  671. #define MANUFACTURER "YJZK"
  672. #define DEVICE "SWITCH_2CH"
  673. // Buttons
  674. #define BUTTON1_PIN 0
  675. #define BUTTON2_PIN 9
  676. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  677. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  678. #define BUTTON1_RELAY 1
  679. #define BUTTON2_RELAY 2
  680. // Relays
  681. #define RELAY1_PIN 12
  682. #define RELAY2_PIN 5
  683. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  684. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  685. // LEDs
  686. #define LED1_PIN 13
  687. #define LED1_PIN_INVERSE 0
  688. // -----------------------------------------------------------------------------
  689. // Electrodragon boards
  690. // -----------------------------------------------------------------------------
  691. #elif defined(ELECTRODRAGON_WIFI_IOT)
  692. // Info
  693. #define MANUFACTURER "ELECTRODRAGON"
  694. #define DEVICE "WIFI_IOT"
  695. // Buttons
  696. #define BUTTON1_PIN 0
  697. #define BUTTON2_PIN 2
  698. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  699. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  700. #define BUTTON1_RELAY 1
  701. #define BUTTON2_RELAY 2
  702. // Relays
  703. #define RELAY1_PIN 12
  704. #define RELAY2_PIN 13
  705. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  706. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  707. // LEDs
  708. #define LED1_PIN 16
  709. #define LED1_PIN_INVERSE 0
  710. // -----------------------------------------------------------------------------
  711. // WorkChoice ecoPlug
  712. // -----------------------------------------------------------------------------
  713. #elif defined(WORKCHOICE_ECOPLUG)
  714. // Info
  715. #define MANUFACTURER "WORKCHOICE"
  716. #define DEVICE "ECOPLUG"
  717. // Buttons
  718. #define BUTTON1_PIN 13
  719. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  720. #define BUTTON1_RELAY 1
  721. // Relays
  722. #define RELAY1_PIN 15
  723. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  724. // LEDs
  725. #define LED1_PIN 2
  726. #define LED1_PIN_INVERSE 0
  727. // -----------------------------------------------------------------------------
  728. // AI Thinker
  729. // -----------------------------------------------------------------------------
  730. #elif defined(AITHINKER_AI_LIGHT)
  731. // Info
  732. #define MANUFACTURER "AITHINKER"
  733. #define DEVICE "AI_LIGHT"
  734. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  735. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  736. #define DUMMY_RELAY_COUNT 1
  737. // Light
  738. #define LIGHT_CHANNELS 4
  739. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  740. #define MY92XX_CHIPS 1
  741. #define MY92XX_DI_PIN 13
  742. #define MY92XX_DCKI_PIN 15
  743. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  744. #define MY92XX_MAPPING 0, 1, 2, 3
  745. // -----------------------------------------------------------------------------
  746. // LED Controller
  747. // -----------------------------------------------------------------------------
  748. #elif defined(MAGICHOME_LED_CONTROLLER)
  749. // Info
  750. #define MANUFACTURER "MAGICHOME"
  751. #define DEVICE "LED_CONTROLLER"
  752. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  753. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  754. #define DUMMY_RELAY_COUNT 1
  755. // LEDs
  756. #define LED1_PIN 2
  757. #define LED1_PIN_INVERSE 1
  758. // Light
  759. #define LIGHT_CHANNELS 4
  760. #define LIGHT_CH1_PIN 14 // RED
  761. #define LIGHT_CH2_PIN 5 // GREEN
  762. #define LIGHT_CH3_PIN 12 // BLUE
  763. #define LIGHT_CH4_PIN 13 // WHITE
  764. #define LIGHT_CH1_INVERSE 0
  765. #define LIGHT_CH2_INVERSE 0
  766. #define LIGHT_CH3_INVERSE 0
  767. #define LIGHT_CH4_INVERSE 0
  768. // IR
  769. #define IR_SUPPORT 1
  770. #define IR_PIN 4
  771. #define IR_BUTTON_SET 1
  772. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  773. // Info
  774. #define MANUFACTURER "MAGICHOME"
  775. #define DEVICE "LED_CONTROLLER_20"
  776. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  777. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  778. #define DUMMY_RELAY_COUNT 1
  779. // LEDs
  780. #define LED1_PIN 2
  781. #define LED1_PIN_INVERSE 1
  782. // Light
  783. #define LIGHT_CHANNELS 4
  784. #define LIGHT_CH1_PIN 5 // RED
  785. #define LIGHT_CH2_PIN 12 // GREEN
  786. #define LIGHT_CH3_PIN 13 // BLUE
  787. #define LIGHT_CH4_PIN 15 // WHITE
  788. #define LIGHT_CH1_INVERSE 0
  789. #define LIGHT_CH2_INVERSE 0
  790. #define LIGHT_CH3_INVERSE 0
  791. #define LIGHT_CH4_INVERSE 0
  792. // IR
  793. #define IR_SUPPORT 1
  794. #define IR_PIN 4
  795. #define IR_BUTTON_SET 1
  796. // -----------------------------------------------------------------------------
  797. // HUACANXING H801 & H802
  798. // -----------------------------------------------------------------------------
  799. #elif defined(HUACANXING_H801)
  800. // Info
  801. #define MANUFACTURER "HUACANXING"
  802. #define DEVICE "H801"
  803. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  804. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  805. #define DUMMY_RELAY_COUNT 1
  806. #define DEBUG_PORT Serial1
  807. #define SERIAL_RX_ENABLED 1
  808. // LEDs
  809. #define LED1_PIN 5
  810. #define LED1_PIN_INVERSE 1
  811. // Light
  812. #define LIGHT_CHANNELS 5
  813. #define LIGHT_CH1_PIN 15 // RED
  814. #define LIGHT_CH2_PIN 13 // GREEN
  815. #define LIGHT_CH3_PIN 12 // BLUE
  816. #define LIGHT_CH4_PIN 14 // WHITE1
  817. #define LIGHT_CH5_PIN 4 // WHITE2
  818. #define LIGHT_CH1_INVERSE 0
  819. #define LIGHT_CH2_INVERSE 0
  820. #define LIGHT_CH3_INVERSE 0
  821. #define LIGHT_CH4_INVERSE 0
  822. #define LIGHT_CH5_INVERSE 0
  823. #elif defined(HUACANXING_H802)
  824. // Info
  825. #define MANUFACTURER "HUACANXING"
  826. #define DEVICE "H802"
  827. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  828. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  829. #define DUMMY_RELAY_COUNT 1
  830. #define DEBUG_PORT Serial1
  831. #define SERIAL_RX_ENABLED 1
  832. // Light
  833. #define LIGHT_CHANNELS 4
  834. #define LIGHT_CH1_PIN 12 // RED
  835. #define LIGHT_CH2_PIN 14 // GREEN
  836. #define LIGHT_CH3_PIN 13 // BLUE
  837. #define LIGHT_CH4_PIN 15 // WHITE
  838. #define LIGHT_CH1_INVERSE 0
  839. #define LIGHT_CH2_INVERSE 0
  840. #define LIGHT_CH3_INVERSE 0
  841. #define LIGHT_CH4_INVERSE 0
  842. // -----------------------------------------------------------------------------
  843. // Jan Goedeke Wifi Relay
  844. // https://github.com/JanGoe/esp8266-wifi-relay
  845. // -----------------------------------------------------------------------------
  846. #elif defined(JANGOE_WIFI_RELAY_NC)
  847. // Info
  848. #define MANUFACTURER "JANGOE"
  849. #define DEVICE "WIFI_RELAY_NC"
  850. // Buttons
  851. #define BUTTON1_PIN 12
  852. #define BUTTON2_PIN 13
  853. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  854. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  855. #define BUTTON1_RELAY 1
  856. #define BUTTON2_RELAY 2
  857. // Relays
  858. #define RELAY1_PIN 2
  859. #define RELAY2_PIN 14
  860. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  861. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  862. #elif defined(JANGOE_WIFI_RELAY_NO)
  863. // Info
  864. #define MANUFACTURER "JANGOE"
  865. #define DEVICE "WIFI_RELAY_NO"
  866. // Buttons
  867. #define BUTTON1_PIN 12
  868. #define BUTTON2_PIN 13
  869. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  870. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  871. #define BUTTON1_RELAY 1
  872. #define BUTTON2_RELAY 2
  873. // Relays
  874. #define RELAY1_PIN 2
  875. #define RELAY2_PIN 14
  876. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  877. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  878. // -----------------------------------------------------------------------------
  879. // Jorge García Wifi+Relays Board Kit
  880. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  881. // https://github.com/jorgegarciadev/wifikit
  882. // -----------------------------------------------------------------------------
  883. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  884. // Info
  885. #define MANUFACTURER "JORGEGARCIA"
  886. #define DEVICE "WIFI_RELAYS"
  887. // Relays
  888. #define RELAY1_PIN 0
  889. #define RELAY2_PIN 2
  890. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  891. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  892. // -----------------------------------------------------------------------------
  893. // WiFi MQTT Relay / Thermostat
  894. // -----------------------------------------------------------------------------
  895. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  896. // Info
  897. #define MANUFACTURER "OPENENERGYMONITOR"
  898. #define DEVICE "MQTT_RELAY"
  899. // Buttons
  900. #define BUTTON1_PIN 0
  901. #define BUTTON1_RELAY 1
  902. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  903. // Relays
  904. #define RELAY1_PIN 12
  905. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  906. // LEDs
  907. #define LED1_PIN 16
  908. #define LED1_PIN_INVERSE 0
  909. // -----------------------------------------------------------------------------
  910. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  911. // 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
  912. // 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
  913. // -----------------------------------------------------------------------------
  914. #elif defined(WION_50055)
  915. // Currently untested, does not support energy monitoring
  916. // Info
  917. #define MANUFACTURER "WION"
  918. #define DEVICE "50055"
  919. // Buttons
  920. #define BUTTON1_PIN 13
  921. #define BUTTON1_RELAY 1
  922. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  923. // Relays
  924. #define RELAY1_PIN 15
  925. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  926. // LEDs
  927. #define LED1_PIN 2
  928. #define LED1_PIN_INVERSE 0
  929. // -----------------------------------------------------------------------------
  930. // EX-Store Wifi Relay v3.1
  931. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  932. // -----------------------------------------------------------------------------
  933. #elif defined(EXS_WIFI_RELAY_V31)
  934. // Untested
  935. // Info
  936. #define MANUFACTURER "EXS"
  937. #define DEVICE "WIFI_RELAY_V31"
  938. // Buttons
  939. #define BUTTON1_PIN 0
  940. #define BUTTON1_RELAY 1
  941. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  942. // Relays
  943. #define RELAY1_PIN 13
  944. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  945. #define RELAY1_RESET_PIN 12
  946. // -----------------------------------------------------------------------------
  947. // V9261F
  948. // -----------------------------------------------------------------------------
  949. #elif defined(GENERIC_V9261F)
  950. // Info
  951. #define MANUFACTURER "GENERIC"
  952. #define DEVICE "V9261F"
  953. #define ALEXA_SUPPORT 0
  954. // V9261F
  955. #define V9261F_SUPPORT 1
  956. #define V9261F_PIN 2
  957. #define V9261F_PIN_INVERSE 1
  958. // -----------------------------------------------------------------------------
  959. // ECH1560
  960. // -----------------------------------------------------------------------------
  961. #elif defined(GENERIC_ECH1560)
  962. // Info
  963. #define MANUFACTURER "GENERIC"
  964. #define DEVICE "ECH1560"
  965. #define ALEXA_SUPPORT 0
  966. // ECH1560
  967. #define ECH1560_SUPPORT 1
  968. #define ECH1560_CLK_PIN 4
  969. #define ECH1560_MISO_PIN 5
  970. #define ECH1560_INVERTED 0
  971. // -----------------------------------------------------------------------------
  972. // ESPLive
  973. // https://github.com/ManCaveMade/ESP-Live
  974. // -----------------------------------------------------------------------------
  975. #elif defined(MANCAVEMADE_ESPLIVE)
  976. // Info
  977. #define MANUFACTURER "MANCAVEMADE"
  978. #define DEVICE "ESPLIVE"
  979. // Buttons
  980. #define BUTTON1_PIN 4
  981. #define BUTTON2_PIN 5
  982. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  983. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  984. #define BUTTON1_RELAY 1
  985. #define BUTTON2_RELAY 2
  986. // Relays
  987. #define RELAY1_PIN 12
  988. #define RELAY2_PIN 13
  989. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  990. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  991. // DS18B20
  992. #ifndef DALLAS_SUPPORT
  993. #define DALLAS_SUPPORT 1
  994. #endif
  995. #define DALLAS_PIN 2
  996. #define DALLAS_UPDATE_INTERVAL 5000
  997. #define TEMPERATURE_MIN_CHANGE 1.0
  998. // -----------------------------------------------------------------------------
  999. // QuinLED
  1000. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  1001. // -----------------------------------------------------------------------------
  1002. #elif defined(INTERMITTECH_QUINLED)
  1003. // Info
  1004. #define MANUFACTURER "INTERMITTECH"
  1005. #define DEVICE "QUINLED"
  1006. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1007. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1008. #define DUMMY_RELAY_COUNT 1
  1009. // LEDs
  1010. #define LED1_PIN 5
  1011. #define LED1_PIN_INVERSE 1
  1012. // Light
  1013. #define LIGHT_CHANNELS 2
  1014. #define LIGHT_CH1_PIN 0
  1015. #define LIGHT_CH2_PIN 2
  1016. #define LIGHT_CH1_INVERSE 0
  1017. #define LIGHT_CH2_INVERSE 0
  1018. // -----------------------------------------------------------------------------
  1019. // Arilux AL-LC06
  1020. // -----------------------------------------------------------------------------
  1021. #elif defined(ARILUX_AL_LC01)
  1022. // Info
  1023. #define MANUFACTURER "ARILUX"
  1024. #define DEVICE "AL_LC01"
  1025. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1026. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1027. #define DUMMY_RELAY_COUNT 1
  1028. // Light
  1029. #define LIGHT_CHANNELS 3
  1030. #define LIGHT_CH1_PIN 5 // RED
  1031. #define LIGHT_CH2_PIN 12 // GREEN
  1032. #define LIGHT_CH3_PIN 13 // BLUE
  1033. #define LIGHT_CH1_INVERSE 0
  1034. #define LIGHT_CH2_INVERSE 0
  1035. #define LIGHT_CH3_INVERSE 0
  1036. #elif defined(ARILUX_AL_LC02)
  1037. // Info
  1038. #define MANUFACTURER "ARILUX"
  1039. #define DEVICE "AL_LC02"
  1040. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1041. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1042. #define DUMMY_RELAY_COUNT 1
  1043. // Light
  1044. #define LIGHT_CHANNELS 4
  1045. #define LIGHT_CH1_PIN 12 // RED
  1046. #define LIGHT_CH2_PIN 5 // GREEN
  1047. #define LIGHT_CH3_PIN 13 // BLUE
  1048. #define LIGHT_CH4_PIN 15 // WHITE1
  1049. #define LIGHT_CH1_INVERSE 0
  1050. #define LIGHT_CH2_INVERSE 0
  1051. #define LIGHT_CH3_INVERSE 0
  1052. #define LIGHT_CH4_INVERSE 0
  1053. #elif defined(ARILUX_AL_LC06)
  1054. // Info
  1055. #define MANUFACTURER "ARILUX"
  1056. #define DEVICE "AL_LC06"
  1057. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1058. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1059. #define DUMMY_RELAY_COUNT 1
  1060. // Light
  1061. #define LIGHT_CHANNELS 5
  1062. #define LIGHT_CH1_PIN 14 // RED
  1063. #define LIGHT_CH2_PIN 12 // GREEN
  1064. #define LIGHT_CH3_PIN 13 // BLUE
  1065. #define LIGHT_CH4_PIN 15 // WHITE1
  1066. #define LIGHT_CH5_PIN 5 // WHITE2
  1067. #define LIGHT_CH1_INVERSE 0
  1068. #define LIGHT_CH2_INVERSE 0
  1069. #define LIGHT_CH3_INVERSE 0
  1070. #define LIGHT_CH4_INVERSE 0
  1071. #define LIGHT_CH5_INVERSE 0
  1072. #elif defined(ARILUX_AL_LC11)
  1073. // Info
  1074. #define MANUFACTURER "ARILUX"
  1075. #define DEVICE "AL_LC11"
  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 5
  1081. #define LIGHT_CH1_PIN 5 // RED
  1082. #define LIGHT_CH2_PIN 4 // GREEN
  1083. #define LIGHT_CH3_PIN 14 // BLUE
  1084. #define LIGHT_CH4_PIN 13 // WHITE1
  1085. #define LIGHT_CH5_PIN 12 // WHITE1
  1086. #define LIGHT_CH1_INVERSE 0
  1087. #define LIGHT_CH2_INVERSE 0
  1088. #define LIGHT_CH3_INVERSE 0
  1089. #define LIGHT_CH4_INVERSE 0
  1090. #define LIGHT_CH5_INVERSE 0
  1091. #elif defined(ARILUX_E27)
  1092. // Info
  1093. #define MANUFACTURER "ARILUX"
  1094. #define DEVICE "E27"
  1095. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1096. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  1097. #define DUMMY_RELAY_COUNT 1
  1098. // Light
  1099. #define LIGHT_CHANNELS 4
  1100. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  1101. #define MY92XX_CHIPS 1
  1102. #define MY92XX_DI_PIN 13
  1103. #define MY92XX_DCKI_PIN 15
  1104. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  1105. #define MY92XX_MAPPING 0, 1, 2, 3
  1106. // -----------------------------------------------------------------------------
  1107. // XENON SM-PW701U
  1108. // -----------------------------------------------------------------------------
  1109. #elif defined(XENON_SM_PW702U)
  1110. // Info
  1111. #define MANUFACTURER "XENON"
  1112. #define DEVICE "SM_PW702U"
  1113. // Buttons
  1114. #define BUTTON1_PIN 13
  1115. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1116. #define BUTTON1_RELAY 1
  1117. // Relays
  1118. #define RELAY1_PIN 12
  1119. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1120. // LEDs
  1121. #define LED1_PIN 4
  1122. #define LED1_PIN_INVERSE 1
  1123. // -----------------------------------------------------------------------------
  1124. // AUTHOMETION LYT8266
  1125. // https://authometion.com/shop/en/home/13-lyt8266.html
  1126. // -----------------------------------------------------------------------------
  1127. #elif defined(AUTHOMETION_LYT8266)
  1128. // Info
  1129. #define MANUFACTURER "AUTHOMETION"
  1130. #define DEVICE "LYT8266"
  1131. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1132. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1133. #define DUMMY_RELAY_COUNT 1
  1134. // Light
  1135. #define LIGHT_CHANNELS 4
  1136. #define LIGHT_CH1_PIN 13 // RED
  1137. #define LIGHT_CH2_PIN 12 // GREEN
  1138. #define LIGHT_CH3_PIN 14 // BLUE
  1139. #define LIGHT_CH4_PIN 2 // WHITE
  1140. #define LIGHT_CH1_INVERSE 0
  1141. #define LIGHT_CH2_INVERSE 0
  1142. #define LIGHT_CH3_INVERSE 0
  1143. #define LIGHT_CH4_INVERSE 0
  1144. #define LIGHT_ENABLE_PIN 15
  1145. #elif defined(GIZWITS_WITTY_CLOUD)
  1146. // Info
  1147. #define MANUFACTURER "GIZWITS"
  1148. #define DEVICE "WITTY_CLOUD"
  1149. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1150. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1151. #define DUMMY_RELAY_COUNT 1
  1152. // Buttons
  1153. #define BUTTON1_PIN 4
  1154. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1155. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  1156. #define BUTTON1_CLICK BUTTON_MODE_NONE
  1157. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1158. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1159. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  1160. #define ANALOG_SUPPORT 1
  1161. // LEDs
  1162. #define LED1_PIN 2 // BLUE build-in
  1163. #define LED1_PIN_INVERSE 1
  1164. // Light
  1165. #define LIGHT_CHANNELS 3
  1166. #define LIGHT_CH1_PIN 15 // RED
  1167. #define LIGHT_CH2_PIN 12 // GREEN
  1168. #define LIGHT_CH3_PIN 13 // BLUE
  1169. #define LIGHT_CH1_INVERSE 0
  1170. #define LIGHT_CH2_INVERSE 0
  1171. #define LIGHT_CH3_INVERSE 0
  1172. // -----------------------------------------------------------------------------
  1173. // KMC 70011
  1174. // https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
  1175. // -----------------------------------------------------------------------------
  1176. #elif defined(KMC_70011)
  1177. // Info
  1178. #define MANUFACTURER "KMC"
  1179. #define DEVICE "70011"
  1180. // Buttons
  1181. #define BUTTON1_PIN 0
  1182. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1183. #define BUTTON1_RELAY 1
  1184. // Relays
  1185. #define RELAY1_PIN 14
  1186. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1187. // LEDs
  1188. #define LED1_PIN 13
  1189. #define LED1_PIN_INVERSE 0
  1190. // HLW8012
  1191. #ifndef HLW8012_SUPPORT
  1192. #define HLW8012_SUPPORT 1
  1193. #endif
  1194. #define HLW8012_SEL_PIN 12
  1195. #define HLW8012_CF1_PIN 5
  1196. #define HLW8012_CF_PIN 4
  1197. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1198. // -----------------------------------------------------------------------------
  1199. // Euromate (?) Wifi Stecker Shuko
  1200. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  1201. // Thanks to @Geitde
  1202. // -----------------------------------------------------------------------------
  1203. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  1204. // Info
  1205. #define MANUFACTURER "EUROMATE"
  1206. #define DEVICE "WIFI_STECKER_SCHUKO"
  1207. // Buttons
  1208. #define BUTTON1_PIN 14
  1209. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1210. #define BUTTON1_RELAY 1
  1211. // The relay in the device is not a bistable (latched) relay.
  1212. // The device is reported to have a flip-flop circuit to drive the relay
  1213. // So @Geitde hack is still the only possible
  1214. // Hack: drive GPIO12 low and use GPIO5 as normal relay pin:
  1215. #define RELAY1_PIN 5
  1216. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1217. #define LED2_PIN 12 /* DUMMY: exploit default off state for GPIO12=low */
  1218. #define LED2_PIN_INVERSE 0
  1219. // LEDs
  1220. #define LED1_PIN 4
  1221. #define LED1_PIN_INVERSE 0
  1222. // -----------------------------------------------------------------------------
  1223. // Generic 8CH
  1224. // -----------------------------------------------------------------------------
  1225. #elif defined(GENERIC_8CH)
  1226. // Info
  1227. #define MANUFACTURER "GENERIC"
  1228. #define DEVICE "8CH"
  1229. // Relays
  1230. #define RELAY1_PIN 0
  1231. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1232. #define RELAY2_PIN 2
  1233. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1234. #define RELAY3_PIN 4
  1235. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1236. #define RELAY4_PIN 5
  1237. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1238. #define RELAY5_PIN 12
  1239. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1240. #define RELAY6_PIN 13
  1241. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  1242. #define RELAY7_PIN 14
  1243. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  1244. #define RELAY8_PIN 15
  1245. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  1246. // -----------------------------------------------------------------------------
  1247. // STM RELAY
  1248. // -----------------------------------------------------------------------------
  1249. #elif defined(STM_RELAY)
  1250. // Info
  1251. #define MANUFACTURER "STM_RELAY"
  1252. #define DEVICE "2CH"
  1253. // Relays
  1254. #define DUMMY_RELAY_COUNT 2
  1255. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  1256. // Remove UART noise on serial line
  1257. #define DEBUG_SERIAL_SUPPORT 0
  1258. // -----------------------------------------------------------------------------
  1259. // Tonbux Powerstrip02
  1260. // -----------------------------------------------------------------------------
  1261. #elif defined(TONBUX_POWERSTRIP02)
  1262. // Info
  1263. #define MANUFACTURER "TONBUX"
  1264. #define DEVICE "POWERSTRIP02"
  1265. // Buttons
  1266. #define BUTTON1_PIN 5
  1267. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1268. #define BUTTON1_RELAY 0
  1269. // Relays
  1270. #define RELAY1_PIN 4
  1271. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1272. #define RELAY2_PIN 13
  1273. #define RELAY2_TYPE RELAY_TYPE_INVERSE
  1274. #define RELAY3_PIN 12
  1275. #define RELAY3_TYPE RELAY_TYPE_INVERSE
  1276. #define RELAY4_PIN 14
  1277. #define RELAY4_TYPE RELAY_TYPE_INVERSE
  1278. // Not a relay. USB ports on/off
  1279. #define RELAY5_PIN 16
  1280. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1281. // LEDs
  1282. #define LED1_PIN 0 // 1 blue led
  1283. #define LED1_PIN_INVERSE 1
  1284. #define LED2_PIN 3 // 3 red leds
  1285. #define LED2_PIN_INVERSE 1
  1286. // -----------------------------------------------------------------------------
  1287. // Lingan SWA1
  1288. // -----------------------------------------------------------------------------
  1289. #elif defined(LINGAN_SWA1)
  1290. // Info
  1291. #define MANUFACTURER "LINGAN"
  1292. #define DEVICE "SWA1"
  1293. // Buttons
  1294. #define BUTTON1_PIN 13
  1295. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1296. #define BUTTON1_RELAY 1
  1297. // Relays
  1298. #define RELAY1_PIN 5
  1299. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1300. // LEDs
  1301. #define LED1_PIN 4
  1302. #define LED1_PIN_INVERSE 1
  1303. // -----------------------------------------------------------------------------
  1304. // HEYGO HY02
  1305. // -----------------------------------------------------------------------------
  1306. #elif defined(HEYGO_HY02)
  1307. // Info
  1308. #define MANUFACTURER "HEYGO"
  1309. #define DEVICE "HY02"
  1310. // Buttons
  1311. #define BUTTON1_PIN 13
  1312. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1313. #define BUTTON1_RELAY 1
  1314. // Relays
  1315. #define RELAY1_PIN 12
  1316. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1317. // LEDs
  1318. #define LED1_PIN 4
  1319. #define LED1_PIN_INVERSE 0
  1320. // -----------------------------------------------------------------------------
  1321. // Maxcio W-US002S
  1322. // -----------------------------------------------------------------------------
  1323. #elif defined(MAXCIO_WUS002S)
  1324. // Info
  1325. #define MANUFACTURER "MAXCIO"
  1326. #define DEVICE "WUS002S"
  1327. // Buttons
  1328. #define BUTTON1_PIN 2
  1329. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1330. #define BUTTON1_RELAY 1
  1331. // Relays
  1332. #define RELAY1_PIN 13
  1333. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1334. // LEDs
  1335. #define LED1_PIN 3
  1336. #define LED1_PIN_INVERSE 0
  1337. // HLW8012
  1338. #ifndef HLW8012_SUPPORT
  1339. #define HLW8012_SUPPORT 1
  1340. #endif
  1341. #define HLW8012_SEL_PIN 12
  1342. #define HLW8012_CF1_PIN 5
  1343. #define HLW8012_CF_PIN 4
  1344. #define HLW8012_CURRENT_R 0.002 // Current resistor
  1345. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  1346. // -----------------------------------------------------------------------------
  1347. // YiDian XS-SSA05
  1348. // -----------------------------------------------------------------------------
  1349. #elif defined(YIDIAN_XSSSA05)
  1350. // Info
  1351. #define MANUFACTURER "YIDIAN"
  1352. #define DEVICE "XSSSA05"
  1353. // Buttons
  1354. #define BUTTON1_PIN 13
  1355. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1356. #define BUTTON1_RELAY 1
  1357. // Relays
  1358. #define RELAY1_PIN 12
  1359. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1360. // LEDs
  1361. #define LED1_PIN 4
  1362. #define LED1_PIN_INVERSE 0
  1363. // HLW8012
  1364. #ifndef HLW8012_SUPPORT
  1365. #define HLW8012_SUPPORT 1
  1366. #endif
  1367. #define HLW8012_SEL_PIN 3
  1368. #define HLW8012_CF1_PIN 14
  1369. #define HLW8012_CF_PIN 5
  1370. #define HLW8012_CURRENT_R 0.001 // Current resistor
  1371. #define HLW8012_VOLTAGE_R_UP ( 2 * 1200000 ) // Upstream voltage resistor
  1372. // -----------------------------------------------------------------------------
  1373. // TONBUX XS-SSA06
  1374. // -----------------------------------------------------------------------------
  1375. #elif defined(TONBUX_XSSSA06)
  1376. // Info
  1377. #define MANUFACTURER "TONBUX"
  1378. #define DEVICE "XSSSA06"
  1379. // Buttons
  1380. #define BUTTON1_PIN 13
  1381. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1382. #define BUTTON1_RELAY 1
  1383. // Relays
  1384. #define RELAY1_PIN 15
  1385. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1386. // LEDs
  1387. #define LED1_PIN 0 // R - 8 rgb led ring
  1388. #define LED1_PIN_INVERSE 0
  1389. #define LED2_PIN 5 // G
  1390. #define LED2_PIN_INVERSE 0
  1391. #define LED3_PIN 2 // B
  1392. #define LED3_PIN_INVERSE 0
  1393. // -----------------------------------------------------------------------------
  1394. // GREEN ESP8266 RELAY MODULE
  1395. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  1396. // -----------------------------------------------------------------------------
  1397. #elif defined(GREEN_ESP8266RELAY)
  1398. // Info
  1399. #define MANUFACTURER "GREEN"
  1400. #define DEVICE "ESP8266RELAY"
  1401. // Buttons
  1402. // Not a button but input via Optocoupler
  1403. #define BUTTON1_PIN 5
  1404. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1405. #define BUTTON1_RELAY 1
  1406. // Relays
  1407. #define RELAY1_PIN 4
  1408. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1409. // LEDs
  1410. #define LED1_PIN 2
  1411. #define LED1_PIN_INVERSE 1
  1412. // -----------------------------------------------------------------------------
  1413. // Henrique Gravina ESPIKE
  1414. // https://github.com/Henriquegravina/Espike
  1415. // -----------------------------------------------------------------------------
  1416. #elif defined(IKE_ESPIKE)
  1417. #define MANUFACTURER "IKE"
  1418. #define DEVICE "ESPIKE"
  1419. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1420. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1421. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1422. #define BUTTON1_PIN 13
  1423. #define BUTTON1_RELAY 1
  1424. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1425. #define BUTTON2_PIN 12
  1426. #define BUTTON2_RELAY 2
  1427. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1428. #define BUTTON3_PIN 14
  1429. #define BUTTON3_RELAY 3
  1430. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1431. #define RELAY1_PIN 4
  1432. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1433. #define RELAY2_PIN 5
  1434. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1435. #define RELAY3_PIN 16
  1436. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1437. #define LED1_PIN 2
  1438. #define LED1_PIN_INVERSE 1
  1439. // -----------------------------------------------------------------------------
  1440. // SWIFITCH
  1441. // https://github.com/ArnieX/swifitch
  1442. // -----------------------------------------------------------------------------
  1443. #elif defined(ARNIEX_SWIFITCH)
  1444. // Info
  1445. #define MANUFACTURER "ARNIEX"
  1446. #define DEVICE "SWIFITCH"
  1447. // Buttons
  1448. #define BUTTON1_PIN 4 // D2
  1449. #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1450. #define BUTTON1_RELAY 1
  1451. #define BUTTON1_PRESS BUTTON_MODE_NONE
  1452. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  1453. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1454. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1455. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
  1456. // Relays
  1457. #define RELAY1_PIN 5 // D1
  1458. #define RELAY1_TYPE RELAY_TYPE_INVERSE
  1459. // LEDs
  1460. #define LED1_PIN 12 // D6
  1461. #define LED1_PIN_INVERSE 1
  1462. // -----------------------------------------------------------------------------
  1463. // ESP-01S RELAY v4.0
  1464. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  1465. // -----------------------------------------------------------------------------
  1466. #elif defined(GENERIC_ESP01S_RELAY_V40)
  1467. // Info
  1468. #define MANUFACTURER "GENERIC"
  1469. #define DEVICE "ESP01S_RELAY_40"
  1470. // Relays
  1471. #define RELAY1_PIN 0
  1472. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1473. // LEDs
  1474. #define LED1_PIN 2
  1475. #define LED1_PIN_INVERSE 0
  1476. // -----------------------------------------------------------------------------
  1477. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  1478. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  1479. // -----------------------------------------------------------------------------
  1480. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  1481. // Info
  1482. #define MANUFACTURER "GENERIC"
  1483. #define DEVICE "ESP01S_RGBLED_10"
  1484. // This board is sold as RGB LED module BUT it has on board 3 pin ph2.0 connector (VCC, GPIO2, GND)
  1485. // so, if you wish, you may connect LED, BUTTON, RELAY, SENSOR etc.
  1486. // Buttons
  1487. //#define BUTTON1_PIN 2
  1488. // Relays
  1489. //#define RELAY1_PIN 2
  1490. // LEDs
  1491. #define LED1_PIN 2
  1492. #define LED1_PIN_INVERSE 0
  1493. // -----------------------------------------------------------------------------
  1494. // ESP-01S DHT11 v1.0
  1495. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  1496. // -----------------------------------------------------------------------------
  1497. #elif defined(GENERIC_ESP01S_DHT11_V10)
  1498. // Info
  1499. #define MANUFACTURER "GENERIC"
  1500. #define DEVICE "ESP01S_DHT11_10"
  1501. // DHT11
  1502. #ifndef DHT_SUPPORT
  1503. #define DHT_SUPPORT 1
  1504. #endif
  1505. #define DHT_PIN 2
  1506. #define DHT_TYPE DHT_CHIP_DHT11
  1507. // -----------------------------------------------------------------------------
  1508. // ESP-01S DS18B20 v1.0
  1509. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  1510. // -----------------------------------------------------------------------------
  1511. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  1512. // Info
  1513. #define MANUFACTURER "GENERIC"
  1514. #define DEVICE "ESP01S_DS18B20_10"
  1515. // DB18B20
  1516. #ifndef DALLAS_SUPPORT
  1517. #define DALLAS_SUPPORT 1
  1518. #endif
  1519. #define DALLAS_PIN 2
  1520. // -----------------------------------------------------------------------------
  1521. // ESP-DIN relay board V1
  1522. // https://github.com/pilotak/esp_din
  1523. // -----------------------------------------------------------------------------
  1524. #elif defined(PILOTAK_ESP_DIN_V1)
  1525. // Info
  1526. #define MANUFACTURER "PILOTAK"
  1527. #define DEVICE "ESP_DIN_V1"
  1528. // Buttons
  1529. #define BUTTON1_PIN 0
  1530. #define BUTTON1_RELAY 1
  1531. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1532. // Relays
  1533. #define RELAY1_PIN 4
  1534. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1535. #define RELAY2_PIN 5
  1536. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1537. // LEDs
  1538. #define LED1_PIN 15
  1539. #define LED1_PIN_INVERSE 0
  1540. #define I2C_SDA_PIN 12
  1541. #define I2C_SCL_PIN 13
  1542. #ifndef DALLAS_SUPPORT
  1543. #define DALLAS_SUPPORT 1
  1544. #endif
  1545. #define DALLAS_PIN 2
  1546. #ifndef RF_SUPPORT
  1547. #define RF_SUPPORT 1
  1548. #endif
  1549. #define RF_PIN 14
  1550. #ifndef DIGITAL_SUPPORT
  1551. #define DIGITAL_SUPPORT 1
  1552. #endif
  1553. #define DIGITAL_PIN 16
  1554. #define DIGITAL_PIN_MODE INPUT
  1555. // -----------------------------------------------------------------------------
  1556. // Heltec Touch Relay
  1557. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  1558. // -----------------------------------------------------------------------------
  1559. #elif defined(HELTEC_TOUCHRELAY)
  1560. // Info
  1561. #define MANUFACTURER "HELTEC"
  1562. #define DEVICE "TOUCH_RELAY"
  1563. // Buttons
  1564. #define BUTTON1_PIN 14
  1565. #define BUTTON1_RELAY 1
  1566. #define BUTTON1_MODE BUTTON_PUSHBUTTON
  1567. // Relays
  1568. #define RELAY1_PIN 12
  1569. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1570. // -----------------------------------------------------------------------------
  1571. // Zhilde ZLD-EU44-W
  1572. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  1573. // -----------------------------------------------------------------------------
  1574. #elif defined(ZHILDE_EU44_W)
  1575. // Info
  1576. #define MANUFACTURER "ZHILDE"
  1577. #define DEVICE "EU44_W"
  1578. // Based on the reporter, this product uses GPIO1 and 3 for the button
  1579. // and onboard LED, so hardware serial should be disabled...
  1580. #define DEBUG_SERIAL_SUPPORT 0
  1581. // Buttons
  1582. #define BUTTON1_PIN 3
  1583. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1584. // Relays
  1585. #define RELAY1_PIN 5
  1586. #define RELAY2_PIN 4
  1587. #define RELAY3_PIN 12
  1588. #define RELAY4_PIN 13
  1589. #define RELAY5_PIN 14
  1590. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1591. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1592. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1593. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1594. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  1595. // LEDs
  1596. #define LED1_PIN 1
  1597. #define LED1_PIN_INVERSE 1
  1598. // -----------------------------------------------------------------------------
  1599. // Allnet 4duino ESP8266-UP-Relais
  1600. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  1601. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  1602. // -----------------------------------------------------------------------------
  1603. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  1604. // Info
  1605. #define MANUFACTURER "ALLNET"
  1606. #define DEVICE "4DUINO_IOT_WLAN_RELAIS"
  1607. // Relays
  1608. #define RELAY1_PIN 14
  1609. #define RELAY1_RESET_PIN 12
  1610. #define RELAY1_TYPE RELAY_TYPE_LATCHED
  1611. // LEDs
  1612. #define LED1_PIN 0
  1613. #define LED1_PIN_INVERSE 1
  1614. // Buttons
  1615. //#define BUTTON1_PIN 0
  1616. //#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1617. // Using pins labelled as SDA & SCL as buttons
  1618. #define BUTTON2_PIN 4
  1619. #define BUTTON2_MODE BUTTON_PUSHBUTTON
  1620. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  1621. #define BUTTON2_CLICK BUTTON_MODE_NONE
  1622. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  1623. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  1624. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  1625. #define BUTTON3_PIN 5
  1626. #define BUTTON3_MODE BUTTON_PUSHBUTTON
  1627. // Using pins labelled as SDA & SCL for I2C
  1628. //#define I2C_SDA_PIN 4
  1629. //#define I2C_SCL_PIN 5
  1630. // -----------------------------------------------------------------------------
  1631. // Luani HVIO
  1632. // https://luani.de/projekte/esp8266-hvio/
  1633. // https://luani.de/blog/esp8266-230v-io-modul/
  1634. // -----------------------------------------------------------------------------
  1635. #elif defined(LUANI_HVIO)
  1636. // Info
  1637. #define MANUFACTURER "LUANI"
  1638. #define DEVICE "HVIO"
  1639. // Buttons
  1640. #define BUTTON1_PIN 12
  1641. #define BUTTON1_RELAY 1
  1642. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1643. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1644. #define BUTTON2_PIN 13
  1645. #define BUTTON2_RELAY 2
  1646. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1647. // Relays
  1648. #define RELAY1_PIN 4
  1649. #define RELAY2_PIN 5
  1650. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1651. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1652. // LEDs
  1653. #define LED1_PIN 15
  1654. #define LED1_PIN_INVERSE 0
  1655. // -----------------------------------------------------------------------------
  1656. // Tonbux 50-100M Smart Mosquito Killer USB
  1657. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  1658. // -----------------------------------------------------------------------------
  1659. #elif defined(TONBUX_MOSQUITO_KILLER)
  1660. // Info
  1661. #define MANUFACTURER "TONBUX"
  1662. #define DEVICE "MOSQUITO_KILLER"
  1663. // Buttons
  1664. #define BUTTON1_PIN 2
  1665. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1666. #define BUTTON1_RELAY 1
  1667. // Relays
  1668. #define RELAY1_PIN 5 // not a relay, fan
  1669. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1670. // LEDs
  1671. #define LED1_PIN 15 // blue led
  1672. #define LED1_PIN_INVERSE 1
  1673. #define LED1_MODE LED_MODE_WIFI
  1674. #define LED2_PIN 14 // red led
  1675. #define LED2_PIN_INVERSE 1
  1676. #define LED2_MODE LED_MODE_RELAY
  1677. #define LED3_PIN 12 // UV leds (1-2-3-4-5-6-7-8)
  1678. #define LED3_PIN_INVERSE 0
  1679. #define LED3_RELAY 1
  1680. #define LED4_PIN 16 // UV leds (9-10-11)
  1681. #define LED4_PIN_INVERSE 0
  1682. #define LED4_RELAY 1
  1683. // -----------------------------------------------------------------------------
  1684. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  1685. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  1686. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  1687. // -----------------------------------------------------------------------------
  1688. #elif defined(NEO_COOLCAM_NAS_WR01W)
  1689. // Info
  1690. #define MANUFACTURER "NEO_COOLCAM"
  1691. #define DEVICE "NAS_WR01W"
  1692. // Buttons
  1693. #define BUTTON1_PIN 13
  1694. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1695. #define BUTTON1_RELAY 1
  1696. // Relays
  1697. #define RELAY1_PIN 12
  1698. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1699. // LEDs
  1700. #define LED1_PIN 4
  1701. #define LED1_PIN_INVERSE 1
  1702. // ------------------------------------------------------------------------------
  1703. // Estink Wifi Power Strip
  1704. // https://www.amazon.de/Steckdosenleiste-Ladeger%C3%A4t-Sprachsteuerung-SmartphonesTablets-Android/dp/B0796W5FZY
  1705. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  1706. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  1707. // -----------------------------------------------------------------------------
  1708. #elif defined(ESTINK_WIFI_POWER_STRIP)
  1709. // Info
  1710. #define MANUFACTURER "ESTINK"
  1711. #define DEVICE "WIFI_POWER_STRIP"
  1712. // Disable UART noise since this board uses GPIO3
  1713. #define DEBUG_SERIAL_SUPPORT 0
  1714. // Buttons
  1715. #define BUTTON1_PIN 16
  1716. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1717. #define BUTTON1_RELAY 4
  1718. // Relays
  1719. #define RELAY1_PIN 14 // USB power
  1720. #define RELAY2_PIN 13 // power plug 1
  1721. #define RELAY3_PIN 4 // power plug 2
  1722. #define RELAY4_PIN 15 // power plug 3
  1723. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1724. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1725. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  1726. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  1727. // LEDs
  1728. #define LED1_PIN 0 // power led
  1729. #define LED2_PIN 12 // power plug 1
  1730. #define LED3_PIN 3 // power plug 2
  1731. #define LED4_PIN 5 // power plug 3
  1732. #define LED1_PIN_INVERSE 1
  1733. #define LED2_PIN_INVERSE 1
  1734. #define LED3_PIN_INVERSE 1
  1735. #define LED4_PIN_INVERSE 1
  1736. #define LED1_MODE LED_MODE_FINDME
  1737. #define LED2_MODE LED_MODE_FOLLOW
  1738. #define LED3_MODE LED_MODE_FOLLOW
  1739. #define LED4_MODE LED_MODE_FOLLOW
  1740. #define LED2_RELAY 2
  1741. #define LED3_RELAY 3
  1742. #define LED4_RELAY 4
  1743. // -----------------------------------------------------------------------------
  1744. // Bruno Horta's OnOfre
  1745. // https://www.bhonofre.pt/
  1746. // https://github.com/brunohorta82/BH_OnOfre/
  1747. // -----------------------------------------------------------------------------
  1748. #elif defined(BH_ONOFRE)
  1749. // Info
  1750. #define MANUFACTURER "BH"
  1751. #define DEVICE "ONOFRE"
  1752. // Buttons
  1753. #define BUTTON1_PIN 12
  1754. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1755. #define BUTTON1_RELAY 1
  1756. #define BUTTON2_PIN 13
  1757. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
  1758. #define BUTTON2_RELAY 2
  1759. // Relays
  1760. #define RELAY1_PIN 4
  1761. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1762. #define RELAY2_PIN 5
  1763. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1764. // -----------------------------------------------------------------------------
  1765. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  1766. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  1767. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  1768. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  1769. // * Goosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  1770. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  1771. // -----------------------------------------------------------------------------
  1772. #elif defined(BLITZWOLF_BWSHP2)
  1773. // Info
  1774. #define MANUFACTURER "BLITZWOLF"
  1775. #define DEVICE "BWSHP2"
  1776. // Buttons
  1777. #define BUTTON1_PIN 13
  1778. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1779. #define BUTTON1_RELAY 1
  1780. // Relays
  1781. #define RELAY1_PIN 15
  1782. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1783. // LEDs
  1784. #define LED1_PIN 2
  1785. #define LED1_PIN_INVERSE 1
  1786. #define LED2_PIN 0
  1787. #define LED2_PIN_INVERSE 1
  1788. #define LED2_MODE LED_MODE_FINDME
  1789. #define LED2_RELAY 1
  1790. // HJL01 / BL0937
  1791. #ifndef HLW8012_SUPPORT
  1792. #define HLW8012_SUPPORT 1
  1793. #endif
  1794. #define HLW8012_SEL_PIN 12
  1795. #define HLW8012_CF1_PIN 14
  1796. #define HLW8012_CF_PIN 5
  1797. #define HLW8012_SEL_CURRENT LOW
  1798. #define HLW8012_CURRENT_RATIO 25740
  1799. #define HLW8012_VOLTAGE_RATIO 313400
  1800. #define HLW8012_POWER_RATIO 3414290
  1801. #define HLW8012_INTERRUPT_ON FALLING
  1802. // -----------------------------------------------------------------------------
  1803. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  1804. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  1805. // -----------------------------------------------------------------------------
  1806. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  1807. // Info
  1808. #define MANUFACTURER "VANZAVANZU"
  1809. #define DEVICE "SMART_WIFI_PLUG_MINI"
  1810. // Buttons
  1811. #define BUTTON1_PIN 13
  1812. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1813. #define BUTTON1_RELAY 1
  1814. // Relays
  1815. #define RELAY1_PIN 15
  1816. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1817. // LEDs
  1818. #define LED1_PIN 2
  1819. #define LED1_PIN_INVERSE 1
  1820. #define LED2_PIN 0
  1821. #define LED2_PIN_INVERSE 1
  1822. #define LED2_MODE LED_MODE_FINDME
  1823. #define LED2_RELAY 1
  1824. // Disable UART noise
  1825. #define DEBUG_SERIAL_SUPPORT 0
  1826. // HJL01 / BL0937
  1827. #ifndef HLW8012_SUPPORT
  1828. #define HLW8012_SUPPORT 1
  1829. #endif
  1830. #define HLW8012_SEL_PIN 3
  1831. #define HLW8012_CF1_PIN 14
  1832. #define HLW8012_CF_PIN 5
  1833. #define HLW8012_SEL_CURRENT LOW
  1834. #define HLW8012_CURRENT_RATIO 25740
  1835. #define HLW8012_VOLTAGE_RATIO 313400
  1836. #define HLW8012_POWER_RATIO 3414290
  1837. #define HLW8012_INTERRUPT_ON FALLING
  1838. #elif defined(GENERIC_AG_L4)
  1839. // Info
  1840. #define MANUFACTURER "GENERIC"
  1841. #define DEVICE "AG_L4"
  1842. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1843. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1844. #define DUMMY_RELAY_COUNT 1
  1845. // button 1: "power" button
  1846. #define BUTTON1_PIN 4
  1847. #define BUTTON1_RELAY 1
  1848. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  1849. #define BUTTON1_PRESS BUTTON_MODE_TOGGLE
  1850. #define BUTTON1_CLICK BUTTON_MODE_NONE
  1851. #define BUTTON1_DBLCLICK BUTTON_MODE_NONE
  1852. #define BUTTON1_LNGCLICK BUTTON_MODE_NONE
  1853. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_RESET
  1854. // button 2: "wifi" button
  1855. #define BUTTON2_PIN 2
  1856. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1857. #define BUTTON2_PRESS BUTTON_MODE_TOGGLE
  1858. #define BUTTON2_CLICK BUTTON_MODE_NONE
  1859. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  1860. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  1861. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  1862. // LEDs
  1863. #define LED1_PIN 5 // red status led
  1864. #define LED1_PIN_INVERSE 0
  1865. #define LED2_PIN 16 // master light power
  1866. #define LED2_PIN_INVERSE 1
  1867. #define LED2_MODE LED_MODE_RELAY
  1868. // Light
  1869. #define LIGHT_CHANNELS 3
  1870. #define LIGHT_CH1_PIN 14 // RED
  1871. #define LIGHT_CH2_PIN 13 // GREEN
  1872. #define LIGHT_CH3_PIN 12 // BLUE
  1873. #define LIGHT_CH1_INVERSE 0
  1874. #define LIGHT_CH2_INVERSE 0
  1875. #define LIGHT_CH3_INVERSE 0
  1876. // -----------------------------------------------------------------------------
  1877. // Generic board with Geiger Counter
  1878. // -----------------------------------------------------------------------------
  1879. #elif defined(GENERIC_GEIGER_COUNTER)
  1880. // Info
  1881. #define MANUFACTURER "GENERIC"
  1882. #define DEVICE "GEIGER_COUNTER"
  1883. // Enable Geiger Counter
  1884. #define GEIGER_SUPPORT 1
  1885. // Disable uneeded modules
  1886. #define ALEXA_SUPPORT 0
  1887. #define SCHEDULER_SUPPORT 0
  1888. // -----------------------------------------------------------------------------
  1889. // TEST boards (do not use!!)
  1890. // -----------------------------------------------------------------------------
  1891. #elif defined(TRAVIS01)
  1892. // Info
  1893. #define MANUFACTURER "TravisCI"
  1894. #define DEVICE "Virtual board 01"
  1895. // Some buttons - pin 0
  1896. #define BUTTON1_PIN 0
  1897. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  1898. #define BUTTON1_RELAY 1
  1899. // Some relays - pin 1
  1900. #define RELAY1_PIN 1
  1901. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1902. // Some LEDs - pin 2
  1903. #define LED1_PIN 2
  1904. #define LED1_PIN_INVERSE 1
  1905. // A bit of I2C - pins 3,4
  1906. #define I2C_SDA_PIN 3
  1907. #define I2C_SCL_PIN 4
  1908. // And, as they say in "From Dusk till Dawn":
  1909. // This is a sensor blow out!
  1910. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  1911. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  1912. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  1913. // C'mon, you want sensor, come on in sensor lovers!
  1914. // If we don’t got it, you don't want it!
  1915. #define AM2320_SUPPORT 1
  1916. #define BH1750_SUPPORT 1
  1917. #define BMX280_SUPPORT 1
  1918. #define SHT3X_I2C_SUPPORT 1
  1919. #define EMON_ADC121_SUPPORT 1
  1920. #define EMON_ADS1X15_SUPPORT 1
  1921. #define SHT3X_I2C_SUPPORT 1
  1922. #define SI7021_SUPPORT 1
  1923. #define PMSX003_SUPPORT 1
  1924. #define SENSEAIR_SUPPORT 1
  1925. // A bit of lights - pin 5
  1926. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  1927. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  1928. #define DUMMY_RELAY_COUNT 1
  1929. #define LIGHT_CHANNELS 1
  1930. #define LIGHT_CH1_PIN 5
  1931. #define LIGHT_CH1_INVERSE 0
  1932. // A bit of HLW8012 - pins 6,7,8
  1933. #ifndef HLW8012_SUPPORT
  1934. #define HLW8012_SUPPORT 1
  1935. #endif
  1936. #define HLW8012_SEL_PIN 6
  1937. #define HLW8012_CF1_PIN 7
  1938. #define HLW8012_CF_PIN 8
  1939. // A bit of Dallas - pin 9
  1940. #ifndef DALLAS_SUPPORT
  1941. #define DALLAS_SUPPORT 1
  1942. #endif
  1943. #define DALLAS_PIN 9
  1944. // A bit of ECH1560 - pins 10,11, 12
  1945. #ifndef ECH1560_SUPPORT
  1946. #define ECH1560_SUPPORT 1
  1947. #endif
  1948. #define ECH1560_CLK_PIN 10
  1949. #define ECH1560_MISO_PIN 11
  1950. #define ECH1560_INVERTED 12
  1951. #elif defined(TRAVIS02)
  1952. // Relay provider dual
  1953. #define MANUFACTURER "TravisCI"
  1954. #define DEVICE "Virtual board 02"
  1955. // A bit of CSE7766 - pin 1
  1956. #ifndef CSE7766_SUPPORT
  1957. #define CSE7766_SUPPORT 1
  1958. #endif
  1959. #define CSE7766_PIN 1
  1960. // Relay type dual - pins 2,3
  1961. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  1962. #define RELAY1_PIN 2
  1963. #define RELAY2_PIN 3
  1964. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  1965. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  1966. // IR - pin 4
  1967. #define IR_SUPPORT 1
  1968. #define IR_PIN 4
  1969. #define IR_BUTTON_SET 1
  1970. // A bit of DHT - pin 5
  1971. #ifndef DHT_SUPPORT
  1972. #define DHT_SUPPORT 1
  1973. #endif
  1974. #define DHT_PIN 5
  1975. // A bit of TMP3X (analog)
  1976. #define TMP3X_SUPPORT 1
  1977. // A bit of EVENTS - pin 10
  1978. #define EVENTS_SUPPORT 1
  1979. #define EVENTS_PIN 6
  1980. // HC-RS04
  1981. #define HCSR04_SUPPORT 1
  1982. #define HCSR04_TRIGGER 7
  1983. #define HCSR04_ECHO 8
  1984. // MHZ19
  1985. #define MHZ19_SUPPORT 1
  1986. #define MHZ19_RX_PIN 9
  1987. #define MHZ19_TX_PIN 10
  1988. // PZEM004T
  1989. #define PZEM004T_SUPPORT 1
  1990. #define PZEM004T_RX_PIN 11
  1991. #define PZEM004T_TX_PIN 12
  1992. // V9261F
  1993. #define V9261F_SUPPORT 1
  1994. #define V9261F_PIN 13
  1995. // GUVAS12SD
  1996. #define GUVAS12SD_SUPPORT 1
  1997. #define GUVAS12SD_PIN 14
  1998. // Test non-default modules
  1999. #define MDNS_CLIENT_SUPPORT 1
  2000. #define NOFUSS_SUPPORT 1
  2001. #define UART_MQTT_SUPPORT 1
  2002. #define INFLUXDB_SUPPORT 1
  2003. #define IR_SUPPORT 1
  2004. #elif defined(TRAVIS03)
  2005. // Relay provider light/my92XX
  2006. #define MANUFACTURER "TravisCI"
  2007. #define DEVICE "Virtual board 03"
  2008. // MY9231 Light - pins 1,2
  2009. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  2010. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  2011. #define DUMMY_RELAY_COUNT 1
  2012. #define LIGHT_CHANNELS 5
  2013. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  2014. #define MY92XX_CHIPS 2
  2015. #define MY92XX_DI_PIN 1
  2016. #define MY92XX_DCKI_PIN 2
  2017. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  2018. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  2019. // A bit of Analog EMON (analog)
  2020. #ifndef EMON_ANALOG_SUPPORT
  2021. #define EMON_ANALOG_SUPPORT 1
  2022. #endif
  2023. // Test non-default modules
  2024. #define LLMNR_SUPPORT 1
  2025. #define NETBIOS_SUPPORT 1
  2026. #define SSDP_SUPPORT 1
  2027. #endif
  2028. // -----------------------------------------------------------------------------
  2029. // Check definitions
  2030. // -----------------------------------------------------------------------------
  2031. //#if not defined(MANUFACTURER) || not defined(DEVICE)
  2032. // #error "UNSUPPORTED HARDWARE!!"
  2033. //#endif