name: Ceiling fan with light
products:
  - id: zfwgeelmqcypcdgh
    manufacturer: Orison
    model: Chanfok Neo
entities:
  - entity: fan
    dps:
      - id: 107
        type: boolean
        name: switch
      - id: 106
        name: preset_mode
        type: string
        mapping:
          - dps_val: fresh
            value: fresh
          - dps_val: nature
            value: nature
      - id: 105
        type: integer
        name: speed
        optional: true
        range:
          min: 1
          max: 6
      - id: 104
        type: string
        name: direction
  - entity: switch
    name: Lights
    icon: "mdi:lightbulb-multiple"
    dps:
      - id: 20
        type: boolean
        name: switch
  - entity: light
    dps:
      - id: 20
        type: boolean
        name: available
      - id: 51
        type: base64
        mask: "000100000000000000000000"
        optional: true
        name: switch
        mapping:
          - dps_val: null
            value_mirror: available
      - id: 21
        type: string
        name: work_mode
      - id: 22
        type: integer
        name: std_brightness
        range:
          min: 10
          max: 1000
      - id: 51
        type: base64
        mask: "0000000000000000FFFF0000"
        optional: true
        name: brightness
        mapping:
          - dps_val: null
            value_mirror: std_brightness
        range:
          min: 0
          max: 1000
      - id: 23
        type: integer
        name: std_color_temp
        range:
          min: 0
          max: 1000
        optional: true
        mapping:
          - step: 500
            target_range:
              min: 2700
              max: 6500
      - id: 51
        type: base64
        mask: "00000000000000000000FFFF"
        optional: true
        name: color_temp
        range:
          min: 0
          max: 1000
        mapping:
          - dps_val: null
            value_mirror: std_color_temp
          - target_range:
              min: 3000
              max: 6500
  - entity: light
    translation_key: backlight
    dps:
      - id: 20
        type: boolean
        name: available
      - id: 51
        type: base64
        mask: "000200000000000000000000"
        optional: true
        name: switch
        mapping:
          - dps_val: null
            value: false
      - id: 24
        name: std_rgbhsv
        type: hex
        format:
          - name: h
            bytes: 2
            range:
              min: 0
              max: 360
          - name: s
            bytes: 2
            range:
              min: 0
              max: 1000
          - name: v
            bytes: 2
            range:
              min: 0
              max: 1000
      - id: 51
        type: base64
        optional: true
        name: rgbhsv
        format:
          - name: sw
            bytes: 2
          - name: h
            bytes: 2
            range:
              min: 0
              max: 360
          - name: s
            bytes: 2
            range:
              min: 0
              max: 1000
          - name: v
            bytes: 2
            range:
              min: 0
              max: 1000
          - name: wb
            bytes: 2
          - name: wc
            bytes: 2
  - entity: time
    name: Light timer
    translation_key: timer
    category: config
    dps:
      - id: 26
        type: integer
        name: second
        range:
          min: 0
          max: 86400
  - entity: number
    name: Fan timer
    translation_key: timer
    class: duration
    category: config
    dps:
      - id: 103
        type: integer
        name: value
        range:
          min: 0
          max: 540
        unit: min
  - entity: switch
    translation_key: keytone
    category: config
    dps:
      - id: 101
        type: boolean
        name: switch
  - entity: light
    translation_key: nightlight
    category: config
    dps:
      - id: 53
        type: boolean
        name: switch
  - entity: text
    translation_key: scene
    category: config
    hidden: true
    dps:
      - id: 36
        name: value
        type: base64
        optional: true
  - entity: select
    translation_key: scene
    category: config
    dps:
      - id: 36
        type: string
        name: option
        optional: true
        mapping:
          - dps_val: "AAABAQIODQAAyAAAAAA="
            value: night
          - dps_val: "AAEBAQIODQAD6AH0AAA="
            value: reading
          - dps_val: "AAIBAQIODQAD6APoAAA="
            value: working
          - dps_val: "AAMBAQIODQAB9AH0AAA="
            value: leisure
          - dps_val: "AAQAAAECA0ZGAgB4A+gD6EZGAgB4A+gACg=="
            value: Prairie
          - dps_val: "AAUAAAEGA0ZGAQAAA+gD6EZGAQB4A+gD6EZGAQDwA+gD6EZGAQA9A+gD\
              6EZGAQCuA+gD6EZGAQETA+gD6A=="
            value: Fun
          - dps_val: "AAYAAAEDA0ZGAQAAA+gD6EZGAQB4A+gD6EZGAQDwA+gD6A=="
            value: Dazzle
          - dps_val: "AAcAAAEGA0ZGAgAAA+gD6EZGAgB4A+gD6EZGAgDwA+gD6EZGAgA9A+gD\
              6EZGAgCuA+gD6EZGAgETA+gD6A=="
            value: Colorful
          - dps_val: "ABQAAAEDA0ZGAgCuA+gD6EZGAgC0ASwD6EZGAgC0ADID6A=="
            value: Blue Sky
          - dps_val: "AB0AAAEEA2RkAQAAA+gD6GRkAQDwA+gD6GRkAgB4A+gD6GRkAgA9A+gD\
              6A=="
            value: Mediterranean
          - dps_val: "ACAAAAEGA2RkAQA9A+gD6GRkAQB4A+gD6FpaAQETA+gD6FpaAQCuA+gD\
              6GRkAQAyAfQD6GRkAQAAA+gD6A=="
            value: Birthday
          - dps_val: "ACIAAAEGA1paAQDwA+gD6FpaAQA9A+gD6EZGAQAAA+gD6FpaAQCuA+gD\
              6FpaAQETA+gD6EZGAQB4A+gD6A=="
            value: Christmas
          - dps_val: "ADIBAQIODQAAyAAAAQYDRkYCAAAD6APoRkYCAHgD6APoRkYCAPAD6APo\
              RkYCAD0D6APoRkYCAK4D6APoRkYCARMD6APo"
            value: Streamer
          - dps_val: "ADMBAQIODQAB9AH0AQYDRkYBAAAD6APoRkYBAHgD6APoRkYBAPAD6APo\
              RkYBAD0D6APoRkYBAK4D6APoRkYBARMD6APo"
            value: Entertainment
