7 static const char *
const TAG =
"pid.climate";
19 if (restore.has_value()) {
20 restore->to_call(
this).perform();
62 LOG_CLIMATE(
"",
"PID Climate",
this);
63 ESP_LOGCONFIG(TAG,
" Control Parameters:");
97 if (new_action != this->
action) {
116 if (res.result_params.has_value()) {
124 ESP_LOGW(TAG,
"For PID autotuner you need to set AUTO (also called heat/cool) mode!");
143 this->
autotuner_->config(min_value, max_value);
144 this->
set_interval(
"autotune-progress", 10000, [
this]() {
This class is used to encode all control actions on a climate device.
The climate device is off (inactive or no power)
output::FloatOutput * cool_output_
bool supports_cool_() const
void add_on_state_callback(std::function< void(float)> &&callback)
Add a callback that will be called every time a filtered value arrives.
void set_interval(const std::string &name, uint32_t interval, std::function< void()> &&f)
Set an interval function with a unique name.
void reset_integral_term()
void write_output_(float value)
float target_temperature
The target temperature of the climate device.
const optional< ClimateMode > & get_mode() const
This class contains all static data for climate devices.
The climate device is set to heat to reach the target temperature.
ClimateMode mode
The active mode of the climate device.
float current_temperature
The current temperature of the climate device, as reported from the integration.
void start_autotune(std::unique_ptr< PIDAutotuner > &&autotune)
std::unique_ptr< PIDAutotuner > autotuner_
void set_level(float state)
Set the level of this float output, this is called from the front-end.
void reset_accumulated_integral()
The climate device is set to cool to reach the target temperature.
float state
This member variable stores the last state that has passed through all filters.
float ki
Integral gain K_i.
float kp
Proportional gain K_p.
void set_supported_modes(std::set< ClimateMode > modes)
ClimateAction
Enum for the current action of the climate device. Values match those of ClimateMode.
float update(float setpoint, float process_value)
The climate device is set to heat/cool to reach the target temperature.
void control(const climate::ClimateCall &call) override
Override control to change settings of the climate device.
The climate device is actively heating.
const optional< float > & get_target_temperature() const
float kd
Differential gain K_d.
void publish_state()
Publish the state of the climate device, to be called from integrations.
The climate device is off.
climate::ClimateTraits traits() override
Return the traits of this controller.
void set_supports_action(bool supports_action)
sensor::Sensor * sensor_
The sensor used for getting the current temperature.
bool supports_heat_() const
void dump_config() override
output::FloatOutput * heat_output_
PIDController controller_
The climate device is idle (monitoring climate but no action needed)
void set_supports_two_point_target_temperature(bool supports_two_point_target_temperature)
float default_target_temperature_
optional< ClimateDeviceRestoreState > restore_state_()
Restore the state of the climate device, call this from your setup() method.
void set_supports_current_temperature(bool supports_current_temperature)
float output_value_
Output value as reported by the PID controller, for PIDClimateSensor.
The climate device is actively cooling.
void add_supported_mode(ClimateMode mode)
CallbackManager< void()> pid_computed_callback_
ClimateAction action
The active state of the climate device.