name: Curtain motor
products:
  - id: t6ief6k56sapz1ey
    model: M515EGWT v2
entities:
  - entity: cover
    class: curtain
    dps:
      - id: 1
        name: control
        type: string
        mapping:
          - dps_val: open
            value: open
          - dps_val: stop
            value: stop
          - dps_val: close
            value: close
      - id: 2
        name: position
        type: integer
        range:
          min: 0
          max: 100
        mapping:
          - invert: true
      - id: 2
        name: current_position
        type: integer
        range:
          min: 0
          max: 100
        mapping:
          - invert: true
      - id: 7
        name: work_state
        type: string
        optional: true
        mapping:
          - dps_val: opening
            value: opening
          - dps_val: closing
            value: closing
  - entity: switch
    name: Reversed
    icon: "mdi:arrow-u-left-bottom"
    category: config
    dps:
      - id: 5
        type: boolean
        name: switch
        optional: true
        mapping:
          - dps_val: null
            value: false
            hidden: true
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 12
        type: bitfield
        name: sensor
        optional: true
        mapping:
          - dps_val: 0
            value: false
          - dps_val: null
            value: false
          - value: true
      - id: 12
        name: fault_code
        type: bitfield
        optional: true
  - entity: select
    name: Border setting
    icon: "mdi:border-bottom-variant"
    category: config
    dps:
      - id: 16
        type: string
        name: option
        mapping:
          - dps_val: up
            value: Top
          - dps_val: down
            value: Bottom
          - dps_val: up_delete
            value: Clear top
          - dps_val: down_delete
            value: Clear bottom
          - dps_val: remove_top_bottom
            value: Clear all
  - entity: number
    name: Best position
    category: config
    icon: "mdi:roller-shade"
    dps:
      - id: 19
        type: integer
        name: value
        optional: true
        unit: "%"
        range:
          min: 0
          max: 100
