8static const char *
const TAG =
"thermostat.climate";
40 auto use_default_preset =
true;
45 if (restore.has_value()) {
46 use_default_preset =
false;
47 restore->to_call(
this).perform();
52 if (use_default_preset) {
55 }
else if (this->default_custom_preset_ !=
nullptr) {
70 auto &timer = this->
timer_[i];
71 if (timer.active && (now - timer.started >= timer.time)) {
155 this->
get_traits().get_visual_max_temperature());
162 }
else if (pin_target_temperature_high) {
177 float target_temperature_low_upper_limit =
180 this->
get_traits().get_visual_min_temperature(), this->
get_traits().get_visual_max_temperature())
183 target_temperature_low_upper_limit);
191 float target_temperature_high_lower_limit =
194 this->
get_traits().get_visual_min_temperature(), this->
get_traits().get_visual_max_temperature())
197 this->
get_traits().get_visual_max_temperature());
207 this->
get_traits().get_visual_max_humidity());
212 bool target_temperature_high_changed =
false;
214 if (
call.get_preset().has_value()) {
222 if (
call.has_custom_preset()) {
232 if (
call.get_mode().has_value()) {
235 if (
call.get_fan_mode().has_value()) {
238 if (
call.get_swing_mode().has_value()) {
245 if (
call.get_target_temperature_high().has_value()) {
329 std::vector<const char *> custom_preset_names;
332 custom_preset_names.push_back(entry.name);
357 switch (this->
mode) {
416 return target_action;
429 switch (this->
mode) {
458 return target_action;
480 return target_action;
501 bool action_ready =
false;
520 ESP_LOGVV(TAG,
"Switching to IDLE/OFF action");
536 ESP_LOGVV(TAG,
"Switching to COOLING action");
550 ESP_LOGVV(TAG,
"Switching to HEATING action");
562 ESP_LOGVV(TAG,
"Switching to FAN_ONLY action");
571 ESP_LOGVV(TAG,
"Switching to DRYING action");
589 if (trig !=
nullptr) {
593 if (trig_fan !=
nullptr) {
594 ESP_LOGVV(TAG,
"Calling FAN_ONLY action with HEATING/COOLING action");
624 ESP_LOGVV(TAG,
"Updating supplemental action");
638 ESP_LOGVV(TAG,
"Calling supplemental COOLING action");
645 ESP_LOGVV(TAG,
"Calling supplemental HEATING action");
651 if (trig !=
nullptr) {
667 ESP_LOGVV(TAG,
"Switching to HUMIDIFICATION_OFF action");
671 ESP_LOGVV(TAG,
"Switching to DEHUMIDIFY action");
675 ESP_LOGVV(TAG,
"Switching to HUMIDIFY action");
689 if (trig !=
nullptr) {
710 ESP_LOGVV(TAG,
"Switching to FAN_ON mode");
714 ESP_LOGVV(TAG,
"Switching to FAN_OFF mode");
718 ESP_LOGVV(TAG,
"Switching to FAN_AUTO mode");
722 ESP_LOGVV(TAG,
"Switching to FAN_LOW mode");
726 ESP_LOGVV(TAG,
"Switching to FAN_MEDIUM mode");
730 ESP_LOGVV(TAG,
"Switching to FAN_HIGH mode");
734 ESP_LOGVV(TAG,
"Switching to FAN_MIDDLE mode");
738 ESP_LOGVV(TAG,
"Switching to FAN_FOCUS mode");
742 ESP_LOGVV(TAG,
"Switching to FAN_DIFFUSE mode");
746 ESP_LOGVV(TAG,
"Switching to FAN_QUIET mode");
759 if (trig !=
nullptr) {
805 if (trig !=
nullptr) {
828 switch (swing_mode) {
847 if (trig !=
nullptr) {
902 this->
timer_[timer_index].active =
true;
907 auto ret = this->
timer_[timer_index].active;
908 this->
timer_[timer_index].active =
false;
913 return this->
timer_[timer_index].active;
917 return this->
timer_[timer_index].time;
921 switch (timer_index) {
959 ESP_LOGVV(TAG,
"cooling_max_run_time timer expired");
966 ESP_LOGVV(TAG,
"cooling_off timer expired");
972 ESP_LOGVV(TAG,
"cooling_on timer expired");
978 ESP_LOGVV(TAG,
"fan_mode timer expired");
985 ESP_LOGVV(TAG,
"fanning_off timer expired");
990 ESP_LOGVV(TAG,
"fanning_on timer expired");
995 ESP_LOGVV(TAG,
"heating_max_run_time timer expired");
1002 ESP_LOGVV(TAG,
"heating_off timer expired");
1008 ESP_LOGVV(TAG,
"heating_on timer expired");
1014 ESP_LOGVV(TAG,
"idle_on timer expired");
1028 if (trig !=
nullptr) {
1054 if (trig !=
nullptr) {
1170 ESP_LOGCONFIG(TAG,
" Default Target Temperature Low: %.1f°C",
1174 ESP_LOGCONFIG(TAG,
" Default Target Temperature High: %.1f°C",
1182 ESP_LOGCONFIG(TAG,
" Default Fan Mode: %s",
1186 ESP_LOGCONFIG(TAG,
" Default Swing Mode: %s",
1195 if (entry.preset ==
preset) {
1196 config = &entry.config;
1201 if (config !=
nullptr) {
1207 if (trig !=
nullptr) {
1226 config = &entry.config;
1231 if (config !=
nullptr) {
1239 if (trig !=
nullptr) {
1246 ESP_LOGI(TAG,
"No changes required to apply custom preset %s",
custom_preset);
1252 ESP_LOGW(TAG,
"Custom preset %s not configured; ignoring",
custom_preset);
1257 bool something_changed =
false;
1262 something_changed =
true;
1266 something_changed =
true;
1271 something_changed =
true;
1280 something_changed =
true;
1286 something_changed =
true;
1292 something_changed =
true;
1295 return something_changed;
1307 : cool_action_trigger_(new
Trigger<>()),
1308 supplemental_cool_action_trigger_(new
Trigger<>()),
1309 cool_mode_trigger_(new
Trigger<>()),
1310 dry_action_trigger_(new
Trigger<>()),
1311 dry_mode_trigger_(new
Trigger<>()),
1312 heat_action_trigger_(new
Trigger<>()),
1313 supplemental_heat_action_trigger_(new
Trigger<>()),
1314 heat_mode_trigger_(new
Trigger<>()),
1315 heat_cool_mode_trigger_(new
Trigger<>()),
1316 auto_mode_trigger_(new
Trigger<>()),
1317 idle_action_trigger_(new
Trigger<>()),
1318 off_mode_trigger_(new
Trigger<>()),
1319 fan_only_action_trigger_(new
Trigger<>()),
1320 fan_only_mode_trigger_(new
Trigger<>()),
1321 fan_mode_on_trigger_(new
Trigger<>()),
1322 fan_mode_off_trigger_(new
Trigger<>()),
1323 fan_mode_auto_trigger_(new
Trigger<>()),
1324 fan_mode_low_trigger_(new
Trigger<>()),
1325 fan_mode_medium_trigger_(new
Trigger<>()),
1326 fan_mode_high_trigger_(new
Trigger<>()),
1327 fan_mode_middle_trigger_(new
Trigger<>()),
1328 fan_mode_focus_trigger_(new
Trigger<>()),
1329 fan_mode_diffuse_trigger_(new
Trigger<>()),
1330 fan_mode_quiet_trigger_(new
Trigger<>()),
1331 swing_mode_both_trigger_(new
Trigger<>()),
1332 swing_mode_off_trigger_(new
Trigger<>()),
1333 swing_mode_horizontal_trigger_(new
Trigger<>()),
1334 swing_mode_vertical_trigger_(new
Trigger<>()),
1335 humidity_change_trigger_(new
Trigger<>()),
1336 temperature_change_trigger_(new
Trigger<>()),
1337 preset_change_trigger_(new
Trigger<>()),
1338 humidity_control_dehumidify_action_trigger_(new
Trigger<>()),
1339 humidity_control_humidify_action_trigger_(new
Trigger<>()),
1340 humidity_control_off_action_trigger_(new
Trigger<>()) {}
1346 this->default_custom_preset_ = entry.name;
1351 this->default_custom_preset_ =
nullptr;
1372 if (this->
timer_[timer_index].active) {
1375 uint32_t elapsed = current_time - this->
timer_[timer_index].started;
1377 if (elapsed >= new_duration_ms) {
1379 ESP_LOGVV(TAG,
"timer %d completing immediately (elapsed %d >= new %d)", timer_index, elapsed, new_duration_ms);
1380 this->
timer_[timer_index].active =
false;
1386 ESP_LOGVV(TAG,
"timer %d adjusted: elapsed %d, new total %d, remaining %d", timer_index, elapsed, new_duration_ms,
1387 new_duration_ms - elapsed);
1388 this->
timer_[timer_index].time = new_duration_ms;
1394 this->
timer_[timer_index].time = new_duration_ms;
1443 bool supports_fan_only_action_uses_fan_mode_timer) {
1503 if (supports_dehumidification) {
1509 if (supports_humidification) {
1560 LOG_CLIMATE(
"",
"Thermostat",
this);
1563 " On boot, restore from: %s\n"
1564 " Use Start-up Delay: %s",
1572 " Cooling Parameters:\n"
1573 " Deadband: %.1f°C\n"
1574 " Overrun: %.1f°C\n"
1575 " Minimum Off Time: %" PRIu32
"s\n"
1576 " Minimum Run Time: %" PRIu32
"s",
1583 " Maximum Run Time: %" PRIu32
"s\n"
1584 " Supplemental Delta: %.1f°C",
1591 " Heating Parameters:\n"
1592 " Deadband: %.1f°C\n"
1593 " Overrun: %.1f°C\n"
1594 " Minimum Off Time: %" PRIu32
"s\n"
1595 " Minimum Run Time: %" PRIu32
"s",
1602 " Maximum Run Time: %" PRIu32
"s\n"
1603 " Supplemental Delta: %.1f°C",
1610 " Fan Parameters:\n"
1611 " Minimum Off Time: %" PRIu32
"s\n"
1612 " Minimum Run Time: %" PRIu32
"s",
1620 ESP_LOGCONFIG(TAG,
" Minimum Fan Mode Switching Time: %" PRIu32
"s",
1624 " Minimum Idle Time: %" PRIu32
"s\n"
1625 " Supported MODES:\n"
1632 " FAN_ONLY_ACTION_USES_FAN_MODE_TIMER: %s\n"
1633 " FAN_ONLY_COOLING: %s",
1645 " Supported FAN MODES:\n"
1656 " Supported SWING MODES:\n"
1661 " Supports TWO SET POINTS: %s\n"
1662 " Supported Humidity Parameters:\n"
1665 " DEHUMIDIFICATION: %s\n"
1666 " HUMIDIFICATION: %s",
1680 ESP_LOGCONFIG(TAG,
" Supported PRESETS:");
1683 ESP_LOGCONFIG(TAG,
" %s:%s", preset_name, entry.preset == this->default_preset_ ?
" (default)" :
"");
1689 ESP_LOGCONFIG(TAG,
" Supported CUSTOM PRESETS:");
1691 const auto *preset_name = entry.name;
1692 ESP_LOGCONFIG(TAG,
" %s:%s", preset_name,
1693 (this->default_custom_preset_ !=
nullptr && strcmp(entry.name, this->default_custom_preset_) == 0)
1704 : default_temperature(default_temperature) {}
1707 float default_temperature_high)
1708 : default_temperature_low(default_temperature_low), default_temperature_high(default_temperature_high) {}
BedjetMode mode
BedJet operating mode.
uint32_t IRAM_ATTR HOT get_loop_component_start_time() const
Get the cached time in milliseconds from when the current component started its loop execution.
void trigger(const Ts &...x)
Inform the parent automation that the event has triggered.
void stop_action()
Stop any action connected to this trigger.
This class is used to encode all control actions on a climate device.
const optional< ClimateSwingMode > & get_swing_mode() const
const optional< float > & get_target_humidity() const
const optional< float > & get_target_temperature_low() const
const optional< float > & get_target_temperature() const
const optional< ClimatePreset > & get_preset() const
const char * get_custom_preset() const
const optional< float > & get_target_temperature_high() const
const optional< ClimateFanMode > & get_fan_mode() const
const optional< ClimateMode > & get_mode() const
ClimateMode mode
The active mode of the climate device.
optional< ClimateFanMode > fan_mode
The active fan mode of the climate device.
ClimateTraits get_traits()
Get the traits of this climate device with all overrides applied.
float target_temperature
The target temperature of the climate device.
float current_humidity
The current humidity of the climate device, as reported from the integration.
ClimateSwingMode swing_mode
The active swing mode of the climate device.
float target_temperature_low
The minimum target temperature of the climate device, for climate devices with split target temperatu...
bool set_preset_(ClimatePreset preset)
Set preset. Reset custom preset. Return true if preset has been changed.
bool set_custom_preset_(const char *preset)
Set custom preset. Reset primary preset. Return true if preset has been changed.
const char * get_custom_preset() const
Get the active custom preset (read-only access).
bool has_custom_preset() const
Check if a custom preset is currently active.
float current_temperature
The current temperature of the climate device, as reported from the integration.
ClimateAction action
The active state of the climate device.
void publish_state()
Publish the state of the climate device, to be called from integrations.
optional< ClimatePreset > preset
The active preset of the climate device.
optional< ClimateDeviceRestoreState > restore_state_()
Restore the state of the climate device, call this from your setup() method.
float target_humidity
The target humidity of the climate device.
float target_temperature_high
The maximum target temperature of the climate device, for climate devices with split target temperatu...
void add_feature_flags(uint32_t feature_flags)
void add_supported_fan_mode(ClimateFanMode mode)
float get_visual_min_humidity() const
void add_supported_preset(ClimatePreset preset)
float get_visual_max_humidity() const
void add_supported_mode(ClimateMode mode)
void set_supported_custom_presets(std::initializer_list< const char * > presets)
float get_visual_max_temperature() const
void add_supported_swing_mode(ClimateSwingMode mode)
float get_visual_min_temperature() const
value_type value_or(U const &v) const
value_type const & value() const
Base-class for all sensors.
void add_on_state_callback(std::function< void(float)> &&callback)
Add a callback that will be called every time a filtered value arrives.
float state
This member variable stores the last state that has passed through all filters.
Trigger * swing_mode_off_trigger_
The trigger to call when the controller should switch the swing mode to "off".
void set_supports_humidification(bool supports_humidification)
bool supports_fan_mode_off_
void set_supports_swing_mode_horizontal(bool supports_swing_mode_horizontal)
Trigger * idle_action_trigger_
The trigger to call when the controller should switch to idle action/off mode.
void switch_to_action_(climate::ClimateAction action, bool publish_state=true)
Switch the climate device to the given climate action.
bool supports_fan_mode_quiet_
void set_custom_preset_config(std::initializer_list< CustomPresetEntry > presets)
void set_supports_fan_mode_on(bool supports_fan_mode_on)
Trigger * get_fan_mode_medium_trigger() const
FixedVector< CustomPresetEntry > custom_preset_config_
The set of custom preset configurations this thermostat supports (eg. "My Custom Preset")
Trigger * preset_change_trigger_
The trigger to call when the preset mode changes.
Trigger * get_swing_mode_vertical_trigger() const
float cooling_deadband_
Hysteresis values used for computing climate actions.
Trigger * heat_action_trigger_
The trigger to call when the controller should switch to heating action/mode.
float supplemental_heat_delta_
bool supports_swing_mode_vertical_
void control(const climate::ClimateCall &call) override
Override control to change settings of the climate device.
Trigger * off_mode_trigger_
void validate_target_temperatures(bool pin_target_temperature_high)
HumidificationAction humidification_action
The current humidification action.
void set_timer_duration_in_sec_(ThermostatClimateTimerIndex timer_index, uint32_t time)
Enhanced timer duration setter with running timer adjustment.
void fan_mode_timer_callback_()
Trigger * dry_mode_trigger_
Trigger * humidity_control_dehumidify_action_trigger_
The trigger to call when dehumidification is required.
void set_supports_auto(bool supports_auto)
Trigger * get_fan_mode_off_trigger() const
bool use_startup_delay_
Used to start "off" delay timers at boot.
bool heating_action_ready_()
void set_on_boot_restore_from(OnBootRestoreFrom on_boot_restore_from)
float cool_deadband()
Get current hysteresis values.
bool climate_action_change_delayed()
Returns true if a climate action/fan mode transition is being delayed.
void set_supports_fan_with_heating(bool supports_fan_with_heating)
bool cooling_max_runtime_exceeded_
Flags indicating if maximum allowable run time was exceeded.
Trigger * get_fan_mode_on_trigger() const
Trigger * get_cool_mode_trigger() const
bool supports_fan_mode_medium_
Trigger * get_fan_mode_diffuse_trigger() const
const uint8_t min_timer_duration_
Minimum allowable duration in seconds for action timers.
Trigger * fan_mode_low_trigger_
The trigger to call when the controller should switch the fan to "low" speed.
void set_heat_overrun(float overrun)
Trigger * get_fan_mode_auto_trigger() const
OnBootRestoreFrom on_boot_restore_from_
If set to DEFAULT_PRESET then the default preset is always used.
void change_custom_preset_(const char *custom_preset)
Change to a provided custom preset setting; will reset temperature, mode, fan, and swing modes accord...
void set_supports_two_points(bool supports_two_points)
void validate_target_temperature_low()
Trigger * fan_mode_auto_trigger_
The trigger to call when the controller should switch the fan to "auto" mode.
void set_heating_maximum_run_time_in_sec(uint32_t time)
void set_preset_config(std::initializer_list< PresetEntry > presets)
void set_supports_fan_only_cooling(bool supports_fan_only_cooling)
bool supports_dehumidification_
Whether the controller supports dehumidification and/or humidification.
bool supports_fan_mode_on_
Whether the controller supports turning on or off just the fan.
bool supports_swing_mode_off_
Trigger * get_fan_mode_middle_trigger() const
void set_supports_heat(bool supports_heat)
void set_supports_fan_only_action_uses_fan_mode_timer(bool fan_only_action_uses_fan_mode_timer)
Trigger * humidity_control_off_action_trigger_
The trigger to call when (de)humidification should stop.
float set_point_minimum_differential_
Minimum differential required between set points.
bool supports_fan_with_cooling_
Special flags – enables fan_only action to be called with cooling/heating actions.
void set_supports_fan_mode_diffuse(bool supports_fan_mode_diffuse)
void switch_to_swing_mode_(climate::ClimateSwingMode swing_mode, bool publish_state=true)
Switch the climate device to the given climate swing mode.
Trigger * fan_mode_diffuse_trigger_
The trigger to call when the controller should switch the fan to "diffuse" position.
Trigger * fan_only_action_trigger_
The trigger to call when the controller should switch to fan-only action/mode.
Trigger * cool_action_trigger_
The trigger to call when the controller should switch to cooling action/mode.
Trigger * swing_mode_vertical_trigger_
The trigger to call when the controller should switch the swing mode to "vertical".
bool change_preset_internal_(const ThermostatClimateTargetTempConfig &config)
Applies the temperature, mode, fan, and swing modes of the provided config.
void set_supports_dehumidification(bool supports_dehumidification)
bool hysteresis_valid()
Set point and hysteresis validation.
float humidity_hysteresis_
Hysteresis values used for computing humidification action.
void set_supports_fan_mode_auto(bool supports_fan_mode_auto)
bool supplemental_heating_required_()
float prev_target_humidity_
Store previously-known humidity and temperatures.
Trigger * get_fan_only_mode_trigger() const
void check_humidity_change_trigger_()
Check if the humidity change trigger should be called.
Trigger * humidity_control_humidify_action_trigger_
The trigger to call when humidification is required.
Trigger * supplemental_cool_action_trigger_
void switch_to_supplemental_action_(climate::ClimateAction action)
bool supports_fan_mode_high_
bool fanning_action_ready_()
Trigger * dry_action_trigger_
The trigger to call when the controller should switch to dry (dehumidification) mode.
Trigger * get_swing_mode_off_trigger() const
void switch_to_mode_(climate::ClimateMode mode, bool publish_state=true)
Switch the climate device to the given climate mode.
Trigger * get_fan_mode_low_trigger() const
Trigger * swing_mode_both_trigger_
The trigger to call when the controller should switch the swing mode to "both".
void set_supports_swing_mode_vertical(bool supports_swing_mode_vertical)
bool cooling_action_ready_()
void heating_max_run_time_timer_callback_()
Trigger * prev_humidity_control_trigger_
Trigger * get_dry_action_trigger() const
void validate_target_temperature_high()
void set_supports_fan_only(bool supports_fan_only)
void heating_off_timer_callback_()
void set_sensor(sensor::Sensor *sensor)
bool supports_fan_only_action_uses_fan_mode_timer_
Special flag – enables fan_modes to share timer with fan_only climate action.
void switch_to_humidity_control_action_(HumidificationAction action)
void set_supports_swing_mode_off(bool supports_swing_mode_off)
void switch_to_fan_mode_(climate::ClimateFanMode fan_mode, bool publish_state=true)
Switch the climate device to the given climate fan mode.
void set_heating_minimum_off_time_in_sec(uint32_t time)
void dump_preset_config_(const char *preset_name, const ThermostatClimateTargetTempConfig &config)
void heating_on_timer_callback_()
bool supports_swing_mode_both_
Whether the controller supports various swing modes.
void fanning_off_timer_callback_()
Trigger * get_swing_mode_horizontal_trigger() const
Trigger * get_temperature_change_trigger() const
Trigger * get_fan_mode_focus_trigger() const
bool humidification_required_()
climate::ClimateTraits traits() override
Return the traits of this controller.
Trigger * swing_mode_horizontal_trigger_
The trigger to call when the controller should switch the swing mode to "horizontal".
Trigger * fan_only_mode_trigger_
void idle_on_timer_callback_()
Trigger * get_swing_mode_both_trigger() const
Trigger * fan_mode_focus_trigger_
The trigger to call when the controller should switch the fan to "focus" position.
Trigger * get_auto_mode_trigger() const
climate::ClimateFanMode locked_fan_mode()
Returns the fan mode that is locked in (check fan_mode_change_delayed(), first!)
void set_humidity_sensor(sensor::Sensor *humidity_sensor)
bool supports_fan_mode_middle_
bool supports_fan_mode_focus_
Trigger * get_humidity_control_humidify_action_trigger() const
float prev_target_temperature_low_
void set_supports_fan_mode_middle(bool supports_fan_mode_middle)
void set_supplemental_heat_delta(float delta)
Trigger * temperature_change_trigger_
The trigger to call when the target temperature(s) change(es).
void set_supports_fan_mode_low(bool supports_fan_mode_low)
Trigger * fan_mode_off_trigger_
The trigger to call when the controller should switch off the fan.
Trigger * get_dry_mode_trigger() const
bool timer_active_(ThermostatClimateTimerIndex timer_index)
float supplemental_cool_delta_
Maximum allowable temperature deltas before engaging supplemental cooling/heating actions.
Trigger * prev_mode_trigger_
void set_supports_heat_cool(bool supports_heat_cool)
void set_heating_minimum_run_time_in_sec(uint32_t time)
Trigger * get_heat_action_trigger() const
climate::ClimateSwingMode prev_swing_mode_
Trigger * get_supplemental_cool_action_trigger() const
void set_supports_fan_mode_quiet(bool supports_fan_mode_quiet)
bool supplemental_cooling_required_()
void set_supports_dry(bool supports_dry)
void set_cooling_minimum_off_time_in_sec(uint32_t time)
climate::ClimateAction delayed_climate_action()
Returns the climate action that is being delayed (check climate_action_change_delayed(),...
void set_fanning_minimum_off_time_in_sec(uint32_t time)
sensor::Sensor * sensor_
The sensor used for getting the current temperature.
void set_default_preset(const char *custom_preset)
void call_timer_callback_(ThermostatClimateTimerIndex timer_index)
Call the appropriate timer callback based on timer index.
bool drying_action_ready_()
Trigger * get_fan_mode_high_trigger() const
void set_supports_fan_mode_medium(bool supports_fan_mode_medium)
void set_cool_deadband(float deadband)
Trigger * get_fan_mode_quiet_trigger() const
Trigger * get_off_mode_trigger() const
bool humidity_hysteresis_valid()
uint32_t timer_duration_(ThermostatClimateTimerIndex timer_index)
climate::ClimateMode prev_mode_
void set_supports_swing_mode_both(bool supports_swing_mode_both)
bool limit_setpoints_for_heat_cool()
void set_supports_cool(bool supports_cool)
void start_timer_(ThermostatClimateTimerIndex timer_index)
Start/cancel/get status of climate action timer.
Trigger * prev_fan_mode_trigger_
Trigger * fan_mode_high_trigger_
The trigger to call when the controller should switch the fan to "high" speed.
Trigger * get_idle_action_trigger() const
void set_set_point_minimum_differential(float differential)
bool supports_fan_with_heating_
void set_heat_deadband(float deadband)
bool supports_fan_mode_low_
Whether the controller supports various fan speeds and/or positions.
bool supports_fan_only_cooling_
Special flag – enables fan to be switched based on target_temperature_high.
void fanning_on_timer_callback_()
void dump_config() override
Trigger * prev_action_trigger_
A reference to the trigger that was previously active.
bool supports_auto_
Whether the controller supports auto/cooling/drying/fanning/heating.
bool supports_swing_mode_horizontal_
climate::ClimateAction supplemental_action_
The current supplemental action.
Trigger * get_supplemental_heat_action_trigger() const
std::array< ThermostatClimateTimer, THERMOSTAT_TIMER_COUNT > timer_
Climate action timers.
Trigger * get_heat_mode_trigger() const
Trigger * cool_mode_trigger_
void set_fan_mode_minimum_switching_time_in_sec(uint32_t time)
bool supports_fan_mode_diffuse_
void set_cool_overrun(float overrun)
Trigger * humidity_change_trigger_
The trigger to call when the target humidity changes.
void trigger_supplemental_action_()
void set_supports_fan_with_cooling(bool supports_fan_with_cooling)
Trigger * fan_mode_medium_trigger_
The trigger to call when the controller should switch the fan to "medium" speed.
void validate_target_humidity()
Trigger * fan_mode_middle_trigger_
The trigger to call when the controller should switch the fan to "middle" position.
Trigger * get_fan_only_action_trigger() const
float prev_target_temperature_high_
void set_supports_fan_mode_focus(bool supports_fan_mode_focus)
void check_temperature_change_trigger_()
Check if the temperature change trigger should be called.
Trigger * fan_mode_on_trigger_
The trigger to call when the controller should switch on the fan.
HumidificationAction compute_humidity_control_action_()
void set_supports_fan_mode_off(bool supports_fan_mode_off)
FixedVector< PresetEntry > preset_config_
The set of standard preset configurations this thermostat supports (Eg. AWAY, ECO,...
climate::ClimateFanMode prev_fan_mode_
Store previously-known states.
void cooling_on_timer_callback_()
void set_use_startup_delay(bool use_startup_delay)
Trigger * heat_mode_trigger_
void cooling_off_timer_callback_()
void set_humidity_hysteresis(float humidity_hysteresis)
Trigger * get_humidity_change_trigger() const
bool cancel_timer_(ThermostatClimateTimerIndex timer_index)
climate::ClimateAction compute_supplemental_action_()
float prev_target_temperature_
void set_supplemental_cool_delta(float delta)
climate::ClimatePreset default_preset_
Default standard preset to use on start up.
void set_fanning_minimum_run_time_in_sec(uint32_t time)
sensor::Sensor * humidity_sensor_
The sensor used for getting the current humidity.
bool fan_mode_change_delayed()
Trigger * get_humidity_control_dehumidify_action_trigger() const
void cooling_max_run_time_timer_callback_()
set_timeout() callbacks for various actions (see above)
bool supports_humidification_
Trigger * prev_swing_mode_trigger_
bool supports_fan_mode_auto_
Whether the controller supports fan auto mode.
Trigger * get_preset_change_trigger() const
Trigger * get_heat_cool_mode_trigger() const
void set_cooling_maximum_run_time_in_sec(uint32_t time)
climate::ClimateAction compute_action_(bool ignore_timers=false)
Re-compute the required action of this climate controller.
Trigger * get_humidity_control_off_action_trigger() const
bool dehumidification_required_()
void validate_target_temperature()
bool supports_two_points_
Whether the controller supports two set points.
bool setup_complete_
setup_complete_ blocks modifying/resetting the temps immediately after boot
Trigger * get_cool_action_trigger() const
void set_idle_minimum_time_in_sec(uint32_t time)
void set_supports_fan_mode_high(bool supports_fan_mode_high)
bool idle_action_ready_()
Is the action ready to be called? Returns true if so.
void change_preset_(climate::ClimatePreset preset)
Change to a provided preset setting; will reset temperature, mode, fan, and swing modes accordingly.
void set_cooling_minimum_run_time_in_sec(uint32_t time)
void refresh()
Call triggers based on updated climate states (modes/actions)
Trigger * fan_mode_quiet_trigger_
The trigger to call when the controller should switch the fan to "quiet" position.
Trigger * heat_cool_mode_trigger_
The trigger to call when the controller should switch to heat/cool mode.
Trigger * supplemental_heat_action_trigger_
bool heating_max_runtime_exceeded_
Trigger * auto_mode_trigger_
The trigger to call when the controller should switch to auto mode.
bool cooling_required_()
Check if cooling/fanning/heating actions are required; returns true if so.
ClimateSwingMode swing_mode
@ CLIMATE_SUPPORTS_CURRENT_HUMIDITY
@ CLIMATE_SUPPORTS_TARGET_HUMIDITY
@ CLIMATE_SUPPORTS_TWO_POINT_TARGET_TEMPERATURE
@ CLIMATE_SUPPORTS_CURRENT_TEMPERATURE
@ CLIMATE_SUPPORTS_ACTION
const LogString * climate_swing_mode_to_string(ClimateSwingMode swing_mode)
Convert the given ClimateSwingMode to a human-readable string.
const LogString * climate_preset_to_string(ClimatePreset preset)
Convert the given PresetMode to a human-readable string.
ClimatePreset
Enum for all preset modes NOTE: If adding values, update ClimatePresetMask in climate_traits....
@ CLIMATE_PRESET_NONE
No preset is active.
const LogString * climate_fan_mode_to_string(ClimateFanMode fan_mode)
Convert the given ClimateFanMode to a human-readable string.
ClimateSwingMode
Enum for all modes a climate swing can be in NOTE: If adding values, update ClimateSwingModeMask in c...
@ CLIMATE_SWING_OFF
The swing mode is set to Off.
@ CLIMATE_SWING_HORIZONTAL
The fan mode is set to Horizontal.
@ CLIMATE_SWING_VERTICAL
The fan mode is set to Vertical.
@ CLIMATE_SWING_BOTH
The fan mode is set to Both.
ClimateMode
Enum for all modes a climate device can be in.
@ CLIMATE_MODE_DRY
The climate device is set to dry/humidity mode.
@ CLIMATE_MODE_FAN_ONLY
The climate device only has the fan enabled, no heating or cooling is taking place.
@ CLIMATE_MODE_HEAT
The climate device is set to heat to reach the target temperature.
@ CLIMATE_MODE_COOL
The climate device is set to cool to reach the target temperature.
@ CLIMATE_MODE_HEAT_COOL
The climate device is set to heat/cool to reach the target temperature.
@ CLIMATE_MODE_OFF
The climate device is off.
@ CLIMATE_MODE_AUTO
The climate device is adjusting the temperature dynamically.
const LogString * climate_mode_to_string(ClimateMode mode)
Convert the given ClimateMode to a human-readable string.
ClimateAction
Enum for the current action of the climate device. Values match those of ClimateMode.
@ CLIMATE_ACTION_OFF
The climate device is off (inactive or no power)
@ CLIMATE_ACTION_IDLE
The climate device is idle (monitoring climate but no action needed)
@ CLIMATE_ACTION_DRYING
The climate device is drying.
@ CLIMATE_ACTION_HEATING
The climate device is actively heating.
@ CLIMATE_ACTION_COOLING
The climate device is actively cooling.
@ CLIMATE_ACTION_FAN
The climate device is in fan only mode.
ClimateFanMode
NOTE: If adding values, update ClimateFanModeMask in climate_traits.h to use the new last value.
@ CLIMATE_FAN_MEDIUM
The fan mode is set to Medium.
@ CLIMATE_FAN_DIFFUSE
The fan mode is set to Diffuse.
@ CLIMATE_FAN_ON
The fan mode is set to On.
@ CLIMATE_FAN_AUTO
The fan mode is set to Auto.
@ CLIMATE_FAN_FOCUS
The fan mode is set to Focus.
@ CLIMATE_FAN_LOW
The fan mode is set to Low.
@ CLIMATE_FAN_MIDDLE
The fan mode is set to Middle.
@ CLIMATE_FAN_QUIET
The fan mode is set to Quiet.
@ CLIMATE_FAN_OFF
The fan mode is set to Off.
@ CLIMATE_FAN_HIGH
The fan mode is set to High.
ThermostatClimateTimerIndex
@ THERMOSTAT_TIMER_HEATING_OFF
@ THERMOSTAT_TIMER_IDLE_ON
@ THERMOSTAT_TIMER_FANNING_ON
@ THERMOSTAT_TIMER_COOLING_OFF
@ THERMOSTAT_TIMER_FANNING_OFF
@ THERMOSTAT_TIMER_FAN_MODE
@ THERMOSTAT_TIMER_HEATING_ON
@ THERMOSTAT_TIMER_HEATING_MAX_RUN_TIME
@ THERMOSTAT_TIMER_COOLING_MAX_RUN_TIME
@ THERMOSTAT_TIMER_COOLING_ON
@ THERMOSTAT_HUMIDITY_CONTROL_ACTION_NONE
@ THERMOSTAT_HUMIDITY_CONTROL_ACTION_HUMIDIFY
@ THERMOSTAT_HUMIDITY_CONTROL_ACTION_OFF
@ THERMOSTAT_HUMIDITY_CONTROL_ACTION_DEHUMIDIFY
uint32_t IRAM_ATTR HOT millis()
Application App
Global storage of Application pointer - only one Application can exist.
optional< climate::ClimateSwingMode > swing_mode_
optional< climate::ClimateFanMode > fan_mode_
float default_temperature_low
optional< climate::ClimateMode > mode_
float default_temperature
ThermostatClimateTargetTempConfig()
float default_temperature_high