rytilahti / python-miio

Python library & console tool for controlling Xiaomi smart appliances
https://python-miio.readthedocs.io
GNU General Public License v3.0
3.51k stars 542 forks source link

Smart Rice Cooker Recipes #563

Open slinkymanbyday opened 4 years ago

slinkymanbyday commented 4 years ago

Hi, I'm in the process of collecting more recipes for the smart rice cooker (hunmi.cooker.normal2).

The way I am doing this is to intercept HTTPS traffic from the app. I am wondering why if anyone know why I am experiencing the below difference?

1) For "Khao Niao Mamuang" (one of the few recipes in english). I get the following cook code from the get_extra_data API endpoint (when retrieving recipe collection): 02176101000000000000800200a00069030103730000085a020000eb006b040103740000095a0400012d006e0501037400000a5a0401ffff00700601047600000c5a0401052d0a0f3c0a1e91ff820e01ff05ff78826eff10ff786e02690f0dff826eff691000ff826eff69100069ff5aff000000000000bc01

2) I send a different cook code to the device when i actually start the cooking process (RPC API): 0217e101000000000200800200a00069030103730000085a020000eb006b040103740000095a0400012d006e0501037400000a5a0401ffff00700601047600000c5a0401052d0a0f3c0a1e91ff820e01ff05ff78826eff10ff786e02690f0dff826eff691000ff826eff69100069ff5aff000000000000d3bf

Is this due to the set altititude or something else happening? There are small differences throughout the time period.

Once I understand this difference, I'll create a PR with the cooking codes for all the english recipes. I'll also look at doing some of the Chinese recipes, but there are lots and i'm not sure how to get the cooking codes automatically yet.

EDIT: if anyone knows of a python script/library that deals with authentication & signing API requests to xiaomi please enlighten me :)

rezmus commented 4 years ago

recipe api

https://framipotplugapi.joyami.com/v6/recipe/searchdataByModel?name=&model=chunmi.cooker.normal2&type=&pageno=1&perpage=1000&language=zh_CN

change language to en_US to get 4 english recipes (compared to 556 chinese).

cookcode may change a bit when you set some options before sending recipe. last 2 bytes are checksum recalculated on final cookcode data. you can get all info from this plugin

https://cdn.cnbj1.fds.api.mi-img.com/rn-plugins/2019-09-20/signed_10027_1000631_1_ANDROID_bundle_ed0835c722da8c38d68661a9bc9feef2.zip

kelemenlajos commented 1 year ago

Hi! Is there an easy way to download the recipes? I plan to get a joyami smart rice cooker, and I would like to use some authentic recipes, which are hard to find in Europe. As far as I understand the recipes are on these images:"iconPath":"/static/upload/recipe/625/843d157b60bb44e380c0179af00469eb.jpg which are somehow downloaded locally. Is there a way to get these? Thanks,

kelemenlajos commented 1 year ago

@slinkymanbyday did you manage to get the recipes?

prelude0000 commented 4 days ago

Im interested to create my own recipies but I haven't manage to find format how recipes are build. I tried to understand it from: https://github.com/rytilahti/python-miio/blob/master/miio/data/cooker_profiles.json but without success. Is there any work already on this and if is then could someone possibly provide to link on it?