ESPHome  2024.11.3
daikin_arc.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 namespace esphome {
6 namespace daikin_arc {
7 
8 // Values for Daikin ARC43XXX IR Controllers
9 // Temperature
10 const uint8_t DAIKIN_TEMP_MIN = 10; // Celsius
11 const uint8_t DAIKIN_TEMP_MAX = 30; // Celsius
12 
13 // Modes
14 const uint8_t DAIKIN_MODE_AUTO = 0x00;
15 const uint8_t DAIKIN_MODE_COOL = 0x30;
16 const uint8_t DAIKIN_MODE_HEAT = 0x40;
17 const uint8_t DAIKIN_MODE_DRY = 0x20;
18 const uint8_t DAIKIN_MODE_FAN = 0x60;
19 const uint8_t DAIKIN_MODE_OFF = 0x00;
20 const uint8_t DAIKIN_MODE_ON = 0x01;
21 
22 // Fan Speed
23 const uint8_t DAIKIN_FAN_AUTO = 0xA0;
24 const uint8_t DAIKIN_FAN_SILENT = 0xB0;
25 const uint8_t DAIKIN_FAN_1 = 0x30;
26 const uint8_t DAIKIN_FAN_2 = 0x40;
27 const uint8_t DAIKIN_FAN_3 = 0x50;
28 const uint8_t DAIKIN_FAN_4 = 0x60;
29 const uint8_t DAIKIN_FAN_5 = 0x70;
30 
31 // IR Transmission
32 const uint32_t DAIKIN_IR_FREQUENCY = 38000;
33 const uint32_t DAIKIN_ARC_PRE_MARK = 9950;
34 const uint32_t DAIKIN_ARC_PRE_SPACE = 25100;
35 const uint32_t DAIKIN_HEADER_MARK = 3450;
36 const uint32_t DAIKIN_HEADER_SPACE = 1760;
37 const uint32_t DAIKIN_BIT_MARK = 400;
38 const uint32_t DAIKIN_ONE_SPACE = 1300;
39 const uint32_t DAIKIN_ZERO_SPACE = 480;
40 const uint32_t DAIKIN_MESSAGE_SPACE = 35000;
41 
42 const uint8_t DAIKIN_DBG_TOLERANCE = 25;
43 #define DAIKIN_DBG_LOWER(x) ((100 - DAIKIN_DBG_TOLERANCE) * (x) / 100U)
44 #define DAIKIN_DBG_UPPER(x) ((100 + DAIKIN_DBG_TOLERANCE) * (x) / 100U)
45 
46 // State Frame size
47 const uint8_t DAIKIN_STATE_FRAME_SIZE = 19;
48 
50  public:
52  : climate_ir::ClimateIR(DAIKIN_TEMP_MIN, DAIKIN_TEMP_MAX, 0.5f, true, true,
57 
58  void setup() override;
59 
60  protected:
61  void control(const climate::ClimateCall &call) override;
62  // Transmit via IR the state of this climate controller.
63  void transmit_query_();
64  void transmit_state() override;
65  climate::ClimateTraits traits() override;
66  uint8_t operation_mode_();
67  uint16_t fan_speed_();
68  uint8_t temperature_();
69  uint8_t humidity_();
70  // Handle received IR Buffer
71  bool on_receive(remote_base::RemoteReceiveData data) override;
72  bool parse_state_frame_(const uint8_t frame[]);
73 };
74 
75 } // namespace daikin_arc
76 } // namespace esphome
This class is used to encode all control actions on a climate device.
Definition: climate.h:33
The fan mode is set to Low.
Definition: climate_mode.h:54
const uint8_t DAIKIN_MODE_HEAT
Definition: daikin_arc.h:16
const uint32_t DAIKIN_MESSAGE_SPACE
Definition: daikin_arc.h:40
const uint8_t DAIKIN_DBG_TOLERANCE
Definition: daikin_arc.h:42
The fan mode is set to Both.
Definition: climate_mode.h:74
const uint32_t DAIKIN_ONE_SPACE
Definition: daikin_arc.h:38
This class contains all static data for climate devices.
const uint8_t DAIKIN_MODE_OFF
Definition: daikin_arc.h:19
const uint8_t DAIKIN_TEMP_MAX
Definition: daikin_arc.h:11
const uint8_t DAIKIN_MODE_COOL
Definition: daikin_arc.h:15
const uint32_t DAIKIN_BIT_MARK
Definition: daikin_arc.h:37
void control(const climate::ClimateCall &call) override
Definition: daikin_arc.cpp:479
const uint8_t DAIKIN_MODE_FAN
Definition: daikin_arc.h:18
const uint32_t DAIKIN_HEADER_SPACE
Definition: daikin_arc.h:36
The fan mode is set to Horizontal.
Definition: climate_mode.h:78
const uint8_t DAIKIN_FAN_1
Definition: daikin_arc.h:25
The fan mode is set to Auto.
Definition: climate_mode.h:52
const uint8_t DAIKIN_FAN_5
Definition: daikin_arc.h:29
const uint8_t DAIKIN_TEMP_MIN
Definition: daikin_arc.h:10
const uint32_t DAIKIN_HEADER_MARK
Definition: daikin_arc.h:35
ClimateIR(float minimum_temperature, float maximum_temperature, float temperature_step=1.0f, bool supports_dry=false, bool supports_fan_only=false, std::set< climate::ClimateFanMode > fan_modes={}, std::set< climate::ClimateSwingMode > swing_modes={}, std::set< climate::ClimatePreset > presets={})
Definition: climate_ir.h:26
const uint32_t DAIKIN_ARC_PRE_SPACE
Definition: daikin_arc.h:34
The fan mode is set to Vertical.
Definition: climate_mode.h:76
bool on_receive(remote_base::RemoteReceiveData data) override
Definition: daikin_arc.cpp:347
The fan mode is set to High.
Definition: climate_mode.h:58
The swing mode is set to Off.
Definition: climate_mode.h:72
bool parse_state_frame_(const uint8_t frame[])
Definition: daikin_arc.cpp:252
const uint8_t DAIKIN_MODE_DRY
Definition: daikin_arc.h:17
const uint8_t DAIKIN_MODE_AUTO
Definition: daikin_arc.h:14
const uint8_t DAIKIN_MODE_ON
Definition: daikin_arc.h:20
const uint8_t DAIKIN_FAN_SILENT
Definition: daikin_arc.h:24
const uint32_t DAIKIN_IR_FREQUENCY
Definition: daikin_arc.h:32
const uint8_t DAIKIN_STATE_FRAME_SIZE
Definition: daikin_arc.h:47
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
climate::ClimateTraits traits() override
Definition: daikin_arc.cpp:242
const uint8_t DAIKIN_FAN_4
Definition: daikin_arc.h:28
The fan mode is set to Medium.
Definition: climate_mode.h:56
const uint32_t DAIKIN_ARC_PRE_MARK
Definition: daikin_arc.h:33
const uint32_t DAIKIN_ZERO_SPACE
Definition: daikin_arc.h:39
const uint8_t DAIKIN_FAN_2
Definition: daikin_arc.h:26
const uint8_t DAIKIN_FAN_3
Definition: daikin_arc.h:27
const uint8_t DAIKIN_FAN_AUTO
Definition: daikin_arc.h:23