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.

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