Home IO Control
ESPHome add-on for IO-Homecontrol devices
Toggle main menu visibility
Loading...
Searching...
No Matches
platform_climate.h
Go to the documentation of this file.
1
#pragma once
2
3
/// @file platform_climate.h
4
/// @brief Experimental climate entity for IO-Homecontrol heating devices (CMD_WRITE_PRIVATE 0x20).
5
/// @ingroup hioc_platforms
6
///
7
/// Maps Home Assistant climate semantics (HVAC mode, target temperature, presets) onto the six
8
/// 2W heating functions in proto_heating.h, transmitting through the hub's single shared heating
9
/// send path (IOHomeControlComponent::send_heating_command()). Both this entity and the
10
/// `heating_control` hub action use that one path.
11
///
12
/// Write-only state: the `set_*` functions are write-only — nothing decodes what the radiator
13
/// actually did into this entity. (`power_on` and `midnight_sync` are register *reads*; their
14
/// 0x21 ACK payload is logged at DEBUG but not decoded into any field.) The entity publishes only
15
/// what it has just successfully sent ("last commanded, never confirmed") and never at request
16
/// time; there is no status poll and no current temperature. It deliberately does NOT use the
17
/// OptimisticState overlay (ADR 0030) — that machinery keeps a prediction apart from a competing
18
/// observation, and heating has no observation stream for it to sit against.
19
///
20
/// @warning Unvalidated on hardware. The protocol is derived from the iohomecontrol project's
21
/// Cozytouch support (Atlantic / Thermor / Sauter radiators); no such device has ever
22
/// been exercised. See docs/configuration/climate.md's experimental banner.
23
24
#include "esphome/components/climate/climate.h"
25
#include "esphome/core/component.h"
26
#include "
platform_entity_base.h
"
27
#include "
proto_heating.h
"
28
29
namespace
esphome
{
30
namespace
home_io_control
{
31
32
/// @brief Climate entity for IO-Homecontrol heating devices.
33
/// @ingroup hioc_platforms
34
///
35
/// The device-binding setters and setup() registration ritual come from DeviceBoundEntity; the
36
/// HA-to-protocol mapping and the write-only publish discipline live here.
37
class
IOHomeClimate
:
public
climate::Climate,
public
Component,
public
DeviceBoundEntity
{
38
public
:
39
/// @brief Register the entity with the shared hub (no status poll — heating has no readback).
40
void
setup
()
override
;
41
/// @brief Dump configuration to the log.
42
void
dump_config
()
override
;
43
/// @brief Get setup priority (DATA).
44
/// @return setup_priority::DATA.
45
[[nodiscard]]
float
get_setup_priority
()
const override
{
return
setup_priority::DATA; }
46
47
/// @brief Static traits: modes OFF/HEAT/AUTO, presets HOME/AWAY, temperature range
48
/// HEATING_TEMP_MIN_C..HEATING_TEMP_MAX_C (7.0..28.0 C) at a 0.5 C step. No current
49
/// temperature (no sensor evidence in the protocol).
50
climate::ClimateTraits
traits
()
override
;
51
52
/// @brief Apply a Home Assistant climate control request.
53
///
54
/// Translates the request to one or more send_heating_command() calls via a single static
55
/// mapping table (climate_mode <-> HeatingMode, climate_preset <-> presence). Publishes each
56
/// changed field only after its send returns success; a failed send leaves the entity state
57
/// untouched.
58
/// @param call The requested attribute changes.
59
void
control
(
const
climate::ClimateCall &call)
override
;
60
61
protected
:
62
/// @brief Inbound device-update hook. Intentionally empty: a write-only heating device produces
63
/// no state this entity can publish. Link health / active issue reach the user through the
64
/// companion diagnostic sensors instead.
65
void
on_device_update_
(
const
std::string &
id
,
const
IoDevice
&dev);
66
67
/// @brief Apply the request's HVAC mode via SET_MODE, if present. @return true if state was published.
68
bool
apply_mode_
(
const
climate::ClimateCall &call);
69
/// @brief Apply the "Program" custom preset via SET_MODE(prog), if present. @return true if published.
70
bool
apply_custom_preset_
(
const
climate::ClimateCall &call);
71
/// @brief Apply a HOME/AWAY preset via SET_PRESENCE, if present. @return true if published.
72
bool
apply_preset_
(
const
climate::ClimateCall &call);
73
/// @brief Apply the target temperature via SET_TEMPERATURE, if present. @return true if published.
74
bool
apply_target_temperature_
(
const
climate::ClimateCall &call);
75
};
76
77
}
// namespace home_io_control
78
}
// namespace esphome
esphome::home_io_control::DeviceBoundEntity
Mixin holding the hub-device binding shared by all IO-Homecontrol entity platforms.
Definition
platform_entity_base.h:36
esphome::home_io_control::IOHomeClimate
Climate entity for IO-Homecontrol heating devices.
Definition
platform_climate.h:37
esphome::home_io_control::IOHomeClimate::on_device_update_
void on_device_update_(const std::string &id, const IoDevice &dev)
Inbound device-update hook.
Definition
platform_climate.cpp:165
esphome::home_io_control::IOHomeClimate::apply_custom_preset_
bool apply_custom_preset_(const climate::ClimateCall &call)
Apply the "Program" custom preset via SET_MODE(prog), if present.
Definition
platform_climate.cpp:124
esphome::home_io_control::IOHomeClimate::dump_config
void dump_config() override
Dump configuration to the log.
Definition
platform_climate.cpp:170
esphome::home_io_control::IOHomeClimate::apply_target_temperature_
bool apply_target_temperature_(const climate::ClimateCall &call)
Apply the target temperature via SET_TEMPERATURE, if present.
Definition
platform_climate.cpp:154
esphome::home_io_control::IOHomeClimate::get_setup_priority
float get_setup_priority() const override
Get setup priority (DATA).
Definition
platform_climate.h:45
esphome::home_io_control::IOHomeClimate::apply_preset_
bool apply_preset_(const climate::ClimateCall &call)
Apply a HOME/AWAY preset via SET_PRESENCE, if present.
Definition
platform_climate.cpp:137
esphome::home_io_control::IOHomeClimate::traits
climate::ClimateTraits traits() override
Static traits: modes OFF/HEAT/AUTO, presets HOME/AWAY, temperature range HEATING_TEMP_MIN_C....
Definition
platform_climate.cpp:76
esphome::home_io_control::IOHomeClimate::control
void control(const climate::ClimateCall &call) override
Apply a Home Assistant climate control request.
Definition
platform_climate.cpp:93
esphome::home_io_control::IOHomeClimate::setup
void setup() override
Register the entity with the shared hub (no status poll — heating has no readback).
Definition
platform_climate.cpp:49
esphome::home_io_control::IOHomeClimate::apply_mode_
bool apply_mode_(const climate::ClimateCall &call)
Apply the request's HVAC mode via SET_MODE, if present.
Definition
platform_climate.cpp:106
esphome::home_io_control
Definition
device_registry.cpp:13
esphome
Definition
device_registry.cpp:12
platform_entity_base.h
Shared device-binding mixins for IO-Homecontrol entity platforms.
proto_heating.h
Pure codec for IO-Homecontrol 2W heating/climate functions (CMD_WRITE_PRIVATE 0x20).
esphome::home_io_control::IoDevice
Runtime state of a paired IO‑Homecontrol device.
Definition
proto_device_model.h:321
components
home_io_control
platform_climate.h
Generated by
1.18.0