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

Water heater entity for a domestic hot water heater. More...

#include <platform_water_heater.h>

Inheritance diagram for esphome::home_io_control::IOHomeWaterHeater:
Collaboration diagram for esphome::home_io_control::IOHomeWaterHeater:

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).
water_heater::WaterHeaterCallInternal make_call () override
 A call bound to this entity (the pattern of ESPHome's template water heater).
void control (const water_heater::WaterHeaterCall &call) override
 Apply a Home Assistant request: a mode is written to register 0x0006, away mode goes through the operating-mode word, a target is sent in an EXECUTE.
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_device_model (DeviceModel model)
 Set the declared product model below the subtype (YAML io_model:).
void set_optimistic_state (bool optimistic_state)
 Enable or disable optimistic target updates for this device (from YAML).
void set_travel_speed (TravelSpeed speed)
 Set the speed profile of this device's position moves (from YAML travel_speed: or silent:).
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

water_heater::WaterHeaterTraits traits () override
 Current and target temperature, the three modes, and the target range DHW_TARGET_MIN_C..DHW_TARGET_MAX_C at a 1 C step.
void on_device_update_ (const std::string &id, const IoDevice &dev)
 Inbound device-update hook: fold IoDevice::dhw into the entity and publish when a shown field changed.
bool sync_from_readings_ (const DhwReadings &readings)
 Copy the readings into the entity's fields.
Protected Member Functions inherited from esphome::home_io_control::DeviceBoundEntity
void register_device_binding_ (Component *self, DeviceCapabilityClass entity_class, std::optional< bool > invert_override, std::function< void(const std::string &, const IoDevice &)> on_update, bool dimmable=false)
 Perform the shared setup() registration ritual.
DeviceFeatures device_features_ (DeviceCapabilityClass entity_class) const
 What this entity's device can do: the registered device's features, or, before it is registered, the features its declared kind resolves to.
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.
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}
DeviceModel model_ {DeviceModel::NONE}
uint32_t status_poll_interval_ms_ {0}
bool optimistic_state_ {true}
TravelSpeed travel_speed_ {TravelSpeed::FAST}
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

Water heater entity for a domestic hot water heater.

The device-binding setters and setup() registration ritual come from DeviceBoundEntity.

Definition at line 70 of file platform_water_heater.h.

Member Function Documentation

◆ control()

void esphome::home_io_control::IOHomeWaterHeater::control ( const water_heater::WaterHeaterCall & call)
override

Apply a Home Assistant request: a mode is written to register 0x0006, away mode goes through the operating-mode word, a target is sent in an EXECUTE.

The mode and away go first; a target is then not sent while the heater holds automatic mode (it chooses its own), judged on the mode read back after the mode write. A failed send leaves its field as it was.

Parameters
callThe requested changes, already checked against traits() by ESPHome.

Definition at line 96 of file platform_water_heater.cpp.

Here is the call graph for this function:

◆ dump_config()

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

Dump configuration to the log.

Definition at line 180 of file platform_water_heater.cpp.

◆ get_setup_priority()

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

Get setup priority (DATA).

Returns
setup_priority::DATA.

Definition at line 78 of file platform_water_heater.h.

◆ make_call()

water_heater::WaterHeaterCallInternal esphome::home_io_control::IOHomeWaterHeater::make_call ( )
inlineoverride

A call bound to this entity (the pattern of ESPHome's template water heater).

Returns
A new call.

Definition at line 82 of file platform_water_heater.h.

◆ on_device_update_()

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

Inbound device-update hook: fold IoDevice::dhw into the entity and publish when a shown field changed.

Ignores updates for other devices.

Definition at line 173 of file platform_water_heater.cpp.

Here is the call graph for this function:

◆ setup()

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

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

Definition at line 62 of file platform_water_heater.cpp.

Here is the call graph for this function:

◆ sync_from_readings_()

bool esphome::home_io_control::IOHomeWaterHeater::sync_from_readings_ ( const DhwReadings & readings)
protected

Copy the readings into the entity's fields.

The target is shown as unknown (NaN) while the heater reports automatic mode or away; away follows the heater's report.

Parameters
readingsWhat the hub has read from the heater.
Returns
true when a published field changed.

Definition at line 139 of file platform_water_heater.cpp.

Here is the call graph for this function:

◆ traits()

water_heater::WaterHeaterTraits esphome::home_io_control::IOHomeWaterHeater::traits ( )
overrideprotected

Current and target temperature, the three modes, and the target range DHW_TARGET_MIN_C..DHW_TARGET_MAX_C at a 1 C step.

Definition at line 81 of file platform_water_heater.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ observed_

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

True once a reading has been folded in.

Definition at line 106 of file platform_water_heater.h.


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