Skip to content

Xiaomi Smart Pet Food Feeder

jsapede edited this page Nov 16, 2024 · 3 revisions

Disassembly

Note

Requires special Tri-point screwdriver.

  1. Remove the backup batteries, if any are installed, in addition to unplugging the device.
  2. Remove the top food compartment lid and the food hopper.
  3. Unscrew the 6 tri-point screws visible on the triangular plastic cover of the controller board.
  4. Important! Take pictures of the connectors. The connectors for the hopper motor and door motor, respectively the connectors for the battery and DC IN, are the same shape, but different colors. Try to not swap any of them when reassembling!
  5. Unplug all the connectors and unscrew the board. We are now ready for flashing.

image

image

image

image

Pictures to be added soon

Flashing

Note

Requires soldering to exposed pads.

Unfortunately, for this device there are no connector footprints for the required pins on the ESP8266, so a solderless flash is not possible.

There are however, broken out and labelled test-pads, so it's not necessary to solder the wires directly to the tiny pins of the chip.

image

  1. On the back of the board identify test-pads labelled 11, 12, VIN, (2x) GND, IO0, and solder wires to them.
    • Identifying two GND pads is not necessary, but is easier than soldering 2 wires to the same pad.
  2. With the flasher disconnected from your PC,
    • Make sure your flasher voltage is set to 3.3V;
    • Connect VIN and one GND to the 3V3 and GND on your flasher;
    • Cross-connect pad 11 (RXD) to TX, and pad 12 (TXD) to RX on your flasher; (ESP-WROOM-02U Datasheet, Pin 11 - RXD, Pin 12 - TXD)
    • Connect the other GND pad to the pad labelled IO0 to put the ESP in bootloader mode.
  3. Using the tool of your choosing (esptool recommended) download the contents of the flash and store for safe keeping, in case you want to revert to factory or sell the device.
  4. Flash the ESPHome config.
  5. Unsolder the cables, plug the connectors according to the pictures you took, and reassemble the device.

Pictures to be added soon

Usage of example yaml

Feeding schedule

To be added.

MIOT Spec Details

Device Info (SIID: 1)

Nothing is sent on 1:1 ~ 1:5 on power cycle.

Feeder (SIID: 2)

Properties

  1. Device Fault. Works as expected
  2. Feeding measure. Can be read, but garbage. Used as input for the pet-food-out action.
  3. Pet Food Level Left - Works as expected

Actions

  1. Pet Food Out. Works as expected. Dispenses the specified portions immediately. Optional feeding-measure parameter; if left out, dispenses one portion.

Indicator Light (SIID: 3)

Everything works as expected

Feed Service (SIID: 4)

Properties

  1. outfood-num. Number of dispensed portions in last event. Specs say this is read|notify, but really it's only notify. The feed started|status|successful events use this to communicate what happened

  2. outfood-id. Index of scheduled feed that dispensed outfood-num portions in last event, or 255 if a manual feed. Specs say this is read|notify, but really it's only notify. The feed started|status|successful events use this to communicate what happened

  3. outletstatus. There is a motorized door protecting the dispensing outlet, "for freshness". Can be read. Is notified by properties_changed, but only after it's closed; there's no notification when it's opened, not even in the "Feeding Started" event.

  4. doorstatus. Top Lid of the device. Works as expected, thankfully.

Feeding Schedule (SIID: 5)

Properties

  1. feedplan-contr. Enable or disable the automatic feeding schedule. Works as expected.
  2. feedplan-stat. Unknown? Marked as write-only.
  • 6 - feedplan-hour, 7 - feedplan-min, 8 - feedplan-unit, 10 - feedplan-id, 11 - getfeedplan-num, 12 - feddplan-string produce garbage if read by themselves. They're used as inputs/outputs for actions.

Actions

  1. stopfeed. Unknown. Marks feedplan-contr as input, but the control is switchable by itself, making this action redundant.

  2. getfeedplan. Usage action 5 6 11 0 or action 5 6 11 1, and returns the first 5 or last 5 schedules in the feddplan-string property as output.

    Example:

    // Get page 0 of schedule. (schedules 0-4)
    [15:04:28][V][miot:189]: Sending reply 'down action 5 6 11 0' to MCU
    [15:04:28][V][miot:095]: Received MCU message 'result 5 6 0 12 "0,6,0,5,0,1,10,0,5,0,2,255,255,255,255,3,255,255,255,255,4,255,255,255,255"'
    [15:04:28][V][miot.text_sensor:011]: MCU reported text sensor 5:12 is: 0,6,0,5,0,1,10,0,5,0,2,255,255,255,255,3,255,255,255,255,4,255,255,255,255
    [15:04:28][V][text_sensor:013]: 'Raw Feed Plan': Received new state 0,6,0,5,0,1,10,0,5,0,2,255,255,255,255,3,255,255,255,255,4,255,255,255,255
    [15:04:28][D][text_sensor:064]: 'Raw Feed Plan': Sending state '0,6,0,5,0,1,10,0,5,0,2,255,255,255,255,3,255,255,255,255,4,255,255,255,255'
    
    // Get page 1 of schedule. (schedules 5-9)
    [15:05:06][V][miot:189]: Sending reply 'down action 5 6 11 1' to MCU
    [15:05:06][V][miot:095]: Received MCU message 'result 5 6 0 12 "5,255,255,255,255,6,255,255,255,255,7,255,255,255,255,8,255,255,255,255,9,255,255,255,255"'
    [15:05:06][V][miot.text_sensor:011]: MCU reported text sensor 5:12 is: 5,255,255,255,255,6,255,255,255,255,7,255,255,255,255,8,255,255,255,255,9,255,255,255,255
    [15:05:06][V][text_sensor:013]: 'Raw Feed Plan': Received new state 5,255,255,255,255,6,255,255,255,255,7,255,255,255,255,8,255,255,255,255,9,255,255,255,255
    [15:05:06][D][text_sensor:064]: 'Raw Feed Plan': Sending state '5,255,255,255,255,6,255,255,255,255,7,255,255,255,255,8,255,255,255,255,9,255,255,255,255'
  • 5 - feedlistadd, 6 - feedlistedit, 7 - feedlistdel are implemented as home assistant service calls add_scheduled_feed, edit_scheduled_feed and remove_scheduled_feed respectively. All work as intended.

Child Lock (SIID: 6)

Everything works as expected.

Cleaning Reminder (SIID: 8)

Everything works as expected.

Device Control (SIID:9)

Properties

  1. factory-result. Did not test. Specs say read|notify but I expect is only an output for the prtest action
  2. phon-time-zone. Unknown if this is useful. read|write|notify works.
  3. countrycode. Unknown if this is useful. read|write|notify works.

Actions

Not tested.

Replace Dessicant Reminder (SIID: 11)

Everything works as expected.