Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xiaomi Xiaowan Smart pet feeder mmgg.feeder.petfeeder #1047

Open
AlexPotterOnGit opened this issue May 14, 2021 · 6 comments
Open

Xiaomi Xiaowan Smart pet feeder mmgg.feeder.petfeeder #1047

AlexPotterOnGit opened this issue May 14, 2021 · 6 comments

Comments

@AlexPotterOnGit
Copy link

Before submitting a new request, use the search to see if there is an existing issue for the device.

Device information:

  • Name(s) of the device: Xiaomi pet feeder
  • Link:

Use miiocli device --ip <ip address> --token <token>.

  • Model: mmgg.feeder.petfeeder
  • Hardware version: esp8266
  • Firmware version: 2.1.3

Additional context
If you know already about potential commands or any other useful information to add support for the device, please add that information here.

Hi team,

I'm not a developer but have the device above and would like to contribute to support of it if possible. I installed miiocli and can communicate with it. Just don't know next steps which needs to be done. If you could point me out the right direction will be appreciated.

@ofen
Copy link
Contributor

ofen commented Nov 2, 2021

@AlexPotterOnGit You could try similar way as for Pet Water Dispenser but I'm not sure about token flow:

  • hold hardware button to initialize provisioning mode
  • device should indicate that it's waiting for connection (e.g. blue blinking light)
  • connect from laptop to device's wifi (ssid usually contain model name)
  • run miiocli discover --no-mdns
  • output should print token and it should be different from 00000000000000000000000000000000 or ffffffffffffffffffffffffffffffff
  • check that token is valid miiocli device --ip <device_ip> --token <device_discovered_token> info
  • previous command should print model, hardware and firmware version
  • connect device to 2.4Ghz wifi miiocli device --ip <device_ip> --token <device_discovered_token> raw_command miIO.config_router '[{"ssid": "<your_wifi_name>", "passwd": "<your_wifi_password>", "uid": <your_xiaomi_account_user_id>}]'
  • device will print ok, changed it's network address and turn off (you could turn it back manually)
  • after success provisioning and if wifi have internet access, device will regenerate token and send it to Xiaomi cloud for subsequent use via their app
  • to get provisioned token from Xiaomi cloud you could use https://github.com/Squachen/micloud#in-terminal micloud --username youraccount@example.com --country cn --pretty
  • new token should be printed out if device is belong to account and country
  • if wifi network does not have internet access it should not regenerate token
  • go to https://home.miot-spec.com/spec/mmgg.feeder.spec for siid/piid/aiid
  • example: get feedtotal and outfood-num property miiocli device --ip <device_ip> --token <device_token> raw_command get_properties '[{"siid": 4, "piid": 2}, {"siid": 4, "piid": 4}]'
  • example: set server-time-zone property miiocli device --ip <device_ip> --token <device_token> raw_command set_properties '[{"siid": 9, "piid": 13, "value": 3}]'
  • example: run pet-food-out action miiocli device --ip <device_ip> --token <device_token> raw_command action '{"did": "", "siid": 2, "aiid": 1, "in":[]}'
  • example device with similar realization https://github.com/rytilahti/python-miio/blob/master/miio/huizuo.py
  • base class with proper action, getter and setter methods https://github.com/rytilahti/python-miio/blob/master/miio/miot_device.py

@AlexPotterOnGit
Copy link
Author

Great instructions, appreciated. Let me give it a try tonight.

@rytilahti
Copy link
Owner

Great instructions @ofen!

Would you mind creating a PR to add a note or two based on your experiences to https://python-miio.readthedocs.io/en/latest/contributing.html#miot-devices (https://github.com/rytilahti/python-miio/blob/master/docs/contributing.rst#miot-devices) based on what you just wrote above?

@Wh1terat
Copy link

Wh1terat commented Dec 5, 2021

Sadly it doesn't follow it's own published miot spec 🤦

But we've worked out all the available miio methods and format now.

See:
al-one/hass-xiaomi-miot#220

@Wh1terat
Copy link

Wh1terat commented Dec 6, 2021

#1210

@Charliecheung2
Copy link

  • raw_command action '{"did": "", "siid": 2, "aiid": 1, "in":[]}'

Dude you are amazing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants