19#ifndef SRC_SUPLA_SENSOR_TEMPERATURE_DROP_SENSOR_H_
20#define SRC_SUPLA_SENSOR_TEMPERATURE_DROP_SENSOR_H_
22#include <supla/element.h>
24#include "virtual_binary.h"
25#include "therm_hygro_meter.h"
30#define MAX_TEMPERATURE_MEASUREMENTS 60
39 bool isDropDetected()
const;
40 int getBinarySensorChannelNo()
const;
61 int16_t getAverage(
int fromIndex,
int toIndex)
const;
62 bool detectTemperatureDrop(int16_t temperature, int16_t *average)
const;
64 uint32_t lastTemperatureUpdate = 0;
65 uint32_t filteringTimestamp = 0;
66 uint32_t dropDetectionTimestamp = 0;
67 uint32_t probeIntervalMs = 30000;
68 uint32_t dropDetectionDelayMs = 0;
70 int16_t measurements[MAX_TEMPERATURE_MEASUREMENTS] = {};
71 int measurementIndex = 0;
72 int16_t temperatureDropThreshold = -200;
73 int16_t averageAtDropDetection = INT16_MIN;
Base class for all elements of SuplaDevice.
Definition element.h:33
void setTemperatureDropThreshold(int16_t threshold)
Set temperature drop threshold detection.
Definition temperature_drop_sensor.cpp:137
void iterateAlways() override
Method called on each SuplaDevice iteration.
Definition temperature_drop_sensor.cpp:39
void onInit() override
Third method called on element in SuplaDevice.begin()
Definition temperature_drop_sensor.cpp:36
void setDropDetectionDelayMs(uint32_t delayMs)
Set drop detection delay.
Definition temperature_drop_sensor.cpp:141
Definition therm_hygro_meter.h:29
Definition virtual_binary.h:28