# Daikin Device Parameters Reference

This document provides a comprehensive reference of all parameters returned by Daikin air conditioner devices.

## Table of Contents

- [Control Parameters](#control-parameters)
- [Temperature Settings](#temperature-settings)
- [Sensor Readings](#sensor-readings)
- [Device Information](#device-information)
- [Advanced Modes](#advanced-modes)
- [Energy Data](#energy-data)
- [Feature Flags](#feature-flags)
- [Other Parameters](#other-parameters)
- [Mode Values](#mode-values)
- [Fan Rate Values](#fan-rate-values)
- [Fan Direction Values](#fan-direction-values)
- [Advanced Mode Values](#advanced-mode-values)

---

## Value Translation System

Daikin devices use numeric/coded values internally, while humans prefer readable values. The library provides translation between these formats:

### Daikin to Human (Reading)

When you read values from the device, Daikin codes are translated to human-readable values:

```typescript
// Device returns: mode='3'
// Library translates to: 'cool'
console.log(device.values.get('mode')); // 'cool' (human-readable)
```

### Human to Daikin (Writing)

When you set values, human values are translated to Daikin codes:

```typescript
// You provide: mode='cool'
// Library translates to: '3'
await device.set({ mode: 'cool' });
```

### How It Works

Each device class defines a `TRANSLATIONS` map that maps between Daikin codes and human values:

```typescript
// Example from DaikinBRP069
static TRANSLATIONS: TranslationMap = {
  mode: {
    '2': 'dry',
    '3': 'cool',
    '4': 'hot',
    '6': 'fan',
    '0': 'auto',
    '10': 'off',
  },
  f_rate: {
    'A': 'auto',
    'B': 'silence',
    '3': '1',
    '4': '2',
    '5': '3',
    '6': '4',
    '7': '5',
  },
  f_dir: {
    '0': 'off',
    '1': 'vertical',
    '2': 'horizontal',
    '3': '3d',
  },
};
```

### Important: Use Human Values

When setting values, always use human-readable values:

```typescript
// ✅ Correct - use human values
await device.set({ mode: 'cool', f_rate: 'auto', f_dir: 'vertical' });

// ❌ Wrong - don't use Daikin codes
await device.set({ mode: '3', f_rate: 'A', f_dir: '1' });
```

### Device-Specific Translations

Different device types may have different translations:

| Device Type | mode='cool' → | f_rate='auto' → |
|-------------|----------------|-----------------|
| BRP069/BRP072C | `3` | `A` |
| BRP084 | `0200` | `0A00` |
| SkyFi | `8` | different scale |

### Translation Methods

```typescript
import { DaikinBRP069 } from './devices/brp069.js';

// Daikin to Human
DaikinBRP069.daikinToHuman('mode', '3');  // 'cool'
DaikinBRP069.daikinToHuman('f_rate', 'A'); // 'auto'

// Human to Daikin
DaikinBRP069.humanToDaikin('mode', 'cool');  // '3'
DaikinBRP069.humanToDaikin('f_rate', 'auto'); // 'A'

// Get all human values
DaikinBRP069.daikinValues('mode');   // ['auto', 'cool', 'dry', 'fan', 'heat', 'off']
DaikinBRP069.daikinValues('f_rate'); // ['1', '2', '3', '4', '5', 'auto', 'silence']
```

---

## Complete Translation Reference

This section provides the complete translation maps for all device types.

### Quick Reference

| Device Type | Class | Notes |
|-------------|-------|-------|
| BRP069/BRP072C | `DaikinBRP069` | Standard WiFi adapter |
| BRP084 | `DaikinBRP084` | Firmware 2.8.0+ |
| AirBase | `DaikinAirBase` | Inherits from BRP069 |
| SkyFi | `DaikinSkyFi` | Legacy device |

---

### DaikinBRP069 / BRP072C / AirBase

#### Mode (`mode`)

| Daikin Code | Human Value | Description |
|-------------|-------------|-------------|
| `0` | `auto` | Automatic |
| `1` | `auto-1` | Auto variant 1 |
| `2` | `dry` | Dehumidify |
| `3` | `cool` | Cooling |
| `4` | `hot` | Heating |
| `6` | `fan` | Fan only |
| `7` | `auto-7` | Auto variant 7 |
| `10` | `off` | Off |

**Reverse (Human → Daikin):**
| Human | Daikin |
|-------|--------|
| `auto` | `0` |
| `auto-1` | `1` |
| `dry` | `2` |
| `cool` | `3` |
| `heat` / `hot` | `4` |
| `fan` | `6` |
| `auto-7` | `7` |
| `off` | `10` |

#### Fan Rate (`f_rate`)

| Daikin Code | Human Value | Description |
|-------------|-------------|-------------|
| `A` | `auto` | Automatic |
| `B` | `silence` | Silent/lowest |
| `3` | `1` | Speed 1 (lowest) |
| `4` | `2` | Speed 2 |
| `5` | `3` | Speed 3 |
| `6` | `4` | Speed 4 |
| `7` | `5` | Speed 5 (highest) |

**Reverse (Human → Daikin):**
| Human | Daikin |
|-------|--------|
| `auto` | `A` |
| `silence` | `B` |
| `1` | `3` |
| `2` | `4` |
| `3` | `5` |
| `4` | `6` |
| `5` | `7` |

#### Fan Direction (`f_dir`)

| Daikin Code | Human Value | Description |
|-------------|-------------|-------------|
| `0` | `off` | No swing |
| `1` | `vertical` | Up/down |
| `2` | `horizontal` | Left/right |
| `3` | `3d` | Combined |

**Reverse (Human → Daikin):**
| Human | Daikin |
|-------|--------|
| `off` | `0` |
| `vertical` | `1` |
| `horizontal` | `2` |
| `3d` | `3` |

#### Advanced Mode (`adv`)

| Daikin Code | Human Value | Description |
|-------------|-------------|-------------|
| (empty) | `off` | No special mode |
| `2` | `powerful` | Powerful mode |
| `12` | `econo` | Economy mode |
| `13` | `streamer` | Streamer only |
| `2/13` | `powerful streamer` | Powerful + Streamer |
| `12/13` | `econo streamer` | Econo + Streamer |

**Reverse (Human → Daikin):**
| Human | Daikin |
|-------|--------|
| `off` | `` (empty) |
| `powerful` | `2` |
| `econo` | `12` |
| `streamer` | `13` |
| `powerful streamer` | `2/13` |
| `econo streamer` | `12/13` |

#### Holiday Mode (`en_hol`)

| Daikin Code | Human Value |
|-------------|-------------|
| `0` | `off` |
| `1` | `on` |

**Reverse (Human → Daikin):**
| Human | Daikin |
|-------|--------|
| `off` | `0` |
| `on` | `1` |

#### Special Mode Kind (`spmode_kind`)

| Daikin Code | Human Value |
|-------------|-------------|
| `0` | `streamer` |
| `1` | `powerful` |
| `2` | `econo` |

#### Special Mode (`spmode`)

| Daikin Code | Human Value |
|-------------|-------------|
| `0` | `off` |
| `1` | `on` |

---

### DaikinBRP084

#### Mode (`mode`)

| Daikin Code | Human Value | Description |
|-------------|-------------|-------------|
| `00` | `off` | Off |
| `01` | `on` | On |
| `0300` | `auto` | Automatic |
| `0200` | `cool` | Cooling |
| `0100` | `heat` | Heating |
| `0500` | `dry` | Dehumidify |
| `0000` | `fan` | Fan only |

**Reverse (Human → Daikin):**
| Human | Daikin |
|-------|--------|
| `off` | `00` |
| `on` | `01` |
| `auto` | `0300` |
| `cool` | `0200` |
| `heat` | `0100` |
| `dry` | `0500` |
| `fan` | `0000` |

#### Fan Rate (`f_rate`)

| Daikin Code | Human Value | Description |
|-------------|-------------|-------------|
| `0A00` | `auto` | Automatic |
| `0B00` | `quiet` | Quiet |
| `0300` | `1` | Speed 1 |
| `0400` | `2` | Speed 2 |
| `0500` | `3` | Speed 3 |
| `0600` | `4` | Speed 4 |
| `0700` | `5` | Speed 5 |

**Reverse (Human → Daikin):**
| Human | Daikin |
|-------|--------|
| `auto` | `0A00` |
| `quiet` | `0B00` |
| `1` | `0300` |
| `2` | `0400` |
| `3` | `0500` |
| `4` | `0600` |
| `5` | `0700` |

#### Fan Direction (`f_dir`)

| Daikin Code | Human Value | Description |
|-------------|-------------|-------------|
| `off` | `off` | No swing |
| `vertical` | `vertical` | Up/down |
| `horizontal` | `horizontal` | Left/right |
| `both` | `3d` | Combined |

**Reverse (Human → Daikin):**
| Human | Daikin |
|-------|--------|
| `off` | `off` |
| `vertical` | `vertical` |
| `horizontal` | `horizontal` |
| `3d` | `both` |

#### Holiday Mode (`en_hol`)

| Daikin Code | Human Value |
|-------------|-------------|
| `0` | `off` |
| `1` | `on` |

**Reverse (Human → Daikin):**
| Human | Daikin |
|-------|--------|
| `off` | `0` |
| `on` | `1` |

---

### DaikinSkyFi

#### Mode (`mode`)

| Daikin Code | Human Value | Description |
|-------------|-------------|-------------|
| `0` | `off` | Off |
| `1` | `auto` | Automatic |
| `2` | `hot` | Heating |
| `3` | `auto-3` | Auto variant |
| `4` | `dry` | Dehumidify |
| `8` | `cool` | Cooling |
| `9` | `auto-9` | Auto variant |
| `16` | `fan` | Fan only |

**Reverse (Human → Daikin):**
| Human | Daikin |
|-------|--------|
| `off` | `0` |
| `auto` | `1` |
| `heat` / `hot` | `2` |
| `auto-3` | `3` |
| `dry` | `4` |
| `cool` | `8` |
| `auto-9` | `9` |
| `fan` | `16` |

#### Fan Rate (`f_rate`)

| Daikin Code | Human Value | Description |
|-------------|-------------|-------------|
| `1` | `low` | Low |
| `2` | `medium` | Medium |
| `3` | `high` | High |
| `5` | `low/auto` | Low/Auto |
| `6` | `medium/auto` | Medium/Auto |
| `7` | `high/auto` | High/Auto |

**Reverse (Human → Daikin):**
| Human | Daikin |
|-------|--------|
| `low` | `1` |
| `medium` | `2` |
| `high` | `3` |
| `low/auto` | `5` |
| `medium/auto` | `6` |
| `high/auto` | `7` |

---

## Parameter Display Names (VALUES_TRANSLATION)

This maps internal parameter keys to human-readable display names:

| Parameter | Display Name |
|-----------|--------------|
| `otemp` | outside temp |
| `htemp` | inside temp |
| `stemp` | target temp |
| `shum` | target humidity |
| `hhum` | humidity |
| `cmpfreq` | compressor frequency |
| `mode` | mode |
| `pow` | power |
| `f_rate` | fan rate |
| `f_dir` | fan direction |

---

## Control Parameters

These are the main parameters you can set using `device.set()`:

| Parameter | Daikin Values | Human Values | Description |
|-----------|---------------|--------------|-------------|
| `pow` | `0` | `off` | Power off |
| `pow` | `1` | `on` | Power on |
| `mode` | See [Mode Values](#mode-values) | | Operation mode |
| `stemp` | `10`-`41`, `M`, `H` | Temperature | Target temperature in Celsius |
| `shum` | `0`-`100` | Humidity | Target humidity percentage |
| `f_rate` | See [Fan Rate Values](#fan-rate-values) | | Fan speed |
| `f_dir` | See [Fan Direction Values](#fan-direction-values) | | Fan swing direction |

---

## Temperature Settings

Parameters for temperature limits per operation mode:

| Parameter | Description |
|-----------|-------------|
| `dt1` | Target temp for mode 1 (auto-1) |
| `dt2` | Target temp for mode 2 (dry) |
| `dt3` | Target temp for mode 3 (cool) |
| `dt4` | Target temp for mode 4 (heat) |
| `dt5` | Target temp for mode 5 |
| `dt7` | Target temp for mode 7 (auto-7) |
| `dhh` | Default humidity setting |

**Example values:** `25.0`, `M` (maximum), `H` (high)

---

## Humidity Settings

Parameters for humidity limits per operation mode:

| Parameter | Description |
|-----------|-------------|
| `dh1` | Humidity for mode 1 (AUTO) |
| `dh2` | Humidity for mode 2 (50 default) |
| `dh3` | Humidity for mode 3 (cool) |
| `dh4` | Humidity for mode 4 (heat) |
| `dh5` | Humidity for mode 5 |
| `dh7` | Humidity for mode 7 (AUTO) |

**Example values:** `AUTO`, `50`, `0`

---

## Sensor Readings

Real-time sensor data from the device:

| Parameter | Example Value | Description |
|-----------|---------------|-------------|
| `htemp` | `26.0` | Inside/room temperature (°C) |
| `otemp` | `31.0` | Outside temperature (°C) |
| `hhum` | `-` or `45` | Inside humidity (`-` = not available) |
| `cmpfreq` | `30` | Compressor frequency (Hz) |

---

## Device Information

Parameters that identify the device:

| Parameter | Example Value | Description |
|-----------|---------------|-------------|
| `mac` | `20:4E:F6:D9:C3:F4` | MAC address |
| `model` | `0D89` | Model number |
| `ver` | `1_16_0` | Firmware version |
| `type` | `C` | Device type (`C` = air conditioner) |
| `name` | `Living Room` | Device name (set via app) |
| `reg` | `th` | Region code (th, au, eu, us, jp) |
| `dst` | `1` | Daylight saving time (0/1) |
| `method` | `polling` | Connection method |
| `ssid` | `DaikinAP47912` | WiFi network name |

---

## Advanced Modes

Special operating modes:

| Parameter | Daikin Values | Human Values | Description |
|-----------|---------------|--------------|-------------|
| `adv` | (see below) | | Advanced mode status |
| `en_hol` | `0`/`off` | off | Holiday mode off |
| `en_hol` | `1`/`on` | on | Holiday mode on |
| `en_streamer` | `0`/`off` | off | Streamer off |
| `en_streamer` | `1`/`on` | on | Streamer on |

### Advanced Mode Values (`adv`)

| Daikin Value | Human Value | Description |
|--------------|-------------|-------------|
| (empty) | `off` | No special mode |
| `2` | `powerful` | Powerful mode |
| `12` | `econo` | Econo mode |
| `13` | `streamer` | Streamer only |
| `2/13` | `powerful streamer` | Powerful + Streamer |
| `12/13` | `econo streamer` | Econo + Streamer |

---

## Fan Rate Settings

Fan rates available per operation mode:

| Parameter | Description |
|-----------|-------------|
| `dfr1` | Fan rate for mode 1 |
| `dfr2` | Fan rate for mode 2 |
| `dfr3` | Fan rate for mode 3 |
| `dfr4` | Fan rate for mode 4 |
| `dfr5` | Fan rate for mode 5 |
| `dfr6` | Fan rate for mode 6 |
| `dfr7` | Fan rate for mode 7 |
| `dfrh` | Fan rate for heating |

---

## Fan Direction Settings

Fan directions available per operation mode:

| Parameter | Description |
|-----------|-------------|
| `dfd1` | Fan direction for mode 1 |
| `dfd2` | Fan direction for mode 2 |
| `dfd3` | Fan direction for mode 3 |
| `dfd4` | Fan direction for mode 4 |
| `dfd5` | Fan direction for mode 5 |
| `dfd6` | Fan direction for mode 6 |
| `dfd7` | Fan direction for mode 7 |
| `dfdh` | Fan direction for heating |

---

## Energy Data

Parameters related to power and energy consumption:

| Parameter | Example Value | Description |
|-----------|---------------|-------------|
| `elec` | `0` | Current power consumption |
| `datas` | `13200/7100/6900/...` | Energy data array |
| `curr_day_cool` | `0/0/0/...` | Today's cooling energy (hourly) |
| `curr_day_heat` | `0/0/0/...` | Today's heating energy (hourly) |
| `prev_1day_cool` | `0/0/0/...` | Yesterday's cooling energy |
| `prev_1day_heat` | `0/0/0/...` | Yesterday's heating energy |
| `today_runtime` | `99` | Minutes run today |
| `cmpfreq` | `30` | Compressor frequency (Hz) |

---

## Feature Flags

Parameters indicating which features are enabled on the device:

| Parameter | Values | Description |
|-----------|--------|-------------|
| `en_frate` | `0`/`1` | Fan rate control enabled |
| `en_fdir` | `0`/`1` | Fan direction control enabled |
| `en_secure` | `0`/`1` | HTTPS/secure mode enabled |
| `en_spmode` | `0`/`1` | Special modes enabled |
| `en_hol` | `0`/`1` | Holiday mode enabled |
| `en_filter_sign` | `0`/`1` | Filter dirty sign enabled |
| `en_setzone` | `0`/`1` | Zone control enabled |
| `en_grp` | `0`/`1` | Group control enabled |
| `en_patrol` | `0`/`1` | Patrol/air quality sensor enabled |
| `en_rtemp_a` | `0`/`1` | Remote temperature sensor enabled |
| `en_mompow` | `0`/`1` | Monitor power enabled |
| `en_demand` | `0`/`1` | Demand control enabled |

---

## Other Parameters

Miscellaneous parameters:

| Parameter | Example Value | Description |
|-----------|---------------|-------------|
| `led` | `1` | Display LED (0=off, 1=on) |
| `alert` | `255` | Alert code (0=no alert) |
| `err` | `0` | Error code (0=no error) |
| `acled` | `0` | Air curtain LED |
| `ac_dst` | `--` | Air curtain destination |
| `disp_dry` | `0` | Display dry mode |
| `dmnd` | `0` | Demand control active |
| `temp_rng` | `0` | Temperature range |
| `m_dtct` | `1` | Motion detect enabled |
| `lpw_flag` | `0` | Low power warning flag |
| `pv` | `2` | Protocol version |
| `cpv` | `2` | Control protocol version |
| `cpv_minor` | `00` | Control protocol minor |
| `icon` | `0` | Icon type |
| `id` | `leroylim` | User ID |
| `location` | `0` | Location setting |
| `land` | `0` | Language |
| `port` | `30051` | Communication port |
| `enlver` | `1.00` | Enocean lever version |
| `s_fdir` | `3` | Swing fan direction setting |
| `s_humd` | `0` | Swing humidity |
| `b_mode` | `3` | Backup mode |
| `b_stemp` | `22.0` | Backup target temp |
| `b_shum` | `0` | Backup target humidity |
| `b_f_rate` | `A` | Backup fan rate |
| `b_f_dir` | `0` | Backup fan direction |

---

## Mode Values

Operation modes (`mode` parameter):

| Daikin Value | Human Value | Description |
|--------------|-------------|-------------|
| `0` | `auto` | Automatic mode |
| `1` | `auto-1` | Auto mode variant 1 |
| `2` | `dry` | Dry/dehumidify mode |
| `3` | `cool` | Cooling mode |
| `4` | `hot` / `heat` | Heating mode |
| `6` | `fan` | Fan only mode |
| `7` | `auto-7` | Auto mode variant 7 |
| `10` | `off` | Off mode |

---

## Fan Rate Values

Fan speed settings (`f_rate` parameter):

| Daikin Value | Human Value | Description |
|--------------|-------------|-------------|
| `A` | `auto` | Automatic speed |
| `B` | `silence` | Silent/lowest speed |
| `3` | `1` | Speed level 1 (lowest) |
| `4` | `2` | Speed level 2 |
| `5` | `3` | Speed level 3 |
| `6` | `4` | Speed level 4 |
| `7` | `5` | Speed level 5 (highest) |

---

## Fan Direction Values

Fan swing settings (`f_dir` parameter):

| Daikin Value | Human Value | Description |
|--------------|-------------|-------------|
| `0` | `off` | No swing |
| `1` | `vertical` | Vertical swing (up/down) |
| `2` | `horizontal` | Horizontal swing (left/right) |
| `3` | `3d` | 3D swing (combined) |

---

## Advanced Mode Values

See [Advanced Modes](#advanced-modes) section above.

---

## Using These Parameters

### Reading Values

```typescript
const device = await DaikinFactory('192.168.1.100', { key: 'YOUR_KEY' });

// Access sensor readings
console.log(device.insideTemperature);  // e.g., 26
console.log(device.outsideTemperature); // e.g., 31

// Access control values
console.log(device.values.get('mode'));    // e.g., '3' (cool)
console.log(device.values.get('stemp'));   // e.g., '22.0'
console.log(device.values.get('f_rate')); // e.g., 'A' (auto)

// Access device info
console.log(device.values.get('mac'));  // e.g., '20:4E:F6:D9:C3F4'
console.log(device.values.get('ver'));   // e.g., '1_16_0'
```

### Setting Values

```typescript
// Turn on with cool mode, 22°C, auto fan, no swing
await device.set({
  mode: 'cool',
  stemp: '22.0',
  f_rate: 'auto',
  f_dir: 'off'
});

// Enable powerful mode
await device.setAdvancedMode('powerful', 'on');

// Enable streamer
await device.setStreamer('on');

// Set holiday mode
await device.setHoliday('on');
```

### Note on Temperature Format

Always use decimal format for temperature:

```typescript
// ✅ Correct
await device.set({ stemp: '22.0' });

// ❌ May not work
await device.set({ stemp: '22' });
```
