name: Air conditioner
products:
  - id: nn2ooaacswz6uyi0
    manufacturer: Brokton
    model: BRST12
entities:
  - 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: "0"
                value: auto
              - dps_val: "1"
                value: cool
              - dps_val: "2"
                value: dry
              - dps_val: "3"
                value: fan_only
              - dps_val: "4"
                value: heat
      - id: 2
        type: integer
        name: temperature
        precision: 1
        unit: C
        range:
          min: 1600
          max: 3100
        mapping:
          - scale: 100
            step: 50
      - id: 3
        type: integer
        name: current_temperature
        precision: 1
        mapping:
          - scale: 100
      - id: 4
        type: string
        name: mode
        hidden: true  # control via hvac_mode
      - id: 5
        type: string
        name: fan_speed
        hidden: true  # control via fan_mode
      - id: 7
        type: boolean
        name: fan_mode
        mapping:
          - dps_val: true
            value: auto
          - dps_val: false
            constraint: fan_speed
            conditions:
              - dps_val: "0"
                value: "off"
              - dps_val: "1"
                value: quiet
              - dps_val: "2"
                value: low
              - dps_val: "3"
                value: medlow
              - dps_val: "4"
                value: medium
              - dps_val: "5"
                value: medhigh
              - dps_val: "6"
                value: high
              - dps_val: "7"
                value: strong
      - id: 8
        type: boolean
        optional: true
        name: preset_mode
        mapping:
          - dps_val: false
            value: comfort
          - dps_val: true
            value: eco
          - value_redirect: ai_eco
      - id: 111
        type: boolean
        name: ai_eco
        optional: true
        hidden: true  # control via above
        mapping:
          - dps_val: false
            value: comfort
          - dps_val: true
            value: eco
      - id: 124
        type: string
        optional: true
        name: ai_eco_status
        mapping:
          - dps_val: "0"
            value: "off"
          - dps_val: "1"
            value: "AI eco frequency modulation"
          - dps_val: "2"
            value: "AI eco PID"
      - id: 113
        type: integer
        name: max_temperature
        mapping:
          - scale: 100
      - id: 114
        type: integer
        name: min_temperature
        mapping:
          - scale: 100
      - id: 24
        type: integer
        name: temp_set_f
      - id: 31
        type: string
        name: swing_mode
        mapping:
          - dps_val: "1"
            value: "on"
          - dps_val: "2"
            value: upper_half
          - dps_val: "3"
            value: lower_half
          - dps_val: "6"
            value: surround
          - dps_val: "8"
            value: "off"
          - dps_val: "9"
            value: topmost
          - dps_val: "10"
            value: top
          - dps_val: "11"
            value: middle
          - dps_val: "12"
            value: down
          - dps_val: "13"
            value: downmost
      - id: 34
        type: string
        name: swing_horizontal_mode
        mapping:
          - dps_val: "1"
            value: "on"
          - dps_val: "2"
            value: left_swing
          - dps_val: "3"
            value: center_swing
          - dps_val: "4"
            value: right_swing
          - dps_val: "5"
            value: direct
          - dps_val: "8"
            value: "off"
          - dps_val: "9"
            value: leftmost
          - dps_val: "10"
            value: left
          - dps_val: "11"
            value: center
          - dps_val: "12"
            value: right
          - dps_val: "13"
            value: rightmost
          - dps_val: "17"
            value: surround
  - entity: switch
    name: Anti-mould
    category: config
    hidden: unavailable
    dps:
      - id: 9
        type: boolean
        optional: true
        name: switch
      # Capabilities looks promising, but exact format unclear, and it
      # is not reported which prevents its use
      # - id: 133
      #   type: base64
      #   mask: "000000000010"
      #   name: available
      - id: 9
        type: boolean
        optional: true
        name: available
        mapping:
          - dps_val: null
            value: false
          - value: true
  - entity: switch
    name: Emergency heat
    category: config
    dps:
      - id: 12
        type: boolean
        optional: true
        name: switch
  - entity: light
    translation_key: display
    category: config
    dps:
      - id: 13
        type: boolean
        name: switch
  - entity: switch
    translation_key: sound
    category: config
    dps:
      - id: 16
        type: boolean
        name: switch
  - entity: switch
    translation_key: uv_sterilization
    category: config
    dps:
      - id: 26
        type: boolean
        name: switch
  - entity: switch
    translation_key: evaporator_cleaning
    category: config
    hidden: unavailable
    dps:
      - id: 27
        type: boolean
        optional: true
        name: switch
      # - id: 133
      #   type: base64
      #   mask: "000000000008"
      #   name: available
      - id: 27
        type: boolean
        optional: true
        name: available
        mapping:
          - dps_val: null
            value: false
          - value: true
  - entity: fan
    translation_key: ventilation
    category: config
    hidden: unavailable
    dps:
      - id: 39
        type: boolean
        optional: true
        name: switch
      - id: 40
        type: string
        optional: true
        name: speed
        mapping:
          - dps_val: "0"
            value: 0
          - dps_val: "1"
            value: 33
          - dps_val: "2"
            value: 66
          - dps_val: "3"
            value: 100
      # - id: 133
      #   type: base64
      #   mask: ""
      #   name: available
      - id: 39
        type: boolean
        optional: true
        name: available
        mapping:
          - dps_val: null
            value: false
          - value: true
  - entity: select
    translation_key: temperature_unit
    category: config
    dps:
      - id: 101
        type: boolean
        name: option
        mapping:
          - dps_val: false
            value: celsius
          - dps_val: true
            value: fahrenheit
  - entity: switch
    name: Eight-stage heating
    category: config
    dps:
      - id: 102
        type: boolean
        name: switch
  - entity: binary_sensor
    name: Aux heat
    class: running
    category: diagnostic
    dps:
      - id: 103
        type: boolean
        name: sensor
  - entity: switch
    name: Hot wind
    category: config
    dps:
      - id: 104
        type: boolean
        name: switch
  - entity: switch
    name: Cool wind
    category: config
    dps:
      - id: 105
        type: boolean
        name: switch
  - entity: switch
    name: Auto ventilation
    category: config
    hidden: unavailable
    dps:
      - id: 106
        type: boolean
        optional: true
        name: switch
      - id: 39
        type: boolean
        optional: true
        name: available
        mapping:
          - dps_val: null
            value: false
          - value: true
  - entity: text
    name: Week timer 1
    category: config
    icon: "mdi:calendar-clock"
    hidden: true  # advanced: need to understand format to use
    dps:
      - id: 107
        type: string
        name: value
  - entity: text
    name: Week timer 2
    category: config
    icon: "mdi:calendar-clock"
    hidden: true  # advanced: need to understand format to use
    dps:
      - id: 109
        type: string
        name: value
  - entity: binary_sensor
    name: Ventilation blocked
    class: problem
    category: diagnostic
    hidden: unavailable
    dps:
      - id: 108
        type: boolean
        optional: true
        name: sensor
      - id: 39
        type: boolean
        optional: true
        name: available
        mapping:
          - dps_val: null
            value: false
          - value: true
  - entity: binary_sensor
    name: Filter blocked
    class: problem
    category: diagnostic
    dps:
      - id: 110
        type: boolean
        name: sensor
      - id: 149
        type: boolean
        name: voice_alert
  - entity: binary_sensor
    name: Access card
    class: lock
    category: diagnostic
    dps:
      - id: 112
        type: boolean
        name: sensor
  - entity: sensor
    translation_key: ambient_temperature
    class: temperature
    dps:
      - id: 116
        type: integer
        name: sensor
        unit: C
        class: measurement
        precision: 1
        mapping:
          - scale: 100
  - entity: sensor
    name: Outdoor fan speed
    icon: "mdi:fan"
    category: diagnostic
    dps:
      - id: 117
        type: integer
        name: sensor
        unit: rpm
        class: measurement
  - entity: number
    name: Outdoor fan speed
    category: config
    hidden: true  # should be controlled by the unit
    icon: "mdi:fan"
    dps:
      - id: 118
        type: integer
        name: value
        unit: rpm
        range:
          min: 0
          max: 200
        mapping:
          - scale: 0.1
  - entity: sensor
    name: Compressor frequency
    class: frequency
    category: diagnostic
    dps:
      - id: 119
        type: integer
        name: sensor
        unit: Hz
        class: measurement
      - id: 120
        type: integer
        name: target
  - entity: number
    name: Compressor frequency
    category: config
    hidden: true  # should be controlled by the unit
    class: frequency
    dps:
      - id: 121
        type: integer
        name: value
        unit: Hz
        range:
          min: 0
          max: 150
  - entity: number
    name: EEV opening
    category: config
    hidden: true  # should be controlled by the unit
    icon: "mdi:valve"
    dps:
      - id: 122
        type: integer
        name: value
        range:
          min: 0
          max: 500
  - entity: switch
    name: Soft wind
    category: config
    dps:
      - id: 123
        type: string
        name: switch
        mapping:
          - dps_val: "0"
            value: false
          - dps_val: "1"
            value: true
          - value: true
            hidden: true
  - entity: select
    name: Reporting mode
    icon: "mdi:invoice-text-send"
    category: config
    dps:
      - id: 125
        type: string
        name: option
        mapping:
          - dps_val: "0"
            value: "On mode change"
          - dps_val: "1"
            value: "Hourly"
          - dps_val: "2"
            value: "Cloud pull"
  - entity: select
    name: Sleep mode
    icon: "mdi:sleep"
    category: config
    dps:
      - id: 126
        type: string
        name: option
        mapping:
          - dps_val: "0"
            value: "off"
          - dps_val: "1"
            value: normal
          - dps_val: "2"
            value: elderly
          - dps_val: "3"
            value: child
  - entity: sensor
    class: energy
    dps:
      - id: 127
        type: integer
        name: sensor
        unit: kWh
        class: total
        mapping:
          - scale: 100
      - id: 128
        type: unixtime
        name: last_reset
      - id: 129
        type: unixtime
        name: timestamp
  - entity: datetime
    name: Reset energy starting
    hidden: true  # avoid conflict with cloud
    category: config
    dps:
      - id: 130
        type: unixtime
        optional: true
        name: second
  - entity: datetime
    name: Reset energy ending
    hidden: true  # avoid conflict with cloud
    category: config
    dps:
      - id: 131
        type: unixtime
        optional: true
        name: second
  - entity: select
    name: Generator mode
    icon: "mdi:solar-power-variant"
    category: config
    dps:
      - id: 132
        type: string
        name: option
        mapping:
          - dps_val: "0"
            value: disabled
          - dps_val: "1"
            value: level_1
          - dps_val: "2"
            value: level_2
          - dps_val: "3"
            value: level_3
          - dps_val: "4"
            value: level_4
          - dps_val: "5"
            value: level_5
          - dps_val: "6"
            value: level_6
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 134
        type: string
        optional: true
        name: sensor
        mapping:
          # Since we don't have any observations, cover many possibilities
          - dps_val: ""
            value: false
          - dps_val: AA==
            value: false
          - dps_val: AAAA
            value: false
          - dps_val: AAAAAAAA
            value: false
          - dps_val: null
            value: false
          - value: true
      - id: 134
        type: base64
        optional: true
        name: fault_code
      - id: 144
        type: boolean
        name: inspection_mode
      - id: 145
        type: boolean
        name: demo_mode
  - entity: switch
    class: Light sensor
    category: config
    hidden: unavailable
    dps:
      - id: 135
        type: boolean
        optional: true
        name: switch
      - id: 135
        type: boolean
        optional: true
        name: available
        mapping:
          - dps_val: null
            value: false
          - value: true
  - entity: text
    name: Special timer
    category: config
    icon: "mdi:clock"
    hidden: true  # advanced config, need to understand format to use
    dps:
      - id: 136
        type: string
        name: value
  - entity: switch
    name: Vertical swing
    category: config
    hidden: true  # duplicates dp 31 but in more simplistic way
    dps:
      - id: 137
        type: string
        name: switch
        mapping:
          - dps_val: "0"
            value: false
          - dps_val: "1"
            value: true
  - entity: switch
    name: Horizontal swing
    category: config
    hidden: true  # duplicates dp 34 but in more simplistic way
    dps:
      - id: 138
        type: string
        name: switch
        mapping:
          - dps_val: "0"
            value: false
          - dps_val: "1"
            value: true
  - entity: switch
    name: Voice activation
    icon: "mdi:account-voice"
    category: config
    dps:
      - id: 142
        type: boolean
        name: switch
  - entity: sensor
    name: Voice status
    class: enum
    translation_key: status
    category: diagnostic
    dps:
      - id: 143
        type: string
        name: sensor
        mapping:
          - dps_val: "0"
            value: standby
          - dps_val: "1"
            value: starting
          - dps_val: "2"
            value: working
          - dps_val: "3"
            value: failed
          - dps_val: "4"
            value: replying
          - dps_val: "5"
            value: playback
  - entity: select
    name: Voice location
    icon: "mdi:account-voice"
    category: config
    hidden: true  # not clear whether this is user setting
    dps:
      - id: 146
        type: string
        name: option
        mapping:
          - dps_val: "0"
            value: location_1
          - dps_val: "1"
            value: location_2
          - dps_val: "2"
            value: location_3
          - dps_val: "3"
            value: location_4
          - dps_val: "4"
            value: location_5
      - id: 148
        type: integer
        name: mic_distance
  - entity: select
    name: Smart wind
    icon: "mdi:weather-windy"
    category: config
    dps:
      - id: 147
        type: string
        name: option
        mapping:
          - dps_val: "0"
            value: "off"
          - dps_val: "1"
            value: Avoid people
          - dps_val: "2"
            value: Target people
  - entity: select
    name: Auto generator mode
    icon: "mdi:solar-power-variant"
    category: config
    hidden: unavailable
    dps:
      - id: 151
        type: string
        optional: true
        name: option
        mapping:
          - dps_val: "0"
            value: disabled
          - dps_val: "1"
            value: level_1
          - dps_val: "2"
            value: level_2
          - dps_val: "3"
            value: level_3
          - dps_val: "4"
            value: level_4
          - dps_val: "5"
            value: level_5
          - dps_val: "6"
            value: level_6
          - dps_val: "7"
            value: paused
      - id: 151
        type: string
        optional: true
        name: available
        mapping:
          - dps_val: null
            value: false
          - value: true
  - entity: sensor
    name: Power source
    class: enum
    category: diagnostic
    hidden: unavailable
    dps:
      - id: 152
        type: string
        optional: true
        name: sensor
        mapping:
          - dps_val: "0"
            value: grid
          - dps_val: "1"
            value: generator
      - id: 152
        type: string
        optional: true
        name: available
        mapping:
          - dps_val: null
            value: false
          - value: true
  - entity: switch
    name: Turbo ventilation
    category: config
    icon: "mdi:car-turbocharger"
    hidden: unavailable
    dps:
      - id: 155
        type: boolean
        optional: true
        name: switch
      - id: 155
        type: boolean
        optional: true
        name: available
        mapping:
          - dps_val: null
            value: false
          - value: true
  - entity: binary_sensor
    class: light
    category: diagnostic
    hidden: unavailable
    dps:
      - id: 156
        type: boolean
        optional: true
        name: sensor
      - id: 156
        type: boolean
        optional: true
        name: available
        mapping:
          - dps_val: null
            value: false
          - value: true
