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.

1334 lines
45 KiB

7 years ago
7 years ago
7 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. // -----------------------------------------------------------------------------
  2. // Devices
  3. // -----------------------------------------------------------------------------
  4. // New boards have to be added just before the BOARD_LAST line,
  5. // then add configuration in the hardware.ino
  6. enum boards {
  7. BOARD_UNKNOWN,
  8. BOARD_CUSTOM,
  9. BOARD_NODEMCU_LOLIN,
  10. BOARD_WEMOS_D1_MINI_RELAYSHIELD,
  11. BOARD_ITEAD_SONOFF_BASIC,
  12. BOARD_ITEAD_SONOFF_TH,
  13. BOARD_ITEAD_SONOFF_SV,
  14. BOARD_ITEAD_SONOFF_TOUCH,
  15. BOARD_ITEAD_SONOFF_POW,
  16. BOARD_ITEAD_SONOFF_DUAL,
  17. BOARD_ITEAD_1CH_INCHING,
  18. BOARD_ITEAD_SONOFF_4CH,
  19. BOARD_ITEAD_SLAMPHER,
  20. BOARD_ITEAD_S20,
  21. BOARD_ELECTRODRAGON_WIFI_IOT,
  22. BOARD_WORKCHOICE_ECOPLUG,
  23. BOARD_JANGOE_WIFI_RELAY_NC,
  24. BOARD_JANGOE_WIFI_RELAY_NO,
  25. BOARD_OPENENERGYMONITOR_MQTT_RELAY,
  26. BOARD_JORGEGARCIA_WIFI_RELAYS,
  27. BOARD_AITHINKER_AI_LIGHT,
  28. BOARD_MAGICHOME_LED_CONTROLLER,
  29. BOARD_ITEAD_MOTOR,
  30. BOARD_TINKERMAN_ESPURNA_H06,
  31. BOARD_HUACANXING_H801,
  32. BOARD_ITEAD_BNSZ01,
  33. BOARD_ITEAD_SONOFF_RFBRIDGE,
  34. BOARD_ITEAD_SONOFF_4CH_PRO,
  35. BOARD_ITEAD_SONOFF_B1,
  36. BOARD_ITEAD_SONOFF_LED,
  37. BOARD_ITEAD_SONOFF_T1_1CH,
  38. BOARD_ITEAD_SONOFF_T1_2CH,
  39. BOARD_ITEAD_SONOFF_T1_3CH,
  40. BOARD_ITEAD_SONOFF_RF,
  41. BOARD_WION_50055,
  42. BOARD_EXS_WIFI_RELAY_V31,
  43. BOARD_HUACANXING_H802,
  44. BOARD_GENERIC_V9261F,
  45. BOARD_GENERIC_ECH1560,
  46. BOARD_TINKERMAN_ESPURNA_H08,
  47. BOARD_MANCAVEMADE_ESPLIVE,
  48. BOARD_INTERMITTECH_QUINLED,
  49. BOARD_MAGICHOME_LED_CONTROLLER_20,
  50. BOARD_ARILUX_AL_LC06,
  51. BOARD_XENON_SM_PW702U,
  52. BOARD_AUTHOMETION_LYT8266,
  53. BOARD_ARILUX_E27,
  54. BOARD_YJZK_SWITCH_2CH,
  55. BOARD_ITEAD_SONOFF_DUAL_R2,
  56. BOARD_GENERIC_8CH,
  57. BOARD_ARILUX_AL_LC01,
  58. BOARD_ARILUX_AL_LC11,
  59. BOARD_ARILUX_AL_LC02,
  60. BOARD_KMC_70011,
  61. BOARD_GIZWITS_WITTY_CLOUD,
  62. BOARD_EUROMATE_WIFI_STECKER_SCHUKO,
  63. BOARD_TONBUX_POWERSTRIP02,
  64. BOARD_LINGAN_SWA1,
  65. BOARD_HEYGO_HY02,
  66. BOARD_MAXCIO_WUS002S,
  67. BOARD_YIDIAN_XSSSA05,
  68. BOARD_TONBUX_XSSSA06,
  69. BOARD_GREEN_ESP8266RELAY,
  70. BOARD_IKE_ESPIKE,
  71. BOARD_ARNIEX_SWIFITCH,
  72. BOARD_GENERIC_ESP01S_RELAY_V40,
  73. BOARD_GENERIC_ESP01S_RGBLED_V10,
  74. BOARD_HELTEC_TOUCHRELAY,
  75. BOARD_GENERIC_ESP01S_DHT11_V10,
  76. BOARD_GENERIC_ESP01S_DS18B20_V10,
  77. BOARD_ZHILDE_EU44_W,
  78. BOARD_ITEAD_SONOFF_POW_R2,
  79. BOARD_LUANI_HVIO,
  80. BOARD_ALLNET_4DUINO_IOT_WLAN_RELAIS,
  81. BOARD_TONBUX_MOSQUITO_KILLER,
  82. BOARD_NEO_COOLCAM_NAS_WR01W,
  83. BOARD_PILOTAK_ESP_DIN_V1,
  84. BOARD_ESTINK_WIFI_POWER_STRIP,
  85. BOARD_BH_ONOFRE,
  86. BOARD_BLITZWOLF_BWSHP2,
  87. BOARD_TINKERMAN_ESPURNA_SWITCH,
  88. BOARD_ITEAD_SONOFF_S31,
  89. BOARD_STM_RELAY,
  90. BOARD_VANZAVANZU_SMART_WIFI_PLUG_MINI,
  91. BOARD_GENERIC_GEIGER_COUNTER,
  92. BOARD_TINKERMAN_RFM69GW,
  93. BOARD_ITEAD_SONOFF_IFAN02,
  94. BOARD_GENERIC_AG_L4,
  95. BOARD_LAST
  96. };
  97. // -----------------------------------------------------------------------------
  98. // Development boards
  99. // -----------------------------------------------------------------------------
  100. #if defined(NODEMCU_LOLIN)
  101. #define ESPURNA_IMAGE ESPURNA_BASIC
  102. #elif defined(WEMOS_D1_MINI_RELAYSHIELD)
  103. #define ESPURNA_IMAGE ESPURNA_BASIC
  104. // -----------------------------------------------------------------------------
  105. // ESPurna
  106. // -----------------------------------------------------------------------------
  107. #elif defined(TINKERMAN_ESPURNA_H06)
  108. #define ESPURNA_IMAGE ESPURNA_POWER
  109. // HLW8012
  110. #ifndef HLW8012_SUPPORT
  111. #define HLW8012_SUPPORT 1
  112. #endif
  113. #define HLW8012_SEL_PIN 2
  114. #define HLW8012_CF1_PIN 13
  115. #define HLW8012_CF_PIN 14
  116. #elif defined(TINKERMAN_ESPURNA_H08)
  117. #define ESPURNA_IMAGE ESPURNA_POWER
  118. // HLW8012
  119. #ifndef HLW8012_SUPPORT
  120. #define HLW8012_SUPPORT 1
  121. #endif
  122. #define HLW8012_SEL_PIN 5
  123. #define HLW8012_CF1_PIN 13
  124. #define HLW8012_CF_PIN 14
  125. #elif defined(TINKERMAN_ESPURNA_SWITCH)
  126. #define ESPURNA_IMAGE ESPURNA_BASIC
  127. // Check http://tinkerman.cat/rfm69-wifi-gateway/
  128. #elif defined(TINKERMAN_RFM69GW)
  129. #define ESPURNA_IMAGE ESPURNA_RFM69
  130. // RFM69GW
  131. #define RFM69_SUPPORT 1
  132. // Disable non-core modules
  133. #define ALEXA_SUPPORT 0
  134. #define DOMOTICZ_SUPPORT 0
  135. #define HOMEASSISTANT_SUPPORT 0
  136. #define I2C_SUPPORT 0
  137. #define SCHEDULER_SUPPORT 0
  138. #define SENSOR_SUPPORT 0
  139. #define THINGSPEAK_SUPPORT 0
  140. // -----------------------------------------------------------------------------
  141. // Itead Studio boards
  142. // -----------------------------------------------------------------------------
  143. #elif defined(ITEAD_SONOFF_BASIC)
  144. #define ESPURNA_IMAGE ESPURNA_BASIC
  145. #elif defined(ITEAD_SONOFF_RF)
  146. #define ESPURNA_IMAGE ESPURNA_BASIC
  147. #elif defined(ITEAD_SONOFF_TH)
  148. #define ESPURNA_IMAGE ESPURNA_SENSOR
  149. // Jack is connected to GPIO14 (and with a small hack to GPIO4)
  150. #ifndef DALLAS_SUPPORT
  151. #define DALLAS_SUPPORT 1
  152. #endif
  153. #define DALLAS_PIN 14
  154. #ifndef DHT_SUPPORT
  155. #define DHT_SUPPORT 1
  156. #endif
  157. #define DHT_PIN 14
  158. #elif defined(ITEAD_SONOFF_SV)
  159. #define ESPURNA_IMAGE ESPURNA_BASIC
  160. #elif defined(ITEAD_SLAMPHER)
  161. #define ESPURNA_IMAGE ESPURNA_BASIC
  162. #elif defined(ITEAD_S20)
  163. #define ESPURNA_IMAGE ESPURNA_BASIC
  164. #elif defined(ITEAD_SONOFF_TOUCH)
  165. #define ESPURNA_IMAGE ESPURNA_BASIC
  166. #elif defined(ITEAD_SONOFF_POW)
  167. #define ESPURNA_IMAGE ESPURNA_POWER
  168. // HLW8012
  169. #ifndef HLW8012_SUPPORT
  170. #define HLW8012_SUPPORT 1
  171. #endif
  172. #define HLW8012_SEL_PIN 5
  173. #define HLW8012_CF1_PIN 13
  174. #define HLW8012_CF_PIN 14
  175. #elif defined(ITEAD_SONOFF_POW_R2)
  176. #define ESPURNA_IMAGE ESPURNA_POWER
  177. // Disable UART noise
  178. #define DEBUG_SERIAL_SUPPORT 0
  179. // CSE7766
  180. #ifndef CSE7766_SUPPORT
  181. #define CSE7766_SUPPORT 1
  182. #endif
  183. #define CSE7766_PIN 1
  184. #elif defined(ITEAD_SONOFF_DUAL)
  185. #define ESPURNA_IMAGE ESPURNA_SONOFF_DUAL
  186. #define SERIAL_BAUDRATE 19230
  187. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  188. #define DEBUG_SERIAL_SUPPORT 0
  189. #elif defined(ITEAD_SONOFF_DUAL_R2)
  190. #define ESPURNA_IMAGE ESPURNA_BASIC
  191. #elif defined(ITEAD_SONOFF_4CH)
  192. #define ESPURNA_IMAGE ESPURNA_BASIC
  193. #elif defined(ITEAD_SONOFF_4CH_PRO)
  194. #define ESPURNA_IMAGE ESPURNA_BASIC
  195. #elif defined(ITEAD_1CH_INCHING)
  196. #define ESPURNA_IMAGE ESPURNA_BASIC
  197. #elif defined(ITEAD_MOTOR)
  198. #define ESPURNA_IMAGE ESPURNA_BASIC
  199. #elif defined(ITEAD_BNSZ01)
  200. #define ESPURNA_IMAGE ESPURNA_LIGHT
  201. // Info
  202. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  203. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  204. #define LIGHT_CHANNELS 1
  205. #define LIGHT_CH1_PIN 12
  206. #define LIGHT_CH1_INVERSE 0
  207. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  208. #define ESPURNA_IMAGE ESPURNA_SONOFF_RFBRIDGE
  209. // Info
  210. #define RELAY_PROVIDER RELAY_PROVIDER_RFBRIDGE
  211. // RFB Direct hack thanks to @wildwiz
  212. // https://github.com/xoseperez/espurna/wiki/Hardware-Itead-Sonoff-RF-Bridge---Direct-Hack
  213. #ifndef RFB_DIRECT
  214. #define RFB_DIRECT 0
  215. #endif
  216. #ifndef RFB_RX_PIN
  217. #define RFB_RX_PIN 4 // GPIO for RX when RFB_DIRECT
  218. #endif
  219. #ifndef RFB_TX_PIN
  220. #define RFB_TX_PIN 5 // GPIO for TX when RFB_DIRECT
  221. #endif
  222. // When using un-modified harware, ESPurna communicates with the secondary
  223. // MCU EFM8BB1 via UART at 19200 bps so we need to change the speed of
  224. // the port and remove UART noise on serial line
  225. #if not RFB_DIRECT
  226. #define SERIAL_BAUDRATE 19200
  227. #define DEBUG_SERIAL_SUPPORT 0
  228. #endif
  229. #elif defined(ITEAD_SONOFF_B1)
  230. #define ESPURNA_IMAGE ESPURNA_LIGHT
  231. // Info
  232. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  233. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  234. #define LIGHT_CHANNELS 5
  235. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  236. #define MY92XX_CHIPS 2
  237. #define MY92XX_DI_PIN 12
  238. #define MY92XX_DCKI_PIN 14
  239. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  240. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  241. #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1
  242. #elif defined(ITEAD_SONOFF_LED)
  243. #define ESPURNA_IMAGE ESPURNA_LIGHT
  244. // Info
  245. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  246. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  247. #define LIGHT_CHANNELS 2
  248. #define LIGHT_CH1_PIN 12 // Cold white
  249. #define LIGHT_CH2_PIN 14 // Warm white
  250. #define LIGHT_CH1_INVERSE 0
  251. #define LIGHT_CH2_INVERSE 0
  252. #elif defined(ITEAD_SONOFF_T1_1CH)
  253. #define ESPURNA_IMAGE ESPURNA_BASIC
  254. #elif defined(ITEAD_SONOFF_T1_2CH)
  255. #define ESPURNA_IMAGE ESPURNA_BASIC
  256. #elif defined(ITEAD_SONOFF_T1_3CH)
  257. #define ESPURNA_IMAGE ESPURNA_BASIC
  258. #elif defined(ITEAD_SONOFF_S31)
  259. #define ESPURNA_IMAGE ESPURNA_POWER
  260. // Disable UART noise
  261. #define DEBUG_SERIAL_SUPPORT 0
  262. // CSE7766
  263. #define CSE7766_SUPPORT 1
  264. #define CSE7766_PIN 1
  265. #elif defined(ITEAD_SONOFF_IFAN02)
  266. #define ESPURNA_IMAGE ESPURNA_BASIC
  267. // -----------------------------------------------------------------------------
  268. // YJZK
  269. // -----------------------------------------------------------------------------
  270. #elif defined(YJZK_SWITCH_2CH)
  271. #define ESPURNA_IMAGE ESPURNA_BASIC
  272. // -----------------------------------------------------------------------------
  273. // Electrodragon boards
  274. // -----------------------------------------------------------------------------
  275. #elif defined(ELECTRODRAGON_WIFI_IOT)
  276. #define ESPURNA_IMAGE ESPURNA_BASIC
  277. // -----------------------------------------------------------------------------
  278. // WorkChoice ecoPlug
  279. // -----------------------------------------------------------------------------
  280. #elif defined(WORKCHOICE_ECOPLUG)
  281. #define ESPURNA_IMAGE ESPURNA_BASIC
  282. // -----------------------------------------------------------------------------
  283. // AI Thinker
  284. // -----------------------------------------------------------------------------
  285. #elif defined(AITHINKER_AI_LIGHT)
  286. #define ESPURNA_IMAGE ESPURNA_LIGHT
  287. // Info
  288. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  289. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  290. #define LIGHT_CHANNELS 4
  291. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  292. #define MY92XX_CHIPS 1
  293. #define MY92XX_DI_PIN 13
  294. #define MY92XX_DCKI_PIN 15
  295. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  296. #define MY92XX_MAPPING 0, 1, 2, 3
  297. // -----------------------------------------------------------------------------
  298. // LED Controller
  299. // -----------------------------------------------------------------------------
  300. #elif defined(MAGICHOME_LED_CONTROLLER)
  301. #define ESPURNA_IMAGE ESPURNA_LIGHT
  302. // Info
  303. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  304. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  305. #define DUMMY_RELAY_COUNT 1
  306. #define LIGHT_CHANNELS 4
  307. #define LIGHT_CH1_PIN 14 // RED
  308. #define LIGHT_CH2_PIN 5 // GREEN
  309. #define LIGHT_CH3_PIN 12 // BLUE
  310. #define LIGHT_CH4_PIN 13 // WHITE
  311. #define LIGHT_CH1_INVERSE 0
  312. #define LIGHT_CH2_INVERSE 0
  313. #define LIGHT_CH3_INVERSE 0
  314. #define LIGHT_CH4_INVERSE 0
  315. // IR
  316. #define IR_SUPPORT 1
  317. #define IR_RECEIVER_PIN 4
  318. #define IR_BUTTON_SET 1
  319. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  320. #define ESPURNA_IMAGE ESPURNA_LIGHT
  321. // Info
  322. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  323. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  324. #define LIGHT_CHANNELS 4
  325. #define LIGHT_CH1_PIN 5 // RED
  326. #define LIGHT_CH2_PIN 12 // GREEN
  327. #define LIGHT_CH3_PIN 13 // BLUE
  328. #define LIGHT_CH4_PIN 15 // WHITE
  329. #define LIGHT_CH1_INVERSE 0
  330. #define LIGHT_CH2_INVERSE 0
  331. #define LIGHT_CH3_INVERSE 0
  332. #define LIGHT_CH4_INVERSE 0
  333. // IR
  334. #define IR_SUPPORT 1
  335. #define IR_RECEIVER_PIN 4
  336. #define IR_BUTTON_SET 1
  337. // -----------------------------------------------------------------------------
  338. // HUACANXING H801 & H802
  339. // -----------------------------------------------------------------------------
  340. #elif defined(HUACANXING_H801)
  341. #define ESPURNA_IMAGE ESPURNA_LIGHT
  342. // Info
  343. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  344. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  345. #define DEBUG_PORT Serial1
  346. #define SERIAL_RX_ENABLED 1
  347. #define LIGHT_CHANNELS 5
  348. #define LIGHT_CH1_PIN 15 // RED
  349. #define LIGHT_CH2_PIN 13 // GREEN
  350. #define LIGHT_CH3_PIN 12 // BLUE
  351. #define LIGHT_CH4_PIN 14 // WHITE1
  352. #define LIGHT_CH5_PIN 4 // WHITE2
  353. #define LIGHT_CH1_INVERSE 0
  354. #define LIGHT_CH2_INVERSE 0
  355. #define LIGHT_CH3_INVERSE 0
  356. #define LIGHT_CH4_INVERSE 0
  357. #define LIGHT_CH5_INVERSE 0
  358. #elif defined(HUACANXING_H802)
  359. #define ESPURNA_IMAGE ESPURNA_LIGHT
  360. // Info
  361. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  362. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  363. #define DEBUG_PORT Serial1
  364. #define SERIAL_RX_ENABLED 1
  365. #define LIGHT_CHANNELS 4
  366. #define LIGHT_CH1_PIN 12 // RED
  367. #define LIGHT_CH2_PIN 14 // GREEN
  368. #define LIGHT_CH3_PIN 13 // BLUE
  369. #define LIGHT_CH4_PIN 15 // WHITE
  370. #define LIGHT_CH1_INVERSE 0
  371. #define LIGHT_CH2_INVERSE 0
  372. #define LIGHT_CH3_INVERSE 0
  373. #define LIGHT_CH4_INVERSE 0
  374. // -----------------------------------------------------------------------------
  375. // Jan Goedeke Wifi Relay
  376. // https://github.com/JanGoe/esp8266-wifi-relay
  377. // -----------------------------------------------------------------------------
  378. #elif defined(JANGOE_WIFI_RELAY_NC)
  379. #define ESPURNA_IMAGE ESPURNA_BASIC
  380. #elif defined(JANGOE_WIFI_RELAY_NO)
  381. #define ESPURNA_IMAGE ESPURNA_BASIC
  382. // -----------------------------------------------------------------------------
  383. // Jorge García Wifi+Relays Board Kit
  384. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  385. // https://github.com/jorgegarciadev/wifikit
  386. // -----------------------------------------------------------------------------
  387. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  388. #define ESPURNA_IMAGE ESPURNA_BASIC
  389. // -----------------------------------------------------------------------------
  390. // WiFi MQTT Relay / Thermostat
  391. // -----------------------------------------------------------------------------
  392. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  393. #define ESPURNA_IMAGE ESPURNA_BASIC
  394. // -----------------------------------------------------------------------------
  395. // WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap
  396. // 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
  397. // 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
  398. // -----------------------------------------------------------------------------
  399. #elif defined(WION_50055)
  400. #define ESPURNA_IMAGE ESPURNA_BASIC
  401. // -----------------------------------------------------------------------------
  402. // EX-Store Wifi Relay v3.1
  403. // https://ex-store.de/ESP8266-WiFi-Relay-V31
  404. // -----------------------------------------------------------------------------
  405. #elif defined(EXS_WIFI_RELAY_V31)
  406. #define ESPURNA_IMAGE ESPURNA_BASIC
  407. // -----------------------------------------------------------------------------
  408. // V9261F
  409. // -----------------------------------------------------------------------------
  410. #elif defined(GENERIC_V9261F)
  411. #define ESPURNA_IMAGE ESPURNA_POWER
  412. // Info
  413. #define ALEXA_SUPPORT 0
  414. // V9261F
  415. #define V9261F_SUPPORT 1
  416. #define V9261F_PIN 2
  417. #define V9261F_PIN_INVERSE 1
  418. // -----------------------------------------------------------------------------
  419. // ECH1560
  420. // -----------------------------------------------------------------------------
  421. #elif defined(GENERIC_ECH1560)
  422. #define ESPURNA_IMAGE ESPURNA_POWER
  423. // Info
  424. #define ALEXA_SUPPORT 0
  425. // ECH1560
  426. #define ECH1560_SUPPORT 1
  427. #define ECH1560_CLK_PIN 4
  428. #define ECH1560_MISO_PIN 5
  429. #define ECH1560_INVERTED 0
  430. // -----------------------------------------------------------------------------
  431. // ESPLive
  432. // https://github.com/ManCaveMade/ESP-Live
  433. // -----------------------------------------------------------------------------
  434. #elif defined(MANCAVEMADE_ESPLIVE)
  435. #define ESPURNA_IMAGE ESPURNA_SENSOR
  436. // DS18B20
  437. #ifndef DALLAS_SUPPORT
  438. #define DALLAS_SUPPORT 1
  439. #endif
  440. #define DALLAS_PIN 2
  441. #define DALLAS_UPDATE_INTERVAL 5000
  442. #define TEMPERATURE_MIN_CHANGE 1.0
  443. // -----------------------------------------------------------------------------
  444. // QuinLED
  445. // http://blog.quindorian.org/2017/02/esp8266-led-lighting-quinled-v2-6-pcb.html
  446. // -----------------------------------------------------------------------------
  447. #elif defined(INTERMITTECH_QUINLED)
  448. #define ESPURNA_IMAGE ESPURNA_LIGHT
  449. // Info
  450. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  451. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  452. #define LIGHT_CHANNELS 2
  453. #define LIGHT_CH1_PIN 0
  454. #define LIGHT_CH2_PIN 2
  455. #define LIGHT_CH1_INVERSE 0
  456. #define LIGHT_CH2_INVERSE 0
  457. // -----------------------------------------------------------------------------
  458. // Arilux AL-LC06
  459. // -----------------------------------------------------------------------------
  460. #elif defined(ARILUX_AL_LC01)
  461. #define ESPURNA_IMAGE ESPURNA_LIGHT
  462. // Info
  463. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  464. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  465. #define LIGHT_CHANNELS 3
  466. #define LIGHT_CH1_PIN 5 // RED
  467. #define LIGHT_CH2_PIN 12 // GREEN
  468. #define LIGHT_CH3_PIN 13 // BLUE
  469. #define LIGHT_CH1_INVERSE 0
  470. #define LIGHT_CH2_INVERSE 0
  471. #define LIGHT_CH3_INVERSE 0
  472. #elif defined(ARILUX_AL_LC02)
  473. #define ESPURNA_IMAGE ESPURNA_LIGHT
  474. // Info
  475. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  476. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  477. #define LIGHT_CHANNELS 4
  478. #define LIGHT_CH1_PIN 12 // RED
  479. #define LIGHT_CH2_PIN 5 // GREEN
  480. #define LIGHT_CH3_PIN 13 // BLUE
  481. #define LIGHT_CH4_PIN 15 // WHITE1
  482. #define LIGHT_CH1_INVERSE 0
  483. #define LIGHT_CH2_INVERSE 0
  484. #define LIGHT_CH3_INVERSE 0
  485. #define LIGHT_CH4_INVERSE 0
  486. #elif defined(ARILUX_AL_LC06)
  487. #define ESPURNA_IMAGE ESPURNA_LIGHT
  488. // Info
  489. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  490. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  491. #define LIGHT_CHANNELS 5
  492. #define LIGHT_CH1_PIN 14 // RED
  493. #define LIGHT_CH2_PIN 12 // GREEN
  494. #define LIGHT_CH3_PIN 13 // BLUE
  495. #define LIGHT_CH4_PIN 15 // WHITE1
  496. #define LIGHT_CH5_PIN 5 // WHITE2
  497. #define LIGHT_CH1_INVERSE 0
  498. #define LIGHT_CH2_INVERSE 0
  499. #define LIGHT_CH3_INVERSE 0
  500. #define LIGHT_CH4_INVERSE 0
  501. #define LIGHT_CH5_INVERSE 0
  502. #elif defined(ARILUX_AL_LC11)
  503. #define ESPURNA_IMAGE ESPURNA_LIGHT
  504. // Info
  505. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  506. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  507. #define LIGHT_CHANNELS 5
  508. #define LIGHT_CH1_PIN 5 // RED
  509. #define LIGHT_CH2_PIN 4 // GREEN
  510. #define LIGHT_CH3_PIN 14 // BLUE
  511. #define LIGHT_CH4_PIN 13 // WHITE1
  512. #define LIGHT_CH5_PIN 12 // WHITE1
  513. #define LIGHT_CH1_INVERSE 0
  514. #define LIGHT_CH2_INVERSE 0
  515. #define LIGHT_CH3_INVERSE 0
  516. #define LIGHT_CH4_INVERSE 0
  517. #define LIGHT_CH5_INVERSE 0
  518. #elif defined(ARILUX_E27)
  519. #define ESPURNA_IMAGE ESPURNA_LIGHT
  520. // Info
  521. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  522. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  523. #define LIGHT_CHANNELS 4
  524. #define MY92XX_MODEL MY92XX_MODEL_MY9291
  525. #define MY92XX_CHIPS 1
  526. #define MY92XX_DI_PIN 13
  527. #define MY92XX_DCKI_PIN 15
  528. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  529. #define MY92XX_MAPPING 0, 1, 2, 3
  530. // -----------------------------------------------------------------------------
  531. // XENON SM-PW701U
  532. // -----------------------------------------------------------------------------
  533. #elif defined(XENON_SM_PW702U)
  534. #define ESPURNA_IMAGE ESPURNA_BASIC
  535. // -----------------------------------------------------------------------------
  536. // AUTHOMETION LYT8266
  537. // https://authometion.com/shop/en/home/13-lyt8266.html
  538. // -----------------------------------------------------------------------------
  539. #elif defined(AUTHOMETION_LYT8266)
  540. #define ESPURNA_IMAGE ESPURNA_LIGHT
  541. // Info
  542. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  543. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  544. #define LIGHT_CHANNELS 4
  545. #define LIGHT_CH1_PIN 13 // RED
  546. #define LIGHT_CH2_PIN 12 // GREEN
  547. #define LIGHT_CH3_PIN 14 // BLUE
  548. #define LIGHT_CH4_PIN 2 // WHITE
  549. #define LIGHT_CH1_INVERSE 0
  550. #define LIGHT_CH2_INVERSE 0
  551. #define LIGHT_CH3_INVERSE 0
  552. #define LIGHT_CH4_INVERSE 0
  553. #define LIGHT_ENABLE_PIN 15
  554. #elif defined(GIZWITS_WITTY_CLOUD)
  555. #define ESPURNA_IMAGE ESPURNA_LIGHT
  556. // Info
  557. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  558. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  559. #define LIGHT_CHANNELS 3
  560. #define LIGHT_CH1_PIN 15 // RED
  561. #define LIGHT_CH2_PIN 12 // GREEN
  562. #define LIGHT_CH3_PIN 13 // BLUE
  563. #define LIGHT_CH1_INVERSE 0
  564. #define LIGHT_CH2_INVERSE 0
  565. #define LIGHT_CH3_INVERSE 0
  566. #define ANALOG_SUPPORT 1 // TODO: specific or generic?
  567. // -----------------------------------------------------------------------------
  568. // KMC 70011
  569. // https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
  570. // -----------------------------------------------------------------------------
  571. #elif defined(KMC_70011)
  572. #define ESPURNA_IMAGE ESPURNA_POWER
  573. // HLW8012
  574. #ifndef HLW8012_SUPPORT
  575. #define HLW8012_SUPPORT 1
  576. #endif
  577. #define HLW8012_SEL_PIN 12
  578. #define HLW8012_CF1_PIN 5
  579. #define HLW8012_CF_PIN 4
  580. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  581. // -----------------------------------------------------------------------------
  582. // Euromate (?) Wifi Stecker Shuko
  583. // https://www.obi.de/hausfunksteuerung/wifi-stecker-schuko/p/2291706
  584. // Thanks to @Geitde
  585. // -----------------------------------------------------------------------------
  586. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  587. #define ESPURNA_IMAGE ESPURNA_BASIC
  588. // -----------------------------------------------------------------------------
  589. // Generic 8CH
  590. // -----------------------------------------------------------------------------
  591. #elif defined(GENERIC_8CH)
  592. #define ESPURNA_IMAGE ESPURNA_BASIC
  593. // -----------------------------------------------------------------------------
  594. // STM RELAY
  595. // -----------------------------------------------------------------------------
  596. #elif defined(STM_RELAY)
  597. #define ESPURNA_IMAGE ESPURNA_STM
  598. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  599. #define DEBUG_SERIAL_SUPPORT 0
  600. // -----------------------------------------------------------------------------
  601. // Tonbux Powerstrip02
  602. // -----------------------------------------------------------------------------
  603. #elif defined(TONBUX_POWERSTRIP02)
  604. #define ESPURNA_IMAGE ESPURNA_BASIC
  605. // -----------------------------------------------------------------------------
  606. // Lingan SWA1
  607. // -----------------------------------------------------------------------------
  608. #elif defined(LINGAN_SWA1)
  609. #define ESPURNA_IMAGE ESPURNA_BASIC
  610. // -----------------------------------------------------------------------------
  611. // HEYGO HY02
  612. // -----------------------------------------------------------------------------
  613. #elif defined(HEYGO_HY02)
  614. #define ESPURNA_IMAGE ESPURNA_BASIC
  615. // -----------------------------------------------------------------------------
  616. // Maxcio W-US002S
  617. // -----------------------------------------------------------------------------
  618. #elif defined(MAXCIO_WUS002S)
  619. #define ESPURNA_IMAGE ESPURNA_POWER
  620. // HLW8012
  621. #ifndef HLW8012_SUPPORT
  622. #define HLW8012_SUPPORT 1
  623. #endif
  624. #define HLW8012_SEL_PIN 12
  625. #define HLW8012_CF1_PIN 5
  626. #define HLW8012_CF_PIN 4
  627. #define HLW8012_CURRENT_R 0.002 // Current resistor
  628. #define HLW8012_VOLTAGE_R_UP ( 2 * 1000000 ) // Upstream voltage resistor
  629. // -----------------------------------------------------------------------------
  630. // YiDian XS-SSA05
  631. // -----------------------------------------------------------------------------
  632. #elif defined(YIDIAN_XSSSA05)
  633. #define ESPURNA_IMAGE ESPURNA_POWER
  634. // HLW8012
  635. #ifndef HLW8012_SUPPORT
  636. #define HLW8012_SUPPORT 1
  637. #endif
  638. #define HLW8012_SEL_PIN 3
  639. #define HLW8012_CF1_PIN 14
  640. #define HLW8012_CF_PIN 5
  641. #define HLW8012_CURRENT_R 0.001 // Current resistor
  642. #define HLW8012_VOLTAGE_R_UP ( 2 * 1200000 ) // Upstream voltage resistor
  643. // -----------------------------------------------------------------------------
  644. // TONBUX XS-SSA06
  645. // -----------------------------------------------------------------------------
  646. #elif defined(TONBUX_XSSSA06)
  647. #define ESPURNA_IMAGE ESPURNA_BASIC
  648. // -----------------------------------------------------------------------------
  649. // GREEN ESP8266 RELAY MODULE
  650. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180323113846&SearchText=Green+ESP8266
  651. // -----------------------------------------------------------------------------
  652. #elif defined(GREEN_ESP8266RELAY)
  653. #define ESPURNA_IMAGE ESPURNA_BASIC
  654. // -----------------------------------------------------------------------------
  655. // Henrique Gravina ESPIKE
  656. // https://github.com/Henriquegravina/Espike
  657. // -----------------------------------------------------------------------------
  658. #elif defined(IKE_ESPIKE)
  659. #define ESPURNA_IMAGE ESPURNA_BASIC
  660. // -----------------------------------------------------------------------------
  661. // SWIFITCH
  662. // https://github.com/ArnieX/swifitch
  663. // -----------------------------------------------------------------------------
  664. #elif defined(ARNIEX_SWIFITCH)
  665. #define ESPURNA_IMAGE ESPURNA_BASIC
  666. // -----------------------------------------------------------------------------
  667. // ESP-01S RELAY v4.0
  668. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404024035&SearchText=esp-01s+relay
  669. // -----------------------------------------------------------------------------
  670. #elif defined(GENERIC_ESP01S_RELAY_V40)
  671. #define ESPURNA_IMAGE ESPURNA_BASIC
  672. // -----------------------------------------------------------------------------
  673. // ESP-01S RGB LED v1.0 (some sold with ws2818)
  674. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180404023816&SearchText=esp-01s+led+controller
  675. // -----------------------------------------------------------------------------
  676. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  677. #define ESPURNA_IMAGE ESPURNA_BASIC
  678. // -----------------------------------------------------------------------------
  679. // ESP-01S DHT11 v1.0
  680. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105907&SearchText=esp-01s+dht11
  681. // -----------------------------------------------------------------------------
  682. #elif defined(GENERIC_ESP01S_DHT11_V10)
  683. #define ESPURNA_IMAGE ESPURNA_SENSOR
  684. // DHT11
  685. #ifndef DHT_SUPPORT
  686. #define DHT_SUPPORT 1
  687. #endif
  688. #define DHT_PIN 2
  689. #define DHT_TYPE DHT_CHIP_DHT11
  690. // -----------------------------------------------------------------------------
  691. // ESP-01S DS18B20 v1.0
  692. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180410105933&SearchText=esp-01s+ds18b20
  693. // -----------------------------------------------------------------------------
  694. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  695. #define ESPURNA_IMAGE ESPURNA_SENSOR
  696. // DB18B20
  697. #ifndef DALLAS_SUPPORT
  698. #define DALLAS_SUPPORT 1
  699. #endif
  700. #define DALLAS_PIN 2
  701. // -----------------------------------------------------------------------------
  702. // ESP-DIN relay board V1
  703. // https://github.com/pilotak/esp_din
  704. // -----------------------------------------------------------------------------
  705. #elif defined(PILOTAK_ESP_DIN_V1)
  706. #define ESPURNA_IMAGE ESPURNA_SENSOR
  707. #define I2C_SDA_PIN 12 // TODO:what is this for?
  708. #define I2C_SCL_PIN 13
  709. #ifndef DALLAS_SUPPORT
  710. #define DALLAS_SUPPORT 1
  711. #endif
  712. #define DALLAS_PIN 2
  713. #ifndef RF_SUPPORT
  714. #define RF_SUPPORT 1
  715. #endif
  716. #define RF_PIN 14
  717. #ifndef DIGITAL_SUPPORT
  718. #define DIGITAL_SUPPORT 1
  719. #endif
  720. #define DIGITAL_PIN 16
  721. #define DIGITAL_PIN_MODE INPUT
  722. // -----------------------------------------------------------------------------
  723. // Heltec Touch Relay
  724. // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay
  725. // -----------------------------------------------------------------------------
  726. #elif defined(HELTEC_TOUCHRELAY)
  727. #define ESPURNA_IMAGE ESPURNA_BASIC
  728. // -----------------------------------------------------------------------------
  729. // Zhilde ZLD-EU44-W
  730. // http://www.zhilde.com/product/60705150109-805652505/EU_WiFi_Surge_Protector_Extension_Socket_4_Outlets_works_with_Amazon_Echo_Smart_Power_Strip.html
  731. // -----------------------------------------------------------------------------
  732. #elif defined(ZHILDE_EU44_W)
  733. #define ESPURNA_IMAGE ESPURNA_BASIC
  734. // Based on the reporter, this product uses GPIO1 and 3 for the button
  735. // and onboard LED, so hardware serial should be disabled...
  736. #define DEBUG_SERIAL_SUPPORT 0
  737. // -----------------------------------------------------------------------------
  738. // Allnet 4duino ESP8266-UP-Relais
  739. // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
  740. // https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
  741. // -----------------------------------------------------------------------------
  742. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  743. #define ESPURNA_IMAGE ESPURNA_BASIC
  744. // -----------------------------------------------------------------------------
  745. // Luani HVIO
  746. // https://luani.de/projekte/esp8266-hvio/
  747. // https://luani.de/blog/esp8266-230v-io-modul/
  748. // -----------------------------------------------------------------------------
  749. #elif defined(LUANI_HVIO)
  750. #define ESPURNA_IMAGE ESPURNA_BASIC
  751. // -----------------------------------------------------------------------------
  752. // Tonbux 50-100M Smart Mosquito Killer USB
  753. // https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
  754. // -----------------------------------------------------------------------------
  755. #elif defined(TONBUX_MOSQUITO_KILLER)
  756. #define ESPURNA_IMAGE ESPURNA_BASIC
  757. // -----------------------------------------------------------------------------
  758. // NEO Coolcam NAS-WR01W Wifi Smart Power Plug
  759. // https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N
  760. // https://www.fasttech.com/product/9649426-neo-coolcam-nas-wr01w-wifi-smart-power-plug-eu
  761. // -----------------------------------------------------------------------------
  762. #elif defined(NEO_COOLCAM_NAS_WR01W)
  763. #define ESPURNA_IMAGE ESPURNA_BASIC
  764. // ------------------------------------------------------------------------------
  765. // Estink Wifi Power Strip
  766. // https://www.amazon.de/Steckdosenleiste-Ladeger%C3%A4t-Sprachsteuerung-SmartphonesTablets-Android/dp/B0796W5FZY
  767. // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
  768. // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
  769. // -----------------------------------------------------------------------------
  770. #elif defined(ESTINK_WIFI_POWER_STRIP)
  771. #define ESPURNA_IMAGE ESPURNA_BASIC
  772. // Disable UART noise since this board uses GPIO3
  773. #define DEBUG_SERIAL_SUPPORT 0
  774. // -----------------------------------------------------------------------------
  775. // Bruno Horta's OnOfre
  776. // https://www.bhonofre.pt/
  777. // https://github.com/brunohorta82/BH_OnOfre/
  778. // -----------------------------------------------------------------------------
  779. #elif defined(BH_ONOFRE)
  780. #define ESPURNA_IMAGE ESPURNA_BASIC
  781. // -----------------------------------------------------------------------------
  782. // Several boards under different names uing a power chip labelled BL0937 or HJL-01
  783. // * Blitzwolf (https://www.amazon.es/Inteligente-Temporización-Dispositivos-Cualquier-BlitzWolf/dp/B07BMQP142)
  784. // * HomeCube (https://www.amazon.de/Steckdose-Homecube-intelligente-Verbrauchsanzeige-funktioniert/dp/B076Q2LKHG)
  785. // * Coosa (https://www.amazon.com/COOSA-Monitoring-Function-Campatible-Assiatant/dp/B0788W9TDR)
  786. // * Goosund (http://www.gosund.com/?m=content&c=index&a=show&catid=6&id=5)
  787. // * Ablue (https://www.amazon.de/Intelligente-Steckdose-Ablue-Funktioniert-Assistant/dp/B076DRFRZC)
  788. // -----------------------------------------------------------------------------
  789. #elif defined(BLITZWOLF_BWSHP2)
  790. #define ESPURNA_IMAGE ESPURNA_POWER
  791. // HJL01 / BL0937
  792. #ifndef HLW8012_SUPPORT
  793. #define HLW8012_SUPPORT 1
  794. #endif
  795. #define HLW8012_SEL_PIN 12
  796. #define HLW8012_CF1_PIN 14
  797. #define HLW8012_CF_PIN 5
  798. #define HLW8012_SEL_CURRENT LOW
  799. #define HLW8012_CURRENT_RATIO 25740
  800. #define HLW8012_VOLTAGE_RATIO 313400
  801. #define HLW8012_POWER_RATIO 3414290
  802. #define HLW8012_INTERRUPT_ON FALLING
  803. // ----------------------------------------------------------------------------------------
  804. // Homecube 16A is similar but some pins differ and it also has RGB LEDs
  805. // https://www.amazon.de/gp/product/B07D7RVF56/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
  806. // ----------------------------------------------------------------------------------------
  807. #elif defined(HOMECUBE_16A)
  808. #define ESPURNA_IMAGE ESPURNA_POWER
  809. // HJL01 / BL0937
  810. #ifndef HLW8012_SUPPORT
  811. #define HLW8012_SUPPORT 1
  812. #endif
  813. #define HLW8012_SEL_PIN 16
  814. #define HLW8012_CF1_PIN 14
  815. #define HLW8012_CF_PIN 5
  816. #define HLW8012_SEL_CURRENT LOW
  817. #define HLW8012_CURRENT_RATIO 25740
  818. #define HLW8012_VOLTAGE_RATIO 313400
  819. #define HLW8012_POWER_RATIO 3414290
  820. #define HLW8012_INTERRUPT_ON FALLING
  821. // -----------------------------------------------------------------------------
  822. // VANZAVANZU Smart Outlet Socket (based on BL0937 or HJL-01)
  823. // https://www.amazon.com/Smart-Plug-Wifi-Mini-VANZAVANZU/dp/B078PHD6S5
  824. // -----------------------------------------------------------------------------
  825. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  826. #define ESPURNA_IMAGE ESPURNA_POWER
  827. // Disable UART noise
  828. #define DEBUG_SERIAL_SUPPORT 0
  829. // HJL01 / BL0937
  830. #ifndef HLW8012_SUPPORT
  831. #define HLW8012_SUPPORT 1
  832. #endif
  833. #define HLW8012_SEL_PIN 3
  834. #define HLW8012_CF1_PIN 14
  835. #define HLW8012_CF_PIN 5
  836. #define HLW8012_SEL_CURRENT LOW
  837. #define HLW8012_CURRENT_RATIO 25740
  838. #define HLW8012_VOLTAGE_RATIO 313400
  839. #define HLW8012_POWER_RATIO 3414290
  840. #define HLW8012_INTERRUPT_ON FALLING
  841. #elif defined(GENERIC_AG_L4)
  842. #define ESPURNA_IMAGE ESPURNA_LIGHT
  843. // Info
  844. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  845. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  846. #define LIGHT_CHANNELS 3
  847. #define LIGHT_CH1_PIN 14 // RED
  848. #define LIGHT_CH2_PIN 13 // GREEN
  849. #define LIGHT_CH3_PIN 12 // BLUE
  850. #define LIGHT_CH1_INVERSE 0
  851. #define LIGHT_CH2_INVERSE 0
  852. #define LIGHT_CH3_INVERSE 0
  853. // -----------------------------------------------------------------------------
  854. // Generic board with Geiger Counter
  855. // -----------------------------------------------------------------------------
  856. #elif defined(GENERIC_GEIGER_COUNTER)
  857. #define ESPURNA_IMAGE ESPURNA_GEIGER
  858. // Enable Geiger Counter
  859. #define GEIGER_SUPPORT 1
  860. // Disable uneeded modules
  861. #define ALEXA_SUPPORT 0
  862. #define SCHEDULER_SUPPORT 0
  863. // -----------------------------------------------------------------------------
  864. // TEST boards (do not use!!)
  865. // -----------------------------------------------------------------------------
  866. #elif defined(TRAVIS01)
  867. // A bit of I2C - pins 3,4
  868. #define I2C_SDA_PIN 3
  869. #define I2C_SCL_PIN 4
  870. // And, as they say in "From Dusk till Dawn":
  871. // This is a sensor blow out!
  872. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  873. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  874. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  875. // C'mon, you want sensor, come on in sensor lovers!
  876. // If we don’t got it, you don't want it!
  877. #define AM2320_SUPPORT 1
  878. #define BH1750_SUPPORT 1
  879. #define BMX280_SUPPORT 1
  880. #define SHT3X_I2C_SUPPORT 1
  881. #define EMON_ADC121_SUPPORT 1
  882. #define EMON_ADS1X15_SUPPORT 1
  883. #define SHT3X_I2C_SUPPORT 1
  884. #define SI7021_SUPPORT 1
  885. #define PMSX003_SUPPORT 1
  886. #define SENSEAIR_SUPPORT 1
  887. // A bit of lights - pin 5
  888. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  889. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  890. #define DUMMY_RELAY_COUNT 1
  891. #define LIGHT_CHANNELS 1
  892. #define LIGHT_CH1_PIN 5
  893. #define LIGHT_CH1_INVERSE 0
  894. // A bit of HLW8012 - pins 6,7,8
  895. #ifndef HLW8012_SUPPORT
  896. #define HLW8012_SUPPORT 1
  897. #endif
  898. #define HLW8012_SEL_PIN 6
  899. #define HLW8012_CF1_PIN 7
  900. #define HLW8012_CF_PIN 8
  901. // A bit of Dallas - pin 9
  902. #ifndef DALLAS_SUPPORT
  903. #define DALLAS_SUPPORT 1
  904. #endif
  905. #define DALLAS_PIN 9
  906. // A bit of ECH1560 - pins 10,11, 12
  907. #ifndef ECH1560_SUPPORT
  908. #define ECH1560_SUPPORT 1
  909. #endif
  910. #define ECH1560_CLK_PIN 10
  911. #define ECH1560_MISO_PIN 11
  912. #define ECH1560_INVERTED 12
  913. #elif defined(TRAVIS02)
  914. // A bit of CSE7766 - pin 1
  915. #ifndef CSE7766_SUPPORT
  916. #define CSE7766_SUPPORT 1
  917. #endif
  918. #define CSE7766_PIN 1
  919. // Relay type dual - pins 2,3
  920. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  921. #define RELAY1_PIN 2
  922. #define RELAY2_PIN 3
  923. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  924. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  925. // IR - pin 4
  926. #define IR_SUPPORT 1
  927. #define IR_RECEIVER_PIN 4
  928. #define IR_BUTTON_SET 1
  929. // A bit of DHT - pin 5
  930. #ifndef DHT_SUPPORT
  931. #define DHT_SUPPORT 1
  932. #endif
  933. #define DHT_PIN 5
  934. // A bit of TMP3X (analog)
  935. #define TMP3X_SUPPORT 1
  936. // A bit of EVENTS - pin 10
  937. #define EVENTS_SUPPORT 1
  938. #define EVENTS_PIN 6
  939. // Sonar
  940. #define SONAR_SUPPORT 1
  941. #define SONAR_TRIGGER 7
  942. #define SONAR_ECHO 8
  943. // MHZ19
  944. #define MHZ19_SUPPORT 1
  945. #define MHZ19_RX_PIN 9
  946. #define MHZ19_TX_PIN 10
  947. // PZEM004T
  948. #define PZEM004T_SUPPORT 1
  949. #define PZEM004T_RX_PIN 11
  950. #define PZEM004T_TX_PIN 12
  951. // V9261F
  952. #define V9261F_SUPPORT 1
  953. #define V9261F_PIN 13
  954. // GUVAS12SD
  955. #define GUVAS12SD_SUPPORT 1
  956. #define GUVAS12SD_PIN 14
  957. // Test non-default modules
  958. #define MDNS_CLIENT_SUPPORT 1
  959. #define NOFUSS_SUPPORT 1
  960. #define UART_MQTT_SUPPORT 1
  961. #define INFLUXDB_SUPPORT 1
  962. #define IR_SUPPORT 1
  963. #elif defined(TRAVIS03)
  964. // MY9231 Light - pins 1,2
  965. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  966. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  967. #define DUMMY_RELAY_COUNT 1
  968. #define LIGHT_CHANNELS 5
  969. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  970. #define MY92XX_CHIPS 2
  971. #define MY92XX_DI_PIN 1
  972. #define MY92XX_DCKI_PIN 2
  973. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  974. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  975. // A bit of Analog EMON (analog)
  976. #ifndef EMON_ANALOG_SUPPORT
  977. #define EMON_ANALOG_SUPPORT 1
  978. #endif
  979. // Test non-default modules
  980. #define LLMNR_SUPPORT 1
  981. #define NETBIOS_SUPPORT 1
  982. #define SSDP_SUPPORT 1
  983. // -----------------------------------------------------------------------------
  984. // ESPurna Core
  985. // -----------------------------------------------------------------------------
  986. #else
  987. // This is a special device targeted to generate a light-weight binary image
  988. // meant to be able to do two-step-updates:
  989. // https://github.com/xoseperez/espurna/wiki/TwoStepUpdates
  990. #define ESPURNA_IMAGE ESPURNA_CORE
  991. // Disable non-core modules
  992. #define ALEXA_SUPPORT 0
  993. #define BROKER_SUPPORT 0
  994. #define BUTTON_SUPPORT 0
  995. #define DOMOTICZ_SUPPORT 0
  996. #define HOMEASSISTANT_SUPPORT 0
  997. #define I2C_SUPPORT 0
  998. #define MDNS_SERVER_SUPPORT 0
  999. #define MQTT_SUPPORT 0
  1000. #define NTP_SUPPORT 0
  1001. #define SCHEDULER_SUPPORT 0
  1002. #define SENSOR_SUPPORT 0
  1003. #define THINGSPEAK_SUPPORT 0
  1004. #define WEB_SUPPORT 0
  1005. // Extra light-weight image
  1006. //#define DEBUG_SERIAL_SUPPORT 0
  1007. //#define DEBUG_TELNET_SUPPORT 0
  1008. //#define DEBUG_WEB_SUPPORT 0
  1009. //#define LED_SUPPORT 0
  1010. //#define TELNET_SUPPORT 0
  1011. //#define TERMINAL_SUPPORT 0
  1012. #endif