name: Air conditioner
products:
  - id: f3goccgfj6qino4c
    name: Sensei Air Conditioner
primary_entity:
  entity: climate
  translation_key: aircon_extra
  dps:
    - id: 1
      type: boolean
      name: hvac_mode
      mapping:
        - dps_val: false
          value: "off"
        - dps_val: true
          constraint: mode
          conditions:
            - dps_val: auto
              value: heat_cool
            - dps_val: cold
              value: cool
            - dps_val: wet
              value: dry
            - dps_val: heat
              value: heat
            - dps_val: fan
              value: fan_only
            - dps_val: null
              value: "off"
              hidden: true
    - id: 2
      type: integer
      name: temperature
      range:
        min: 160
        max: 320
      mapping:
        - scale: 10
          step: 10
          constraint: temperature_unit
          conditions:
            - dps_val: f
              range:
                min: 600
                max: 900
    - id: 3
      type: integer
      name: current_temperature
      mapping:
        - scale: 10
          constraint: temperature_unit
          conditions:
            - dps_val: f
    - id: 4
      type: string
      name: mode
      hidden: true
      optional: true
    - id: 5
      type: string
      name: fan_mode
      mapping:
        - dps_val: auto
          value: auto
        - dps_val: mute
          value: quiet
        - dps_val: low
          value: low
        - dps_val: low_mid
          value: medlow
        - dps_val: mid
          value: medium
        - dps_val: mid_high
          value: medhigh
        - dps_val: high
          value: high
        - dps_val: turbo
          value: strong
    - id: 8
      type: boolean
      optional: true
      name: preset_mode
      mapping:
        - dps_val: true
          value: eco
        - dps_val: false
          value: comfort
    - id: 15
      name: swing_mode
      type: string
      mapping:
        - dps_val: un_down
          value: vertical
        - dps_val: left_right
          value: horizontal
        - dps_val: all
          value: both
        - dps_val: "off"
          value: "off"
    - id: 105
      name: temperature_unit
      type: string
      optional: true
      mapping:
        - dps_val: c
          value: C
        - dps_val: f
          value: F
    - id: 112
      name: model
      type: string
    - id: 114
      name: current_mode
      type: string
      optional: true
secondary_entities:
  - entity: switch
    name: Wet
    icon: "mdi:hvac"
    dps:
      - id: 9
        name: switch
        type: boolean
  - entity: switch
    name: Emergency heat
    icon: "mdi:fire"
    dps:
      - id: 12
        name: switch
        type: boolean
  - entity: light
    translation_key: backlight
    category: config
    dps:
      - id: 13
        name: switch
        type: boolean
  - entity: select
    category: config
    translation_key: timer
    dps:
      - id: 21
        type: string
        optional: true
        name: option
        mapping:
          - dps_val: "0"
            value: cancel
          - dps_val: "1"
            value: "1h"
          - dps_val: "2"
            value: "2h"
          - dps_val: "3"
            value: "3h"
          - dps_val: "4"
            value: "4h"
          - dps_val: "5"
            value: "5h"
          - dps_val: "6"
            value: "6h"
          - dps_val: "7"
            value: "7h"
          - dps_val: "8"
            value: "8h"
          - dps_val: "9"
            value: "9h"
          - dps_val: "10"
            value: "10h"
          - dps_val: "11"
            value: "11h"
          - dps_val: "12"
            value: "12h"
          - dps_val: "13"
            value: "13h"
          - dps_val: "14"
            value: "14h"
          - dps_val: "15"
            value: "15h"
          - dps_val: "16"
            value: "16h"
          - dps_val: "17"
            value: "17h"
          - dps_val: "18"
            value: "18h"
          - dps_val: "19"
            value: "19h"
          - dps_val: "20"
            value: "20h"
          - dps_val: "21"
            value: "21h"
          - dps_val: "22"
            value: "22h"
          - dps_val: "23"
            value: "23h"
          - dps_val: "24"
            value: "24h"
  - entity: sensor
    class: duration
    translation_key: time_remaining
    category: diagnostic
    dps:
      - id: 22
        name: sensor
        type: integer
        unit: min
  - entity: sensor
    name: Usage counter
    category: diagnostic
    icon: "mdi:counter"
    dps:
      - id: 101
        name: sensor
        type: integer
  - entity: sensor
    class: duration
    name: Total time
    category: diagnostic
    icon: "mdi:timer"
    dps:
      - id: 102
        name: sensor
        type: integer
        unit: h
  - entity: sensor
    name: Electricity
    category: diagnostic
    icon: "mdi:check-circle"
    dps:
      - id: 103
        name: sensor
        type: integer
        unit: kWh
        mapping:
          - scale: 10
      - id: 104
        type: integer
        name: report_number
        optional: true
  - entity: select
    translation_key: temperature_unit
    category: config
    dps:
      - id: 105
        type: string
        name: option
        mapping:
          - dps_val: c
            value: celsius
          - dps_val: f
            value: fahrenheit
  - entity: select
    name: Horizontal
    icon: "mdi:arrow-left-right"
    category: config
    dps:
      - id: 106
        type: string
        name: option
        mapping:
          - dps_val: "off"
            value: "Off"
          - dps_val: same
            value: Focus
          - dps_val: opposite
            value: Diffuse
  - entity: select
    name: Vertical
    category: config
    icon: "mdi:arrow-up-down"
    dps:
      - id: 107
        type: string
        name: option
        mapping:
          - dps_val: "off"
            value: "Off"
          - dps_val: "15"
            value: "Swing"
          - dps_val: "1"
            value: "1"
          - dps_val: "2"
            value: "2"
          - dps_val: "3"
            value: "3"
          - dps_val: "4"
            value: "4"
          - dps_val: "5"
            value: "5"
  - entity: switch
    name: Swing 3d
    icon: "mdi:arrow-all"
    category: config
    dps:
      - id: 108
        type: boolean
        name: switch
  - entity: switch
    translation_key: sleep
    category: config
    dps:
      - id: 109
        name: switch
        type: boolean
  - entity: switch
    translation_key: uv_sterilization
    dps:
      - id: 110
        name: switch
        type: boolean
  - entity: switch
    translation_key: ionizer
    dps:
      - id: 111
        name: switch
        type: boolean
  - entity: binary_sensor
    class: problem
    category: diagnostic
    icon: "mdi:check-circle-outline"
    dps:
      - id: 20
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: true
            constraint: fault_code2
            conditions:
              - dps_val: 0
                value: false
          - value: true
      - id: 20
        type: bitfield
        name: fault_code
      - id: 113
        type: bitfield
        name: fault_code2
  - entity: switch
    translation_key: anti_frost
    dps:
      - id: 115
        name: switch
        type: boolean
