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.

650 lines
19 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_LAST
  97. };
  98. // -----------------------------------------------------------------------------
  99. // Board => Image type
  100. // -----------------------------------------------------------------------------
  101. #if \
  102. defined(ALLNET_4DUINO_IOT_WLAN_RELAIS) || \
  103. defined(ARNIEX_SWIFITCH) || \
  104. defined(BH_ONOFRE) || \
  105. defined(ELECTRODRAGON_WIFI_IOT) || \
  106. defined(ESTINK_WIFI_POWER_STRIP) || \
  107. defined(EUROMATE_WIFI_STECKER_SCHUKO) || \
  108. defined(EXS_WIFI_RELAY_V31) || \
  109. defined(GENERIC_8CH) || \
  110. defined(GENERIC_ESP01S_RELAY_V40) || \
  111. defined(GENERIC_ESP01S_RGBLED_V10) || \
  112. defined(GREEN_ESP8266RELAY) || \
  113. defined(HELTEC_TOUCHRELAY) || \
  114. defined(HEYGO_HY02) || \
  115. defined(IKE_ESPIKE) || \
  116. defined(ITEAD_1CH_INCHING) || \
  117. defined(ITEAD_MOTOR) || \
  118. defined(ITEAD_S20) || \
  119. defined(ITEAD_SLAMPHER) || \
  120. defined(ITEAD_SONOFF_4CH) || \
  121. defined(ITEAD_SONOFF_4CH_PRO) || \
  122. defined(ITEAD_SONOFF_BASIC) || \
  123. defined(ITEAD_SONOFF_DUAL_R2) || \
  124. defined(ITEAD_SONOFF_IFAN02) || \
  125. defined(ITEAD_SONOFF_RF) || \
  126. defined(ITEAD_SONOFF_SV) || \
  127. defined(ITEAD_SONOFF_T1_1CH) || \
  128. defined(ITEAD_SONOFF_T1_2CH) || \
  129. defined(ITEAD_SONOFF_T1_3CH) || \
  130. defined(ITEAD_SONOFF_TOUCH) || \
  131. defined(JANGOE_WIFI_RELAY_NC) || \
  132. defined(JANGOE_WIFI_RELAY_NO) || \
  133. defined(JORGEGARCIA_WIFI_RELAYS) || \
  134. defined(LINGAN_SWA1) || \
  135. defined(LUANI_HVIO) || \
  136. defined(NEO_COOLCAM_NAS_WR01W) || \
  137. defined(NODEMCU_LOLIN) || \
  138. defined(OPENENERGYMONITOR_MQTT_RELAY) || \
  139. defined(TINKERMAN_ESPURNA_SWITCH) || \
  140. defined(TONBUX_MOSQUITO_KILLER) || \
  141. defined(TONBUX_POWERSTRIP02) || \
  142. defined(TONBUX_XSSSA06) || \
  143. defined(WEMOS_D1_MINI_RELAYSHIELD) || \
  144. defined(WION_50055) || \
  145. defined(WORKCHOICE_ECOPLUG) || \
  146. defined(XENON_SM_PW702U) || \
  147. defined(YJZK_SWITCH_2CH) || \
  148. defined(ZHILDE_EU44_W)
  149. #undef ESPURNA_IMAGE
  150. #define ESPURNA_IMAGE ESPURNA_BASIC
  151. // -----------------------------------------------------------------------------
  152. #elif \
  153. defined(BLITZWOLF_BWSHP2) || \
  154. defined(HOMECUBE_16A) || \
  155. defined(ITEAD_SONOFF_POW) || \
  156. defined(KMC_70011) || \
  157. defined(MAXCIO_WUS002S) || \
  158. defined(TINKERMAN_ESPURNA_H06) || \
  159. defined(TINKERMAN_ESPURNA_H08) || \
  160. defined(VANZAVANZU_SMART_WIFI_PLUG_MINI) || \
  161. defined(YIDIAN_XSSSA05)
  162. #undef ESPURNA_IMAGE
  163. #define ESPURNA_IMAGE ESPURNA_HLW8012
  164. // -----------------------------------------------------------------------------
  165. #elif \
  166. defined(ITEAD_SONOFF_POW_R2) || \
  167. defined(ITEAD_SONOFF_S31)
  168. #undef ESPURNA_IMAGE
  169. #define ESPURNA_IMAGE ESPURNA_CSE77XX
  170. // -----------------------------------------------------------------------------
  171. #elif defined(GENERIC_V9261F)
  172. #undef ESPURNA_IMAGE
  173. #define ESPURNA_IMAGE ESPURNA_V9261F
  174. // -----------------------------------------------------------------------------
  175. #elif defined(GENERIC_ECH1560)
  176. #undef ESPURNA_IMAGE
  177. #define ESPURNA_IMAGE ESPURNA_ECH1560
  178. // -----------------------------------------------------------------------------
  179. #elif \
  180. defined(ARILUX_AL_LC01) || \
  181. defined(ARILUX_AL_LC02) || \
  182. defined(ARILUX_AL_LC06) || \
  183. defined(ARILUX_AL_LC11) || \
  184. defined(AUTHOMETION_LYT8266) || \
  185. defined(GENERIC_AG_L4) || \
  186. defined(HUACANXING_H801) || \
  187. defined(HUACANXING_H802) || \
  188. defined(INTERMITTECH_QUINLED) || \
  189. defined(ITEAD_BNSZ01) || \
  190. defined(ITEAD_SONOFF_LED)
  191. #undef ESPURNA_IMAGE
  192. #define ESPURNA_IMAGE ESPURNA_DIMMER
  193. // -----------------------------------------------------------------------------
  194. #elif \
  195. defined(AITHINKER_AI_LIGHT) || \
  196. defined(ARILUX_E27) || \
  197. defined(ITEAD_SONOFF_B1)
  198. #undef ESPURNA_IMAGE
  199. #define ESPURNA_IMAGE ESPURNA_MY92XX
  200. // -----------------------------------------------------------------------------
  201. #elif \
  202. defined(GENERIC_ESP01S_DHT11_V10) || \
  203. defined(GENERIC_ESP01S_DS18B20_V10) || \
  204. defined(ITEAD_SONOFF_TH) || \
  205. defined(MANCAVEMADE_ESPLIVE)
  206. #undef ESPURNA_IMAGE
  207. #define ESPURNA_IMAGE ESPURNA_SENSOR
  208. // -----------------------------------------------------------------------------
  209. #elif defined(TINKERMAN_RFM69GW)
  210. #undef ESPURNA_IMAGE
  211. #define ESPURNA_IMAGE ESPURNA_RFM69
  212. // -----------------------------------------------------------------------------
  213. #elif defined(ITEAD_SONOFF_DUAL)
  214. #undef ESPURNA_IMAGE
  215. #define ESPURNA_IMAGE ESPURNA_SONOFF_DUAL
  216. // -----------------------------------------------------------------------------
  217. #elif defined(STM_RELAY)
  218. #undef ESPURNA_IMAGE
  219. #define ESPURNA_IMAGE ESPURNA_STM
  220. // -----------------------------------------------------------------------------
  221. #elif defined(GENERIC_GEIGER_COUNTER)
  222. #undef ESPURNA_IMAGE
  223. #define ESPURNA_IMAGE ESPURNA_GEIGER
  224. // -----------------------------------------------------------------------------
  225. // PENDING
  226. // -----------------------------------------------------------------------------
  227. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  228. #undef ESPURNA_IMAGE
  229. #define ESPURNA_IMAGE ESPURNA_SONOFF_RFBRIDGE
  230. // Info
  231. #define RELAY_PROVIDER RELAY_PROVIDER_RFBRIDGE
  232. // RFB Direct hack thanks to @wildwiz
  233. // https://github.com/xoseperez/espurna/wiki/Hardware-Itead-Sonoff-RF-Bridge---Direct-Hack
  234. #ifndef RFB_DIRECT
  235. #define RFB_DIRECT 0
  236. #endif
  237. #ifndef RFB_RX_PIN
  238. #define RFB_RX_PIN 4 // GPIO for RX when RFB_DIRECT
  239. #endif
  240. #ifndef RFB_TX_PIN
  241. #define RFB_TX_PIN 5 // GPIO for TX when RFB_DIRECT
  242. #endif
  243. // When using un-modified harware, ESPurna communicates with the secondary
  244. // MCU EFM8BB1 via UART at 19200 bps so we need to change the speed of
  245. // the port and remove UART noise on serial line
  246. #if not RFB_DIRECT
  247. #define SERIAL_BAUDRATE 19200
  248. #define DEBUG_SERIAL_SUPPORT 0
  249. #endif
  250. // -----------------------------------------------------------------------------
  251. #elif defined(PILOTAK_ESP_DIN_V1)
  252. #undef ESPURNA_IMAGE
  253. #define ESPURNA_IMAGE ESPURNA_SENSOR
  254. #ifndef RF_SUPPORT
  255. #define RF_SUPPORT 1 // Does this need the RFBRIDGE image?
  256. #endif
  257. #define RF_PIN 14
  258. // -----------------------------------------------------------------------------
  259. #elif defined(MAGICHOME_LED_CONTROLLER)
  260. #undef ESPURNA_IMAGE
  261. #define ESPURNA_IMAGE ESPURNA_DIMMER
  262. // IR
  263. #define IR_SUPPORT 1
  264. #define IR_RECEIVER_PIN 4
  265. #define IR_BUTTON_SET 1
  266. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  267. #undef ESPURNA_IMAGE
  268. #define ESPURNA_IMAGE ESPURNA_DIMMER
  269. // IR
  270. #define IR_SUPPORT 1
  271. #define IR_RECEIVER_PIN 4
  272. #define IR_BUTTON_SET 1
  273. #elif defined(GIZWITS_WITTY_CLOUD)
  274. #undef ESPURNA_IMAGE
  275. #define ESPURNA_IMAGE ESPURNA_DIMMER
  276. #define ANALOG_SUPPORT 1 // TODO: specific or generic?
  277. // -----------------------------------------------------------------------------
  278. // TEST devices (do not use!!)
  279. // -----------------------------------------------------------------------------
  280. #elif defined(TRAVIS01)
  281. #undef ESPURNA_IMAGE
  282. #define ESPURNA_IMAGE ESPURNA_BASIC
  283. // A bit of I2C - pins 3,4
  284. #define I2C_SDA_PIN 3
  285. #define I2C_SCL_PIN 4
  286. // And, as they say in "From Dusk till Dawn":
  287. // This is a sensor blow out!
  288. // Alright, we got white sensor, black sensor, spanish sensor, yellow sensor. We got hot sensor, cold sensor.
  289. // We got wet sensor. We got smelly sensor. We got hairy sensor, bloody sensor. We got snapping sensor.
  290. // We got silk sensor, velvet sensor, naugahyde sensor. We even got horse sensor, dog sensor, chicken sensor.
  291. // C'mon, you want sensor, come on in sensor lovers!
  292. // If we don’t got it, you don't want it!
  293. #define AM2320_SUPPORT 1
  294. #define BH1750_SUPPORT 1
  295. #define BMX280_SUPPORT 1
  296. #define SHT3X_I2C_SUPPORT 1
  297. #define EMON_ADC121_SUPPORT 1
  298. #define EMON_ADS1X15_SUPPORT 1
  299. #define SHT3X_I2C_SUPPORT 1
  300. #define SI7021_SUPPORT 1
  301. #define PMSX003_SUPPORT 1
  302. #define SENSEAIR_SUPPORT 1
  303. // A bit of lights - pin 5
  304. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  305. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  306. #define DUMMY_RELAY_COUNT 1
  307. #define LIGHT_CHANNELS 1
  308. #define LIGHT_CH1_PIN 5
  309. #define LIGHT_CH1_INVERSE 0
  310. // A bit of HLW8012 - pins 6,7,8
  311. #ifndef HLW8012_SUPPORT
  312. #define HLW8012_SUPPORT 1
  313. #endif
  314. #define HLW8012_SEL_PIN 6
  315. #define HLW8012_CF1_PIN 7
  316. #define HLW8012_CF_PIN 8
  317. // A bit of Dallas - pin 9
  318. #ifndef DALLAS_SUPPORT
  319. #define DALLAS_SUPPORT 1
  320. #endif
  321. #define DALLAS_PIN 9
  322. // A bit of ECH1560 - pins 10,11, 12
  323. #ifndef ECH1560_SUPPORT
  324. #define ECH1560_SUPPORT 1
  325. #endif
  326. #define ECH1560_CLK_PIN 10
  327. #define ECH1560_MISO_PIN 11
  328. #define ECH1560_INVERTED 12
  329. #elif defined(TRAVIS02)
  330. #undef ESPURNA_IMAGE
  331. #define ESPURNA_IMAGE ESPURNA_BASIC
  332. // A bit of CSE7766 - pin 1
  333. #ifndef CSE7766_SUPPORT
  334. #define CSE7766_SUPPORT 1
  335. #endif
  336. #define CSE7766_PIN 1
  337. // Relay type dual - pins 2,3
  338. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  339. #define RELAY1_PIN 2
  340. #define RELAY2_PIN 3
  341. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  342. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  343. // IR - pin 4
  344. #define IR_SUPPORT 1
  345. #define IR_RECEIVER_PIN 4
  346. #define IR_BUTTON_SET 1
  347. // A bit of DHT - pin 5
  348. #ifndef DHT_SUPPORT
  349. #define DHT_SUPPORT 1
  350. #endif
  351. #define DHT_PIN 5
  352. // A bit of TMP3X (analog)
  353. #define TMP3X_SUPPORT 1
  354. // A bit of EVENTS - pin 10
  355. #define EVENTS_SUPPORT 1
  356. #define EVENTS_PIN 6
  357. // Sonar
  358. #define SONAR_SUPPORT 1
  359. #define SONAR_TRIGGER 7
  360. #define SONAR_ECHO 8
  361. // MHZ19
  362. #define MHZ19_SUPPORT 1
  363. #define MHZ19_RX_PIN 9
  364. #define MHZ19_TX_PIN 10
  365. // PZEM004T
  366. #define PZEM004T_SUPPORT 1
  367. #define PZEM004T_RX_PIN 11
  368. #define PZEM004T_TX_PIN 12
  369. // V9261F
  370. #define V9261F_SUPPORT 1
  371. #define V9261F_PIN 13
  372. // GUVAS12SD
  373. #define GUVAS12SD_SUPPORT 1
  374. #define GUVAS12SD_PIN 14
  375. // Test non-default modules
  376. #define MDNS_CLIENT_SUPPORT 1
  377. #define NOFUSS_SUPPORT 1
  378. #define UART_MQTT_SUPPORT 1
  379. #define INFLUXDB_SUPPORT 1
  380. #define IR_SUPPORT 1
  381. #elif defined(TRAVIS03)
  382. #undef ESPURNA_IMAGE
  383. #define ESPURNA_IMAGE ESPURNA_BASIC
  384. // MY9231 Light - pins 1,2
  385. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  386. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  387. #define DUMMY_RELAY_COUNT 1
  388. #define LIGHT_CHANNELS 5
  389. #define MY92XX_MODEL MY92XX_MODEL_MY9231
  390. #define MY92XX_CHIPS 2
  391. #define MY92XX_DI_PIN 1
  392. #define MY92XX_DCKI_PIN 2
  393. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  394. #define MY92XX_MAPPING 4, 3, 5, 0, 1
  395. // A bit of Analog EMON (analog)
  396. #ifndef EMON_ANALOG_SUPPORT
  397. #define EMON_ANALOG_SUPPORT 1
  398. #endif
  399. // Test non-default modules
  400. #define LLMNR_SUPPORT 1
  401. #define NETBIOS_SUPPORT 1
  402. #define SSDP_SUPPORT 1
  403. #endif
  404. // -----------------------------------------------------------------------------
  405. // ESPurna Core
  406. // This is a special device targeted to generate a light-weight binary image
  407. // meant to be able to do two-step-updates:
  408. // https://github.com/xoseperez/espurna/wiki/TwoStepUpdates
  409. // -----------------------------------------------------------------------------
  410. #ifndef ESPURNA_IMAGE
  411. #define ESPURNA_IMAGE ESPURNA_CORE
  412. #endif
  413. // -----------------------------------------------------------------------------
  414. // Image definitions
  415. // -----------------------------------------------------------------------------
  416. #if ESPURNA_IMAGE == ESPURNA_CORE
  417. // Disable non-core modules
  418. #define ALEXA_SUPPORT 0
  419. #define API_SUPPORT 0
  420. #define BROKER_SUPPORT 0
  421. #define BUTTON_SUPPORT 0
  422. #define DOMOTICZ_SUPPORT 0
  423. #define HOMEASSISTANT_SUPPORT 0
  424. #define I2C_SUPPORT 0
  425. #define MDNS_SERVER_SUPPORT 0
  426. #define MQTT_SUPPORT 0
  427. #define NTP_SUPPORT 0
  428. #define SCHEDULER_SUPPORT 0
  429. #define SENSOR_SUPPORT 0
  430. #define THINGSPEAK_SUPPORT 0
  431. #define WEB_SUPPORT 0
  432. // Extra light-weight image
  433. //#define DEBUG_SERIAL_SUPPORT 0
  434. //#define DEBUG_TELNET_SUPPORT 0
  435. //#define DEBUG_WEB_SUPPORT 0
  436. //#define LED_SUPPORT 0
  437. //#define TELNET_SUPPORT 0
  438. //#define TERMINAL_SUPPORT 0
  439. #elif ESPURNA_IMAGE == ESPURNA_BASIC
  440. #elif ESPURNA_IMAGE == ESPURNA_DIMMER
  441. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  442. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  443. #elif ESPURNA_IMAGE == ESPURNA_MY92XX
  444. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  445. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX
  446. #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT
  447. #elif ESPURNA_IMAGE == ESPURNA_EMON
  448. #ifndef EMON_ANALOG_SUPPORT
  449. #define EMON_ANALOG_SUPPORT 1
  450. #endif
  451. #ifndef EMON_ADC121_SUPPORT
  452. #define EMON_ADC121_SUPPORT 1
  453. #endif
  454. #ifndef EMON_ADS1X15_SUPPORT
  455. #define EMON_ADS1X15_SUPPORT 1
  456. #endif
  457. #elif ESPURNA_IMAGE == ESPURNA_HLW8012
  458. #ifndef HLW8012_SUPPORT
  459. #define HLW8012_SUPPORT 1
  460. #endif
  461. #elif ESPURNA_IMAGE == ESPURNA_CSE77XX
  462. #ifndef CSE7766_SUPPORT
  463. #define CSE7766_SUPPORT 1
  464. #endif
  465. #elif ESPURNA_IMAGE == ESPURNA_V9261F
  466. #ifndef V9261F_SUPPORT
  467. #define V9261F_SUPPORT 1
  468. #endif
  469. #ifndef ALEXA_SUPPORT
  470. #define ALEXA_SUPPORT 0
  471. #endif
  472. #elif ESPURNA_IMAGE == ESPURNA_ECH1560
  473. #ifndef ECH1560_SUPPORT
  474. #define ECH1560_SUPPORT 1
  475. #endif
  476. #ifndef ALEXA_SUPPORT
  477. #define ALEXA_SUPPORT 0
  478. #endif
  479. #elif ESPURNA_IMAGE == ESPURNA_SENSOR
  480. #ifndef ANALOG_SUPPORT
  481. #define ANALOG_SUPPORT 1
  482. #endif
  483. #ifndef DALLAS_SUPPORT
  484. #define DALLAS_SUPPORT 1
  485. #endif
  486. #ifndef DHT_SUPPORT
  487. #define DHT_SUPPORT 1
  488. #endif
  489. #ifndef DIGITAL_SUPPORT
  490. #define DIGITAL_SUPPORT 1
  491. #endif
  492. #elif ESPURNA_IMAGE == ESPURNA_SONOFF_DUAL
  493. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  494. #elif ESPURNA_IMAGE == ESPURNA_SONOFF_RFBRIDGE
  495. #elif ESPURNA_IMAGE == ESPURNA_RFM69
  496. // RFM69GW
  497. #define RFM69_SUPPORT 1
  498. // Disable non-core modules
  499. #define ALEXA_SUPPORT 0
  500. #define DOMOTICZ_SUPPORT 0
  501. #define HOMEASSISTANT_SUPPORT 0
  502. #define I2C_SUPPORT 0
  503. #define SCHEDULER_SUPPORT 0
  504. #define SENSOR_SUPPORT 0
  505. #define THINGSPEAK_SUPPORT 0
  506. #elif ESPURNA_IMAGE == ESPURNA_STM
  507. #define RELAY_PROVIDER RELAY_PROVIDER_STM
  508. #elif ESPURNA_IMAGE == ESPURNA_GEIGER
  509. // Enable Geiger Counter
  510. #define GEIGER_SUPPORT 1
  511. // Disable uneeded modules
  512. #define ALEXA_SUPPORT 0
  513. #define SCHEDULER_SUPPORT 0
  514. #endif