mirror of
https://github.com/esphome/esphome.git
synced 2026-05-26 19:26:25 +08:00
[toshiba] Add support for RAS-2819T air conditioner (#9490)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
This commit is contained in:
@@ -14,6 +14,7 @@ MODELS = {
|
||||
"GENERIC": Model.MODEL_GENERIC,
|
||||
"RAC-PT1411HWRU-C": Model.MODEL_RAC_PT1411HWRU_C,
|
||||
"RAC-PT1411HWRU-F": Model.MODEL_RAC_PT1411HWRU_F,
|
||||
"RAS-2819T": Model.MODEL_RAS_2819T,
|
||||
}
|
||||
|
||||
CONFIG_SCHEMA = climate_ir.climate_ir_with_receiver_schema(ToshibaClimate).extend(
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "esphome/components/climate_ir/climate_ir.h"
|
||||
#include "esphome/components/remote_base/toshiba_ac_protocol.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace toshiba {
|
||||
@@ -10,6 +11,7 @@ enum Model {
|
||||
MODEL_GENERIC = 0, // Temperature range is from 17 to 30
|
||||
MODEL_RAC_PT1411HWRU_C = 1, // Temperature range is from 16 to 30
|
||||
MODEL_RAC_PT1411HWRU_F = 2, // Temperature range is from 16 to 30
|
||||
MODEL_RAS_2819T = 3, // RAS-2819T protocol variant, temperature range 18 to 30
|
||||
};
|
||||
|
||||
// Supported temperature ranges
|
||||
@@ -19,6 +21,8 @@ const float TOSHIBA_RAC_PT1411HWRU_TEMP_C_MIN = 16.0;
|
||||
const float TOSHIBA_RAC_PT1411HWRU_TEMP_C_MAX = 30.0;
|
||||
const float TOSHIBA_RAC_PT1411HWRU_TEMP_F_MIN = 60.0;
|
||||
const float TOSHIBA_RAC_PT1411HWRU_TEMP_F_MAX = 86.0;
|
||||
const float TOSHIBA_RAS_2819T_TEMP_C_MIN = 18.0;
|
||||
const float TOSHIBA_RAS_2819T_TEMP_C_MAX = 30.0;
|
||||
|
||||
class ToshibaClimate : public climate_ir::ClimateIR {
|
||||
public:
|
||||
@@ -35,6 +39,9 @@ class ToshibaClimate : public climate_ir::ClimateIR {
|
||||
void transmit_generic_();
|
||||
void transmit_rac_pt1411hwru_();
|
||||
void transmit_rac_pt1411hwru_temp_(bool cs_state = true, bool cs_send_update = true);
|
||||
void transmit_ras_2819t_();
|
||||
// Process RAS-2819T IR command data
|
||||
bool process_ras_2819t_command_(const remote_base::ToshibaAcData &toshiba_data);
|
||||
// Returns the header if valid, else returns zero
|
||||
uint8_t is_valid_rac_pt1411hwru_header_(const uint8_t *message);
|
||||
// Returns true if message is a valid RAC-PT1411HWRU IR message, regardless if first or second packet
|
||||
@@ -43,11 +50,26 @@ class ToshibaClimate : public climate_ir::ClimateIR {
|
||||
bool compare_rac_pt1411hwru_packets_(const uint8_t *message1, const uint8_t *message2);
|
||||
bool on_receive(remote_base::RemoteReceiveData data) override;
|
||||
|
||||
private:
|
||||
// RAS-2819T state tracking for swing mode optimization
|
||||
climate::ClimateSwingMode last_swing_mode_{climate::CLIMATE_SWING_OFF};
|
||||
climate::ClimateMode last_mode_{climate::CLIMATE_MODE_OFF};
|
||||
optional<climate::ClimateFanMode> last_fan_mode_{};
|
||||
float last_target_temperature_{24.0f};
|
||||
|
||||
float temperature_min_() {
|
||||
return (this->model_ == MODEL_GENERIC) ? TOSHIBA_GENERIC_TEMP_C_MIN : TOSHIBA_RAC_PT1411HWRU_TEMP_C_MIN;
|
||||
if (this->model_ == MODEL_RAC_PT1411HWRU_C || this->model_ == MODEL_RAC_PT1411HWRU_F)
|
||||
return TOSHIBA_RAC_PT1411HWRU_TEMP_C_MIN;
|
||||
if (this->model_ == MODEL_RAS_2819T)
|
||||
return TOSHIBA_RAS_2819T_TEMP_C_MIN;
|
||||
return TOSHIBA_GENERIC_TEMP_C_MIN; // Default to GENERIC for unknown models
|
||||
}
|
||||
float temperature_max_() {
|
||||
return (this->model_ == MODEL_GENERIC) ? TOSHIBA_GENERIC_TEMP_C_MAX : TOSHIBA_RAC_PT1411HWRU_TEMP_C_MAX;
|
||||
if (this->model_ == MODEL_RAC_PT1411HWRU_C || this->model_ == MODEL_RAC_PT1411HWRU_F)
|
||||
return TOSHIBA_RAC_PT1411HWRU_TEMP_C_MAX;
|
||||
if (this->model_ == MODEL_RAS_2819T)
|
||||
return TOSHIBA_RAS_2819T_TEMP_C_MAX;
|
||||
return TOSHIBA_GENERIC_TEMP_C_MAX; // Default to GENERIC for unknown models
|
||||
}
|
||||
std::set<climate::ClimateSwingMode> toshiba_swing_modes_() {
|
||||
return (this->model_ == MODEL_GENERIC)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
remote_transmitter:
|
||||
pin: ${tx_pin}
|
||||
carrier_duty_percent: 50%
|
||||
|
||||
remote_receiver:
|
||||
id: rcvr
|
||||
pin: ${rx_pin}
|
||||
|
||||
climate:
|
||||
- platform: toshiba
|
||||
name: "RAS-2819T Climate"
|
||||
model: RAS-2819T
|
||||
receiver_id: rcvr
|
||||
@@ -0,0 +1,5 @@
|
||||
substitutions:
|
||||
tx_pin: GPIO5
|
||||
rx_pin: GPIO4
|
||||
|
||||
<<: !include common_ras2819t.yaml
|
||||
@@ -0,0 +1,5 @@
|
||||
substitutions:
|
||||
tx_pin: GPIO5
|
||||
rx_pin: GPIO4
|
||||
|
||||
<<: !include common_ras2819t.yaml
|
||||
@@ -0,0 +1,5 @@
|
||||
substitutions:
|
||||
tx_pin: GPIO5
|
||||
rx_pin: GPIO4
|
||||
|
||||
<<: !include common_ras2819t.yaml
|
||||
@@ -0,0 +1,5 @@
|
||||
substitutions:
|
||||
tx_pin: GPIO5
|
||||
rx_pin: GPIO4
|
||||
|
||||
<<: !include common_ras2819t.yaml
|
||||
@@ -0,0 +1,5 @@
|
||||
substitutions:
|
||||
tx_pin: GPIO5
|
||||
rx_pin: GPIO4
|
||||
|
||||
<<: !include common_ras2819t.yaml
|
||||
Reference in New Issue
Block a user