name: Pet feeder
products:
  - id: p7it0r4vcqgluka8
    manufacturer: iPettie / Petlibro
    model: W5 / PLAF101
entities:
  - entity: number
    name: Manual feed
    icon: "mdi:paw"
    dps:
      - id: 3
        type: integer
        optional: true
        name: value
        unit: portions
        range:
          min: 1
          max: 12
      - id: 1
        type: string
        optional: true
        name: meal_plan
  - entity: sensor
    translation_key: status
    class: enum
    icon: "mdi:paw"
    category: diagnostic
    dps:
      - id: 4
        type: string
        name: sensor
        mapping:
          - dps_val: standby
            value: standby
          - dps_val: no_food
            value: no_food
          - dps_val: error_ir
            value: jammed
          - dps_val: feed_timeout
            value: blocked
          - dps_val: feeding
            value: feeding
  - entity: button
    translation_key: factory_reset
    category: config
    dps:
      - id: 9
        type: boolean
        name: button
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 14
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - dps_val: 8
            value: false
          - value: true
      - id: 14
        type: bitfield
        name: fault_code
      - id: 14
        type: bitfield
        name: description
        mapping:
          - dps_val: 0
            value: ok
          - dps_val: 1
            value: no_food
          - dps_val: 2
            value: jammed
          - dps_val: 4
            value: feed_timeout
          - dps_val: 8
            value: battery_low
  - entity: binary_sensor
    class: battery
    category: diagnostic
    dps:
      - id: 14
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 8
            value: true
          - value: false
  - entity: sensor
    name: Last feed
    icon: "mdi:paw"
    dps:
      - id: 15
        type: integer
        name: sensor
        unit: portions
