Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
esphome::home_io_control::IOHomeClimate Class Reference

Climate entity for IO-Homecontrol heating devices. More...

#include <platform_climate.h>

Inheritance diagram for esphome::home_io_control::IOHomeClimate:
Collaboration diagram for esphome::home_io_control::IOHomeClimate:

Public Member Functions

void setup () override
 Register the entity with the shared hub and schedule the first poll of the heater.
void dump_config () override
 Dump configuration to the log.
float get_setup_priority () const override
 Get setup priority (DATA).
climate::ClimateTraits traits () override
 Traits from the device's heating profile: its HVAC modes and presets, current temperature and action where the profile has them, and a target range from HEATING_TEMP_MIN_C to the heater's own maximum setpoint (HEATING_TEMP_MAX_C until it has been read) at a 0.5 C step.
void control (const climate::ClimateCall &call) override
 Apply a Home Assistant climate control request.
void set_temperature_range (float min_c, float max_c)
 Override the temperature encoding range (YAML min_temperature: / max_temperature:) of a heater that carries a temperature in its main parameter; applied to the device in setup().
Public Member Functions inherited from esphome::home_io_control::DeviceBoundEntity
void set_parent (IOHomeControlComponent *parent)
 Set the parent controller component.
void set_device_id (const std::string &id)
 Set the unique IO-homecontrol device ID (from YAML).
void set_device_type (DeviceType type)
 Set the declared device type (from YAML).
void set_subtype (uint8_t subtype)
 Set the declared device subtype (from YAML).
void set_optimistic_state (bool optimistic_state)
 Enable or disable optimistic target updates for this device (from YAML).
void set_silent (bool silent)
 Send this device's position moves in "silent operation" mode — the reference hub's slower travel profile.
void set_low_power (bool low_power)
 Mark this device as a low-power / duty-cycled receiver.
void set_system_key (const std::string &key)
 Give this device a system key of its own (system_key: in YAML).
void set_battery_entities (bool battery_entities)
 Record that the YAML declared battery: true, so the status log line names the battery level even when the device reports none.
void set_status_poll_interval (uint32_t poll_interval_ms)
 Configure bounded follow-up polling while a state change is expected.

Protected Member Functions

const HeatingProfile * profile_ () const
 The device's heating profile: from the declared type, else from the type the hub learned.
void on_device_update_ (const std::string &id, const IoDevice &dev)
 Inbound device-update hook: fold IoDevice::heating into the entity and publish when something it shows changed.
bool sync_from_readings_ (const HeatingProfile &profile, const HeatingReadings &readings)
 Copy the readings into the entity's fields.
bool sync_temperatures_ (const HeatingProfile &profile, const HeatingReadings &readings, bool &seen)
 Fold the temperatures (current, setpoint, maximum) of the readings into the entity.
bool sync_action_ (const HeatingProfile &profile, const HeatingReadings &readings, bool mode_known, bool &seen)
 Fold the regulator state into the entity's action.
bool apply_observed_state_ (const HeatingProfile &profile, uint8_t wire)
 Show a device-reported mode register value or heating level.
bool write_ (const HeatingProfile &profile, HeatingFunction fn, uint8_t wire)
 Send one preset value (or, on the register and level paths, one mode value) over the profile's control path.
bool write_preset_ (const HeatingProfile &profile, const HeatingPresetEntry &entry)
 Send one preset over the profile's control path: a register or level write, or, for a TEMPERATURE_EXECUTE heater, its alias as the main parameter with the entry's functional parameter.
bool encode_target_ (const HeatingProfile &profile, float celsius, uint16_t &main_parameter)
 Encode a target temperature as a main parameter over the device's range (the fixed range for a profile that has one).
bool write_temperature_mode_ (const HeatingProfile &profile, const HeatingModeEntry &entry)
 Send an HVAC mode to a TEMPERATURE_EXECUTE heater: the mode entry's main parameter (the target temperature for heat on a thermostat) with its functional parameter.
void confirm_write_ (HeatingFunction fn)
 Read one register back after an accepted write so the entity shows the heater's value.
bool apply_mode_ (const HeatingProfile &profile, const climate::ClimateCall &call)
 Apply the request's HVAC mode, if present.
