diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index 6705e503..11c45cdd 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -223,7 +223,8 @@ enum boards { #elif \ defined(GENERIC_ESP01S_DHT11_V10) || \ defined(GENERIC_ESP01S_DS18B20_V10) || \ - defined(ITEAD_SONOFF_TH) + defined(ITEAD_SONOFF_TH) || \ + defined(MANCAVEMADE_ESPLIVE) #define ESPURNA_IMAGE ESPURNA_SENSOR @@ -287,17 +288,6 @@ enum boards { // ----------------------------------------------------------------------------- -#elif defined(MANCAVEMADE_ESPLIVE) - - #define ESPURNA_IMAGE ESPURNA_SENSOR - - // DS18B20 - #define DALLAS_PIN 2 - #define DALLAS_UPDATE_INTERVAL 5000 - #define TEMPERATURE_MIN_CHANGE 1.0 - -// ----------------------------------------------------------------------------- - #elif defined(PILOTAK_ESP_DIN_V1) #define ESPURNA_IMAGE ESPURNA_SENSOR diff --git a/code/espurna/hardware.ino b/code/espurna/hardware.ino index 5bfd2667..038eac28 100644 --- a/code/espurna/hardware.ino +++ b/code/espurna/hardware.ino @@ -832,6 +832,8 @@ void _hardwareLoad() { setSetting("dsEnabled", 1); setSetting("dsGPIO", 0, 2); + setSetting("snsDelta", MAGNITUDE_TEMPERATURE, 1.0); // Temperature min change to report + #elif defined(INTERMITTECH_QUINLED) // QuinLED diff --git a/code/espurna/sensor.ino b/code/espurna/sensor.ino index 9da103c6..031c0d69 100644 --- a/code/espurna/sensor.ino +++ b/code/espurna/sensor.ino @@ -24,9 +24,9 @@ typedef struct { unsigned char local; // Local index in its provider unsigned char type; // Type of measurement unsigned char global; // Global index in its type - double current; // Current (last) value, unfiltered - double filtered; // Filtered (averaged) value - double reported; // Last reported value + double current; // Lat raw value (unfiltered) + double filtered; // Last filtered value (averaged) + double reported; // Last reported value (averaged) double min_change; // Minimum value change to report } sensor_magnitude_t; @@ -849,7 +849,9 @@ void _sensorConfigure() { // Update filter sizes for (unsigned char i=0; i<_magnitudes.size(); i++) { - _magnitudes[i].filter->resize(_sensor_report_every); + sensor_magnitude_t magnitude = _magnitudes[i]; + _magnitude.filter->resize(_sensor_report_every); + _magnitude.min_change = getSetting("tmpDelta", magnitude.type, 0).toFloat(); } // Save settings