name: Pet feeder
products:
  - id: 13yxt7ukaktyacqi
    manufacturer: Newpet
    model: DR Feeder
entities:
  - entity: text
    translation_key: meal_plan
    category: config
    hidden: true
    dps:
      # Meal plan is the following binary blob (1 byte per line), encoded
      # in base64:
      # - Date (1 bit per day Monday -> Sunday, padded with 0 on the MSB).
      #    Ex: Monday, Wednesday, Sunday -> 0b01010001
      # - Hour
      # - Minute
      # - Feed number
      # - Enable/Disabled
      - id: 1
        type: base64
        name: value
        optional: true
  - entity: number
    translation_key: manual_feed
    dps:
      - id: 3
        type: integer
        optional: true
        name: value
        unit: portions
        range:
          min: 1
          max: 20
  - entity: sensor
    class: enum
    translation_key: status
    category: diagnostic
    dps:
      - id: 4
        type: string
        name: sensor
        mapping:
          - dps_val: standby
            value: standby
          - dps_val: feeding
            value: feeding
  - entity: binary_sensor
    class: problem
    category: diagnostic
    dps:
      - id: 13
        type: bitfield
        name: sensor
        mapping:
          - dps_val: 0
            value: false
          - dps_val: 8
            value: false
          - value: true
      - id: 13
        type: bitfield
        name: fault_code
      - id: 13
        type: bitfield
        name: description
        mapping:
          - dps_val: 0
            value: ok
          - dps_val: 1
            value: pet_food_jam
          - dps_val: 2
            value: pet_food_shortages
          - dps_val: 4
            value: pet_food_run_out
          - dps_val: 8
            value: desiccant_exhausted
          - dps_val: 16
            value: battery_low
          - dps_val: 64
            value: pet_food_stuck
  - entity: event
    icon: "mdi:paw"
    name: Feed Report
    dps:
      - id: 14
        type: integer
        name: event
        optional: true
        mapping:
          - dps_val: null
            value: null
          - value: fed
      - id: 14
        type: integer
        name: portions
        optional: true
  - entity: button
    translation_key: factory_reset
    category: config
    hidden: true
    dps:
      - id: 24
        type: boolean
        name: button
        optional: true
