Identified Aircon messages.
This commit is contained in:
parent
176a8e0735
commit
8d290fc13c
@ -109,7 +109,7 @@ void LinBusProtocol::lin_msg_diag_single_(const u_int8_t *message, u_int8_t leng
|
|||||||
// - 0x00 - response lin_identifier[0:4] + 0x00 /* Hardware revision*/
|
// - 0x00 - response lin_identifier[0:4] + 0x00 /* Hardware revision*/
|
||||||
// my_node_address:
|
// my_node_address:
|
||||||
// - 0x20 - displayed version
|
// - 0x20 - displayed version
|
||||||
// - 0x22 - unkown
|
// - 0x22 - unknown
|
||||||
auto identifier = message[3];
|
auto identifier = message[3];
|
||||||
std::array<u_int8_t, 8> response = this->lin_empty_response_;
|
std::array<u_int8_t, 8> response = this->lin_empty_response_;
|
||||||
response[0] = this->lin_node_address_;
|
response[0] = this->lin_node_address_;
|
||||||
|
|||||||
@ -49,9 +49,9 @@ void TrumaiNetBoxApp::update() {
|
|||||||
|
|
||||||
const std::array<uint8_t, 4> TrumaiNetBoxApp::lin_identifier() {
|
const std::array<uint8_t, 4> TrumaiNetBoxApp::lin_identifier() {
|
||||||
// Supplier Id: 0x4617 - Truma (Phone: +49 (0)89 4617-0)
|
// Supplier Id: 0x4617 - Truma (Phone: +49 (0)89 4617-0)
|
||||||
// Unkown:
|
// Unknown:
|
||||||
// 17.46.01.03 - Unkown more comms required for init.
|
// 17.46.01.03 - Unknown more comms required for init.
|
||||||
// 17.46.10.03 - Unkown more comms required for init.
|
// 17.46.10.03 - Unknown more comms required for init.
|
||||||
// Heater:
|
// Heater:
|
||||||
// 17.46.40.03 - H2.00.01 - 0340.xx Combi 4/6
|
// 17.46.40.03 - H2.00.01 - 0340.xx Combi 4/6
|
||||||
// Aircon:
|
// Aircon:
|
||||||
@ -203,10 +203,10 @@ bool TrumaiNetBoxApp::lin_read_field_by_identifier_(u_int8_t identifier, std::ar
|
|||||||
(*response)[0] = lin_identifier[0];
|
(*response)[0] = lin_identifier[0];
|
||||||
(*response)[1] = lin_identifier[1];
|
(*response)[1] = lin_identifier[1];
|
||||||
(*response)[2] = lin_identifier[2];
|
(*response)[2] = lin_identifier[2];
|
||||||
// (*response)[3] = // unkown
|
// (*response)[3] = // unknown
|
||||||
// (*response)[4] = // unkown
|
// (*response)[4] = // unknown
|
||||||
return true;
|
return true;
|
||||||
} else if (identifier == 0x22 /* unkown usage */) {
|
} else if (identifier == 0x22 /* unknown usage */) {
|
||||||
// Init is failing if missing
|
// Init is failing if missing
|
||||||
// Data can be anything?
|
// Data can be anything?
|
||||||
return true;
|
return true;
|
||||||
@ -310,6 +310,17 @@ const u_int8_t *TrumaiNetBoxApp::lin_multiframe_recieved(const u_int8_t *message
|
|||||||
|
|
||||||
this->update_status_heater_stale_ = false;
|
this->update_status_heater_stale_ = false;
|
||||||
return response;
|
return response;
|
||||||
|
} else if (header->message_type == STATUS_FRAME_AIRCON && header->message_length == sizeof(StatusFrameAircon)) {
|
||||||
|
ESP_LOGI(TAG, "StatusFrameAircon");
|
||||||
|
// Example:
|
||||||
|
// SID<---------PREAMBLE---------->|<---MSG_HEAD---->|
|
||||||
|
// BB.00.1F.00.1E.00.00.22.FF.FF.FF.54.01.12.35.00.AA.00.00.71.01.00.00.00.00.86.0B.00.00.00.00.00.00.AA.0A
|
||||||
|
this->status_aircon_ = statusFrame->inner.heater;
|
||||||
|
this->status_aircon_valid_ = true;
|
||||||
|
this->status_aircon_updated_ = true;
|
||||||
|
|
||||||
|
this->update_status_aircon_stale_ = false;
|
||||||
|
return response;
|
||||||
} else if (header->message_type == STATUS_FRAME_TIMER && header->message_length == sizeof(StatusFrameTimer)) {
|
} else if (header->message_type == STATUS_FRAME_TIMER && header->message_length == sizeof(StatusFrameTimer)) {
|
||||||
ESP_LOGI(TAG, "StatusFrameTimer");
|
ESP_LOGI(TAG, "StatusFrameTimer");
|
||||||
// EXAMPLE:
|
// EXAMPLE:
|
||||||
@ -398,20 +409,20 @@ const u_int8_t *TrumaiNetBoxApp::lin_multiframe_recieved(const u_int8_t *message
|
|||||||
|
|
||||||
ESP_LOGD(TAG, "StatusFrameDevice %d/%d - %d.%02d.%02d %04X.%02X (%02X %02X)", device.device_id + 1,
|
ESP_LOGD(TAG, "StatusFrameDevice %d/%d - %d.%02d.%02d %04X.%02X (%02X %02X)", device.device_id + 1,
|
||||||
device.device_count, device.software_revision[0], device.software_revision[1], device.software_revision[2],
|
device.device_count, device.software_revision[0], device.software_revision[1], device.software_revision[2],
|
||||||
device.hardware_revision_major, device.hardware_revision_minor, device.unkown_2, device.unkown_3);
|
device.hardware_revision_major, device.hardware_revision_minor, device.unknown_2, device.unknown_3);
|
||||||
|
|
||||||
const auto truma_device = static_cast<TRUMA_DEVICE>(device.software_revision[0]);
|
const auto truma_device = static_cast<TRUMA_DEVICE>(device.software_revision[0]);
|
||||||
{
|
{
|
||||||
bool found_unkown_value = false;
|
bool found_unknown_value = false;
|
||||||
if (device.unkown_0 != 0x01 || device.unkown_1 != 0x00)
|
if (device.unknown_0 != 0x01 || device.unknown_1 != 0x00)
|
||||||
found_unkown_value = true;
|
found_unknown_value = true;
|
||||||
if (truma_device != TRUMA_DEVICE::AIRCON_DEVICE && truma_device != TRUMA_DEVICE::HEATER_COMBI4 &&
|
if (truma_device != TRUMA_DEVICE::AIRCON_DEVICE && truma_device != TRUMA_DEVICE::HEATER_COMBI4 &&
|
||||||
truma_device != TRUMA_DEVICE::HEATER_VARIO && truma_device != TRUMA_DEVICE::CPPLUS_COMBI &&
|
truma_device != TRUMA_DEVICE::HEATER_VARIO && truma_device != TRUMA_DEVICE::CPPLUS_COMBI &&
|
||||||
truma_device != TRUMA_DEVICE::CPPLUS_VARIO && truma_device != TRUMA_DEVICE::HEATER_COMBI6D)
|
truma_device != TRUMA_DEVICE::CPPLUS_VARIO && truma_device != TRUMA_DEVICE::HEATER_COMBI6D)
|
||||||
found_unkown_value = true;
|
found_unknown_value = true;
|
||||||
|
|
||||||
if (found_unkown_value)
|
if (found_unknown_value)
|
||||||
ESP_LOGW(TAG, "Unkown information in StatusFrameDevice found. Please report.");
|
ESP_LOGW(TAG, "Unknown information in StatusFrameDevice found. Please report.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (truma_device == TRUMA_DEVICE::HEATER_COMBI4) {
|
if (truma_device == TRUMA_DEVICE::HEATER_COMBI4) {
|
||||||
@ -428,7 +439,7 @@ const u_int8_t *TrumaiNetBoxApp::lin_multiframe_recieved(const u_int8_t *message
|
|||||||
|
|
||||||
return response;
|
return response;
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGW(TAG, "Unkown message type %02X", header->message_type);
|
ESP_LOGW(TAG, "Unknown message type %02X", header->message_type);
|
||||||
}
|
}
|
||||||
(*return_len) = 0;
|
(*return_len) = 0;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
@ -32,16 +32,16 @@ namespace truma_inetbox {
|
|||||||
#define STAUTS_FRAME_CONFIG 0x17
|
#define STAUTS_FRAME_CONFIG 0x17
|
||||||
#define STATUS_FRAME_HEATER_RESPONSE (STATUS_FRAME_HEATER - 1)
|
#define STATUS_FRAME_HEATER_RESPONSE (STATUS_FRAME_HEATER - 1)
|
||||||
#define STATUS_FRAME_HEATER 0x33
|
#define STATUS_FRAME_HEATER 0x33
|
||||||
// Error response - unkown function
|
#define STATUS_FRAME_AIRCON_RESPONSE 0x34(STATUS_FRAME_AIRCON - 1)
|
||||||
#define STATUS_FRAME_UNKOWN_34 0x34
|
#define STATUS_FRAME_AIRCON 0x35
|
||||||
// Error response - unkown function
|
// Error response - unknown function
|
||||||
#define STATUS_FRAME_UNKOWN_36 0x36
|
#define STATUS_FRAME_UNKNOWN_36 0x36
|
||||||
#define STATUS_FRAME_TIMER_RESPONSE (STATUS_FRAME_TIMER - 1)
|
#define STATUS_FRAME_TIMER_RESPONSE (STATUS_FRAME_TIMER - 1)
|
||||||
#define STATUS_FRAME_TIMER 0x3D
|
#define STATUS_FRAME_TIMER 0x3D
|
||||||
// Error response - unkown function
|
// Error response - unknown function
|
||||||
#define STATUS_FRAME_UNKOWN_3E 0x3E
|
#define STATUS_FRAME_UNKNOWN_3E 0x3E
|
||||||
// Error response - unkown function
|
// Error response - unknown function
|
||||||
#define STATUS_FRAME_UNKOWN_40 0x40
|
#define STATUS_FRAME_UNKNOWN_40 0x40
|
||||||
|
|
||||||
enum class HeatingMode : u_int16_t {
|
enum class HeatingMode : u_int16_t {
|
||||||
HEATING_MODE_OFF = 0x0,
|
HEATING_MODE_OFF = 0x0,
|
||||||
@ -147,7 +147,7 @@ enum class Language : u_int8_t {
|
|||||||
enum class ResponseAckResult : u_int8_t {
|
enum class ResponseAckResult : u_int8_t {
|
||||||
RESPONSE_ACK_RESULT_OKAY = 0x0,
|
RESPONSE_ACK_RESULT_OKAY = 0x0,
|
||||||
RESPONSE_ACK_RESULT_ERROR_INVALID_MSG = 0x2,
|
RESPONSE_ACK_RESULT_ERROR_INVALID_MSG = 0x2,
|
||||||
// The response status frame `message_type` is unkown.
|
// The response status frame `message_type` is unknown.
|
||||||
RESPONSE_ACK_RESULT_ERROR_INVALID_ID = 0x3,
|
RESPONSE_ACK_RESULT_ERROR_INVALID_ID = 0x3,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -210,7 +210,7 @@ struct StatusFrameHeater { // NOLINT(altera-struct-pack-align)
|
|||||||
u_int16_t current_temp_room;
|
u_int16_t current_temp_room;
|
||||||
OperatingStatus operating_status;
|
OperatingStatus operating_status;
|
||||||
u_int16_t error_code;
|
u_int16_t error_code;
|
||||||
u_int8_t heater_unkown_2;
|
u_int8_t heater_unknown_2;
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
// Length 12 (0x0C)
|
// Length 12 (0x0C)
|
||||||
@ -226,6 +226,33 @@ struct StatusFrameHeaterResponse { // NOLINT(altera-struct-pack-align)
|
|||||||
EnergyMix energy_mix_b;
|
EnergyMix energy_mix_b;
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
|
// Length 18 (0x12)
|
||||||
|
// TODO
|
||||||
|
struct StatusFrameAircon { // NOLINT(altera-struct-pack-align)
|
||||||
|
u_int8_t unknown_01;
|
||||||
|
u_int8_t unknown_02;
|
||||||
|
u_int8_t unknown_03;
|
||||||
|
u_int8_t unknown_04;
|
||||||
|
u_int8_t unknown_05;
|
||||||
|
u_int8_t unknown_06;
|
||||||
|
u_int8_t unknown_07;
|
||||||
|
u_int8_t unknown_08;
|
||||||
|
u_int8_t unknown_09;
|
||||||
|
u_int8_t unknown_10;
|
||||||
|
u_int8_t unknown_11;
|
||||||
|
u_int8_t unknown_12;
|
||||||
|
u_int8_t unknown_13;
|
||||||
|
u_int8_t unknown_14;
|
||||||
|
u_int8_t unknown_15;
|
||||||
|
u_int8_t unknown_16;
|
||||||
|
u_int8_t unknown_17;
|
||||||
|
u_int8_t unknown_18;
|
||||||
|
} __attribute__((packed));
|
||||||
|
|
||||||
|
struct StatusFrameAirconResponse { // NOLINT(altera-struct-pack-align)
|
||||||
|
// TODO
|
||||||
|
} __attribute__((packed));
|
||||||
|
|
||||||
// Length 24 (0x18)
|
// Length 24 (0x18)
|
||||||
struct StatusFrameTimer { // NOLINT(altera-struct-pack-align)
|
struct StatusFrameTimer { // NOLINT(altera-struct-pack-align)
|
||||||
TargetTemp timer_target_temp_room;
|
TargetTemp timer_target_temp_room;
|
||||||
@ -270,7 +297,7 @@ struct StatusFrameTimerResponse { // NOLINT(altera-struct-pack-align)
|
|||||||
// Length 2 (0x02)
|
// Length 2 (0x02)
|
||||||
struct StatusFrameResponseAck { // NOLINT(altera-struct-pack-align)
|
struct StatusFrameResponseAck { // NOLINT(altera-struct-pack-align)
|
||||||
ResponseAckResult error_code;
|
ResponseAckResult error_code;
|
||||||
u_int8_t unkown;
|
u_int8_t unknown;
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
// Length 10 (0x0A)
|
// Length 10 (0x0A)
|
||||||
@ -294,18 +321,18 @@ struct StatusFrameConfig { // NOLINT(altera-struct-pack-align)
|
|||||||
// 0x01 .. 0x0A
|
// 0x01 .. 0x0A
|
||||||
u_int8_t display_brightness;
|
u_int8_t display_brightness;
|
||||||
Language language;
|
Language language;
|
||||||
u_int8_t unkown_2; // 0xB4
|
u_int8_t unknown_2; // 0xB4
|
||||||
u_int8_t unkown_3; // 0x0A
|
u_int8_t unknown_3; // 0x0A
|
||||||
TempOffset temp_offset;
|
TempOffset temp_offset;
|
||||||
u_int8_t unkown_5; // 0x0A
|
u_int8_t unknown_5; // 0x0A
|
||||||
OperatingUnits temp_units;
|
OperatingUnits temp_units;
|
||||||
u_int8_t unkown_6;
|
u_int8_t unknown_6;
|
||||||
u_int8_t unkown_7;
|
u_int8_t unknown_7;
|
||||||
u_int8_t unkown_8;
|
u_int8_t unknown_8;
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
enum class TRUMA_DEVICE : u_int8_t {
|
enum class TRUMA_DEVICE : u_int8_t {
|
||||||
UNKOWN = 0x00,
|
UNKNOWN = 0x00,
|
||||||
// Saphir Compact AC
|
// Saphir Compact AC
|
||||||
AIRCON_DEVICE = 0x01,
|
AIRCON_DEVICE = 0x01,
|
||||||
// Combi 4
|
// Combi 4
|
||||||
@ -325,9 +352,9 @@ struct StatusFrameDevice { // NOLINT(altera-struct-pack-align)
|
|||||||
u_int8_t device_count;
|
u_int8_t device_count;
|
||||||
u_int8_t device_id;
|
u_int8_t device_id;
|
||||||
// 0x01 - Maybe active or found
|
// 0x01 - Maybe active or found
|
||||||
u_int8_t unkown_0;
|
u_int8_t unknown_0;
|
||||||
// 0x00
|
// 0x00
|
||||||
u_int8_t unkown_1;
|
u_int8_t unknown_1;
|
||||||
u_int16_t hardware_revision_major;
|
u_int16_t hardware_revision_major;
|
||||||
u_int8_t hardware_revision_minor;
|
u_int8_t hardware_revision_minor;
|
||||||
// `software_revision[0].software_revision[1].software_revision[2]`
|
// `software_revision[0].software_revision[1].software_revision[2]`
|
||||||
@ -335,10 +362,10 @@ struct StatusFrameDevice { // NOLINT(altera-struct-pack-align)
|
|||||||
u_int8_t software_revision[3];
|
u_int8_t software_revision[3];
|
||||||
// 0xAD, 0x0B on CPplus with Combi4 or 0x66 on CPplus with Vario Heat Comfort ohne E
|
// 0xAD, 0x0B on CPplus with Combi4 or 0x66 on CPplus with Vario Heat Comfort ohne E
|
||||||
// 0x00 on Combi4, Vario Heat
|
// 0x00 on Combi4, Vario Heat
|
||||||
u_int8_t unkown_2;
|
u_int8_t unknown_2;
|
||||||
// 0x10, 0x12 on CPplus
|
// 0x10, 0x12 on CPplus
|
||||||
// 0x00 on Combi4, Vario Heat
|
// 0x00 on Combi4, Vario Heat
|
||||||
u_int8_t unkown_3;
|
u_int8_t unknown_3;
|
||||||
|
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
@ -443,7 +470,7 @@ class TrumaiNetBoxApp : public LinBusProtocol {
|
|||||||
|
|
||||||
// Truma heater conected to CP Plus.
|
// Truma heater conected to CP Plus.
|
||||||
TRUMA_DEVICE heater_device_ = TRUMA_DEVICE::HEATER_COMBI4;
|
TRUMA_DEVICE heater_device_ = TRUMA_DEVICE::HEATER_COMBI4;
|
||||||
TRUMA_DEVICE aircon_device_ = TRUMA_DEVICE::UNKOWN;
|
TRUMA_DEVICE aircon_device_ = TRUMA_DEVICE::UNKNOWN;
|
||||||
|
|
||||||
std::vector<StatusFrameListener> listeners_heater_;
|
std::vector<StatusFrameListener> listeners_heater_;
|
||||||
CallbackManager<void(const StatusFrameHeater *)> state_heater_callback_{};
|
CallbackManager<void(const StatusFrameHeater *)> state_heater_callback_{};
|
||||||
@ -453,6 +480,11 @@ class TrumaiNetBoxApp : public LinBusProtocol {
|
|||||||
bool status_heater_updated_ = false;
|
bool status_heater_updated_ = false;
|
||||||
StatusFrameHeater status_heater_;
|
StatusFrameHeater status_heater_;
|
||||||
|
|
||||||
|
bool status_aircon_valid_ = false;
|
||||||
|
// Value has changed notify listeners.
|
||||||
|
bool status_aircon_updated_ = false;
|
||||||
|
StatusFrameAircon status_aircon_;
|
||||||
|
|
||||||
bool status_timer_valid_ = false;
|
bool status_timer_valid_ = false;
|
||||||
// Value has changed notify listeners.
|
// Value has changed notify listeners.
|
||||||
bool status_timer_updated_ = false;
|
bool status_timer_updated_ = false;
|
||||||
@ -479,6 +511,9 @@ class TrumaiNetBoxApp : public LinBusProtocol {
|
|||||||
bool update_status_heater_stale_ = false;
|
bool update_status_heater_stale_ = false;
|
||||||
StatusFrameHeaterResponse update_status_heater_;
|
StatusFrameHeaterResponse update_status_heater_;
|
||||||
|
|
||||||
|
|
||||||
|
bool update_status_aircon_stale_ = false;
|
||||||
|
|
||||||
// Prepared means `update_status_timer_` was copied from `status_timer_`.
|
// Prepared means `update_status_timer_` was copied from `status_timer_`.
|
||||||
bool update_status_timer_prepared_ = false;
|
bool update_status_timer_prepared_ = false;
|
||||||
// Prepared means an update is already awating fetch from CP plus.
|
// Prepared means an update is already awating fetch from CP plus.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user