37 float p = power / 1000;
39 return (p * t) / (c *
m);
60 float prev_temp = this->delayed_temps[0];
62 float ret = (1 - alpha) * prev_temp + alpha * prev_temp;
This class simplifies creating components that periodically check a state.
Base class for all output components that can output a variable level, like PWM.
float temperature
mass of simulated object in kg
size_t delay_cycles
storage of past temperatures for delaying temperature reading
float output_value
how many update cycles to delay the output
void write_state(float state) override
float delta_t(float power)
float efficiency
current temperature of object in °C
float mass
surface area in m²
float specific_heat_capacity
thermal conductivity of surface are in W/(m*K), here: steel
float heat_power
specific heat capacity of mass in kJ/(kg*K), here: water
float thermal_conductivity
heating efficiency, 1 is 100% efficient
std::vector< float > delayed_temps
The simulated updated interval in seconds.
float ambient_temperature
Heating power in W.
sensor::Sensor * sensor
Current output value of heating element.
float update_interval
Ambient temperature in °C.
Base-class for all sensors.
void publish_state(float state)
Publish a new state to the front-end.
Providing packet encoding functions for exchanging data with a remote host.
constexpr const T & clamp(const T &v, const T &lo, const T &hi, Compare comp)