name: Pet feeder
products:
  - id: vhpxqilaahtj3zrr
    manufacturer: Arlec
    model: Grid Connect 5L
entities:
  - entity: number
    name: Manual feed
    icon: "mdi:food-drumstick"
    dps:
      - id: 3
        type: integer
        optional: true
        name: value
        range:
          min: 1
          max: 12
  - entity: text
    name: Meal plan
    category: config
    hidden: true
    dps:
      # Meal plan is the following binary blob (1 byte per line), encoded
      # in base64 (can repeat up to 10 times):
      # - Date (1 bit per day Monday -> Sunday, padded with 0 on the MSB).
      #    Ex: Monday, Wednesday, Sunday -> 0b01010001
      # - Hour
      # - Minute
      # - Feed portions
      # - Enable/Disabled
      - id: 1
        type: base64
        name: value
        optional: true
  - entity: sensor
    translation_key: status
    class: enum
    category: diagnostic
    dps:
      - id: 4
        type: string
        name: sensor
        mapping:
          - dps_val: standby
            value: standby
          - dps_val: feeding
            value: feeding
          - dps_val: done
            value: done
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 14
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            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: pet_food_jam
          - dps_val: 2
            value: pet_food_low
          - dps_val: 4
            value: pet_food_finished
          - dps_val: 8
            value: desiccant_exhausted
          - dps_val: 16
            value: battery_low
  - entity: sensor
    icon: "mdi:paw"
    name: Feed report
    category: diagnostic
    dps:
      - id: 15
        name: sensor
        # Encountered values so far:
        # 11: Feeding OK
        # 10/21: Rotating plate is stuck
        type: integer
        optional: true
  - entity: sensor
    name: Battery
    category: diagnostic
    dps:
      - id: 11
        name: sensor
        type: integer
        unit: "%"
  - entity: number
    name: Voice playbacks
    category: config
    dps:
      - id: 18
        name: value
        type: integer
        range:
          min: 0
          max: 5
  - entity: button
    translation_key: factory_reset
    category: config
    dps:
      - id: 9
        type: boolean
        name: button
        optional: true
  - entity: light
    translation_key: indicator
    category: config
    dps:
      - id: 19
        type: boolean
        name: switch
