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.

704 lines
21 KiB

6 years ago
6 years ago
  1. // -----------------------------------------------------------------------------
  2. // Devices
  3. // -----------------------------------------------------------------------------
  4. // New devices have to be added just before the DEVICE_LAST line,
  5. // then add configuration in the hardware.ino
  6. enum devices {
  7. DEVICE_UNKNOWN,
  8. DEVICE_CUSTOM,
  9. DEVICE_NODEMCU_LOLIN,
  10. DEVICE_WEMOS_D1_MINI_RELAYSHIELD,
  11. DEVICE_ITEAD_SONOFF_BASIC,
  12. DEVICE_ITEAD_SONOFF_TH,
  13. DEVICE_ITEAD_SONOFF_SV,
  14. DEVICE_ITEAD_SONOFF_TOUCH,
  15. DEVICE_ITEAD_SONOFF_POW,
  16. DEVICE_ITEAD_SONOFF_DUAL,
  17. DEVICE_ITEAD_1CH_INCHING,
  18. DEVICE_ITEAD_SONOFF_4CH,
  19. DEVICE_ITEAD_SLAMPHER,
  20. DEVICE_ITEAD_S20,
  21. DEVICE_ELECTRODRAGON_WIFI_IOT,
  22. DEVICE_WORKCHOICE_ECOPLUG,
  23. DEVICE_JANGOE_WIFI_RELAY_NC,
  24. DEVICE_JANGOE_WIFI_RELAY_NO,
  25. DEVICE_OPENENERGYMONITOR_MQTT_RELAY,
  26. DEVICE_JORGEGARCIA_WIFI_RELAYS,
  27. DEVICE_AITHINKER_AI_LIGHT,
  28. DEVICE_MAGICHOME_LED_CONTROLLER,
  29. DEVICE_ITEAD_MOTOR,
  30. DEVICE_TINKERMAN_ESPURNA_H06,
  31. DEVICE_HUACANXING_H801,
  32. DEVICE_ITEAD_BNSZ01,
  33. DEVICE_ITEAD_SONOFF_RFBRIDGE,
  34. DEVICE_ITEAD_SONOFF_4CH_PRO,
  35. DEVICE_ITEAD_SONOFF_B1,
  36. DEVICE_ITEAD_SONOFF_LED,
  37. DEVICE_ITEAD_SONOFF_T1_1CH,
  38. DEVICE_ITEAD_SONOFF_T1_2CH,
  39. DEVICE_ITEAD_SONOFF_T1_3CH,
  40. DEVICE_ITEAD_SONOFF_RF,
  41. DEVICE_WION_50055,
  42. DEVICE_EXS_WIFI_RELAY_V31,
  43. DEVICE_HUACANXING_H802,
  44. DEVICE_GENERIC_V9261F,
  45. DEVICE_GENERIC_ECH1560,
  46. DEVICE_TINKERMAN_ESPURNA_H08,
  47. DEVICE_MANCAVEMADE_ESPLIVE,
  48. DEVICE_INTERMITTECH_QUINLED,
  49. DEVICE_MAGICHOME_LED_CONTROLLER_20,
  50. DEVICE_ARILUX_AL_LC06,
  51. DEVICE_XENON_SM_PW702U,
  52. DEVICE_AUTHOMETION_LYT8266,
  53. DEVICE_ARILUX_E27,
  54. DEVICE_YJZK_SWITCH_2CH,
  55. DEVICE_ITEAD_SONOFF_DUAL_R2,
  56. DEVICE_GENERIC_8CH,
  57. DEVICE_ARILUX_AL_LC01,
  58. DEVICE_ARILUX_AL_LC11,
  59. DEVICE_ARILUX_AL_LC02,
  60. DEVICE_KMC_70011,
  61. DEVICE_GIZWITS_WITTY_CLOUD,
  62. DEVICE_EUROMATE_WIFI_STECKER_SCHUKO,
  63. DEVICE_TONBUX_POWERSTRIP02,
  64. DEVICE_LINGAN_SWA1,
  65. DEVICE_HEYGO_HY02,
  66. DEVICE_MAXCIO_WUS002S,
  67. DEVICE_YIDIAN_XSSSA05,
  68. DEVICE_TONBUX_XSSSA06,
  69. DEVICE_GREEN_ESP8266RELAY,
  70. DEVICE_IKE_ESPIKE,
  71. DEVICE_ARNIEX_SWIFITCH,
  72. DEVICE_GENERIC_ESP01S_RELAY_V40,
  73. DEVICE_GENERIC_ESP01S_RGBLED_V10,
  74. DEVICE_HELTEC_TOUCHRELAY,
  75. DEVICE_GENERIC_ESP01S_DHT11_V10,
  76. DEVICE_GENERIC_ESP01S_DS18B20_V10,
  77. DEVICE_ZHILDE_EU44_W,
  78. DEVICE_ITEAD_SONOFF_POW_R2,
  79. DEVICE_LUANI_HVIO,
  80. DEVICE_ALLNET_4DUINO_IOT_WLAN_RELAIS,
  81. DEVICE_TONBUX_MOSQUITO_KILLER,
  82. DEVICE_NEO_COOLCAM_NAS_WR01W,
  83. DEVICE_PILOTAK_ESP_DIN_V1,
  84. DEVICE_ESTINK_WIFI_POWER_STRIP,
  85. DEVICE_BH_ONOFRE,
  86. DEVICE_BLITZWOLF_BWSHP2,
  87. DEVICE_TINKERMAN_ESPURNA_SWITCH,
  88. DEVICE_ITEAD_SONOFF_S31,
  89. DEVICE_STM_RELAY,
  90. DEVICE_VANZAVANZU_SMART_WIFI_PLUG_MINI,
  91. DEVICE_GENERIC_GEIGER_COUNTER,
  92. DEVICE_TINKERMAN_RFM69GW,
  93. DEVICE_ITEAD_SONOFF_IFAN02,
  94. DEVICE_GENERIC_AG_L4,
  95. DEVICE_HOMECUBE_16A,
  96. DEVICE_ALLTERCO_SHELLY1,
  97. DEVICE_LOHAS_9W,
  98. DEVICE_YJZK_SWITCH_1CH,
  99. DEVICE_YJZK_SWITCH_3CH,
  100. DEVICE_XIAOMI_SMART_DESK_LAMP,
  101. DEVICE_ALLTERCO_SHELLY2,
  102. DEVICE_PHYX_ESP12_RGB,
  103. DEVICE_LAST
  104. };
  105. // -----------------------------------------------------------------------------
  106. // Board => Image type
  107. // -----------------------------------------------------------------------------
  108. #if \
  109. defined(ALLNET_4DUINO_IOT_WLAN_RELAIS) || \
  110. defined(ALLTERCO_SHELLY1) || \
  111. defined(ARNIEX_SWIFITCH) || \
  112. defined(BH_ONOFRE) || \
  113. defined(ELECTRODRAGON_WIFI_IOT) || \
  114. defined(ESTINK_WIFI_POWER_STRIP) || \
  115. defined(EUROMATE_WIFI_STECKER_SCHUKO) || \
  116. defined(EXS_WIFI_RELAY_V31) || \
  117. defined(GENERIC_8CH) || \
  118. defined(GENERIC_ESP01S_RELAY_V40) || \
  119. defined(GENERIC_ESP01S_RGBLED_V10) || \
  120. defined(GREEN_ESP8266RELAY) || \
  121. defined(HELTEC_TOUCHRELAY) || \
  122. defined(HEYGO_HY02) || \
  123. defined(IKE_ESPIKE) || \
  124. defined(ITEAD_1CH_INCHING) || \
  125. defined(ITEAD_MOTOR) || \
  126. defined(ITEAD_S20) || \
  127. defined(ITEAD_SLAMPHER) || \
  128. defined(ITEAD_SONOFF_4CH) || \
  129. defined(ITEAD_SONOFF_4CH_PRO) || \
  130. defined(ITEAD_SONOFF_BASIC) || \
  131. defined(ITEAD_SONOFF_DUAL_R2) || \
  132. defined(ITEAD_SONOFF_IFAN02) || \
  133. defined(ITEAD_SONOFF_RF) || \
  134. defined(ITEAD_SONOFF_SV) || \
  135. defined(ITEAD_SONOFF_T1_1CH) || \
  136. defined(ITEAD_SONOFF_T1_2CH) || \
  137. defined(ITEAD_SONOFF_T1_3CH) || \
  138. defined(ITEAD_SONOFF_TOUCH) || \
  139. defined(JANGOE_WIFI_RELAY_NC) || \
  140. defined(JANGOE_WIFI_RELAY_NO) || \
  141. defined(JORGEGARCIA_WIFI_RELAYS) || \
  142. defined(LINGAN_SWA1) || \
  143. defined(LUANI_HVIO) || \
  144. defined(NEO_COOLCAM_NAS_WR01W) || \
  145. defined(NODEMCU_LOLIN) || \
  146. defined(OPENENERGYMONITOR_MQTT_RELAY) || \
  147. defined(TINKERMAN_ESPURNA_SWITCH) || \
  148. defined(TONBUX_MOSQUITO_KILLER) || \
  149. defined(TONBUX_POWERSTRIP02) || \
  150. defined(TONBUX_XSSSA06) || \
  151. defined(WEMOS_D1_MINI_RELAYSHIELD) || \
  152. defined(WION_50055) || \
  153. defined(WORKCHOICE_ECOPLUG) || \
  154. defined(XENON_SM_PW702U) || \
  155. defined(YJZK_SWITCH_1CH) || \
  156. defined(YJZK_SWITCH_2CH) || \
  157. defined(YJZK_SWITCH_3CH) || \
  158. defined(ZHILDE_EU44_W)
  159. #undef ESPURNA_IMAGE
  160. #define ESPURNA_IMAGE ESPURNA_BASIC
  161. // -----------------------------------------------------------------------------
  162. #elif \
  163. defined(BLITZWOLF_BWSHP2) || \
  164. defined(HOMECUBE_16A) || \
  165. defined(ITEAD_SONOFF_POW) || \
  166. defined(KMC_70011) || \
  167. defined(MAXCIO_WUS002S) || \
  168. defined(TINKERMAN_ESPURNA_H06) || \
  169. defined(TINKERMAN_ESPURNA_H08) || \
  170. defined(VANZAVANZU_SMART_WIFI_PLUG_MINI) || \
  171. defined(YIDIAN_XSSSA05)
  172. #undef ESPURNA_IMAGE
  173. #define ESPURNA_IMAGE ESPURNA_HLW8012
  174. // -----------------------------------------------------------------------------
  175. #elif \
  176. defined(ITEAD_SONOFF_POW_R2) || \
  177. defined(ITEAD_SONOFF_S31)
  178. #undef ESPURNA_IMAGE
  179. #define ESPURNA_IMAGE ESPURNA_CSE77XX
  180. // -----------------------------------------------------------------------------
  181. #elif defined(GENERIC_V9261F)
  182. #undef ESPURNA_IMAGE
  183. #define ESPURNA_IMAGE ESPURNA_V9261F
  184. // -----------------------------------------------------------------------------
  185. #elif defined(GENERIC_ECH1560)
  186. #undef ESPURNA_IMAGE
  187. #define ESPURNA_IMAGE ESPURNA_ECH1560
  188. // -----------------------------------------------------------------------------
  189. #elif \
  190. defined(ARILUX_AL_LC01) || \
  191. defined(ARILUX_AL_LC02) || \
  192. defined(ARILUX_AL_LC06) || \
  193. defined(ARILUX_AL_LC11) || \
  194. defined(AUTHOMETION_LYT8266) || \
  195. defined(GENERIC_AG_L4) || \
  196. defined(HUACANXING_H801) || \
  197. defined(HUACANXING_H802) || \
  198. defined(INTERMITTECH_QUINLED) || \
  199. defined(ITEAD_BNSZ01) || \
  200. defined(ITEAD_SONOFF_LED)
  201. #undef ESPURNA_IMAGE
  202. #define ESPURNA_IMAGE ESPURNA_DIMMER
  203. // -----------------------------------------------------------------------------
  204. #elif \
  205. defined(AITHINKER_AI_LIGHT) || \
  206. defined(ARILUX_E27) || \
  207. defined(ITEAD_SONOFF_B1) || \
  208. defined(LOHAS_9W)
  209. #undef ESPURNA_IMAGE
  210. #define ESPURNA_IMAGE ESPURNA_MY92XX
  211. // -----------------------------------------------------------------------------
  212. #elif \
  213. defined(GENERIC_ESP01S_DHT11_V10) || \
  214. defined(GENERIC_ESP01S_DS18B20_V10) || \
  215. defined(ITEAD_SONOFF_TH) || \
  216. defined(MANCAVEMADE_ESPLIVE)
  217. #undef ESPURNA_IMAGE
  218. #define ESPURNA_IMAGE ESPURNA_SENSOR
  219. // -----------------------------------------------------------------------------
  220. #elif defined(TINKERMAN_RFM69GW)
  221. #undef ESPURNA_IMAGE
  222. #define ESPURNA_IMAGE ESPURNA_RFM69
  223. // -----------------------------------------------------------------------------
  224. #elif defined(ITEAD_SONOFF_DUAL)
  225. #undef ESPURNA_IMAGE
  226. #define ESPURNA_IMAGE ESPURNA_SONOFF_DUAL
  227. // -----------------------------------------------------------------------------
  228. #elif defined(STM_RELAY)
  229. #undef ESPURNA_IMAGE
  230. #define ESPURNA_IMAGE ESPURNA_STM
  231. // -----------------------------------------------------------------------------
  232. #elif defined(GENERIC_GEIGER_COUNTER)
  233. #undef ESPURNA_IMAGE
  234. #define ESPURNA_IMAGE ESPURNA_GEIGER
  235. // -----------------------------------------------------------------------------
  236. // PENDING
  237. // -----------------------------------------------------------------------------
  238. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  239. #undef ESPURNA_IMAGE
  240. #define ESPURNA_IMAGE ESPURNA_SONOFF_RFBRIDGE
  241. // Info
  242. #define RELAY_PROVIDER RELAY_PROVIDER_RFBRIDGE
  243. // RFB Direct hack thanks to @wildwiz
  244. // https://github.com/xoseperez/espurna/wiki/Hardware-Itead-Sonoff-RF-Bridge---Direct-Hack
  245. #ifndef RFB_DIRECT
  246. #define RFB_DIRECT 0
  247. #endif
  248. #ifndef RFB_RX_PIN
  249. #define RFB_RX_PIN 4 // GPIO for RX when RFB_DIRECT
  250. #endif
  251. #ifndef RFB_TX_PIN
  252. #define RFB_TX_PIN 5 // GPIO for TX when RFB_DIRECT
  253. #endif
  254. // When using un-modified harware, ESPurna communicates with the secondary
  255. // MCU EFM8BB1 via UART at 19200 bps so we need to change the speed of
  256. // the port and remove UART noise on serial line
  257. #if not RFB_DIRECT
  258. #define SERIAL_BAUDRATE 19200
  259. #define DEBUG_SERIAL_SUPPORT 0
  260. #endif
  261. // -----------------------------------------------------------------------------
  262. #elif defined(PILOTAK_ESP_DIN_V1)
  263. #undef ESPURNA_IMAGE
  264. #define ESPURNA_IMAGE ESPURNA_SENSOR
  265. #ifndef RF_SUPPORT
  266. #define RF_SUPPORT 1 // Does this need the RFBRIDGE image?
  267. #endif
  268. #define RF_PIN 14
  269. // -----------------------------------------------------------------------------
  270. #elif defined(MAGICHOME_LED_CONTROLLER)
  271. #undef ESPURNA_IMAGE
  272. #define ESPURNA_IMAGE ESPURNA_DIMMER
  273. // IR
  274. #define IR_SUPPORT 1
  275. #define IR_RECEIVER_PIN 4
  276. #define IR_BUTTON_SET 1
  277. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  278. #undef ESPURNA_IMAGE
  279. #define ESPURNA_IMAGE ESPURNA_DIMMER
  280. // IR
  281. #define IR_SUPPORT 1
  282. #define IR_RECEIVER_PIN 4
  283. #define IR_BUTTON_SET 1
  284. #elif defined(GIZWITS_WITTY_CLOUD)
  285. #undef ESPURNA_IMAGE
  286. #define ESPURNA_IMAGE ESPURNA_DIMMER
  287. #define ANALOG_SUPPORT 1 // TODO: specific or generic?
  288. // -----------------------------------------------------------------------------
  289. // TEST devices (do not use!!)
  290. // -----------------------------------------------------------------------------
  291. #elif defined(TRAVIS01)
  292. #undef ESPURNA_IMAGE
  293. #define ESPURNA_IMAGE ESPURNA_BASIC
  294. // A bit of I2C - pins 3,4
  295. #define I2C_SDA_PIN 3
  296. #define I2C_SCL_PIN 4
  297. // And, as they say in "From Dusk till Dawn":
  298. // This is a sensor blow out!
  299. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  300. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  301. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  302. // C'mon, you want sensor, come on in sensor lovers!
  303. // If we don’t got it, you don't want it!
  304. #define AM2320_SUPPORT 1
  305. #define BH1750_SUPPORT 1
  306. #define BMX280_SUPPORT 1
  307. #define SHT3X_I2C_SUPPORT 1
  308. #define EMON_ADC121_SUPPORT 1
  309. #define EMON_ADS1X15_SUPPORT 1
  310. #define SHT3X_I2C_SUPPORT 1
  311. #define SI7021_SUPPORT 1
  312. #define PMSX003_SUPPORT 1
  313. #define SENSEAIR_SUPPORT 1
  314. // A bit of lights - pin 5
  315. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  316. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  317. #define DUMMY_RELAY_COUNT 1
  318. #define LIGHT_CHANNELS 1
  319. #define LIGHT_CH1_PIN 5
  320. #define LIGHT_CH1_INVERSE 0
  321. // A bit of HLW8012 - pins 6,7,8
  322. #ifndef HLW8012_SUPPORT
  323. #define HLW8012_SUPPORT 1
  324. #endif
  325. #define HLW8012_SEL_PIN 6
  326. #define HLW8012_CF1_PIN 7
  327. #define HLW8012_CF_PIN 8
  328. // A bit of Dallas - pin 9
  329. #ifndef DALLAS_SUPPORT
  330. #define DALLAS_SUPPORT 1
  331. #endif
  332. #define DALLAS_PIN 9
  333. // A bit of ECH1560 - pins 10,11, 12
  334. #ifndef ECH1560_SUPPORT
  335. #define ECH1560_SUPPORT 1
  336. #endif
  337. #define ECH1560_CLK_PIN 10
  338. #define ECH1560_MISO_PIN 11
  339. #define ECH1560_INVERTED 12
  340. #elif defined(TRAVIS02)
  341. #undef ESPURNA_IMAGE
  342. #define ESPURNA_IMAGE ESPURNA_BASIC
  343. // A bit of CSE7766 - pin 1
  344. #ifndef CSE7766_SUPPORT
  345. #define CSE7766_SUPPORT 1
  346. #endif
  347. #define CSE7766_PIN 1
  348. // Relay type dual - pins 2,3
  349. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  350. #define RELAY1_PIN 2
  351. #define RELAY2_PIN 3
  352. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  353. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  354. // IR - pin 4
  355. #define IR_SUPPORT 1
  356. #define IR_RECEIVER_PIN 4
  357. #define IR_BUTTON_SET 1
  358. // A bit of DHT - pin 5
  359. #ifndef DHT_SUPPORT
  360. #define DHT_SUPPORT 1
  361. #endif
  362. #define DHT_PIN 5
  363. // A bit of TMP3X (analog)
  364. #define TMP3X_SUPPORT 1
  365. // A bit of EVENTS - pin 10
  366. #define EVENTS_SUPPORT 1
  367. #define EVENTS_PIN 6
  368. // Sonar
  369. #define SONAR_SUPPORT 1
  370. #define SONAR_TRIGGER 7
  371. #define SONAR_ECHO 8
  372. // MHZ19
  373. #define MHZ19_SUPPORT 1
  374. #define MHZ19_RX_PIN 9
  375. #define MHZ19_TX_PIN 10
  376. // PZEM004T
  377. #define PZEM004T_SUPPORT 1
  378. #define PZEM004T_RX_PIN 11
  379. #define PZEM004T_TX_PIN 12
  380. // V9261F
  381. #define V9261F_SUPPORT 1
  382. #define V9261F_PIN 13
  383. // GUVAS12SD
  384. #define GUVAS12SD_SUPPORT 1
  385. #define GUVAS12SD_PIN 14
  386. // Test non-default modules
  387. #define MDNS_CLIENT_SUPPORT 1
  388. #define NOFUSS_SUPPORT 1
  389. #define UART_MQTT_SUPPORT 1
  390. #define INFLUXDB_SUPPORT 1
  391. #define IR_SUPPORT 1
  392. #elif defined(TRAVIS03)
  393. #undef ESPURNA_IMAGE
  394. #define ESPURNA_IMAGE ESPURNA_BASIC
  395. // MY9231 Light - pins 1,2
  396. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  397. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  398. #define DUMMY_RELAY_COUNT 1
  399. #define LIGHT_CHANNELS 5
  400. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  401. #define MY92XX_CHIPS 2
  402. #define MY92XX_DI_PIN 1
  403. #define MY92XX_DCKI_PIN 2
  404. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  405. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  406. // A bit of Analog EMON (analog)
  407. #ifndef EMON_ANALOG_SUPPORT
  408. #define EMON_ANALOG_SUPPORT 1
  409. #endif
  410. // Test non-default modules
  411. #define LLMNR_SUPPORT 1
  412. #define NETBIOS_SUPPORT 1
  413. #define SSDP_SUPPORT 1
  414. // Encoder support
  415. #ifndef ENCODER_SUPPORT
  416. #define ENCODER_SUPPORT 1
  417. #endif
  418. #endif
  419. // -----------------------------------------------------------------------------
  420. // ESPurna Core
  421. // This is a special device targeted to generate a light-weight binary image
  422. // meant to be able to do two-step-updates:
  423. // https://github.com/xoseperez/espurna/wiki/TwoStepUpdates
  424. // -----------------------------------------------------------------------------
  425. #ifndef ESPURNA_IMAGE
  426. #define ESPURNA_IMAGE ESPURNA_CORE
  427. #endif
  428. // -----------------------------------------------------------------------------
  429. // Image definitions
  430. // -----------------------------------------------------------------------------
  431. #if ESPURNA_IMAGE == ESPURNA_CORE
  432. #define ESPURNA_IMAGE_NAME "CORE"
  433. // Disable non-core modules
  434. #define ALEXA_SUPPORT 0
  435. #define API_SUPPORT 0
  436. #define BROKER_SUPPORT 0
  437. #define BUTTON_SUPPORT 0
  438. #define DOMOTICZ_SUPPORT 0
  439. #define HOMEASSISTANT_SUPPORT 0
  440. #define I2C_SUPPORT 0
  441. #define MDNS_SERVER_SUPPORT 0
  442. #define MQTT_SUPPORT 0
  443. #define NTP_SUPPORT 0
  444. #define SCHEDULER_SUPPORT 0
  445. #define SENSOR_SUPPORT 0
  446. #define THINGSPEAK_SUPPORT 0
  447. #define WEB_SUPPORT 0
  448. // Extra light-weight image
  449. //#define DEBUG_SERIAL_SUPPORT 0
  450. //#define DEBUG_TELNET_SUPPORT 0
  451. //#define DEBUG_WEB_SUPPORT 0
  452. //#define LED_SUPPORT 0
  453. //#define TELNET_SUPPORT 0
  454. //#define TERMINAL_SUPPORT 0
  455. #elif ESPURNA_IMAGE == ESPURNA_BASIC
  456. #define ESPURNA_IMAGE_NAME "BASIC"
  457. #elif ESPURNA_IMAGE == ESPURNA_DIMMER
  458. #define ESPURNA_IMAGE_NAME "DIMMER"
  459. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  460. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  461. #ifndef ENCODER_SUPPORT
  462. #define ENCODER_SUPPORT 1
  463. #endif
  464. #elif ESPURNA_IMAGE == ESPURNA_MY92XX
  465. #define ESPURNA_IMAGE_NAME "MY92XX"
  466. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  467. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  468. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  469. #ifndef ENCODER_SUPPORT
  470. #define ENCODER_SUPPORT 1
  471. #endif
  472. #elif ESPURNA_IMAGE == ESPURNA_EMON
  473. #define ESPURNA_IMAGE_NAME "EMON"
  474. #ifndef EMON_ANALOG_SUPPORT
  475. #define EMON_ANALOG_SUPPORT 1
  476. #endif
  477. #ifndef EMON_ADC121_SUPPORT
  478. #define EMON_ADC121_SUPPORT 1
  479. #endif
  480. #ifndef EMON_ADS1X15_SUPPORT
  481. #define EMON_ADS1X15_SUPPORT 1
  482. #endif
  483. #elif ESPURNA_IMAGE == ESPURNA_HLW8012
  484. #define ESPURNA_IMAGE_NAME "HLW8012"
  485. #ifndef HLW8012_SUPPORT
  486. #define HLW8012_SUPPORT 1
  487. #endif
  488. #elif ESPURNA_IMAGE == ESPURNA_CSE77XX
  489. #define ESPURNA_IMAGE_NAME "CSE77XX"
  490. #ifndef CSE7766_SUPPORT
  491. #define CSE7766_SUPPORT 1
  492. #endif
  493. #elif ESPURNA_IMAGE == ESPURNA_V9261F
  494. #define ESPURNA_IMAGE_NAME "V9261F"
  495. #ifndef V9261F_SUPPORT
  496. #define V9261F_SUPPORT 1
  497. #endif
  498. #ifndef ALEXA_SUPPORT
  499. #define ALEXA_SUPPORT 0
  500. #endif
  501. #elif ESPURNA_IMAGE == ESPURNA_ECH1560
  502. #define ESPURNA_IMAGE_NAME "ECH1560"
  503. #ifndef ECH1560_SUPPORT
  504. #define ECH1560_SUPPORT 1
  505. #endif
  506. #ifndef ALEXA_SUPPORT
  507. #define ALEXA_SUPPORT 0
  508. #endif
  509. #elif ESPURNA_IMAGE == ESPURNA_SENSOR
  510. #define ESPURNA_IMAGE_NAME "SENSOR"
  511. #ifndef ANALOG_SUPPORT
  512. #define ANALOG_SUPPORT 1
  513. #endif
  514. #ifndef DALLAS_SUPPORT
  515. #define DALLAS_SUPPORT 1
  516. #endif
  517. #ifndef DHT_SUPPORT
  518. #define DHT_SUPPORT 1
  519. #endif
  520. #ifndef DIGITAL_SUPPORT
  521. #define DIGITAL_SUPPORT 1
  522. #endif
  523. #elif ESPURNA_IMAGE == ESPURNA_SONOFF_DUAL
  524. #define ESPURNA_IMAGE_NAME "SONOFF_DUAL"
  525. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  526. #elif ESPURNA_IMAGE == ESPURNA_SONOFF_RFBRIDGE
  527. #define ESPURNA_IMAGE_NAME "SONOFF_RFBRIDGE"
  528. #elif ESPURNA_IMAGE == ESPURNA_RFM69
  529. #define ESPURNA_IMAGE_NAME "RFM69"
  530. // RFM69GW
  531. #define RFM69_SUPPORT 1
  532. // Disable non-core modules
  533. #define ALEXA_SUPPORT 0
  534. #define DOMOTICZ_SUPPORT 0
  535. #define HOMEASSISTANT_SUPPORT 0
  536. #define I2C_SUPPORT 0
  537. #define SCHEDULER_SUPPORT 0
  538. #define SENSOR_SUPPORT 0
  539. #define THINGSPEAK_SUPPORT 0
  540. #elif ESPURNA_IMAGE == ESPURNA_STM
  541. #define ESPURNA_IMAGE_NAME "STM"
  542. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  543. #elif ESPURNA_IMAGE == ESPURNA_GEIGER
  544. #define ESPURNA_IMAGE_NAME "GEIGER"
  545. // Enable Geiger Counter
  546. #define GEIGER_SUPPORT 1
  547. // Disable uneeded modules
  548. #define ALEXA_SUPPORT 0
  549. #define SCHEDULER_SUPPORT 0
  550. #endif