Skip to content
16 changes: 14 additions & 2 deletions templates/homev2_wifi.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <ArduinoBearSSL.h>
#include <Adafruit_DPS310.h> // http://librarymanager/All#Adafruit_DPS310
#include <sps30.h>

#include <hydreon.h>

// Uncomment the next line to get debugging messages printed on the Serial port
// Do not leave this enabled for long time use
Expand Down Expand Up @@ -144,7 +144,9 @@ Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
int16_t ret;
uint32_t auto_clean;
#endif

#ifdef HYDREONRAIN_CONNECTED
rainsensor_serial(RAINSENSOR_PORT);
#endif

typedef struct measurement {
const char *sensorId;
Expand Down Expand Up @@ -439,6 +441,9 @@ void setup() {
ret = sps30_set_fan_auto_cleaning_interval_days(auto_clean_days);
ret = sps30_start_measurement();
#endif
#ifdef HYDREONRAIN_CONNECTED
rainsensor_serial.begin();
#endif
DEBUG(F("Initializing sensors done!"));
DEBUG(F("Starting loop in 3 seconds."));
delay(3000);
Expand Down Expand Up @@ -556,6 +561,13 @@ void loop() {
addMeasurement(SPS30_PM10SENSOR_ID, m.mc_10p0);
#endif

#ifdef HYDREONRAIN_CONNECTED
rainsensor_serial.readAllData();
addMeasurement(HYDREONRAIN_TOTALACC_ID, rainsensor_serial.getTotalAccumulation());
addMeasurement(HDYDREONRAIN_EVENTACC_ID, rainsensor_serial.getEventAccumulation());
addMeasurement(HYDREONRAIN_INTENSITY_ID, rainsensor_serial.getRainfallIntensity());
#endif

DEBUG(F("Submit values"));
submitValues();

Expand Down
15 changes: 14 additions & 1 deletion templates/homev2_wifi_feinstaub.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <LTR329.h>
#include <ArduinoBearSSL.h>
#include <Adafruit_DPS310.h> // http://librarymanager/All#Adafruit_DPS310

#include <hdydreon.h>
// Uncomment the next line to get debugging messages printed on the Serial port
// Do not leave this enabled for long time use
// #define ENABLE_DEBUG
Expand Down Expand Up @@ -143,6 +143,9 @@ Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
#ifdef DPS310_CONNECTED
Adafruit_DPS310 dps;
#endif
#ifdef HYDREONRAIN_CONNECTED
rainsensor_serial(RAINSENSOR_PORT);
#endif


typedef struct measurement {
Expand Down Expand Up @@ -436,6 +439,9 @@ void setup() {
dps.configurePressure(DPS310_64HZ, DPS310_64SAMPLES);
dps.configureTemperature(DPS310_64HZ, DPS310_64SAMPLES);
#endif
#ifdef HYDREONRAIN_CONNECTED
rainsensor_serial.begin();
#endif
DEBUG(F("Initializing sensors done!"));
DEBUG(F("Starting loop in 3 seconds."));
delay(3000);
Expand Down Expand Up @@ -559,6 +565,13 @@ void loop() {
addMeasurement(DPS310_LUFTDRSENSOR_ID, pressure_event.pressure);
#endif

#ifdef HYDREONRAIN_CONNECTED
rainsensor_serial.readAllData();
addMeasurement(HYDREONRAIN_TOTALACC_ID, rainsensor_serial.getTotalAccumulation());
addMeasurement(HDYDREONRAIN_EVENTACC_ID, rainsensor_serial.getEventAccumulation());
addMeasurement(HYDREONRAIN_INTENSITY_ID, rainsensor_serial.getRainfallIntensity());
#endif

DEBUG(F("Submit values"));
submitValues();

Expand Down