Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
proto_dhw.h
Go to the documentation of this file.
1#pragma once
2
3/// @file proto_dhw.h
4/// @brief Pure codec for a domestic hot water heater: its family-0x00 registers and its target temperature.
5/// @ingroup hioc_protocol
6///
7/// A domestic hot water heater (node type 51, subtype 0) answers the private register reads a heater
8/// answers, `0C 60 00 <index>` in a CMD_WRITE_PRIVATE (0x20), with a CMD_WRITE_PRIVATE_ACK (0x21) that
9/// echoes the four header bytes and then the value. Its registers sit in family 0x00 (the high byte of the
10/// register number) and their multi-byte values are **big-endian**, where the radiator family 0x01 of
11/// proto_heating.h is little-endian; so this is a codec of its own, not a flag on the heater's. An index the
12/// heater does not hold is answered with no value bytes.
13///
14/// Its target temperature is not a register: it is the main parameter of a status reply, on the ordinary
15/// relative scale (0..0xC800) over DHW_TARGET_MIN_C..DHW_TARGET_MAX_C. Three replies pin it: 54 C reads
16/// `A1E8`, 62 C reads `C800`, and AUTO reads `BE7A` = 60.0 C.
17///
18/// Every reading here comes from one Atlantic Calypso Connecte (200 L) whose owner read each register in
19/// several display states (issue #198; corpus
20/// tests/corpus/captures/exchange/atlantic_calypso_exchange_register_read.yaml and
21/// tests/corpus/captures/probe/atlantic_calypso_probe_status_mp_fp.yaml, pinned by corpus_dhw_test.cpp).
22///
23/// The mode write (`0C 61 00 06 <mode>`) and the target EXECUTE are confirmed by the owner of that heater:
24/// its display follows both (issue #198). No reply to either is in the corpus yet.
25///
26/// Boost and away travel in the operating-mode word, functional parameter 16, not in a register (ADR 0081):
27/// one EXECUTE with the main parameter MAIN_PARAMETER_KEEP and one of three fixed FP16 values. The
28/// heater reports its capabilities (FP15) and the current word (FP16) in the status read
29/// DHW_STATUS_FPI1 / DHW_STATUS_FPI2 (corpus
30/// tests/corpus/captures/probe/atlantic_calypso_probe_status_fp_high.yaml). Registers 0x0000 and 0x0005 hold
31/// the boost and away durations; a write of a duration alone starts nothing.
32/// \todo Experimental: confirm on a real water heater that the three FP16 values start and end a boost and
33/// the holiday mode (issue #198).
34
35#include "proto_constants.h"
36#include "proto_frame.h"
37#include "proto_heating.h"
38
39#include <cmath>
40#include <cstddef>
41#include <cstdint>
42
43namespace esphome {
44namespace home_io_control {
45
46// === Registers ===
47
48/// @brief High byte of every register of a domestic hot water heater (family 0x00).
49static constexpr uint8_t DHW_REGISTER_HIGH_BYTE = 0x00;
50
51/// @brief Register 0x0000: boost duration, one byte. It read 1 during a boost started on the display and 0
52/// before and after it (issue #198). A duration is not the state: the state is FP16 (DhwOperatingStatus).
53static constexpr uint8_t DHW_REG_BOOST_DURATION = 0x00;
54/// @brief Register 0x0005: away (holiday) duration, one byte: the days the holiday still runs. It read 0 at
55/// rest and with a holiday scheduled for later, 4 and 2 four and two days before the end, and 255 for a
56/// holiday set on the display with no end date (issue #198).
57static constexpr uint8_t DHW_REG_AWAY_DURATION = 0x05;
58/// @brief Duration a boost start writes to register 0x0000: the value read during a boost started on the
59/// display, the only non-zero value seen.
60static constexpr uint8_t DHW_BOOST_START_DURATION = 1;
61/// @brief Duration an away start writes to register 0x0005: 255, which the heater itself holds for a holiday
62/// with no end date (issue #198), as Home Assistant's away mode (no end date) means.
63static constexpr uint8_t DHW_AWAY_UNTIL_TURNED_OFF = 255;
64/// @brief Register 0x0004: energy consumed since the heater was installed, 32-bit big-endian, Wh. Matches the
65/// display's "since start" total to the kWh, and rose while the heat pump ran.
66static constexpr uint8_t DHW_REG_ENERGY = 0x04;
67/// @brief Register 0x0006: operating mode (DhwMode), one byte. Followed the display in every run.
68static constexpr uint8_t DHW_REG_MODE = 0x06;
69/// @brief Register 0x0007: one ASCII letter naming the brand (`41` = 'A' on the Calypso).
70static constexpr uint8_t DHW_REG_BRAND = 0x07;
71/// @brief Register 0x0017: water temperature, signed 16-bit big-endian tenths of a degree in the first two
72/// value bytes. Four more bytes follow that never changed; they are not decoded.
73static constexpr uint8_t DHW_REG_WATER_TEMPERATURE = 0x17;
74/// @brief Register 0x0021: what is heating, eight bytes (DhwHeatingState).
75static constexpr uint8_t DHW_REG_HEATING = 0x21;
76
77// === Target temperature ===
78
79/// @brief Lower end of the target-temperature scale: main parameter 0 is 20 C.
80static constexpr float DHW_TARGET_MIN_C = 20.0F;
81/// @brief Upper end of the target-temperature scale: main parameter 0xC800 is 62 C, the highest target the
82/// Calypso's display offers.
83static constexpr float DHW_TARGET_MAX_C = 62.0F;
84/// @brief Offset of the main parameter (MSB) in the data of a status reply (CMD_PRIVATE_RESP): the target
85/// slot of a cover's reply. The two bytes after it read `00 00` in every reply seen.
86static constexpr uint8_t DHW_STATUS_MAIN_PARAMETER_OFFSET = 2;
87
88// === Operating mode (functional parameters 15 and 16) ===
89
90/// @brief FP16 that starts a boost and ends away. Bit 14 is set as the heater reports it.
91static constexpr uint16_t DHW_OPERATING_MODE_BOOST_ON = 0x4900;
92/// @brief FP16 that ends a boost and ends away: both fields off.
93static constexpr uint16_t DHW_OPERATING_MODE_OFF = 0x4A00;
94/// @brief FP16 that starts away (holiday) and ends a boost.
95static constexpr uint16_t DHW_OPERATING_MODE_AWAY_ON = 0x4600;
96/// @brief Status-read FPI1 that asks for no FP1-FP8 (the heater holds none of them).
97static constexpr uint8_t DHW_STATUS_FPI1 = 0x00;
98/// @brief Functional parameter that carries the operating-mode capabilities (DHW_CAPABILITY_* bits).
99static constexpr uint8_t DHW_FP_CAPABILITIES = 15;
100/// @brief Functional parameter that carries the operating-mode word (DHW_OPERATING_MODE_*).
101static constexpr uint8_t DHW_FP_OPERATING_MODE = 16;
102/// @brief Functional parameter 10: no decision uses it; the status read asks for it so the read is exactly the
103/// one the heater has been seen answering (FPI2 `43`, issue #198). The decoder skips its value.
104static constexpr uint8_t DHW_FP_ALSO_ASKED = 10;
105/// @brief Status-read FPI2 (`43`): FP10, FP15 and FP16. The capability and operating-mode words come with the
106/// main parameter in one exchange; FP10 keeps the read identical to the one the heater answered.
107static constexpr uint8_t DHW_STATUS_FPI2 =
109/// @brief FP15 bit 2: the heater supports away (absence).
110static constexpr uint16_t DHW_CAPABILITY_AWAY = 1U << 2U;
111/// @brief FP15 bit 3: the heater supports boost (relaunch).
112static constexpr uint16_t DHW_CAPABILITY_BOOST = 1U << 3U;
113
114/// @brief The two features the operating-mode word switches; dhw_operating_feature_wire() holds their wire facts.
115enum class DhwOperatingFeature : uint8_t {
116 BOOST, ///< Relaunch.
117 AWAY, ///< Absence (holiday).
118};
119
120/// @brief The wire facts of one DhwOperatingFeature: what FP15, FP16 and the duration registers say about it.
122 uint16_t capability; ///< FP15 bit that says the heater supports it (DHW_CAPABILITY_*).
123 uint8_t fp16_shift; ///< Lowest bit of its two-bit FP16 field (0 keep, 1 on, 2 off).
124 uint16_t on_word; ///< FP16 that starts it and ends the other (DHW_OPERATING_MODE_*_ON).
125 uint8_t duration_register; ///< Register that holds its duration (DHW_REG_*_DURATION).
126 uint8_t start_duration; ///< Duration a start writes before the FP16 EXECUTE.
127};
128
129/// @brief The wire facts of `which`: the one place each feature's FP15 bit, FP16 field and duration live.
130/// @param which Boost or away.
131/// @return Its row.
133
134/// @brief The operating-mode part of the status read DHW_STATUS_FPI1 / DHW_STATUS_FPI2 (its main parameter,
135/// the target, is decode_dhw_status_target()'s).
137 uint16_t capabilities{0}; ///< FP15: DHW_CAPABILITY_* bits.
138 bool boost{false}; ///< FP16 relaunch field (bits 8-9) is 1: a boost runs.
139 bool away{false}; ///< FP16 absence field (bits 10-11) is 1: the holiday mode is on.
140};
141
142// === Value shapes ===
143
144/// @brief Operating mode as register 0x0006 holds it.
145enum class DhwMode : uint8_t {
146 AUTO = 0, ///< The heater's automatic mode (its own schedule and target).
147 MANUAL_ECO_ON = 1, ///< Manual mode with ECO on (heat pump only).
148 MANUAL_ECO_OFF = 2, ///< Manual mode with ECO off (the electric element may help).
149};
150
151/// @brief What register 0x0021 says is heating.
153 bool heating{false}; ///< Byte 0: the heater is heating at all (heat pump, element or both).
154 bool element{false}; ///< Byte 2: the electric element is on (set during boost only).
155 bool heat_pump{false}; ///< Bytes 3 and 4: the heat pump runs (both were always set together).
156};
157
158/// @brief What the hub has read from a domestic hot water heater.
159///
160/// Every field starts as "not read" and is set only from a decoded reply, so a sensor never shows a value the
161/// heater did not report. Mirrors HeatingReadings for the radiator family.
163 float water_c{NAN}; ///< Water temperature (register 0x0017); NaN until read.
164 float target_c{NAN}; ///< Target temperature (status reply main parameter); NaN until read or when the
165 ///< main parameter is not a temperature.
166 int16_t mode{-1}; ///< DhwMode value; -1 until read.
167 int8_t heating{-1}; ///< DhwHeatingState::heating as 0/1; -1 until read.
168 int8_t element{-1}; ///< DhwHeatingState::element as 0/1; -1 until read.
169 int8_t heat_pump{-1}; ///< DhwHeatingState::heat_pump as 0/1; -1 until read.
170 int32_t capabilities{-1}; ///< FP15 operating-mode capabilities (DHW_CAPABILITY_*); -1 until read.
171 int8_t boost{-1}; ///< Boost on (1) or off (0) as FP16 reports it; -1 until read.
172 int8_t away{-1}; ///< Away on (1) or off (0) as FP16 reports it; -1 until read.
173 int16_t boost_duration{-1}; ///< Register 0x0000; -1 until read. Logged, never a state.
174 int16_t away_duration{-1}; ///< Register 0x0005; -1 until read. Logged, never a state.
175 int64_t energy_wh{-1}; ///< Energy since installation in Wh; -1 until read.
176 int16_t brand{-1}; ///< Brand letter (register 0x0007); -1 until read.
177};
178
179// === Requests ===
180
181/// @brief Encode a read of one family-0x00 register: `0C 60 00 <index>`.
182/// @param index Low byte of the register number.
183/// @param out Output buffer of HEATING_PAYLOAD_MAX_SIZE bytes.
184/// @return Always 4.
185size_t encode_dhw_register_read(uint8_t index, uint8_t out[HEATING_PAYLOAD_MAX_SIZE]);
186
187/// @brief Encode a write of the operating mode: `0C 61 00 06 <mode>`.
188/// @details Only the three values the heater has reported (DhwMode) are encoded; anything else is refused, so
189/// a byte the heater has never shown is never written to it.
190/// @param mode Mode value.
191/// @param out Output buffer of HEATING_PAYLOAD_MAX_SIZE bytes.
192/// @return 5, or 0 for a value other than 0, 1 or 2.
193size_t encode_dhw_mode_write(uint8_t mode, uint8_t out[HEATING_PAYLOAD_MAX_SIZE]);
194
195/// @brief Encode the duration write a start of `which` sends before its FP16 EXECUTE: `0C 61 00 00 01` for
196/// boost (DHW_BOOST_START_DURATION), `0C 61 00 05 FF` for away (DHW_AWAY_UNTIL_TURNED_OFF).
197/// @details The heater has been seen to ignore the boost duration on its own; the write is part of the
198/// sequence so its acknowledgement shows what the heater keeps.
199/// \todo Experimental: confirm on the heater what these durations do (issue #198).
200/// @param which Boost or away.
201/// @param out Output buffer of HEATING_PAYLOAD_MAX_SIZE bytes.
202/// @return Always 5.
204
205/// @brief Encode a target temperature as a main parameter over DHW_TARGET_MIN_C..DHW_TARGET_MAX_C.
206/// @param celsius Target; must be finite and within the range (nothing outside it is ever sent).
207/// @param[out] main_parameter The encoded value; untouched when false is returned.
208/// @return false for a non-finite or out-of-range target.
209bool encode_dhw_target(float celsius, uint16_t &main_parameter);
210
211// === Replies ===
212
213/// @brief The value bytes of a reply to a family-0x00 register read.
214/// @details Accepts a CMD_WRITE_PRIVATE_ACK whose data starts with `0C 60 00 <index>` (or `0C 61 00 <index>`,
215/// the ack of a write). The value may be empty: the heater answers an index it does not hold so.
216/// @param reply The heater's reply.
217/// @param index The register the request addressed.
218/// @param[out] value First value byte (inside `reply`); untouched when false is returned.
219/// @param[out] len Number of value bytes; untouched when false is returned.
220/// @return false for another command, another register or another family.
221bool decode_dhw_register_reply(const IoFrame &reply, uint8_t index, const uint8_t *&value, size_t &len);
222
223/// @brief Water temperature from the value of register 0x0017: signed 16-bit big-endian tenths.
224/// @param value Value bytes.
225/// @param len Number of value bytes; at least 2.
226/// @param[out] celsius Temperature; untouched when false is returned.
227/// @return false for a value shorter than two bytes.
228bool decode_dhw_water_temperature(const uint8_t *value, size_t len, float &celsius);
229
230/// @brief Operating mode from the value of register 0x0006.
231/// @param value Value bytes.
232/// @param len Number of value bytes; at least 1.
233/// @param[out] mode The mode; untouched when false is returned.
234/// @return false for an empty value or a byte other than 0, 1 or 2.
235bool decode_dhw_mode(const uint8_t *value, size_t len, DhwMode &mode);
236
237/// @brief What is heating, from the value of register 0x0021.
238/// @param value Value bytes.
239/// @param len Number of value bytes; at least 5.
240/// @param[out] state The decoded state; untouched when false is returned.
241/// @return false for a value shorter than five bytes.
242bool decode_dhw_heating_state(const uint8_t *value, size_t len, DhwHeatingState &state);
243
244/// @brief Energy since installation from the value of register 0x0004: unsigned 32-bit big-endian, Wh.
245/// @param value Value bytes.
246/// @param len Number of value bytes; at least 4.
247/// @param[out] wh Energy in Wh; untouched when false is returned.
248/// @return false for a value shorter than four bytes.
249bool decode_dhw_energy_wh(const uint8_t *value, size_t len, uint32_t &wh);
250
251/// @brief A duration from the value of register 0x0000 or 0x0005: one byte.
252/// @param value Value bytes.
253/// @param len Number of value bytes; at least 1.
254/// @param[out] duration The byte; untouched when false is returned.
255/// @return false for an empty value.
256bool decode_dhw_duration(const uint8_t *value, size_t len, uint8_t &duration);
257
258/// @brief Target temperature from a main parameter.
259/// @param main_parameter The main parameter as the status reply carries it.
260/// @param[out] celsius Target, rounded to a tenth of a degree; untouched when false is returned.
261/// @return false for a main parameter beyond 0xC800 (an alias such as 0xD8xx is not a temperature).
262bool decode_dhw_target(uint16_t main_parameter, float &celsius);
263
264/// @brief Target temperature from a status reply (CMD_PRIVATE_RESP) of a domestic hot water heater.
265/// @param reply The heater's reply to a status read.
266/// @param[out] celsius Target; untouched when false is returned.
267/// @return false for another command, a reply too short to carry the main parameter, or a main parameter
268/// that is not a temperature.
269bool decode_dhw_status_target(const IoFrame &reply, float &celsius);
270
271/// @brief Capabilities and operating-mode state from the reply to the status read
272/// DHW_STATUS_FPI1 / DHW_STATUS_FPI2.
273/// @details Layout of the data: `[status][b1][MP 2][FPI1][FPI2][one 2-byte value per FPI2 bit, bit 7 first]`.
274/// The echo must carry FPI1 `00` and both the FP15 and FP16 bits; other bits (the heater echoes FP10
275/// when asked for `43`) are skipped. The main parameter is left to decode_dhw_status_target().
276/// @param reply The heater's reply to the status read.
277/// @param[out] status The decoded fields; untouched when false is returned.
278/// @return false for another command, a reply too short for the values its echo announces, an FPI1 echo other
279/// than `00`, or an FPI2 echo without FP15 or FP16.
280bool decode_dhw_operating_status(const IoFrame &reply, DhwOperatingStatus &status);
281
282} // namespace home_io_control
283} // namespace esphome
static constexpr uint16_t DHW_OPERATING_MODE_AWAY_ON
FP16 that starts away (holiday) and ends a boost.
Definition proto_dhw.h:95
bool decode_dhw_mode(const uint8_t *value, size_t len, DhwMode &mode)
Operating mode from the value of register 0x0006.
static constexpr uint8_t DHW_REG_MODE
Register 0x0006: operating mode (DhwMode), one byte. Followed the display in every run.
Definition proto_dhw.h:68
constexpr size_t HEATING_PAYLOAD_MAX_SIZE
Largest payload any function produces: a set of a 16-bit value (4-byte header + 2 value bytes).
static constexpr uint8_t DHW_STATUS_MAIN_PARAMETER_OFFSET
Offset of the main parameter (MSB) in the data of a status reply (CMD_PRIVATE_RESP): the target slot ...
Definition proto_dhw.h:86
DhwMode
Operating mode as register 0x0006 holds it.
Definition proto_dhw.h:145
@ MANUAL_ECO_ON
Manual mode with ECO on (heat pump only).
Definition proto_dhw.h:147
@ MANUAL_ECO_OFF
Manual mode with ECO off (the electric element may help).
Definition proto_dhw.h:148
@ AUTO
The heater's automatic mode (its own schedule and target).
Definition proto_dhw.h:146
static constexpr uint8_t DHW_FP_OPERATING_MODE
Functional parameter that carries the operating-mode word (DHW_OPERATING_MODE_*).
Definition proto_dhw.h:101
static constexpr uint8_t DHW_REG_WATER_TEMPERATURE
Register 0x0017: water temperature, signed 16-bit big-endian tenths of a degree in the first two valu...
Definition proto_dhw.h:73
static constexpr uint8_t DHW_REG_BRAND
Register 0x0007: one ASCII letter naming the brand (41 = 'A' on the Calypso).
Definition proto_dhw.h:70
bool decode_dhw_heating_state(const uint8_t *value, size_t len, DhwHeatingState &state)
What is heating, from the value of register 0x0021.
DhwOperatingFeature
The two features the operating-mode word switches; dhw_operating_feature_wire() holds their wire fact...
Definition proto_dhw.h:115
static constexpr uint8_t DHW_REG_ENERGY
Register 0x0004: energy consumed since the heater was installed, 32-bit big-endian,...
Definition proto_dhw.h:66
static constexpr uint8_t DHW_STATUS_FPI2
Status-read FPI2 (43): FP10, FP15 and FP16.
Definition proto_dhw.h:107
static constexpr uint16_t DHW_OPERATING_MODE_OFF
FP16 that ends a boost and ends away: both fields off.
Definition proto_dhw.h:93
bool encode_dhw_target(float celsius, uint16_t &main_parameter)
Encode a target temperature as a main parameter over DHW_TARGET_MIN_C..DHW_TARGET_MAX_C.
Definition proto_dhw.cpp:97
static constexpr uint16_t DHW_CAPABILITY_AWAY
FP15 bit 2: the heater supports away (absence).
Definition proto_dhw.h:110
static constexpr uint8_t DHW_REG_BOOST_DURATION
Register 0x0000: boost duration, one byte.
Definition proto_dhw.h:53
static constexpr float DHW_TARGET_MIN_C
Lower end of the target-temperature scale: main parameter 0 is 20 C.
Definition proto_dhw.h:80
static constexpr uint8_t DHW_FP_ALSO_ASKED
Functional parameter 10: no decision uses it; the status read asks for it so the read is exactly the ...
Definition proto_dhw.h:104
static constexpr float DHW_TARGET_MAX_C
Upper end of the target-temperature scale: main parameter 0xC800 is 62 C, the highest target the Caly...
Definition proto_dhw.h:83
bool decode_dhw_operating_status(const IoFrame &reply, DhwOperatingStatus &status)
Capabilities and operating-mode state from the reply to the status read DHW_STATUS_FPI1 / DHW_STATUS_...
static constexpr uint8_t DHW_AWAY_UNTIL_TURNED_OFF
Duration an away start writes to register 0x0005: 255, which the heater itself holds for a holiday wi...
Definition proto_dhw.h:63
bool decode_dhw_water_temperature(const uint8_t *value, size_t len, float &celsius)
Water temperature from the value of register 0x0017: signed 16-bit big-endian tenths.
size_t encode_dhw_register_read(uint8_t index, uint8_t out[HEATING_PAYLOAD_MAX_SIZE])
Encode a read of one family-0x00 register: 0C 60 00 <index>.
Definition proto_dhw.cpp:78
static constexpr uint8_t DHW_BOOST_START_DURATION
Duration a boost start writes to register 0x0000: the value read during a boost started on the displa...
Definition proto_dhw.h:60
bool decode_dhw_energy_wh(const uint8_t *value, size_t len, uint32_t &wh)
Energy since installation from the value of register 0x0004: unsigned 32-bit big-endian,...
static constexpr uint16_t DHW_OPERATING_MODE_BOOST_ON
FP16 that starts a boost and ends away. Bit 14 is set as the heater reports it.
Definition proto_dhw.h:91
static constexpr uint8_t DHW_FP_CAPABILITIES
Functional parameter that carries the operating-mode capabilities (DHW_CAPABILITY_* bits).
Definition proto_dhw.h:99
constexpr uint8_t fp_bitmap_bit(uint8_t fp)
Bit of functional parameter fp (1-16) in its bitmap: FPI1 holds FP1-FP8 and FPI2 FP9-FP16,...
static constexpr uint8_t DHW_REGISTER_HIGH_BYTE
High byte of every register of a domestic hot water heater (family 0x00).
Definition proto_dhw.h:49
static constexpr uint8_t DHW_REG_AWAY_DURATION
Register 0x0005: away (holiday) duration, one byte: the days the holiday still runs.
Definition proto_dhw.h:57
size_t encode_dhw_duration_write(DhwOperatingFeature which, uint8_t out[HEATING_PAYLOAD_MAX_SIZE])
Encode the duration write a start of which sends before its FP16 EXECUTE: 0C 61 00 00 01 for boost (D...
Definition proto_dhw.cpp:92
bool decode_dhw_register_reply(const IoFrame &reply, uint8_t index, const uint8_t *&value, size_t &len)
The value bytes of a reply to a family-0x00 register read.
static constexpr uint8_t DHW_REG_HEATING
Register 0x0021: what is heating, eight bytes (DhwHeatingState).
Definition proto_dhw.h:75
static constexpr uint8_t DHW_STATUS_FPI1
Status-read FPI1 that asks for no FP1-FP8 (the heater holds none of them).
Definition proto_dhw.h:97
bool decode_dhw_target(uint16_t main_parameter, float &celsius)
Target temperature from a main parameter.
size_t encode_dhw_mode_write(uint8_t mode, uint8_t out[HEATING_PAYLOAD_MAX_SIZE])
Encode a write of the operating mode: 0C 61 00 06 <mode>.
Definition proto_dhw.cpp:82
const DhwOperatingFeatureWire & dhw_operating_feature_wire(DhwOperatingFeature which)
The wire facts of which: the one place each feature's FP15 bit, FP16 field and duration live.
Definition proto_dhw.cpp:88
bool decode_dhw_status_target(const IoFrame &reply, float &celsius)
Target temperature from a status reply (CMD_PRIVATE_RESP) of a domestic hot water heater.
static constexpr uint16_t DHW_CAPABILITY_BOOST
FP15 bit 3: the heater supports boost (relaunch).
Definition proto_dhw.h:112
bool decode_dhw_duration(const uint8_t *value, size_t len, uint8_t &duration)
A duration from the value of register 0x0000 or 0x0005: one byte.
IO-Homecontrol command IDs, result codes and protocol enumerations.
IO-Homecontrol 2W frame container: control bytes, IoFrame and (de)serialization.
Pure codec for the private register protocol of 2W heaters (CMD_WRITE_PRIVATE 0x20).
What register 0x0021 says is heating.
Definition proto_dhw.h:152
bool heat_pump
Bytes 3 and 4: the heat pump runs (both were always set together).
Definition proto_dhw.h:155
bool element
Byte 2: the electric element is on (set during boost only).
Definition proto_dhw.h:154
bool heating
Byte 0: the heater is heating at all (heat pump, element or both).
Definition proto_dhw.h:153
The wire facts of one DhwOperatingFeature: what FP15, FP16 and the duration registers say about it.
Definition proto_dhw.h:121
uint16_t capability
FP15 bit that says the heater supports it (DHW_CAPABILITY_*).
Definition proto_dhw.h:122
uint8_t start_duration
Duration a start writes before the FP16 EXECUTE.
Definition proto_dhw.h:126
uint8_t fp16_shift
Lowest bit of its two-bit FP16 field (0 keep, 1 on, 2 off).
Definition proto_dhw.h:123
uint8_t duration_register
Register that holds its duration (DHW_REG_*_DURATION).
Definition proto_dhw.h:125
uint16_t on_word
FP16 that starts it and ends the other (DHW_OPERATING_MODE_*_ON).
Definition proto_dhw.h:124
The operating-mode part of the status read DHW_STATUS_FPI1 / DHW_STATUS_FPI2 (its main parameter,...
Definition proto_dhw.h:136
bool boost
FP16 relaunch field (bits 8-9) is 1: a boost runs.
Definition proto_dhw.h:138
bool away
FP16 absence field (bits 10-11) is 1: the holiday mode is on.
Definition proto_dhw.h:139
uint16_t capabilities
FP15: DHW_CAPABILITY_* bits.
Definition proto_dhw.h:137
What the hub has read from a domestic hot water heater.
Definition proto_dhw.h:162
int64_t energy_wh
Energy since installation in Wh; -1 until read.
Definition proto_dhw.h:175
int16_t boost_duration
Register 0x0000; -1 until read. Logged, never a state.
Definition proto_dhw.h:173
int16_t brand
Brand letter (register 0x0007); -1 until read.
Definition proto_dhw.h:176
int32_t capabilities
FP15 operating-mode capabilities (DHW_CAPABILITY_*); -1 until read.
Definition proto_dhw.h:170
float target_c
Target temperature (status reply main parameter); NaN until read or when the main parameter is not a ...
Definition proto_dhw.h:164
int8_t heating
DhwHeatingState::heating as 0/1; -1 until read.
Definition proto_dhw.h:167
int8_t boost
Boost on (1) or off (0) as FP16 reports it; -1 until read.
Definition proto_dhw.h:171
int16_t mode
DhwMode value; -1 until read.
Definition proto_dhw.h:166
int8_t element
DhwHeatingState::element as 0/1; -1 until read.
Definition proto_dhw.h:168
int8_t away
Away on (1) or off (0) as FP16 reports it; -1 until read.
Definition proto_dhw.h:172
int8_t heat_pump
DhwHeatingState::heat_pump as 0/1; -1 until read.
Definition proto_dhw.h:169
int16_t away_duration
Register 0x0005; -1 until read. Logged, never a state.
Definition proto_dhw.h:174
float water_c
Water temperature (register 0x0017); NaN until read.
Definition proto_dhw.h:163