@ -36,40 +36,9 @@
# define HUMIDITY_MIN_CHANGE 0 / / Minimum humidity change to report
# define HUMIDITY_MIN_CHANGE 0 / / Minimum humidity change to report
# endif
# endif
/ / American Society of Heating , Refrigerating and Air - Conditioning Engineers suggests a range of 45 % - 55 % humidity to manage health effects and illnesses .
/ / Comfortable : 30 % - 60 %
/ / Recommended : 45 % - 55 %
/ / High : 55 % - 80 %
# define HUMIDITY_NORMAL 0 / / > %30
# define HUMIDITY_COMFORTABLE 1 / / > %45
# define HUMIDITY_DRY 2 / / < %30
# define HUMIDITY_WET 3 / / > %70
/ / United States Environmental Protection Agency - UV Index Scale
/ / One UV Index unit is equivalent to 25 milliWatts per square meter .
# define UV_INDEX_LOW 0 / / 0 to 2 means low danger from the sun's UV rays for the average person.
# define UV_INDEX_MODERATE 1 / / 3 to 5 means moderate risk of harm from unprotected sun exposure.
# define UV_INDEX_HIGH 2 / / 6 to 7 means high risk of harm from unprotected sun exposure. Protection against skin and eye damage is needed.
# define UV_INDEX_VERY_HIGH 3 / / 8 to 10 means very high risk of harm from unprotected sun exposure.
/ / Take extra precautions because unprotected skin and eyes will be damaged and can burn quickly .
# define UV_INDEX_EXTREME 4 / / 11 or more means extreme risk of harm from unprotected sun exposure.
/ / Take all precautions because unprotected skin and eyes can burn in minutes .
# define SENSOR_PUBLISH_ADDRESSES 0 / / Publish sensor addresses
# define SENSOR_PUBLISH_ADDRESSES 0 / / Publish sensor addresses
# define SENSOR_ADDRESS_TOPIC "address" / / Topic to publish sensor addresses
# define SENSOR_ADDRESS_TOPIC "address" / / Topic to publish sensor addresses
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / UNITS
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# define POWER_WATTS 0
# define POWER_KILOWATTS 1
# define ENERGY_JOULES 0
# define ENERGY_KWH 1
# define TMP_CELSIUS 0
# define TMP_FAHRENHEIT 1
# ifndef SENSOR_TEMPERATURE_UNITS
# ifndef SENSOR_TEMPERATURE_UNITS
# define SENSOR_TEMPERATURE_UNITS TMP_CELSIUS / / Temperature units (TMP_CELSIUS | TMP_FAHRENHEIT)
# define SENSOR_TEMPERATURE_UNITS TMP_CELSIUS / / Temperature units (TMP_CELSIUS | TMP_FAHRENHEIT)
@ -83,68 +52,24 @@
# define SENSOR_POWER_UNITS POWER_WATTS / / Power units (POWER_WATTS | POWER_KILOWATTS)
# define SENSOR_POWER_UNITS POWER_WATTS / / Power units (POWER_WATTS | POWER_KILOWATTS)
# endif
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / Sensor ID
/ / These should remain over time , do not modify them , only add new ones at the end
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# define SENSOR_DHTXX_ID 0x01
# define SENSOR_DALLAS_ID 0x02
# define SENSOR_EMON_ANALOG_ID 0x03
# define SENSOR_EMON_ADC121_ID 0x04
# define SENSOR_EMON_ADS1X15_ID 0x05
# define SENSOR_HLW8012_ID 0x06
# define SENSOR_V9261F_ID 0x07
# define SENSOR_ECH1560_ID 0x08
# define SENSOR_ANALOG_ID 0x09
# define SENSOR_DIGITAL_ID 0x10
# define SENSOR_EVENTS_ID 0x11
# define SENSOR_PMSX003_ID 0x12
# define SENSOR_BMX280_ID 0x13
# define SENSOR_MHZ19_ID 0x14
# define SENSOR_SI7021_ID 0x15
# define SENSOR_SHT3X_I2C_ID 0x16
# define SENSOR_BH1750_ID 0x17
# define SENSOR_PZEM004T_ID 0x18
# define SENSOR_AM2320_ID 0x19
# define SENSOR_GUVAS12SD_ID 0x20
# define SENSOR_CSE7766_ID 0x21
# define SENSOR_TMP3X_ID 0x22
# define SENSOR_HCSR04_ID 0x23
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / Magnitudes
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# define MAGNITUDE_NONE 0
# define MAGNITUDE_TEMPERATURE 1
# define MAGNITUDE_HUMIDITY 2
# define MAGNITUDE_PRESSURE 3
# define MAGNITUDE_CURRENT 4
# define MAGNITUDE_VOLTAGE 5
# define MAGNITUDE_POWER_ACTIVE 6
# define MAGNITUDE_POWER_APPARENT 7
# define MAGNITUDE_POWER_REACTIVE 8
# define MAGNITUDE_POWER_FACTOR 9
# define MAGNITUDE_ENERGY 10
# define MAGNITUDE_ENERGY_DELTA 11
# define MAGNITUDE_ANALOG 12
# define MAGNITUDE_DIGITAL 13
# define MAGNITUDE_EVENTS 14
# define MAGNITUDE_PM1dot0 15
# define MAGNITUDE_PM2dot5 16
# define MAGNITUDE_PM10 17
# define MAGNITUDE_CO2 18
# define MAGNITUDE_LUX 19
# define MAGNITUDE_UV 20
# define MAGNITUDE_DISTANCE 21
# define MAGNITUDE_MAX 22
/ / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/ / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/ / Specific data for each sensor
/ / Specific data for each sensor
/ / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/ / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / AM2320 Humidity & Temperature sensor over I2C
/ / Enable support by passing AM2320_SUPPORT = 1 build flag
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ifndef AM2320_SUPPORT
# define AM2320_SUPPORT 0
# endif
# ifndef AM2320_ADDRESS
# define AM2320_ADDRESS 0x00 / / 0x00 means auto
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / Analog sensor
/ / Analog sensor
/ / Enable support by passing ANALOG_SUPPORT = 1 build flag
/ / Enable support by passing ANALOG_SUPPORT = 1 build flag
@ -154,11 +79,6 @@
# define ANALOG_SUPPORT 0
# define ANALOG_SUPPORT 0
# endif
# endif
# if ANALOG_SUPPORT
# undef ADC_VCC_ENABLED
# define ADC_VCC_ENABLED 0
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / BH1750
/ / BH1750
/ / Enable support by passing BH1750_SUPPORT = 1 build flag
/ / Enable support by passing BH1750_SUPPORT = 1 build flag
@ -175,11 +95,6 @@
# define BH1750_MODE BH1750_CONTINUOUS_HIGH_RES_MODE
# define BH1750_MODE BH1750_CONTINUOUS_HIGH_RES_MODE
# if BH1750_SUPPORT
# undef I2C_SUPPORT
# define I2C_SUPPORT 1
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / BME280 / BMP280
/ / BME280 / BMP280
/ / Enable support by passing BMX280_SUPPORT = 1 build flag
/ / Enable support by passing BMX280_SUPPORT = 1 build flag
@ -202,11 +117,6 @@
# define BMX280_HUMIDITY 1 / / Oversampling for humidity (set to 0 to disable magnitude, only for BME280)
# define BMX280_HUMIDITY 1 / / Oversampling for humidity (set to 0 to disable magnitude, only for BME280)
# define BMX280_PRESSURE 1 / / Oversampling for pressure (set to 0 to disable magnitude)
# define BMX280_PRESSURE 1 / / Oversampling for pressure (set to 0 to disable magnitude)
# if BMX280_SUPPORT
# undef I2C_SUPPORT
# define I2C_SUPPORT 1
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / Dallas OneWire temperature sensors
/ / Dallas OneWire temperature sensors
/ / Enable support by passing DALLAS_SUPPORT = 1 build flag
/ / Enable support by passing DALLAS_SUPPORT = 1 build flag
@ -331,11 +241,6 @@
# define EMON_ADC121_I2C_ADDRESS 0x00 / / 0x00 means auto
# define EMON_ADC121_I2C_ADDRESS 0x00 / / 0x00 means auto
# if EMON_ADC121_SUPPORT
# undef I2C_SUPPORT
# define I2C_SUPPORT 1
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / Energy Monitor based on ADS1X15
/ / Energy Monitor based on ADS1X15
/ / Enable support by passing EMON_ADS1X15_SUPPORT = 1 build flag
/ / Enable support by passing EMON_ADS1X15_SUPPORT = 1 build flag
@ -350,11 +255,6 @@
# define EMON_ADS1X15_GAIN ADS1X15_REG_CONFIG_PGA_4_096V
# define EMON_ADS1X15_GAIN ADS1X15_REG_CONFIG_PGA_4_096V
# define EMON_ADS1X15_MASK 0x0F / / A0=1 A1=2 A2=4 A3=8
# define EMON_ADS1X15_MASK 0x0F / / A0=1 A1=2 A2=4 A3=8
# if EMON_ADS1X15_SUPPORT
# undef I2C_SUPPORT
# define I2C_SUPPORT 1
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / Energy Monitor based on interval analog GPIO
/ / Energy Monitor based on interval analog GPIO
/ / Enable support by passing EMON_ANALOG_SUPPORT = 1 build flag
/ / Enable support by passing EMON_ANALOG_SUPPORT = 1 build flag
@ -364,11 +264,6 @@
# define EMON_ANALOG_SUPPORT 0 / / Do not build support by default
# define EMON_ANALOG_SUPPORT 0 / / Do not build support by default
# endif
# endif
# if EMON_ANALOG_SUPPORT
# undef ADC_VCC_ENABLED
# define ADC_VCC_ENABLED 0
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / Counter sensor
/ / Counter sensor
/ / Enable support by passing EVENTS_SUPPORT = 1 build flag
/ / Enable support by passing EVENTS_SUPPORT = 1 build flag
@ -392,6 +287,19 @@
# define EVENTS_DEBOUNCE 50 / / Do not register events within less than 10 millis
# define EVENTS_DEBOUNCE 50 / / Do not register events within less than 10 millis
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / GUVAS12SD UV Sensor ( analog )
/ / Enable support by passing GUVAS12SD_SUPPORT = 1 build flag
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ifndef GUVAS12SD_SUPPORT
# define GUVAS12SD_SUPPORT 0
# endif
# ifndef GUVAS12SD_PIN
# define GUVAS12SD_PIN 14
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / HC - SR04
/ / HC - SR04
/ / Enable support by passing HCSR04_SUPPORT = 1 build flag
/ / Enable support by passing HCSR04_SUPPORT = 1 build flag
@ -457,11 +365,33 @@
# define MHZ19_SUPPORT 0
# define MHZ19_SUPPORT 0
# endif
# endif
# ifndef MHZ19_RX_PIN
# define MHZ19_RX_PIN 13
# define MHZ19_RX_PIN 13
# endif
# ifndef MHZ19_TX_PIN
# define MHZ19_TX_PIN 15
# define MHZ19_TX_PIN 15
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / SenseAir CO2 sensor
/ / Enable support by passing SENSEAIR_SUPPORT = 1 build flag
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ifndef SENSEAIR_SUPPORT
# define SENSEAIR_SUPPORT 0
# endif
# ifndef SENSEAIR_RX_PIN
# define SENSEAIR_RX_PIN 0
# endif
# ifndef SENSEAIR_TX_PIN
# define SENSEAIR_TX_PIN 2
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / Particle Monitor based on Plantower PMSX003
/ / Particle Monitor based on Plantower PMS
/ / Enable support by passing PMSX003_SUPPORT = 1 build flag
/ / Enable support by passing PMSX003_SUPPORT = 1 build flag
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -469,8 +399,24 @@
# define PMSX003_SUPPORT 0
# define PMSX003_SUPPORT 0
# endif
# endif
# ifndef PMS_TYPE
# define PMS_TYPE PMS_TYPE_X003
# endif
/ / You can enable smart sleep ( read 6 - times then sleep on 24 - reading - cycles ) to extend PMS sensor ' s life .
/ / Otherwise the default lifetime of PMS sensor is about 8000 - hours / 1 - years .
/ / The PMS ' s fan will stop working on sleeping cycle , and will wake up on reading cycle .
# ifndef PMS_SMART_SLEEP
# define PMS_SMART_SLEEP 0
# endif
# ifndef PMS_RX_PIN
# define PMS_RX_PIN 13
# define PMS_RX_PIN 13
# endif
# ifndef PMS_TX_PIN
# define PMS_TX_PIN 15
# define PMS_TX_PIN 15
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / PZEM004T based power monitor
/ / PZEM004T based power monitor
@ -497,7 +443,6 @@
# define PZEM004T_HW_PORT Serial1 / / Hardware serial port (if PZEM004T_USE_SOFT == 0)
# define PZEM004T_HW_PORT Serial1 / / Hardware serial port (if PZEM004T_USE_SOFT == 0)
# endif
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / SHT3X I2C ( Wemos ) temperature & humidity sensor
/ / SHT3X I2C ( Wemos ) temperature & humidity sensor
/ / Enable support by passing SHT3X_SUPPORT = 1 build flag
/ / Enable support by passing SHT3X_SUPPORT = 1 build flag
@ -511,11 +456,6 @@
# define SHT3X_I2C_ADDRESS 0x00 / / 0x00 means auto
# define SHT3X_I2C_ADDRESS 0x00 / / 0x00 means auto
# endif
# endif
# if SHT3X_I2C_SUPPORT
# undef I2C_SUPPORT
# define I2C_SUPPORT 1
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / SI7021 temperature & humidity sensor
/ / SI7021 temperature & humidity sensor
/ / Enable support by passing SI7021_SUPPORT = 1 build flag
/ / Enable support by passing SI7021_SUPPORT = 1 build flag
@ -529,11 +469,6 @@
# define SI7021_ADDRESS 0x00 / / 0x00 means auto
# define SI7021_ADDRESS 0x00 / / 0x00 means auto
# endif
# endif
# if SI7021_SUPPORT
# undef I2C_SUPPORT
# define I2C_SUPPORT 1
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / TMP3X analog temperature sensor
/ / TMP3X analog temperature sensor
/ / Enable support by passing TMP3X_SUPPORT = 1 build flag
/ / Enable support by passing TMP3X_SUPPORT = 1 build flag
@ -547,11 +482,6 @@
# define TMP3X_TYPE TMP3X_TMP35
# define TMP3X_TYPE TMP3X_TMP35
# endif
# endif
# if TMP3X_SUPPORT
# undef ADC_VCC_ENABLED
# define ADC_VCC_ENABLED 0
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / V9261F based power sensor
/ / V9261F based power sensor
/ / Enable support by passing SI7021_SUPPORT = 1 build flag
/ / Enable support by passing SI7021_SUPPORT = 1 build flag
@ -578,54 +508,46 @@
# define V9261F_POWER_FACTOR 153699.0
# define V9261F_POWER_FACTOR 153699.0
# define V9261F_RPOWER_FACTOR V9261F_CURRENT_FACTOR
# define V9261F_RPOWER_FACTOR V9261F_CURRENT_FACTOR
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / AM2320 Humidity & Temperature sensor over I2C
/ / Enable support by passing AM2320_SUPPORT = 1 build flag
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ifndef AM2320_SUPPORT
# define AM2320_SUPPORT 0
# endif
# ifndef AM2320_ADDRESS
# define AM2320_ADDRESS 0x00 / / 0x00 means auto
# endif
# if AM2320_SUPPORT
# undef I2C_SUPPORT
# define I2C_SUPPORT 1
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / GUVAS12SD UV Sensor ( analog )
/ / Enable support by passing GUVAS12SD_SUPPORT = 1 build flag
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ifndef GUVAS12SD_SUPPORT
# define GUVAS12SD_SUPPORT 0
# endif
# ifndef GUVAS12SD_PIN
# define GUVAS12SD_PIN 14
# endif
/ / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/ / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/ / Sensor helpers configuration
/ / Sensor helpers configuration - can ' t move to dependencies . h
/ / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/ / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
# ifndef SENSOR_SUPPORT
# ifndef SENSOR_SUPPORT
# if ANALOG_SUPPORT || BH1750_SUPPORT || BMX280_SUPPORT || DALLAS_SUPPORT \
| | DHT_SUPPORT | | DIGITAL_SUPPORT | | ECH1560_SUPPORT \
| | EMON_ADC121_SUPPORT | | EMON_ADS1X15_SUPPORT \
| | EMON_ANALOG_SUPPORT | | EVENTS_SUPPORT | | HLW8012_SUPPORT \
| | MHZ19_SUPPORT | | PMSX003_SUPPORT | | SHT3X_I2C_SUPPORT \
| | SI7021_SUPPORT | | V9261F_SUPPORT | | AM2320_SUPPORT \
| | GUVAS12SD_SUPPORT | | CSE7766_SUPPORT | | TMP3X_SUPPORT \
| | HCSR04_SUPPORT
# define SENSOR_SUPPORT 1
# else
# define SENSOR_SUPPORT 0
# define SENSOR_SUPPORT ( \
AM2320_SUPPORT | | \
ANALOG_SUPPORT | | \
BH1750_SUPPORT | | \
BMX280_SUPPORT | | \
CSE7766_SUPPORT | | \
DALLAS_SUPPORT | | \
DHT_SUPPORT | | \
DIGITAL_SUPPORT | | \
ECH1560_SUPPORT | | \
EMON_ADC121_SUPPORT | | \
EMON_ADS1X15_SUPPORT | | \
EMON_ANALOG_SUPPORT | | \
EVENTS_SUPPORT | | \
GUVAS12SD_SUPPORT | | \
HCSR04_SUPPORT | | \
HLW8012_SUPPORT | | \
MHZ19_SUPPORT | | \
SENSEAIR_SUPPORT | | \
PMSX003_SUPPORT | | \
PZEM004T_SUPPORT | | \
SHT3X_I2C_SUPPORT | | \
SI7021_SUPPORT | | \
TMP3X_SUPPORT | | \
V9261F_SUPPORT \
)
# endif
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / ADC
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / Default ADC mode is to monitor internal power supply
# ifndef ADC_MODE_VALUE
# define ADC_MODE_VALUE ADC_VCC
# endif
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -651,98 +573,12 @@
# define I2C_CLEAR_BUS 0 / / Clear I2C bus on boot
# define I2C_CLEAR_BUS 0 / / Clear I2C bus on boot
# define I2C_PERFORM_SCAN 1 / / Perform a bus scan on boot
# define I2C_PERFORM_SCAN 1 / / Perform a bus scan on boot
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / Internal power monitor
/ / Enable support by passing ADC_VCC_ENABLED = 1 build flag
/ / Do not enable this if using the analog GPIO for any other thing
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ifndef ADC_VCC_ENABLED
# define ADC_VCC_ENABLED 1
# endif
# if ADC_VCC_ENABLED
ADC_MODE ( ADC_VCC ) ;
# endif
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / Class loading
/ / Class loading
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# if SENSOR_SUPPORT
# if SENSOR_SUPPORT
PROGMEM const unsigned char magnitude_decimals [ ] = {
0 ,
1 , 0 , 2 ,
3 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 ,
0 , 0 , 0 ,
0 , 0 ,
2 , 3
} ;
PROGMEM const char magnitude_unknown_topic [ ] = " unknown " ;
PROGMEM const char magnitude_temperature_topic [ ] = " temperature " ;
PROGMEM const char magnitude_humidity_topic [ ] = " humidity " ;
PROGMEM const char magnitude_pressure_topic [ ] = " pressure " ;
PROGMEM const char magnitude_current_topic [ ] = " current " ;
PROGMEM const char magnitude_voltage_topic [ ] = " voltage " ;
PROGMEM const char magnitude_active_power_topic [ ] = " power " ;
PROGMEM const char magnitude_apparent_power_topic [ ] = " apparent " ;
PROGMEM const char magnitude_reactive_power_topic [ ] = " reactive " ;
PROGMEM const char magnitude_power_factor_topic [ ] = " factor " ;
PROGMEM const char magnitude_energy_topic [ ] = " energy " ;
PROGMEM const char magnitude_energy_delta_topic [ ] = " energy_delta " ;
PROGMEM const char magnitude_analog_topic [ ] = " analog " ;
PROGMEM const char magnitude_digital_topic [ ] = " digital " ;
PROGMEM const char magnitude_events_topic [ ] = " events " ;
PROGMEM const char magnitude_pm1dot0_topic [ ] = " pm1dot0 " ;
PROGMEM const char magnitude_pm2dot5_topic [ ] = " pm2dot5 " ;
PROGMEM const char magnitude_pm10_topic [ ] = " pm10 " ;
PROGMEM const char magnitude_co2_topic [ ] = " co2 " ;
PROGMEM const char magnitude_lux_topic [ ] = " lux " ;
PROGMEM const char magnitude_uv_topic [ ] = " uv " ;
PROGMEM const char magnitude_distance_topic [ ] = " distance " ;
PROGMEM const char * const magnitude_topics [ ] = {
magnitude_unknown_topic , magnitude_temperature_topic , magnitude_humidity_topic ,
magnitude_pressure_topic , magnitude_current_topic , magnitude_voltage_topic ,
magnitude_active_power_topic , magnitude_apparent_power_topic , magnitude_reactive_power_topic ,
magnitude_power_factor_topic , magnitude_energy_topic , magnitude_energy_delta_topic ,
magnitude_analog_topic , magnitude_digital_topic , magnitude_events_topic ,
magnitude_pm1dot0_topic , magnitude_pm2dot5_topic , magnitude_pm10_topic ,
magnitude_co2_topic , magnitude_lux_topic , magnitude_uv_topic ,
magnitude_distance_topic
} ;
PROGMEM const char magnitude_empty [ ] = " " ;
PROGMEM const char magnitude_celsius [ ] = " C " ;
PROGMEM const char magnitude_fahrenheit [ ] = " F " ;
PROGMEM const char magnitude_percentage [ ] = " % " ;
PROGMEM const char magnitude_hectopascals [ ] = " hPa " ;
PROGMEM const char magnitude_amperes [ ] = " A " ;
PROGMEM const char magnitude_volts [ ] = " V " ;
PROGMEM const char magnitude_watts [ ] = " W " ;
PROGMEM const char magnitude_kw [ ] = " kW " ;
PROGMEM const char magnitude_joules [ ] = " J " ;
PROGMEM const char magnitude_kwh [ ] = " kWh " ;
PROGMEM const char magnitude_ugm3 [ ] = " µg/m3 " ;
PROGMEM const char magnitude_ppm [ ] = " ppm " ;
PROGMEM const char magnitude_lux [ ] = " lux " ;
PROGMEM const char magnitude_uv [ ] = " uv " ;
PROGMEM const char magnitude_distance [ ] = " m " ;
PROGMEM const char * const magnitude_units [ ] = {
magnitude_empty , magnitude_celsius , magnitude_percentage ,
magnitude_hectopascals , magnitude_amperes , magnitude_volts ,
magnitude_watts , magnitude_watts , magnitude_watts ,
magnitude_percentage , magnitude_joules , magnitude_joules ,
magnitude_empty , magnitude_empty , magnitude_empty ,
magnitude_ugm3 , magnitude_ugm3 , magnitude_ugm3 ,
magnitude_ppm , magnitude_lux , magnitude_uv ,
magnitude_distance
} ;
# include "../sensors/BaseSensor.h"
# include "../sensors/BaseSensor.h"
# if AM2320_SUPPORT
# if AM2320_SUPPORT
@ -817,9 +653,13 @@ PROGMEM const char* const magnitude_units[] = {
# include "../sensors/MHZ19Sensor.h"
# include "../sensors/MHZ19Sensor.h"
# endif
# endif
# if SENSEAIR_SUPPORT
# include <SoftwareSerial.h>
# include "../sensors/SenseAirSensor.h"
# endif
# if PMSX003_SUPPORT
# if PMSX003_SUPPORT
# include <SoftwareSerial.h>
# include <SoftwareSerial.h>
# include <PMS.h>
# include "../sensors/PMSX003Sensor.h"
# include "../sensors/PMSX003Sensor.h"
# endif
# endif