name: Avatto roller blinds
products:
  - id: 3r8gc33pnqsxfe1g
primary_entity:
  entity: cover
  class: blind
  dps:
    - id: 1
      name: control
      type: string
      mapping:
        - dps_val: open
          value: open
        - dps_val: close
          value: close
        - dps_val: stop
          value: stop
    - id: 2
      name: position
      type: integer
      range:
        min: 0
        max: 100
    - id: 3
      name: current_position
      type: integer
      unit: "%"
      optional: true
      persist: false
    - id: 5
      name: control_back_mode
      type: boolean
    - id: 7
      name: action
      type: string
      mapping:
        - dps_val: opening
          value: opening
          constraint: current_position
          conditions:
            - dps_val: 100
              value: opened
            - dps_val: null
              value: opened
        - dps_val: closing
          value: closing
          constraint: current_position
          conditions:
            - dps_val: 0
              value: closed
            - dps_val: null
              value: closed
secondary_entities:
  - entity: select
    translation_key: timer
    category: config
    dps:
      - id: 8
        name: option
        type: string
        mapping:
          - dps_val: cancel
            value: cancel
          - dps_val: "1"
            value: "1h"
          - dps_val: "2"
            value: "2h"
          - dps_val: "3"
            value: "3h"
          - dps_val: "4"
            value: "4h"
  - entity: sensor
    translation_key: time_remaining
    class: duration
    category: diagnostic
    dps:
      - id: 9
        name: sensor
        type: integer
        optional: true
        unit: s
  - entity: sensor
    name: Travel time
    icon: "mdi:hourglass"
    category: diagnostic
    dps:
      - id: 11
        name: sensor
        type: integer
        unit: ms
