Home IO Control
ESPHome add-on for IO-Homecontrol devices
Toggle main menu visibility
Loading...
Searching...
No Matches
platform_fan.h
Go to the documentation of this file.
1
#pragma once
2
3
/// @file platform_fan.h
4
/// @brief Experimental fan entity for IO-Homecontrol exterior heating (a heat level, 0-100 %).
5
/// @ingroup hioc_platforms
6
///
7
/// Exterior heating (node type 21) takes a heat level in the position field rather than a
8
/// temperature, so it is a fan entity: on/off plus a 0-100 % speed that is the heat level. The
9
/// mapping is the dimmable light's: heat `p` % is the IO position `100 - p` (MP = position x 0x200,
10
/// so 100 % heat is `0x0000` and off is `0xC800`; KLF 200 API specification, Table 277). Every
11
/// exterior heater is sent the main parameter only (no functional-parameter block); subtype 58 is
12
/// on/off, so it advertises no speed.
13
///
14
/// A command shows the commanded on/off and level until the device's status reply (the settle poll
15
/// after the command, then the regular poll) replaces it; a reply is always the observation that
16
/// wins. Turning on without a level uses the last non-zero level, else full heat.
17
///
18
/// @todo Experimental: no exterior heater has been exercised on hardware. Confirm the position
19
/// mapping and the status read with a capture or a reporter's heater.
20
21
#include "esphome/components/fan/fan.h"
22
#include "esphome/core/component.h"
23
#include "
platform_entity_base.h
"
24
25
namespace
esphome
{
26
namespace
home_io_control
{
27
28
/// @brief Fan entity for IO-Homecontrol exterior heating.
29
/// @ingroup hioc_platforms
30
///
31
/// The device-binding setters, setup() registration ritual and poll-interval dump line come from
32
/// DeviceBoundEntity; the heat-level command and status decoding live here.
33
class
IOHomeFan
:
public
fan::Fan,
public
Component,
public
DeviceBoundEntity
{
34
public
:
35
/// @brief Register the entity with the shared hub and schedule the first status poll.
36
void
setup
()
override
;
37
/// @brief Dump configuration to the log.
38
void
dump_config
()
override
;
39
/// @brief Get setup priority (DATA).
40
/// @return setup_priority::DATA.
41
[[nodiscard]]
float
get_setup_priority
()
const override
{
return
setup_priority::DATA; }
42
43
/// @brief Traits: a 100-step speed (the heat level) unless the device takes the main parameter
44
/// only (subtype 58, on/off). No oscillation, no direction.
45
fan::FanTraits
get_traits
()
override
;
46
47
protected
:
48
/// @brief Apply a Home Assistant fan request: a heat level, or on/off.
49
/// @param call The requested changes.
50
void
control
(
const
fan::FanCall &call)
override
;
51
52
/// @brief Show a settled device status: heat level = 100 - position.
53
/// @param id Device ID.
54
/// @param dev Updated device state.
55
void
on_device_update_
(
const
std::string &
id
,
const
IoDevice
&dev);
56
};
57
58
}
// namespace home_io_control
59
}
// 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:38
esphome::home_io_control::IOHomeFan
Fan entity for IO-Homecontrol exterior heating.
Definition
platform_fan.h:33
esphome::home_io_control::IOHomeFan::get_traits
fan::FanTraits get_traits() override
Traits: a 100-step speed (the heat level) unless the device takes the main parameter only (subtype 58...
Definition
platform_fan.cpp:43
esphome::home_io_control::IOHomeFan::dump_config
void dump_config() override
Dump configuration to the log.
Definition
platform_fan.cpp:93
esphome::home_io_control::IOHomeFan::on_device_update_
void on_device_update_(const std::string &id, const IoDevice &dev)
Show a settled device status: heat level = 100 - position.
Definition
platform_fan.cpp:77
esphome::home_io_control::IOHomeFan::setup
void setup() override
Register the entity with the shared hub and schedule the first status poll.
Definition
platform_fan.cpp:27
esphome::home_io_control::IOHomeFan::get_setup_priority
float get_setup_priority() const override
Get setup priority (DATA).
Definition
platform_fan.h:41
esphome::home_io_control::IOHomeFan::control
void control(const fan::FanCall &call) override
Apply a Home Assistant fan request: a heat level, or on/off.
Definition
platform_fan.cpp:49
esphome::home_io_control
Definition
device_registry.cpp:15
esphome
Definition
device_registry.cpp:14
platform_entity_base.h
Shared device-binding mixins for IO-Homecontrol entity platforms.
esphome::home_io_control::IoDevice
Runtime state of a paired IO‑Homecontrol device.
Definition
proto_device_model.h:413
components
home_io_control
platform_fan.h
Generated by
1.18.0