bool apply_custom_preset_ (const HeatingProfile &profile, const climate::ClimateCall &call)
 Apply a custom preset, if present.
bool apply_preset_ (const HeatingProfile &profile, const climate::ClimateCall &call)
 Apply a standard preset, if present.
bool apply_target_temperature_ (const HeatingProfile &profile, const climate::ClimateCall &call)
 Apply the target temperature, if present.
Protected Member Functions inherited from esphome::home_io_control::DeviceBoundEntity
void register_device_binding_ (Component *self, bool inverted, std::function< void(const std::string &, const IoDevice &)> on_update)
 Perform the shared setup() registration ritual.
bool passes_binary_update_filter_ (const std::string &id, const IoDevice &dev) const
 Shared inbound-update guard for binary endpoints.
void log_poll_interval_config_ (const char *tag) const
 Emit the shared two-branch poll-interval line for dump_config().

Protected Attributes

bool observed_ {false}
 True once a reading has been folded in.
bool has_range_ {false}
 YAML overrode the temperature encoding range.
float range_min_c_ {HEATING_TEMPERATURE_RANGE_MIN_C}
 YAML min_temperature:.
float range_max_c_ {HEATING_TEMPERATURE_RANGE_MAX_C}
 YAML max_temperature:.
bool mode_commanded_ {false}
 A mode was commanded (matters where nothing reads the mode back).
