Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
proto_dhw.h File Reference

Pure codec for a domestic hot water heater: its family-0x00 registers and its target temperature. More...

#include "proto_constants.h"
#include "proto_frame.h"
#include "proto_heating.h"
#include <cmath>
#include <cstddef>
#include <cstdint>
Include dependency graph for proto_dhw.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  esphome::home_io_control::DhwOperatingFeatureWire
 The wire facts of one DhwOperatingFeature: what FP15, FP16 and the duration registers say about it. More...
struct  esphome::home_io_control::DhwOperatingStatus
 The operating-mode part of the status read DHW_STATUS_FPI1 / DHW_STATUS_FPI2 (its main parameter, the target, is decode_dhw_status_target()'s). More...
struct  esphome::home_io_control::DhwHeatingState
 What register 0x0021 says is heating. More...
struct  esphome::home_io_control::DhwReadings
 What the hub has read from a domestic hot water heater. More...

Namespaces

namespace  esphome
namespace  esphome::home_io_control

Enumerations

enum class  esphome::home_io_control::DhwOperatingFeature : uint8_t { esphome::home_io_control::BOOST , esphome::home_io_control::AWAY }
 The two features the operating-mode word switches; dhw_operating_feature_wire() holds their wire facts. More...
enum class  esphome::home_io_control::DhwMode : uint8_t { esphome::home_io_control::AUTO = 0 , esphome::home_io_control::MANUAL_ECO_ON = 1 , esphome::home_io_control::MANUAL_ECO_OFF = 2 }
 Operating mode as register 0x0006 holds it. More...

Functions

const DhwOperatingFeatureWire & esphome::home_io_control::dhw_operating_feature_wire (DhwOperatingFeature which)
 The wire facts of which: the one place each feature's FP15 bit, FP16 field and duration live.
size_t esphome::home_io_control::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>.
size_t esphome::home_io_control::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>.
size_t esphome::home_io_control::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 (DHW_BOOST_START_DURATION), 0C 61 00 05 FF for away (DHW_AWAY_UNTIL_TURNED_OFF).
bool esphome::home_io_control::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.
bool esphome::home_io_control::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.
bool esphome::home_io_control::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.
bool esphome::home_io_control::decode_dhw_mode (const uint8_t *value, size_t len, DhwMode &mode)
 Operating mode from the value of register 0x0006.
bool esphome::home_io_control::decode_dhw_heating_state (const uint8_t *value, size_t len, DhwHeatingState &state)
 What is heating, from the value of register 0x0021.
bool esphome::home_io_control::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, Wh.
bool esphome::home_io_control::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.
bool esphome::home_io_control::decode_dhw_target (uint16_t main_parameter, float &celsius)
 Target temperature from a main parameter.
bool esphome::home_io_control::decode_dhw_status_target (const IoFrame &reply, float &celsius)
 Target temperature from a status reply (CMD_PRIVATE_RESP) of a domestic hot water heater.
bool esphome::home_io_control::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_FPI2.

Variables

static constexpr uint8_t esphome::home_io_control::DHW_REGISTER_HIGH_BYTE = 0x00
 High byte of every register of a domestic hot water heater (family 0x00).
static constexpr uint8_t esphome::home_io_control::DHW_REG_BOOST_DURATION = 0x00
 Register 0x0000: boost duration, one byte.
static constexpr uint8_t esphome::home_io_control::DHW_REG_AWAY_DURATION = 0x05
 Register 0x0005: away (holiday) duration, one byte: the days the holiday still runs.
static constexpr uint8_t esphome::home_io_control::DHW_BOOST_START_DURATION = 1
 Duration a boost start writes to register 0x0000: the value read during a boost started on the display, the only non-zero value seen.
static constexpr uint8_t esphome::home_io_control::DHW_AWAY_UNTIL_TURNED_OFF = 255
 Duration an away start writes to register 0x0005: 255, which the heater itself holds for a holiday with no end date (issue #198), as Home Assistant's away mode (no end date) means.
static constexpr uint8_t esphome::home_io_control::DHW_REG_ENERGY = 0x04
 Register 0x0004: energy consumed since the heater was installed, 32-bit big-endian, Wh.
static constexpr uint8_t esphome::home_io_control::DHW_REG_MODE = 0x06
 Register 0x0006: operating mode (DhwMode), one byte. Followed the display in every run.
static constexpr uint8_t esphome::home_io_control::DHW_REG_BRAND = 0x07
 Register 0x0007: one ASCII letter naming the brand (41 = 'A' on the Calypso).
static constexpr uint8_t esphome::home_io_control::DHW_REG_WATER_TEMPERATURE = 0x17
 Register 0x0017: water temperature, signed 16-bit big-endian tenths of a degree in the first two value bytes.
static constexpr uint8_t esphome::home_io_control::DHW_REG_HEATING = 0x21
 Register 0x0021: what is heating, eight bytes (DhwHeatingState).
static constexpr float esphome::home_io_control::DHW_TARGET_MIN_C = 20.0F
 Lower end of the target-temperature scale: main parameter 0 is 20 C.
static constexpr float esphome::home_io_control::DHW_TARGET_MAX_C = 62.0F
 Upper end of the target-temperature scale: main parameter 0xC800 is 62 C, the highest target the Calypso's display offers.
static constexpr uint8_t esphome::home_io_control::DHW_STATUS_MAIN_PARAMETER_OFFSET = 2
 Offset of the main parameter (MSB) in the data of a status reply (CMD_PRIVATE_RESP): the target slot of a cover's reply.
static constexpr uint16_t esphome::home_io_control::DHW_OPERATING_MODE_BOOST_ON = 0x4900
 FP16 that starts a boost and ends away. Bit 14 is set as the heater reports it.
static constexpr uint16_t esphome::home_io_control::DHW_OPERATING_MODE_OFF = 0x4A00
 FP16 that ends a boost and ends away: both fields off.
static constexpr uint16_t esphome::home_io_control::DHW_OPERATING_MODE_AWAY_ON = 0x4600
 FP16 that starts away (holiday) and ends a boost.
static constexpr uint8_t esphome::home_io_control::DHW_STATUS_FPI1 = 0x00
 Status-read FPI1 that asks for no FP1-FP8 (the heater holds none of them).
static constexpr uint8_t esphome::home_io_control::DHW_FP_CAPABILITIES = 15
 Functional parameter that carries the operating-mode capabilities (DHW_CAPABILITY_* bits).
static constexpr uint8_t esphome::home_io_control::DHW_FP_OPERATING_MODE = 16
 Functional parameter that carries the operating-mode word (DHW_OPERATING_MODE_*).
static constexpr uint8_t esphome::home_io_control::DHW_FP_ALSO_ASKED = 10
 Functional parameter 10: no decision uses it; the status read asks for it so the read is exactly the one the heater has been seen answering (FPI2 43, issue #198).
static constexpr uint8_t esphome::home_io_control::DHW_STATUS_FPI2
 Status-read FPI2 (43): FP10, FP15 and FP16.
static constexpr uint16_t esphome::home_io_control::DHW_CAPABILITY_AWAY = 1U << 2U
 FP15 bit 2: the heater supports away (absence).
static constexpr uint16_t esphome::home_io_control::DHW_CAPABILITY_BOOST = 1U << 3U
 FP15 bit 3: the heater supports boost (relaunch).

Detailed Description

Pure codec for a domestic hot water heater: its family-0x00 registers and its target temperature.

A domestic hot water heater (node type 51, subtype 0) answers the private register reads a heater answers, 0C 60 00 <index> in a CMD_WRITE_PRIVATE (0x20), with a CMD_WRITE_PRIVATE_ACK (0x21) that echoes the four header bytes and then the value. Its registers sit in family 0x00 (the high byte of the register number) and their multi-byte values are big-endian, where the radiator family 0x01 of proto_heating.h is little-endian; so this is a codec of its own, not a flag on the heater's. An index the heater does not hold is answered with no value bytes.

Its target temperature is not a register: it is the main parameter of a status reply, on the ordinary relative scale (0..0xC800) over DHW_TARGET_MIN_C..DHW_TARGET_MAX_C. Three replies pin it: 54 C reads A1E8, 62 C reads C800, and AUTO reads BE7A = 60.0 C.

Every reading here comes from one Atlantic Calypso Connecte (200 L) whose owner read each register in several display states (issue #198; corpus tests/corpus/captures/exchange/atlantic_calypso_exchange_register_read.yaml and tests/corpus/captures/probe/atlantic_calypso_probe_status_mp_fp.yaml, pinned by corpus_dhw_test.cpp).

The mode write (0C 61 00 06 <mode>) and the target EXECUTE are confirmed by the owner of that heater: its display follows both (issue #198). No reply to either is in the corpus yet.

Boost and away travel in the operating-mode word, functional parameter 16, not in a register (ADR 0081): one EXECUTE with the main parameter MAIN_PARAMETER_KEEP and one of three fixed FP16 values. The heater reports its capabilities (FP15) and the current word (FP16) in the status read DHW_STATUS_FPI1 / DHW_STATUS_FPI2 (corpus tests/corpus/captures/probe/atlantic_calypso_probe_status_fp_high.yaml). Registers 0x0000 and 0x0005 hold the boost and away durations; a write of a duration alone starts nothing.

Todo
Experimental: confirm on a real water heater that the three FP16 values start and end a boost and the holiday mode (issue #198).

Definition in file proto_dhw.h.