ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
esphome::haier_water_heater::water_heater_protocol Namespace Reference

Data Structures

struct  Command
 
class  FrameParser
 
struct  Status
 

Enumerations

enum class  FrameType : uint8_t {
  FRAME_TYPE_CONTROL = 0x01 , FRAME_TYPE_STATUS = 0x02 , FRAME_TYPE_INVALID = 0x03 , FRAME_TYPE_CONFIRM = 0x05 ,
  FRAME_TYPE_REPORT = 0x06 , FRAME_TYPE_GET_VERSION = 0x61 , FRAME_TYPE_VERSION = 0x62 , FRAME_TYPE_GET_DEVICE_ID = 0x70 ,
  FRAME_TYPE_DEVICE_ID = 0x71 , FRAME_TYPE_GET_NETWORK_STATUS = 0xF0 , FRAME_TYPE_NETWORK_STATUS = 0xF7
}
 
enum class  HonMode : uint8_t { HON_MODE_UNKNOWN , HON_MODE_NORMAL , HON_MODE_ECO , HON_MODE_BPS }
 
enum class  Parameter : uint8_t { PARAMETER_POWER = 0x01 , PARAMETER_TARGET_TEMPERATURE = 0x02 , PARAMETER_ECO = 0x05 , PARAMETER_BPS = 0x17 }
 

Functions

size_t encode_frame (FrameType type, const uint8_t *payload, size_t size, uint8_t *wire)
 Writes a clear-text frame with up to MAX_PAYLOAD bytes of payload into wire, which must hold MAX_WIRE_FRAME bytes.
 
HonMode decode_mode (const uint8_t *payload)
 
bool decode_status (const uint8_t *frame, size_t size, Status &status)
 Decodes a status report or a polled status; false for any other frame or an implausible one.
 
void encode_control (const Command &command, uint8_t *payload)
 Fills the four-byte control payload for a command.
 
bool command_confirmed (const Command &command, const Status &status)
 True when a status shows that the command took effect.
 

Enumeration Type Documentation

◆ FrameType

Enumerator
FRAME_TYPE_CONTROL 
FRAME_TYPE_STATUS 
FRAME_TYPE_INVALID 
FRAME_TYPE_CONFIRM 
FRAME_TYPE_REPORT 
FRAME_TYPE_GET_VERSION 
FRAME_TYPE_VERSION 
FRAME_TYPE_GET_DEVICE_ID 
FRAME_TYPE_DEVICE_ID 
FRAME_TYPE_GET_NETWORK_STATUS 
FRAME_TYPE_NETWORK_STATUS 

Definition at line 27 of file hon_parser.h.

◆ HonMode

Enumerator
HON_MODE_UNKNOWN 
HON_MODE_NORMAL 
HON_MODE_ECO 
HON_MODE_BPS 

Definition at line 165 of file hon_parser.h.

◆ Parameter

Enumerator
PARAMETER_POWER 
PARAMETER_TARGET_TEMPERATURE 
PARAMETER_ECO 
PARAMETER_BPS 

Definition at line 226 of file hon_parser.h.

Function Documentation

◆ command_confirmed()

bool esphome::haier_water_heater::water_heater_protocol::command_confirmed ( const Command & command,
const Status & status )
inline

True when a status shows that the command took effect.

Definition at line 248 of file hon_parser.h.

◆ decode_mode()

HonMode esphome::haier_water_heater::water_heater_protocol::decode_mode ( const uint8_t * payload)
inline

Definition at line 183 of file hon_parser.h.

◆ decode_status()

bool esphome::haier_water_heater::water_heater_protocol::decode_status ( const uint8_t * frame,
size_t size,
Status & status )
inline

Decodes a status report or a polled status; false for any other frame or an implausible one.

Offsets are into the payload, which starts with 6D 01, as captured from a VH3W. The secondary temperature's physical location and the heating time's unit (assumed minutes) are unconfirmed. Available water is 0 to 3 segments of usable hot water, not the tank fill level.

Definition at line 202 of file hon_parser.h.

◆ encode_control()

void esphome::haier_water_heater::water_heater_protocol::encode_control ( const Command & command,
uint8_t * payload )
inline

Fills the four-byte control payload for a command.

Definition at line 240 of file hon_parser.h.

◆ encode_frame()

size_t esphome::haier_water_heater::water_heater_protocol::encode_frame ( FrameType type,
const uint8_t * payload,
size_t size,
uint8_t * wire )
inline

Writes a clear-text frame with up to MAX_PAYLOAD bytes of payload into wire, which must hold MAX_WIRE_FRAME bytes.

Returns the number of bytes written, or 0 when the payload is too long.

Definition at line 137 of file hon_parser.h.