name: Curtain motor
products:
  - id: t6ief6k56sapz1ey
    name: M515EGWT v2
primary_entity:
  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
    - id: 7
      name: action
      type: string
      persist: false
      optional: true
      mapping:
        - dps_val: opening
          value: opening
        - dps_val: closing
          value: closing
    - id: 12
      name: fault_code
      type: bitfield
      optional: true
secondary_entities:
  - 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
  - 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
