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.

644 lines
22 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
6 years ago
  1. // =============================================================================
  2. // SENSORS - General data
  3. // =============================================================================
  4. #define SENSOR_DEBUG 0 // Debug sensors
  5. #define SENSOR_READ_INTERVAL 6 // Read data from sensors every 6 seconds
  6. #define SENSOR_READ_MIN_INTERVAL 6 // Minimum read interval
  7. #define SENSOR_READ_MAX_INTERVAL 3600 // Maximum read interval
  8. #define SENSOR_REPORT_EVERY 10 // Report every this many readings
  9. #define SENSOR_REPORT_MIN_EVERY 1 // Minimum every value
  10. #define SENSOR_REPORT_MAX_EVERY 12 // Maximum
  11. #define SENSOR_USE_INDEX 0 // Use the index in topic (i.e. temperature/0)
  12. // even if just one sensor (0 for backwards compatibility)
  13. #ifndef SENSOR_TEMPERATURE_UNITS
  14. #define SENSOR_TEMPERATURE_UNITS TMP_CELSIUS // Temperature units (TMP_CELSIUS | TMP_FAHRENHEIT)
  15. #endif
  16. #ifndef SENSOR_TEMPERATURE_CORRECTION
  17. #define SENSOR_TEMPERATURE_CORRECTION 0.0 // Offset correction
  18. #endif
  19. #ifndef TEMPERATURE_MIN_CHANGE
  20. #define TEMPERATURE_MIN_CHANGE 0.0 // Minimum temperature change to report
  21. #endif
  22. #ifndef HUMIDITY_MIN_CHANGE
  23. #define HUMIDITY_MIN_CHANGE 0 // Minimum humidity change to report
  24. #endif
  25. #define HUMIDITY_NORMAL 0
  26. #define HUMIDITY_COMFORTABLE 1
  27. #define HUMIDITY_DRY 2
  28. #define HUMIDITY_WET 3
  29. #define SENSOR_PUBLISH_ADDRESSES 0 // Publish sensor addresses
  30. #define SENSOR_ADDRESS_TOPIC "address" // Topic to publish sensor addresses
  31. //--------------------------------------------------------------------------------
  32. // Sensor ID
  33. // These should remain over time, do not modify them, only add new ones at the end
  34. //--------------------------------------------------------------------------------
  35. #define SENSOR_DHTXX_ID 0x01
  36. #define SENSOR_DALLAS_ID 0x02
  37. #define SENSOR_EMON_ANALOG_ID 0x03
  38. #define SENSOR_EMON_ADC121_ID 0x04
  39. #define SENSOR_EMON_ADS1X15_ID 0x05
  40. #define SENSOR_HLW8012_ID 0x06
  41. #define SENSOR_V9261F_ID 0x07
  42. #define SENSOR_ECH1560_ID 0x08
  43. #define SENSOR_ANALOG_ID 0x09
  44. #define SENSOR_DIGITAL_ID 0x10
  45. #define SENSOR_EVENTS_ID 0x11
  46. #define SENSOR_PMSX003_ID 0x12
  47. #define SENSOR_BMX280_ID 0x13
  48. #define SENSOR_MHZ19_ID 0x14
  49. #define SENSOR_SI7021_ID 0x15
  50. #define SENSOR_SHT3X_I2C_ID 0x16
  51. #define SENSOR_BH1750_ID 0x17
  52. //--------------------------------------------------------------------------------
  53. // Magnitudes
  54. //--------------------------------------------------------------------------------
  55. #define MAGNITUDE_NONE 0
  56. #define MAGNITUDE_TEMPERATURE 1
  57. #define MAGNITUDE_HUMIDITY 2
  58. #define MAGNITUDE_PRESSURE 3
  59. #define MAGNITUDE_CURRENT 4
  60. #define MAGNITUDE_VOLTAGE 5
  61. #define MAGNITUDE_POWER_ACTIVE 6
  62. #define MAGNITUDE_POWER_APPARENT 7
  63. #define MAGNITUDE_POWER_REACTIVE 8
  64. #define MAGNITUDE_POWER_FACTOR 9
  65. #define MAGNITUDE_ENERGY 10
  66. #define MAGNITUDE_ENERGY_DELTA 11
  67. #define MAGNITUDE_ANALOG 12
  68. #define MAGNITUDE_DIGITAL 13
  69. #define MAGNITUDE_EVENTS 14
  70. #define MAGNITUDE_PM1dot0 15
  71. #define MAGNITUDE_PM2dot5 16
  72. #define MAGNITUDE_PM10 17
  73. #define MAGNITUDE_CO2 18
  74. #define MAGNITUDE_LUX 19
  75. #define MAGNITUDE_MAX 20
  76. // =============================================================================
  77. // Specific data for each sensor
  78. // =============================================================================
  79. //------------------------------------------------------------------------------
  80. // Analog sensor
  81. // Enable support by passing ANALOG_SUPPORT=1 build flag
  82. //--------------------------------------------------------------------------------
  83. #ifndef ANALOG_SUPPORT
  84. #define ANALOG_SUPPORT 0
  85. #endif
  86. #if ANALOG_SUPPORT
  87. #undef ADC_VCC_ENABLED
  88. #define ADC_VCC_ENABLED 0
  89. #endif
  90. //------------------------------------------------------------------------------
  91. // BH1750
  92. // Enable support by passing BH1750_SUPPORT=1 build flag
  93. // http://www.elechouse.com/elechouse/images/product/Digital%20light%20Sensor/bh1750fvi-e.pdf
  94. //------------------------------------------------------------------------------
  95. #ifndef BH1750_SUPPORT
  96. #define BH1750_SUPPORT 0
  97. #endif
  98. #ifndef BH1750_ADDRESS
  99. #define BH1750_ADDRESS 0x00 // 0x00 means auto
  100. #endif
  101. #define BH1750_MODE BH1750_CONTINUOUS_HIGH_RES_MODE
  102. #if BH1750_SUPPORT
  103. #undef I2C_SUPPORT
  104. #define I2C_SUPPORT 1
  105. #endif
  106. //------------------------------------------------------------------------------
  107. // BME280/BMP280
  108. // Enable support by passing BMX280_SUPPORT=1 build flag
  109. //------------------------------------------------------------------------------
  110. #ifndef BMX280_SUPPORT
  111. #define BMX280_SUPPORT 0
  112. #endif
  113. #ifndef BMX280_ADDRESS
  114. #define BMX280_ADDRESS 0x00 // 0x00 means auto
  115. #endif
  116. #define BMX280_MODE 1 // 0 for sleep mode, 1 or 2 for forced mode, 3 for normal mode
  117. #define BMX280_STANDBY 0 // 0 for 0.5ms, 1 for 62.5ms, 2 for 125ms
  118. // 3 for 250ms, 4 for 500ms, 5 for 1000ms
  119. // 6 for 10ms, 7 for 20ms
  120. #define BMX280_FILTER 0 // 0 for OFF, 1 for 2 values, 2 for 4 values, 3 for 8 values and 4 for 16 values
  121. #define BMX280_TEMPERATURE 1 // Oversampling for temperature (set to 0 to disable magnitude)
  122. #define BMX280_HUMIDITY 1 // Oversampling for humidity (set to 0 to disable magnitude, only for BME280)
  123. #define BMX280_PRESSURE 1 // Oversampling for pressure (set to 0 to disable magnitude)
  124. #if BMX280_SUPPORT
  125. #undef I2C_SUPPORT
  126. #define I2C_SUPPORT 1
  127. #endif
  128. //------------------------------------------------------------------------------
  129. // Dallas OneWire temperature sensors
  130. // Enable support by passing DALLAS_SUPPORT=1 build flag
  131. //------------------------------------------------------------------------------
  132. #ifndef DALLAS_SUPPORT
  133. #define DALLAS_SUPPORT 0
  134. #endif
  135. #ifndef DALLAS_PIN
  136. #define DALLAS_PIN 14
  137. #endif
  138. #define DALLAS_RESOLUTION 9 // Not used atm
  139. #define DALLAS_READ_INTERVAL 2000 // Force sensor read & cache every 2 seconds
  140. //------------------------------------------------------------------------------
  141. // DHTXX temperature/humidity sensor
  142. // Enable support by passing DHT_SUPPORT=1 build flag
  143. //------------------------------------------------------------------------------
  144. #ifndef DHT_SUPPORT
  145. #define DHT_SUPPORT 0
  146. #endif
  147. #ifndef DHT_PIN
  148. #define DHT_PIN 14
  149. #endif
  150. #ifndef DHT_TYPE
  151. #define DHT_TYPE DHT_CHIP_DHT22
  152. #endif
  153. //------------------------------------------------------------------------------
  154. // Digital sensor
  155. // Enable support by passing DIGITAL_SUPPORT=1 build flag
  156. //------------------------------------------------------------------------------
  157. #ifndef DIGITAL_SUPPORT
  158. #define DIGITAL_SUPPORT 0
  159. #endif
  160. #ifndef DIGITAL_PIN
  161. #define DIGITAL_PIN 2
  162. #endif
  163. #ifndef DIGITAL_PIN_MODE
  164. #define DIGITAL_PIN_MODE INPUT_PULLUP
  165. #endif
  166. #ifndef DIGITAL_DEFAULT_STATE
  167. #define DIGITAL_DEFAULT_STATE 1
  168. #endif
  169. //------------------------------------------------------------------------------
  170. // ECH1560 based power sensor
  171. // Enable support by passing ECH1560_SUPPORT=1 build flag
  172. //------------------------------------------------------------------------------
  173. #ifndef ECH1560_SUPPORT
  174. #define ECH1560_SUPPORT 0
  175. #endif
  176. #ifndef ECH1560_CLK_PIN
  177. #define ECH1560_CLK_PIN 4 // CLK pin for the ECH1560
  178. #endif
  179. #ifndef ECH1560_MISO_PIN
  180. #define ECH1560_MISO_PIN 5 // MISO pin for the ECH1560
  181. #endif
  182. #ifndef ECH1560_INVERTED
  183. #define ECH1560_INVERTED 0 // Signal is inverted
  184. #endif
  185. //------------------------------------------------------------------------------
  186. // Energy Monitor general settings
  187. //------------------------------------------------------------------------------
  188. #define EMON_MAX_SAMPLES 1000 // Max number of samples to get
  189. #define EMON_MAX_TIME 250 // Max time in ms to sample
  190. #define EMON_FILTER_SPEED 512 // Mobile average filter speed
  191. #define EMON_MAINS_VOLTAGE 230 // Mains voltage
  192. #define EMON_REFERENCE_VOLTAGE 3.3 // Reference voltage of the ADC
  193. #define EMON_CURRENT_RATIO 30 // Current ratio in the clamp (30V/1A)
  194. #define EMON_REPORT_CURRENT 0 // Report current
  195. #define EMON_REPORT_POWER 1 // Report power
  196. #define EMON_REPORT_ENERGY 1 // Report energy
  197. //------------------------------------------------------------------------------
  198. // Energy Monitor based on ADC121
  199. // Enable support by passing EMON_ADC121_SUPPORT=1 build flag
  200. //------------------------------------------------------------------------------
  201. #ifndef EMON_ADC121_SUPPORT
  202. #define EMON_ADC121_SUPPORT 0 // Do not build support by default
  203. #endif
  204. #define EMON_ADC121_I2C_ADDRESS 0x00 // 0x00 means auto
  205. #if EMON_ADC121_SUPPORT
  206. #undef I2C_SUPPORT
  207. #define I2C_SUPPORT 1
  208. #endif
  209. //------------------------------------------------------------------------------
  210. // Energy Monitor based on ADS1X15
  211. // Enable support by passing EMON_ADS1X15_SUPPORT=1 build flag
  212. //------------------------------------------------------------------------------
  213. #ifndef EMON_ADS1X15_SUPPORT
  214. #define EMON_ADS1X15_SUPPORT 0 // Do not build support by default
  215. #endif
  216. #define EMON_ADS1X15_I2C_ADDRESS 0x00 // 0x00 means auto
  217. #define EMON_ADS1X15_TYPE ADS1X15_CHIP_ADS1115
  218. #define EMON_ADS1X15_GAIN ADS1X15_REG_CONFIG_PGA_4_096V
  219. #define EMON_ADS1X15_MASK 0x0F // A0=1 A1=2 A2=4 A3=8
  220. #if EMON_ADS1X15_SUPPORT
  221. #undef I2C_SUPPORT
  222. #define I2C_SUPPORT 1
  223. #endif
  224. //------------------------------------------------------------------------------
  225. // Energy Monitor based on interval analog GPIO
  226. // Enable support by passing EMON_ANALOG_SUPPORT=1 build flag
  227. //------------------------------------------------------------------------------
  228. #ifndef EMON_ANALOG_SUPPORT
  229. #define EMON_ANALOG_SUPPORT 0 // Do not build support by default
  230. #endif
  231. #if EMON_ANALOG_SUPPORT
  232. #undef ADC_VCC_ENABLED
  233. #define ADC_VCC_ENABLED 0
  234. #endif
  235. //------------------------------------------------------------------------------
  236. // Counter sensor
  237. // Enable support by passing EVENTS_SUPPORT=1 build flag
  238. //------------------------------------------------------------------------------
  239. #ifndef EVENTS_SUPPORT
  240. #define EVENTS_SUPPORT 0 // Do not build with counter support by default
  241. #endif
  242. #ifndef EVENTS_PIN
  243. #define EVENTS_PIN 2 // GPIO to monitor
  244. #endif
  245. #ifndef EVENTS_PIN_MODE
  246. #define EVENTS_PIN_MODE INPUT // INPUT, INPUT_PULLUP
  247. #endif
  248. #ifndef EVENTS_INTERRUPT_MODE
  249. #define EVENTS_INTERRUPT_MODE RISING // RISING, FALLING, BOTH
  250. #endif
  251. #define EVENTS_DEBOUNCE 50 // Do not register events within less than 10 millis
  252. //------------------------------------------------------------------------------
  253. // HLW8012 Energy monitor IC
  254. // Enable support by passing HLW8012_SUPPORT=1 build flag
  255. //------------------------------------------------------------------------------
  256. #ifndef HLW8012_SUPPORT
  257. #define HLW8012_SUPPORT 0
  258. #endif
  259. #ifndef HLW8012_SEL_PIN
  260. #define HLW8012_SEL_PIN 5
  261. #endif
  262. #ifndef HLW8012_CF1_PIN
  263. #define HLW8012_CF1_PIN 13
  264. #endif
  265. #ifndef HLW8012_CF_PIN
  266. #define HLW8012_CF_PIN 14
  267. #endif
  268. #ifndef HLW8012_SEL_CURRENT
  269. #define HLW8012_SEL_CURRENT HIGH // SEL pin to HIGH to measure current
  270. #endif
  271. #ifndef HLW8012_CURRENT_R
  272. #define HLW8012_CURRENT_R 0.001 // Current resistor
  273. #endif
  274. #ifndef HLW8012_VOLTAGE_R_UP
  275. #define HLW8012_VOLTAGE_R_UP ( 5 * 470000 ) // Upstream voltage resistor
  276. #endif
  277. #ifndef HLW8012_VOLTAGE_R_DOWN
  278. #define HLW8012_VOLTAGE_R_DOWN ( 1000 ) // Downstream voltage resistor
  279. #endif
  280. #define HLW8012_USE_INTERRUPTS 1 // Use interrupts to trap HLW8012 signals
  281. //------------------------------------------------------------------------------
  282. // MHZ19 CO2 sensor
  283. // Enable support by passing MHZ19_SUPPORT=1 build flag
  284. //------------------------------------------------------------------------------
  285. #ifndef MHZ19_SUPPORT
  286. #define MHZ19_SUPPORT 0
  287. #endif
  288. #define MHZ19_RX_PIN 13
  289. #define MHZ19_TX_PIN 15
  290. //------------------------------------------------------------------------------
  291. // Particle Monitor based on Plantower PMSX003
  292. // Enable support by passing PMSX003_SUPPORT=1 build flag
  293. //------------------------------------------------------------------------------
  294. #ifndef PMSX003_SUPPORT
  295. #define PMSX003_SUPPORT 0
  296. #endif
  297. #define PMS_RX_PIN 13
  298. #define PMS_TX_PIN 15
  299. //------------------------------------------------------------------------------
  300. // SHT3X I2C (Wemos) temperature & humidity sensor
  301. // Enable support by passing SHT3X_SUPPORT=1 build flag
  302. //------------------------------------------------------------------------------
  303. #ifndef SHT3X_I2C_SUPPORT
  304. #define SHT3X_I2C_SUPPORT 0
  305. #endif
  306. #ifndef SHT3X_I2C_ADDRESS
  307. #define SHT3X_I2C_ADDRESS 0x00 // 0x00 means auto
  308. #endif
  309. #if SHT3X_I2C_SUPPORT
  310. #undef I2C_SUPPORT
  311. #define I2C_SUPPORT 1
  312. #endif
  313. //------------------------------------------------------------------------------
  314. // SI7021 temperature & humidity sensor
  315. // Enable support by passing SI7021_SUPPORT=1 build flag
  316. //------------------------------------------------------------------------------
  317. #ifndef SI7021_SUPPORT
  318. #define SI7021_SUPPORT 0
  319. #endif
  320. #ifndef SI7021_ADDRESS
  321. #define SI7021_ADDRESS 0x00 // 0x00 means auto
  322. #endif
  323. #if SI7021_SUPPORT
  324. #undef I2C_SUPPORT
  325. #define I2C_SUPPORT 1
  326. #endif
  327. //------------------------------------------------------------------------------
  328. // V9261F based power sensor
  329. // Enable support by passing SI7021_SUPPORT=1 build flag
  330. //------------------------------------------------------------------------------
  331. #ifndef V9261F_SUPPORT
  332. #define V9261F_SUPPORT 0
  333. #endif
  334. #ifndef V9261F_PIN
  335. #define V9261F_PIN 2 // TX pin from the V9261F
  336. #endif
  337. #ifndef V9261F_PIN_INVERSE
  338. #define V9261F_PIN_INVERSE 1 // Signal is inverted
  339. #endif
  340. #define V9261F_SYNC_INTERVAL 600 // Sync signal length (ms)
  341. #define V9261F_BAUDRATE 4800 // UART baudrate
  342. // Default ratios
  343. #define V9261F_CURRENT_FACTOR 79371434.0
  344. #define V9261F_VOLTAGE_FACTOR 4160651.0
  345. #define V9261F_POWER_FACTOR 153699.0
  346. #define V9261F_RPOWER_FACTOR V9261F_CURRENT_FACTOR
  347. // =============================================================================
  348. // Sensor helpers configuration
  349. // =============================================================================
  350. #ifndef SENSOR_SUPPORT
  351. #if ANALOG_SUPPORT || BH1750_SUPPORT || BMX280_SUPPORT || DALLAS_SUPPORT \
  352. || DHT_SUPPORT || DIGITAL_SUPPORT || ECH1560_SUPPORT \
  353. || EMON_ADC121_SUPPORT || EMON_ADS1X15_SUPPORT \
  354. || EMON_ANALOG_SUPPORT || EVENTS_SUPPORT || HLW8012_SUPPORT \
  355. || MHZ19_SUPPORT || PMSX003_SUPPORT || SHT3X_I2C_SUPPORT \
  356. || SI7021_SUPPORT || V9261F_SUPPORT
  357. #define SENSOR_SUPPORT 1
  358. #else
  359. #define SENSOR_SUPPORT 0
  360. #endif
  361. #endif
  362. // -----------------------------------------------------------------------------
  363. // I2C
  364. // -----------------------------------------------------------------------------
  365. #ifndef I2C_SUPPORT
  366. #define I2C_SUPPORT 0 // I2C enabled (1.98Kb)
  367. #endif
  368. #define I2C_USE_BRZO 0 // Use brzo_i2c library or standard Wire
  369. #ifndef I2C_SDA_PIN
  370. #define I2C_SDA_PIN SDA // SDA GPIO (Sonoff => 4)
  371. #endif
  372. #ifndef I2C_SCL_PIN
  373. #define I2C_SCL_PIN SCL // SCL GPIO (Sonoff => 14)
  374. #endif
  375. #define I2C_CLOCK_STRETCH_TIME 200 // BRZO clock stretch time
  376. #define I2C_SCL_FREQUENCY 1000 // BRZO SCL frequency
  377. #define I2C_CLEAR_BUS 0 // Clear I2C bus on boot
  378. #define I2C_PERFORM_SCAN 1 // Perform a bus scan on boot
  379. //--------------------------------------------------------------------------------
  380. // Internal power monitor
  381. // Enable support by passing ADC_VCC_ENABLED=1 build flag
  382. // Do not enable this if using the analog GPIO for any other thing
  383. //--------------------------------------------------------------------------------
  384. #ifndef ADC_VCC_ENABLED
  385. #define ADC_VCC_ENABLED 1
  386. #endif
  387. #if ADC_VCC_ENABLED
  388. ADC_MODE(ADC_VCC);
  389. #endif
  390. //--------------------------------------------------------------------------------
  391. // Class loading
  392. //--------------------------------------------------------------------------------
  393. #if SENSOR_SUPPORT
  394. PROGMEM const unsigned char magnitude_decimals[] = {
  395. 0,
  396. 1, 0, 2,
  397. 3, 0, 0, 0, 0, 0, 0, 0,
  398. 0, 0, 0,
  399. 0, 0, 0,
  400. 0, 0
  401. };
  402. PROGMEM const char magnitude_unknown_topic[] = "unknown";
  403. PROGMEM const char magnitude_temperature_topic[] = "temperature";
  404. PROGMEM const char magnitude_humidity_topic[] = "humidity";
  405. PROGMEM const char magnitude_pressure_topic[] = "pressure";
  406. PROGMEM const char magnitude_current_topic[] = "current";
  407. PROGMEM const char magnitude_voltage_topic[] = "voltage";
  408. PROGMEM const char magnitude_active_power_topic[] = "power";
  409. PROGMEM const char magnitude_apparent_power_topic[] = "apparent";
  410. PROGMEM const char magnitude_reactive_power_topic[] = "reactive";
  411. PROGMEM const char magnitude_power_factor_topic[] = "factor";
  412. PROGMEM const char magnitude_energy_topic[] = "energy";
  413. PROGMEM const char magnitude_energy_delta_topic[] = "energy_delta";
  414. PROGMEM const char magnitude_analog_topic[] = "analog";
  415. PROGMEM const char magnitude_digital_topic[] = "digital";
  416. PROGMEM const char magnitude_events_topic[] = "events";
  417. PROGMEM const char magnitude_pm1dot0_topic[] = "pm1dot0";
  418. PROGMEM const char magnitude_pm2dot5_topic[] = "pm2dot5";
  419. PROGMEM const char magnitude_pm10_topic[] = "pm10";
  420. PROGMEM const char magnitude_co2_topic[] = "co2";
  421. PROGMEM const char magnitude_lux_topic[] = "lux";
  422. PROGMEM const char* const magnitude_topics[] = {
  423. magnitude_unknown_topic, magnitude_temperature_topic, magnitude_humidity_topic,
  424. magnitude_pressure_topic, magnitude_current_topic, magnitude_voltage_topic,
  425. magnitude_active_power_topic, magnitude_apparent_power_topic, magnitude_reactive_power_topic,
  426. magnitude_power_factor_topic, magnitude_energy_topic, magnitude_energy_delta_topic,
  427. magnitude_analog_topic, magnitude_digital_topic, magnitude_events_topic,
  428. magnitude_pm1dot0_topic, magnitude_pm2dot5_topic, magnitude_pm10_topic,
  429. magnitude_co2_topic, magnitude_lux_topic
  430. };
  431. PROGMEM const char magnitude_empty[] = "";
  432. PROGMEM const char magnitude_celsius[] = "C";
  433. PROGMEM const char magnitude_fahrenheit[] = "F";
  434. PROGMEM const char magnitude_percentage[] = "%";
  435. PROGMEM const char magnitude_hectopascals[] = "hPa";
  436. PROGMEM const char magnitude_amperes[] = "A";
  437. PROGMEM const char magnitude_volts[] = "V";
  438. PROGMEM const char magnitude_watts[] = "W";
  439. PROGMEM const char magnitude_joules[] = "J";
  440. PROGMEM const char magnitude_ugm3[] = "µg/m3";
  441. PROGMEM const char magnitude_ppm[] = "ppm";
  442. PROGMEM const char magnitude_lux[] = "lux";
  443. PROGMEM const char* const magnitude_units[] = {
  444. magnitude_empty, magnitude_celsius, magnitude_percentage,
  445. magnitude_hectopascals, magnitude_amperes, magnitude_volts,
  446. magnitude_watts, magnitude_watts, magnitude_watts,
  447. magnitude_percentage, magnitude_joules, magnitude_joules,
  448. magnitude_empty, magnitude_empty, magnitude_empty,
  449. magnitude_ugm3, magnitude_ugm3, magnitude_ugm3,
  450. magnitude_ppm, magnitude_lux
  451. };
  452. #include "../sensors/BaseSensor.h"
  453. #if ANALOG_SUPPORT
  454. #include "../sensors/AnalogSensor.h"
  455. #endif
  456. #if BH1750_SUPPORT
  457. #include "../sensors/BH1750Sensor.h"
  458. #endif
  459. #if BMX280_SUPPORT
  460. #include <SparkFunBME280.h>
  461. #include "../sensors/BMX280Sensor.h"
  462. #endif
  463. #if DALLAS_SUPPORT
  464. #include <OneWire.h>
  465. #include "../sensors/DallasSensor.h"
  466. #endif
  467. #if DHT_SUPPORT
  468. #include "../sensors/DHTSensor.h"
  469. #endif
  470. #if DIGITAL_SUPPORT
  471. #include "../sensors/DigitalSensor.h"
  472. #endif
  473. #if ECH1560_SUPPORT
  474. #include "../sensors/ECH1560Sensor.h"
  475. #endif
  476. #if EMON_ADC121_SUPPORT
  477. #include "../sensors/EmonADC121Sensor.h"
  478. #endif
  479. #if EMON_ADS1X15_SUPPORT
  480. #include "../sensors/EmonADS1X15Sensor.h"
  481. #endif
  482. #if EMON_ANALOG_SUPPORT
  483. #include "../sensors/EmonAnalogSensor.h"
  484. #endif
  485. #if EVENTS_SUPPORT
  486. #include "../sensors/EventSensor.h"
  487. #endif
  488. #if HLW8012_SUPPORT
  489. #include <HLW8012.h>
  490. #include "../sensors/HLW8012Sensor.h"
  491. #endif
  492. #if MHZ19_SUPPORT
  493. #include <SoftwareSerial.h>
  494. #include "../sensors/MHZ19Sensor.h"
  495. #endif
  496. #if PMSX003_SUPPORT
  497. #include <SoftwareSerial.h>
  498. #include <PMS.h>
  499. #include "../sensors/PMSX003Sensor.h"
  500. #endif
  501. #if SI7021_SUPPORT
  502. #include "../sensors/SI7021Sensor.h"
  503. #endif
  504. #if SHT3X_I2C_SUPPORT
  505. #include "../sensors/SHT3XI2CSensor.h"
  506. #endif
  507. #if V9261F_SUPPORT
  508. #include <SoftwareSerial.h>
  509. #include "../sensors/V9261FSensor.h"
  510. #endif
  511. #endif // SENSOR_SUPPORT