name: Curtain
products:
  - id: oxzxmhkdvqexpwqo
    name: Eruiklink curtain motor
primary_entity:
  entity: cover
  class: curtain
  dps:
    - id: 1
      type: string
      name: control
      mapping:
        - dps_val: open
          value: open
        - dps_val: close
          value: close
        - dps_val: stop
          value: stop
    - id: 2
      type: integer
      name: position
      range:
        min: 0
        max: 100
    - id: 3
      type: integer
      name: current_position
      range:
        min: 0
        max: 100
    - id: 7
      type: string
      name: unreliable_action
    - id: 11
      type: string
      name: situation_set
      optional: true
secondary_entities:
  - entity: select
    name: Direction
    icon: "mdi:arrow-u-left-bottom"
    category: config
    dps:
      - id: 5
        type: string
        name: option
        mapping:
          - dps_val: forward
            value: Clockwise
          - dps_val: back
            value: Anti-clockwise
  - 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
        type: bitfield
        optional: true
        name: fault_code
  - entity: binary_sensor
    name: Hand pulled
    icon: "mdi:hand-back-right"
    category: diagnostic
    dps:
      - id: 102
        type: boolean
        name: sensor