float max_temperature_c_ {HEATING_TEMP_MAX_C}
 Upper end of the target range (heater's own maximum once read).
std::vector< const char * > custom_presets_
 Custom preset names of the profile, registered in setup().
Protected Attributes inherited from esphome::home_io_control::DeviceBoundEntity
IOHomeControlComponent * parent_ {nullptr}
std::string device_id_
DeviceType device_type_ {DeviceType::UNKNOWN}
uint8_t subtype_ {0}
uint32_t status_poll_interval_ms_ {0}
bool optimistic_state_ {true}
bool silent_ {false}
bool low_power_ {false}
bool battery_entities_ {false}
bool has_system_key_ {false}
uint8_t system_key_ [AES_KEY_SIZE] {}
 Key material: never logged.

Detailed Description

Climate entity for IO-Homecontrol heating devices.

The device-binding setters and setup() registration ritual come from DeviceBoundEntity; the profile-to-ESPHome mapping and the publish-from-readings discipline live here.

Definition at line 50 of file platform_climate.h.

Member Function Documentation

◆ apply_custom_preset_()

bool esphome::home_io_control::IOHomeClimate::apply_custom_preset_ ( const HeatingProfile & profile,
const climate::ClimateCall & call )
protected

Apply a custom preset, if present.

Returns
true if published.

Definition at line 266 of file platform_climate.cpp.

Here is the call graph for this function:

◆ apply_mode_()

bool esphome::home_io_control::IOHomeClimate::apply_mode_ ( const HeatingProfile & profile,
const climate::ClimateCall & call )
protected

Apply the request's HVAC mode, if present.

Returns
true if state was published.

Definition at line 229 of file platform_climate.cpp.

Here is the call graph for this function:

◆ apply_observed_state_()

bool esphome::home_io_control::IOHomeClimate::apply_observed_state_ ( const HeatingProfile & profile,
uint8_t wire )
protected

Show a device-reported mode register value or heating level.

Parameters
profileThe device's profile.
wireValue as the device reports it.
Returns
true when the mode or a preset changed; a value the profile does not map changes nothing.

Definition at line 442 of file platform_climate.cpp.

Here is the call graph for this function:

◆ apply_preset_()

bool esphome::home_io_control::IOHomeClimate::apply_preset_ ( const HeatingProfile & profile,
const climate::ClimateCall & call )
protected

Apply a standard preset, if present.

Returns
true if published.

Definition at line 293 of file platform_climate.cpp.

Here is the call graph for this function:

◆ apply_target_temperature_()

bool esphome::home_io_control::IOHomeClimate::apply_target_temperature_ ( const HeatingProfile & profile,
const climate::ClimateCall & call )
protected

Apply the target temperature, if present.

Returns
true if published.

Definition at line 321 of file platform_climate.cpp.

Here is the call graph for this function:

◆ confirm_write_()

void esphome::home_io_control::IOHomeClimate::confirm_write_ ( HeatingFunction fn)
protected

Read one register back after an accepted write so the entity shows the heater's value.

Parameters
fnRegister that was just written.

Definition at line 223 of file platform_climate.cpp.

Here is the call graph for this function:

◆ control()

void esphome::home_io_control::IOHomeClimate::control ( const climate::ClimateCall & call)
override

Apply a Home Assistant climate control request.

Each requested mode, preset and setpoint is looked up in the profile and sent over its control path. After an accepted register write the register is read back; what the heater answers is what the entity then shows. Only while no read has succeeded yet does an accepted write publish the commanded value. A failed send leaves the entity state untouched.

Parameters
callThe requested attribute changes.

Definition at line 156 of file platform_climate.cpp.

Here is the call graph for this function:

◆ dump_config()

void esphome::home_io_control::IOHomeClimate::dump_config ( )
override

Dump configuration to the log.

Definition at line 491 of file platform_climate.cpp.

Here is the call graph for this function:

◆ encode_target_()

bool esphome::home_io_control::IOHomeClimate::encode_target_ ( const HeatingProfile & profile,
float celsius,
uint16_t & main_parameter )
protected

Encode a target temperature as a main parameter over the device's range (the fixed range for a profile that has one).

Parameters
profileThe device's profile.
celsiusThe target.
[out]main_parameterThe encoded value.
Returns
false when the temperature or the range cannot be encoded.

Definition at line 195 of file platform_climate.cpp.

Here is the call graph for this function:

◆ get_setup_priority()

float esphome::home_io_control::IOHomeClimate::get_setup_priority ( ) const
inlinenodiscardoverride

Get setup priority (DATA).

Returns
setup_priority::DATA.

Definition at line 58 of file platform_climate.h.

◆ on_device_update_()

void esphome::home_io_control::IOHomeClimate::on_device_update_ ( const std::string & id,
const IoDevice & dev )
protected

Inbound device-update hook: fold IoDevice::heating into the entity and publish when something it shows changed.

Ignores updates for other devices.

Definition at line 481 of file platform_climate.cpp.

Here is the call graph for this function:

◆ profile_()

const HeatingProfile * esphome::home_io_control::IOHomeClimate::profile_ ( ) const
nodiscardprotected

The device's heating profile: from the declared type, else from the type the hub learned.

Returns
The profile, or nullptr while the type is unknown.

Definition at line 78 of file platform_climate.cpp.

Here is the call graph for this function:

◆ set_temperature_range()

void esphome::home_io_control::IOHomeClimate::set_temperature_range ( float min_c,
float max_c )
inline

Override the temperature encoding range (YAML min_temperature: / max_temperature:) of a heater that carries a temperature in its main parameter; applied to the device in setup().

Parameters
min_cLower end of the range in degrees Celsius.
max_cUpper end of the range.

Definition at line 79 of file platform_climate.h.

◆ setup()

void esphome::home_io_control::IOHomeClimate::setup ( )
override

Register the entity with the shared hub and schedule the first poll of the heater.

Definition at line 86 of file platform_climate.cpp.

Here is the call graph for this function:

◆ sync_action_()

bool esphome::home_io_control::IOHomeClimate::sync_action_ ( const HeatingProfile & profile,
const HeatingReadings & readings,
bool mode_known,
bool & seen )
protected

Fold the regulator state into the entity's action.

Parameters
profileThe device's profile.
readingsWhat the hub has read from the heater.
mode_knownTrue when the mode or level has been read (an off heater is then not idle).
[in,out]seenSet when a reading was present.
Returns
true when the action changed.

Definition at line 388 of file platform_climate.cpp.

◆ sync_from_readings_()

bool esphome::home_io_control::IOHomeClimate::sync_from_readings_ ( const HeatingProfile & profile,
const HeatingReadings & readings )
protected

Copy the readings into the entity's fields.

Parameters
profileThe device's profile.
readingsWhat the hub has read from the heater.
Returns
true when a published field (including the traits' maximum) changed.

Definition at line 409 of file platform_climate.cpp.

Here is the call graph for this function:

◆ sync_temperatures_()

bool esphome::home_io_control::IOHomeClimate::sync_temperatures_ ( const HeatingProfile & profile,
const HeatingReadings & readings,
bool & seen )
protected

Fold the temperatures (current, setpoint, maximum) of the readings into the entity.

Parameters
profileThe device's profile.
readingsWhat the hub has read from the heater.
[in,out]seenSet when a reading was present.
Returns
true when a published field changed.

Definition at line 354 of file platform_climate.cpp.

◆ traits()

climate::ClimateTraits esphome::home_io_control::IOHomeClimate::traits ( )
override

Traits from the device's heating profile: its HVAC modes and presets, current temperature and action where the profile has them, and a target range from HEATING_TEMP_MIN_C to the heater's own maximum setpoint (HEATING_TEMP_MAX_C until it has been read) at a 0.5 C step.

A device whose type is not known yet gets the off mode only.

Definition at line 125 of file platform_climate.cpp.

Here is the call graph for this function:

◆ write_()

bool esphome::home_io_control::IOHomeClimate::write_ ( const HeatingProfile & profile,
HeatingFunction fn,
uint8_t wire )
protected

Send one preset value (or, on the register and level paths, one mode value) over the profile's control path.

Parameters
profileThe device's profile.
fnRegister to write (PRIVATE_REGISTERS only).
wireRegister value, or the low byte of a level or alias.
Returns
true when the device accepted it.

Definition at line 175 of file platform_climate.cpp.

Here is the call graph for this function:

◆ write_preset_()

bool esphome::home_io_control::IOHomeClimate::write_preset_ ( const HeatingProfile & profile,
const HeatingPresetEntry & entry )
protected

Send one preset over the profile's control path: a register or level write, or, for a TEMPERATURE_EXECUTE heater, its alias as the main parameter with the entry's functional parameter.

Parameters
profileThe device's profile.
entryThe preset entry.
Returns
true when the device accepted it.

Definition at line 187 of file platform_climate.cpp.

Here is the call graph for this function:

◆ write_temperature_mode_()

bool esphome::home_io_control::IOHomeClimate::write_temperature_mode_ ( const HeatingProfile & profile,
const HeatingModeEntry & entry )
protected

Send an HVAC mode to a TEMPERATURE_EXECUTE heater: the mode entry's main parameter (the target temperature for heat on a thermostat) with its functional parameter.

Parameters
profileThe device's profile.
entryThe mode entry.
Returns
true when the device accepted it; false when it did not, or when heat needs a target temperature that is not known yet.

Definition at line 205 of file platform_climate.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ custom_presets_

std::vector<const char *> esphome::home_io_control::IOHomeClimate::custom_presets_
protected

Custom preset names of the profile, registered in setup().

Definition at line 171 of file platform_climate.h.

◆ has_range_

bool esphome::home_io_control::IOHomeClimate::has_range_ {false}
protected

YAML overrode the temperature encoding range.

Definition at line 166 of file platform_climate.h.

◆ max_temperature_c_

float esphome::home_io_control::IOHomeClimate::max_temperature_c_ {HEATING_TEMP_MAX_C}
protected

Upper end of the target range (heater's own maximum once read).

Definition at line 170 of file platform_climate.h.

◆ mode_commanded_

bool esphome::home_io_control::IOHomeClimate::mode_commanded_ {false}
protected

A mode was commanded (matters where nothing reads the mode back).

Definition at line 169 of file platform_climate.h.

◆ observed_

bool esphome::home_io_control::IOHomeClimate::observed_ {false}
protected

True once a reading has been folded in.

Definition at line 165 of file platform_climate.h.

◆ range_max_c_

float esphome::home_io_control::IOHomeClimate::range_max_c_ {HEATING_TEMPERATURE_RANGE_MAX_C}
protected

YAML max_temperature:.

Definition at line 168 of file platform_climate.h.

◆ range_min_c_

float esphome::home_io_control::IOHomeClimate::range_min_c_ {HEATING_TEMPERATURE_RANGE_MIN_C}
protected

YAML min_temperature:.

Definition at line 167 of file platform_climate.h.


The documentation for this class was generated from the following files: