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

Support for Xiaomi Mi Induction Cooker #491

Open
EUA opened this issue Mar 29, 2019 · 27 comments
Open

Support for Xiaomi Mi Induction Cooker #491

EUA opened this issue Mar 29, 2019 · 27 comments

Comments

@EUA
Copy link

EUA commented Mar 29, 2019

I believe it has similar commands with Mi Smart Electric Rice Cooker.

[death@Ryzen ~]$ mirobo -d info
INFO:miio.vacuum_cli:Debug mode active
DEBUG:miio.vacuum_cli:Read stored sequence ids: {'seq': 13, 'manual_seq': 0}
DEBUG:miio.vacuum_cli:Connecting to 192.168.1.236 with token [TOKEN]
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''
DEBUG:miio.device:Got a response: Container: 
    data = Container: 
        data = b'' (total 0)
        value = b'' (total 0)
        offset1 = 32
        offset2 = 32
        length = 0
    header = Container: 
        data = b'!1\x00 \x00\x00\x00\x00\x07\x14~D\x00\x00"]' (total 16)
        value = Container: 
            length = 32
            unknown = 0
            device_id = b'\x07\x14~D' (total 4)
            ts = 1970-01-01 02:26:37
        offset1 = 0
        offset2 = 16
        length = 16
    checksum = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' (total 16)
DEBUG:miio.device:Discovered 07147e44 with ts: 1970-01-01 02:26:37, token: b'00000000000000000000000000000000'
DEBUG:miio.device:192.168.1.236:54321 >>: {'id': 14, 'method': 'miIO.info', 'params': []}
DEBUG:miio.device:192.168.1.236:54321 (ts: 1970-01-01 02:26:37, id: 14) << {'result': {'life': 8797, 'token': '[TOKEN]', 'mac': '[MAC]', 'fw_ver': '1.3.6', 'hw_ver': 'ESP8266', 'uid': '1588398448', 'model': 'chunmi.ihcooker.v1', 'mcu_fw_ver': '0027', 'wifi_fw_ver': '1.5.0-dev(7efd021)', 'ap': {'rssi': -50, 'ssid': 'DeathNet', 'bssid': '[BSSID]'}, 'netif': {'localIp': '192.168.1.236', 'mask': '255.255.255.0', 'gw': '192.168.1.1'}, 'mmfree': 16728}, 'id': 14}
chunmi.ihcooker.v1 v1.3.6 ([MAC]) @ 192.168.1.236 - token: [TOKEN]
DEBUG:miio.vacuum_cli:Full response: {'ap': {'bssid': '[BSSID]', 'rssi': -50, 'ssid': 'DeathNet'},
 'fw_ver': '1.3.6',
 'hw_ver': 'ESP8266',
 'life': 8797,
 'mac': '[MAC]',
 'mcu_fw_ver': '0027',
 'mmfree': 16728,
 'model': 'chunmi.ihcooker.v1',
 'netif': {'gw': '192.168.1.1',
           'localIp': '192.168.1.236',
           'mask': '255.255.255.0'},
 'token': '[TOKEN]',
 'uid': '1588398448',
 'wifi_fw_ver': '1.5.0-dev(7efd021)'}
DEBUG:miio.vacuum_cli:Writing {'seq': 14, 'manual_seq': 0} to /home/death/.cache/python-miio/python-mirobo.seq

And can get this outputs to 'all' command.

[death@Ryzen ~]$ mirobo raw-command get_prop '["all"]'
Sending cmd get_prop with params ['all']
['shutdown', '0200000000000000000000000000000000', '000f000000', '0100000000000000', '001b0a04', '00000001000000020000000300000004000000050000a4e000000dcc00000000', '00', '0000e70a00170f0f00']

[death@Ryzen ~]$ mirobo raw-command get_prop '["all"]'
Sending cmd get_prop with params ['all']
['waiting', '02537465616d2f626f696c000000000002', '0013000000', '0100010000000000', '001b0a04', '00000001000000020000000300000004000000050000a4e000000dcc00000000', '00', '0000e60a0017130f00']

@aquarat
Copy link

aquarat commented May 20, 2019

I've bought four of these things haha and disassembled one of them. Here is the output from the same commands as above and some interpretations :

INFO:miio.vacuum_cli:Debug mode active
DEBUG:miio.vacuum_cli:Connecting to 192.168.4.1 with token 264d146cddb9406f9d7acdacea6bd083
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''
DEBUG:miio.device:Got a response: Container: 
    data = Container: 
        data = b'' (total 0)
        value = b'' (total 0)
        offset1 = 32
        offset2 = 32
        length = 0
    header = Container: 
        data = b'!1\x00 \x00\x00\x00\x00\x06\xb8\xa0\xa6\x00\x00\x01H' (total 16)
        value = Container: 
            length = 32
            unknown = 0
            device_id = b'\x06\xb8\xa0\xa6' (total 4)
            ts = 1970-01-01 00:05:28
        offset1 = 0
        offset2 = 16
        length = 16
    checksum = b'&M\x14l\xdd\xb9@o\x9dz\xcd\xac\xeak\xd0\x83' (total 16)
DEBUG:miio.device:Discovered 06b8a0a6 with ts: 1970-01-01 00:05:28, token: b'264d146cddb9406f9d7acdacea6bd083'
DEBUG:miio.device:192.168.4.1:54321 >>: {'id': 1, 'method': 'miIO.info', 'params': []}
DEBUG:miio.device:192.168.4.1:54321 (ts: 1970-01-01 00:05:28, id: 1) << {'result': {'life': 328, 'token': '264d146cddb9406f9d7acdacea6bd083', 'mac': '40:31:3C:70:CD:0D', 'fw_ver': '1.3.3', 'hw_ver': 'ESP8266', 'model': 'chunmi.ihcooker.exp1', 'mcu_fw_ver': '0010', 'wifi_fw_ver': '1.5.0-dev(1210f4f)', 'ap': {'rssi': 31, 'ssid': 'SOME-WIFI', 'bssid': '0A:1B:6B:0C:D4:A5'}, 'netif': {'localIp': '0.0.0.0', 'mask': '0.0.0.0', 'gw': '0.0.0.0'}, 'mmfree': 16432}, 'id': 1}
chunmi.ihcooker.exp1 v1.3.3 (40:31:3C:70:CD:0D) @ 0.0.0.0 - token: 264d146cddb9406f9d7acdacea6bd083
DEBUG:miio.vacuum_cli:Full response: {'ap': {'bssid': '6C:3B:6B:0C:D4:A5', 'rssi': 31, 'ssid': 'aquarat'},
 'fw_ver': '1.3.3',
 'hw_ver': 'ESP8266',
 'life': 328,
 'mac': '40:31:3C:70:CD:0D',
 'mcu_fw_ver': '0010',
 'mmfree': 16432,
 'model': 'chunmi.ihcooker.exp1',
 'netif': {'gw': '0.0.0.0', 'localIp': '0.0.0.0', 'mask': '0.0.0.0'},
 'token': '264d146cddb9406f9d7acdacea6bd083',
 'wifi_fw_ver': '1.5.0-dev(1210f4f)'}
DEBUG:miio.vacuum_cli:Writing {'seq': 1, 'manual_seq': 0} to /home/aquarat/.cache/python-miio/python-mirobo.seq

and while it was on (but not cooking) :

Sending cmd get_prop with params ['all']
['waiting', '01484f54504f540000000000000000000000000000000000000000000000000001', '000f000000', '0000000000000000', '000a1404', '0000000100000002000000030000000400000005000000000000000000000000', '01', '0000f30a00150f0f00']

While off, room temperature pot :

Sending cmd get_prop with params ['all']
['shutdown', '010000000000000000000000000000000000000000000000000000000000000000', '000f000000', '0000000000000000', '000a1404', '0000000100000002000000030000000400000005000000000000000000000000', '01', '0000f00a00160f0b00']

While cooking at 10% power in "hotpot" mode (pot is cold) :

Sending cmd get_prop with params ['all']
['running', '01484f54504f540000000000000000000000000000000000000000000000000001', '00170a00b9', '0200020000000000', '000a1404', '0000000100000002000000030000000400000005000000000000000000000000', '01', '0000ef160a1a171b00']

While cooking at 99% power in "hotpot" mode (pot is warming up, probably +/- 50 deg C) :

Sending cmd get_prop with params ['all']
['running', '01484f54504f540000000000000000000000000000000000000000000000000001', '00306300b9', '0200013b00000000', '000a1404', '0000000100000002000000030000000400000005000000000000000000000000', '01', '0000ea4a6330303400'

Paused, just after hitting 99.5 degrees C water temperature in the pot :

['pause', '01484f54504f540000000000000000000000000000000000000000000000000001', '00616300b9', '0200013b00000935', '000a1404', '0000000100000002000000030000000400000005000000000000000000000000', '01', '0000f00a0032616500']

If results[2] is '00591000b9' then
'00591000b9'[2:4] is temperature in C in hex (89 deg C)
'00591000b9'[4:6] is power in % in hex (16% power)
'00591000b9'[8:10] seems to be an enum of the cooking mode :
"hotpot" 9b
"simmer" 9b
"stir fry" c7
"steam and boil" b4

results[3] appears to be timer-related:
When the timer has been set, results[3][5] is '2', '1' when running and '0' when not active.
results[3][8:10] is hours in hex remaining
results[3][10:12] is minutes in hex remaining

Also, if I discover the device with handshaking enabled and then do wifi-configure, the device connects to the target network but the token seems to change. The device's token can't be retrieved once it is on the new network.

@rytilahti
Copy link
Owner

Have you already tried to using the existing cooker module for this, maybe it uses the same (or slightly changed) format? I'm unfamiliar with these devices, @syssi knows more what'd be the best approach to add support for it.

@aquarat
Copy link

aquarat commented May 21, 2019

I looked at cooker.py thinking that they may be similar but the format appears to be quite different (they're much simpler than the device cooker.py describes, but running modes are somewhat similar). It should be easy to implement though. If I have time today I'll give it a go.

There's one issue I'm having though that's really turning into a drag: the devices seem to change their token when I configure them to connect to my home wifi network. I can only query them when they're in pairing mode.

It's got an esp8266 in it with UART headers, so first prize would be a Tasmota-like project haha. One day.

@rytilahti
Copy link
Owner

Ah, I see, yeah, ESP8266 is a common occurrence, I suppose ;-) Almost all, if not all devices reset the token during provisioning (except some very old one, I think this got fixed at some point in their sdk), so the token has to be extracted, e.g., from the backups after that is done.

Feel free to submit a PR in case you discover how the message format works!

@arzaman
Copy link

arzaman commented Oct 11, 2019

Does anyone succeed to control the Xiaomi Induction cooker ?
@aquarat did you complete the hacking of the ES8266 ?
I'm Interested to contribute to a Tasmota like control and looking for some support

@hossF
Copy link

hossF commented Oct 12, 2019

I am trying to start, stop and control the temperature of the Xiamoi Induction stove.
I succeded to stop it using the raw command:
mirobo --ip [the_IP] --token [the_Token] raw-command set_func '["end02"]'.
Does anyone know if it's possible to start the induction cooker or/and control the temperatures using the raw commands? If not, I would like to contribute and make this control possible.
Thanks.
Houssem

@syssi
Copy link
Collaborator

syssi commented Oct 12, 2019

Could you provide the Mi Home app plugin (apk) of this device? You can extract/retrieve it if you have a rooted android device.

@esgie
Copy link

esgie commented Apr 6, 2020

Could you provide the Mi Home app plugin (apk) of this device? You can extract/retrieve it if you have a rooted android device.

Hi there, here’s apk for induction cooker.
https://drive.google.com/file/d/1eA21un6n8inM2nAZLCGDRdVrQzTPVdwX/view?usp=drivesdk

@houser42
Copy link

Hello,
I am trying to use this induction cooker in Homebridge/Homekit. Can this code be used for this?
Would be really useful! Many thanks..

@SimonDanisch
Copy link

Hi,
I'd love to create a smart cooker with a nice App to create complex, shareable cooking profiles for e.g. the perfect sushi rice.
The Xioami induction stove is the only stove I could find, which even gives you the chance to control everything by wifi.
I'm tempted to buy it, but I want to make sure, that it will be possible to control it with my custom software!

So is the token problem solvable? I guess the rest, snooping all parts of the protocol, should be fairly trivial going forward?
I'd be willing to help with that, but I don't think I can contribute much to the token issue.

@coolibry
Copy link

Hi,
i got chunmi.ihcooker.exp1,
i test pull request #832 from basveeling,

first on line 621 of ihcooker.py, i change menu to recip_name :
"Menu: {result.recipe_name}\n"

then i got the status :

$ miiocli ihcooker --ip my_ip --token my_token status
Mode: OperationMode.Shutdown
Menu:
Temperature: 60
Hardware version: 13
Firmware version: 5124

after i want to start a program, but i got error :

$ miiocli ihcooker --ip my_ip --token my_token start 01 false
Cooking profile started
Traceback (most recent call last):
File "/usr/bin/miiocli", line 33, in
sys.exit(load_entry_point('python-miio==0.5.0.1', 'console_scripts', 'miiocli')())
File "/usr/lib/python3.9/site-packages/miio/cli.py", line 44, in create_cli
return cli(auto_envvar_prefix="MIIO")
File "/usr/lib/python3.9/site-packages/miio/click_common.py", line 59, in call
return self.main(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/miio/click_common.py", line 280, in wrap
kwargs["result"] = func(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/click/decorators.py", line 73, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/lib/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/miio/click_common.py", line 245, in command_callback
return miio_command.call(miio_device, *args, **kwargs)
File "/usr/lib/python3.9/site-packages/miio/click_common.py", line 193, in call
return method(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/miio/ihcooker.py", line 677, in start
profile.set_save_recipe(False)
File "/usr/lib/python3.9/site-packages/miio/ihcooker.py", line 279, in set_save_recipe
self.data[i] = self.data[i] & 255
IndexError: bytearray index out of range

value of self.data is:

bytearray(b'\x01')

in next i want to set temperature in continuous mode with a custom level of fire,
it's seem to be possible to make this, but what is the correct command line?

Thanks in advance.

@coolibry
Copy link

coolibry commented Jan 17, 2021

i find the solution,
we need to insert complet recipe,
i use example :
030207bce5c5e0b8f90000000000000000000000000000000000000000000000000000000ce1000f040000000000010000800fd2c8501414008000d2b9011414008000d2b95a1414008000d2b95a1414008000d2b95a1414008000d2b95a1414008000d2b9371414008000d2b9001414008000d2b9001414008000d2b9001414008000d2b9001414008000d2b9001414008000d2b9001414008000d2b900141400ffffd2b9001414000000000000000000b2f8

all value need to converted to hexadecimal
[0-1] : mode
[2-3] : device id
[4-5] : position on the menu, range: 01>08, don't save: 09
[6-72] : name of recipe
[76-77] : hour timer
[78-79] : hour timer
[104-105] : target temp
[106-107] : fire level

after adjustement :
miiocli ihcooker --ip <my_ip> --token <my_token> start <long_Hexa_string> false

with this we can set target temp 40°C to 200°C (80°C to 110°C works, Xiaomi app can't this),
happy cooking :).

edit :
i modify ihcooker.py to get easier custom recipe :
ihcooker.py.zip
and for use it :
edit your recipe stage start at line 738, actual example is for automatic rice cooking
save file and in terminal launch this :
miiocli ihcooker --ip <my_ip> --token <my_token> set_menu "recipe name" "position [1-9] 9: no saving" "confirm_start [True/False]"

with this no need to do something with hexadecimal value.

@coolibry
Copy link

coolibry commented Jan 31, 2021

Hi,
i buy TOKIT TDCL0P1ACM (Smart Induction Cooker Pro),
but this don't works with mi home app,
with tokit app and chinese phone number it's works,
token don't works the same as mi home,

with app in power mode, it's possible to make a recipe with 3 step power and time
in temp mode only 1 step and unable to select 80°C >110°C

standby power is the same as chunmi.ihcooker.exp1 = 3.4W
power at level 2 is the same as chunmi.ihcooker.exp1 = 400W with small pan

i don't know if it's possible to flash a firmware that works with Mi home app,
then get token and play with it.

i take screenshot of Tokit app:
https://imgur.com/a/tEX29uJ

From 4pda.ru, Sergevit buy TDCL0E1ACM (Smart Induction Cooker Lite),
it's take some picture,
controller used is : ESP32-WROOM-32D
new design on sensor to avoid burn,
https://4pda.ru/forum/index.php?s=&showtopic=910277&view=findpost&p=103480910

then if you want to get something like this please verify that this induction cooker works with mi home application,
tokit application is chinese only and chinese phone +86 is required.

edit 2021-02-24 :
this induction cooker use mqtt protocol instead of miio,
i setup mosquitto server, and after many try, i can control it, cloud is in my home now :)
in short :

  • create acces point 2.4ghz
  • connect induction cooker with tokit account (free sms temp is your friend for +86 phone number)
  • setup dnsmasq, assign static ip, redirect url domain to mosquitto server
  • setup nginx server to listen on port 443, then see log and retrieve passwords
  • use documentation of aliuncs to connect on server and play with request
  • use iptable to transfert port 443 to 8883
  • setup mosquitto with tls support and generate certificate
  • induction cooker now connect to my server :)
  • play with it and understand request <- i'm here

thanks basveeling for make the code,
for recipe step code is the same,
i can add comment about some points,
maybe it's possible to schedule start of induction cooker (mine can)
i retrieve firmware update file (unencrypted), i don't know if reverse enginering is possible.

but now it's outside of miio protocol,
mqtt protocol is cool :), it's a very good learning experience for me

@cudab
Copy link

cudab commented Mar 4, 2021

i find the solution,
we need to insert complet recipe,
i use example :
030207bce5c5e0b8f90000000000000000000000000000000000000000000000000000000ce1000f040000000000010000800fd2c8501414008000d2b9011414008000d2b95a1414008000d2b95a1414008000d2b95a1414008000d2b95a1414008000d2b9371414008000d2b9001414008000d2b9001414008000d2b9001414008000d2b9001414008000d2b9001414008000d2b9001414008000d2b900141400ffffd2b9001414000000000000000000b2f8

all value need to converted to hexadecimal
[0-1] : mode
[2-3] : device id
[4-5] : position on the menu, range: 01>08, don't save: 09
[6-72] : name of recipe
[76-77] : hour timer
[78-79] : hour timer
[104-105] : target temp
[106-107] : fire level

after adjustement :
miiocli ihcooker --ip <my_ip> --token <my_token> start <long_Hexa_string> false

with this we can set target temp 40°C to 200°C (80°C to 110°C works, Xiaomi app can't this),
happy cooking :).

edit :
i modify ihcooker.py to get easier custom recipe :
ihcooker.py.zip
and for use it :
edit your recipe stage start at line 738, actual example is for automatic rice cooking
save file and in terminal launch this :
miiocli ihcooker --ip <my_ip> --token <my_token> set_menu "recipe name" "position [1-9] 9: no saving" "confirm_start [True/False]"

with this no need to do something with hexadecimal value.

Sorry, I searched for a long time, but I couldn't find how to add ihcooker.py to miiocli (or another * .py).
Can someone just refer me to how?
Thank you very much

edit2:
answer for me how :-):

add text to the correct files or insert new files from basveeling #832. ihcooker.py from coolibry and edit for own recipe.

great, thank you very much, I'm going to try!!!!

edit3:
note: i have chunmi.ihcooker.exp1 so VERSION_2 and Timer (set mins) doesn't work. I'm not a programmer, but I'm still fighting to see why :-)

If i can set timer, manualy set hours and minutes in set_duration and set_duration_maximum. But more then 4 hours not set, cooker time will reduce

edit4:
I found out, that mins in mode works, but Timer on cooker is not set and cooker is STAND BY after set mins in mode to Time cooker.
Time on cooker is 60 min, set by set_duration in file ihcooker.py (line 138). I think, that 60 min is default, so Timer on cooker look like not set. I must try, if set_dureation < sum(mins in mode), than cooker is stoped earlier then mins in mode. If yes, must set set_duration sum(mins in mode) + approx time mode heat_until_temp. So put approx time to input args and set_duration to count sum phase.get("mins", 0) + input more minutes? And if this time is more then 240 so put 240? when I have time, I'll try

@coolibry
Copy link

hello Cudab,
great to see this works :),
yes some durations is coded by default, then code need to be adjusted,

in my side i noticed 3 things that can be usefull :

  1. for each phase end value :
self.data[o + 6] = 20
self.data[o + 7] = 20

this is the mode of fire, this value equal to constant fire,
to pulse fire, it can be (value need to be different) :

self.data[o + 6] = 6  #fire off time
self.data[o + 7] = 3  #fire on time

if value is set to 0 = no fire
if value is the same = constant fire

  1. i found 4 different mode of cooking (self.data[o]) :
    "continuous_output" = 0 #Temp regulation, no thresold, fire adjustable, the same as 16

"heat_until_temp" = 2 #same as 0 but with threshold

"temp_auto_small" = 8 #temp regulation and fire hard coded for small pot
#step 1: fire level 50, step 2: when target temp fire level go to level 10

"temp_auto_big" = 24 #temp regulation and fire hard coded for big pot
#step 1: fire level 99, step 2: when target temp fire level go to level 50

then only mode 0 and 2 are usefull.
for mode 8 & 24, wattmeter permit to see how this works.

  1. my cooker permit to differ start of cooking (i don't know if this is available on other cooker) :
    this works as (cooker need to be on and command is set_start):
    prog time = 19h00
    current time = 8h00
    time of recipe = 1h00

array_recipe[14] = prog hours end cooking 128+hours = 147
array_recipe[15] = prog min end cooking = 00
second parameter = (prog time - current time - time of recipe) in hh:min
array_recipe[16] = hours of second parameter = 10
array_recipe[17] = minutes of second parameter = 00

with this cooker start at 18h cooking

of course position of this need to find (in range of all 0 value).

hope this can be usefull :)

@sachaw
Copy link

sachaw commented Sep 15, 2021

Sorry about this being off-topic, but is anybody able to provide an English version of the firmware, me and many other people have Chinese language only versions and would love to be able to flash the international firmware.
Thanks.

@edimarcr
Copy link

edimarcr commented Dec 4, 2021

i find the solution, we need to insert complet recipe, i use example : 030207bce5c5e0b8f90000000000000000000000000000000000000000000000000000000ce1000f040000000000010000800fd2c8501414008000d2b9011414008000d2b95a1414008000d2b95a1414008000d2b95a1414008000d2b95a1414008000d2b9371414008000d2b9001414008000d2b9001414008000d2b9001414008000d2b9001414008000d2b9001414008000d2b9001414008000d2b900141400ffffd2b9001414000000000000000000b2f8

all value need to converted to hexadecimal [0-1] : mode [2-3] : device id [4-5] : position on the menu, range: 01>08, don't save: 09 [6-72] : name of recipe [76-77] : hour timer [78-79] : hour timer [104-105] : target temp [106-107] : fire level

after adjustement : miiocli ihcooker --ip <my_ip> --token <my_token> start <long_Hexa_string> false

with this we can set target temp 40°C to 200°C (80°C to 110°C works, Xiaomi app can't this), happy cooking :).

edit : i modify ihcooker.py to get easier custom recipe : ihcooker.py.zip and for use it : edit your recipe stage start at line 738, actual example is for automatic rice cooking save file and in terminal launch this : miiocli ihcooker --ip <my_ip> --token <my_token> set_menu "recipe name" "position [1-9] 9: no saving" "confirm_start [True/False]"

with this no need to do something with hexadecimal value.

==================================================

Installed version: Python-miio 0.5.9.1
Mi Induction Cooker chunmi.ihcooker.v1

I tried to use the indicated improvement, but the command returned the following error:

Usage: miiocli [OPTIONS] COMMAND [ARGS]...
Try "miiocli --help" for help.

Error: No such command "ihcooker".

Thanks for sharing

@cudab
Copy link

cudab commented Dec 5, 2021

i find the solution, we need to insert complet recipe, i use example : 030207bce5c5e0b8f90000000000000000000000000000000000000000000000000000000ce1000f040000000000010000800fd2c8501414008000d2b9011414008000d2b95a1414008000d2b95a1414008000d2b95a1414008000d2b95a1414008000d2b9371414008000d2b9001414008000d2b9001414008000d2b9001414008000d2b9001414008000d2b9001414008000d2b9001414008000d2b900141400ffffd2b9001414000000000000000000b2f8
all value need to converted to hexadecimal [0-1] : mode [2-3] : device id [4-5] : position on the menu, range: 01>08, don't save: 09 [6-72] : name of recipe [76-77] : hour timer [78-79] : hour timer [104-105] : target temp [106-107] : fire level
after adjustement : miiocli ihcooker --ip <my_ip> --token <my_token> start <long_Hexa_string> false
with this we can set target temp 40°C to 200°C (80°C to 110°C works, Xiaomi app can't this), happy cooking :).
edit : i modify ihcooker.py to get easier custom recipe : ihcooker.py.zip and for use it : edit your recipe stage start at line 738, actual example is for automatic rice cooking save file and in terminal launch this : miiocli ihcooker --ip <my_ip> --token <my_token> set_menu "recipe name" "position [1-9] 9: no saving" "confirm_start [True/False]"
with this no need to do something with hexadecimal value.

==================================================

Installed version: Python-miio 0.5.9.1 Mi Induction Cooker chunmi.ihcooker.v1

I tried to use the indicated improvement, but the command returned the following error:

Usage: miiocli [OPTIONS] COMMAND [ARGS]... Try "miiocli --help" for help.

Error: No such command "ihcooker".

Thanks for sharing

Hi,
try past incooker.py from https://github.com/rytilahti/python-miio/blob/9b402c0585bf97820adc9ea69dcafb30dfd7d5a0/miio/integrations/ihcooker/ihcooker.py to ..../pythonX.Y/dist_pakages/miio/

@edimarcr
Copy link

edimarcr commented Dec 5, 2021

miiocli ihcooker --ip <my_ip> --token <my_token> set_menu "recipe name" "position [1-9] 9: no saving" "confirm_start [True/False]"

================================================================================

Thanks Cudab!

I downloaded several files and made changes to the files as errors came up.

The address used was https://github.com/rytilahti/python-miio/tree/9b402c0585bf97820adc9ea69dcafb30dfd7d5a0/miio. To download the files I needed to open each one of them and click on the RAW button to get an address that could be downloaded by wget in linux.

In the /.local/lib/python3.8/site-packages/miio directory
cli.py
discovery.py
init.py

In the /.local/lib/python3.8/site-packages/miio/integrations directory
init.py
custom_construct.py
ihcooker.py
recipe_profile.py

In the /.local/lib/python3.8/site-packages/miio/integrations/ihcooker directory
init.py
custom_construct.py
ihcooker.py
recipe_profile.py

In the ~/.local/lib/python3.8/site-packages/miio/integrations/ihcooker/data directory
ihcooker_profiles.json
ihcooker_rice_recipe.json

When I run the command miiocli ihcooker --ip <my_ip> --token <my_token> set_menu "recipe name" "position [1-9] 9: no saving" "confirm_start [True/False]" the following error occurs:

Traceback (most recent call last):
File "/home/user/.local/bin/miiocli", line 5, in
from miio.cli import create_cli
File "/home/user/.local/lib/python3.8/site-packages/miio/init.py", line 43, in
from miio.integrations.ihcooker.ihcooker import IHCooker
File "/home/user/.local/lib/python3.8/site-packages/miio/integrations/ihcooker/ihcooker.py", line 11, in
from .click_common import command, format_output
ModuleNotFoundError: No module named 'miio.integrations.ihcooker.click_common'

@cudab
Copy link

cudab commented Dec 6, 2021

miiocli ihcooker --ip <my_ip> --token <my_token> set_menu "recipe name" "position [1-9] 9: no saving" "confirm_start [True/False]"

================================================================================

Thanks Cudab!

I downloaded several files and made changes to the files as errors came up.

The address used was https://github.com/rytilahti/python-miio/tree/9b402c0585bf97820adc9ea69dcafb30dfd7d5a0/miio. To download the files I needed to open each one of them and click on the RAW button to get an address that could be downloaded by wget in linux.

In the /.local/lib/python3.8/site-packages/miio directory cli.py discovery.py init.py

In the /.local/lib/python3.8/site-packages/miio/integrations directory init.py custom_construct.py ihcooker.py recipe_profile.py

In the /.local/lib/python3.8/site-packages/miio/integrations/ihcooker directory init.py custom_construct.py ihcooker.py recipe_profile.py

In the ~/.local/lib/python3.8/site-packages/miio/integrations/ihcooker/data directory ihcooker_profiles.json ihcooker_rice_recipe.json

When I run the command miiocli ihcooker --ip <my_ip> --token <my_token> set_menu "recipe name" "position [1-9] 9: no saving" "confirm_start [True/False]" the following error occurs:

Traceback (most recent call last): File "/home/user/.local/bin/miiocli", line 5, in from miio.cli import create_cli File "/home/user/.local/lib/python3.8/site-packages/miio/init.py", line 43, in from miio.integrations.ihcooker.ihcooker import IHCooker File "/home/user/.local/lib/python3.8/site-packages/miio/integrations/ihcooker/ihcooker.py", line 11, in from .click_common import command, format_output ModuleNotFoundError: No module named 'miio.integrations.ihcooker.click_common'

Hi.
https://github.com/rytilahti/python-miio/blob/9b402c0585bf97820adc9ea69dcafb30dfd7d5a0/miio/integrations/ihcooker/ihcooker.py is on line 10
from miio.click_common import command, format_output
and here https://github.com/rytilahti/python-miio/tree/9b402c0585bf97820adc9ea69dcafb30dfd7d5a0/miio i file click_common.py so try in the ihcooker.py write miio. before click_common

@edimarcr
Copy link

edimarcr commented Dec 7, 2021

miiocli ihcooker --ip <my_ip> --token <my_token> set_menu "recipe name" "position [1-9] 9: no saving" "confirm_start [True/False]"

================================================================================
Thanks Cudab!
I downloaded several files and made changes to the files as errors came up.
The address used was https://github.com/rytilahti/python-miio/tree/9b402c0585bf97820adc9ea69dcafb30dfd7d5a0/miio. To download the files I needed to open each one of them and click on the RAW button to get an address that could be downloaded by wget in linux.
In the /.local/lib/python3.8/site-packages/miio directory cli.py discovery.py init.py
In the /.local/lib/python3.8/site-packages/miio/integrations directory init.py custom_construct.py ihcooker.py recipe_profile.py
In the /.local/lib/python3.8/site-packages/miio/integrations/ihcooker directory init.py custom_construct.py ihcooker.py recipe_profile.py
In the ~/.local/lib/python3.8/site-packages/miio/integrations/ihcooker/data directory ihcooker_profiles.json ihcooker_rice_recipe.json
When I run the command miiocli ihcooker --ip <my_ip> --token <my_token> set_menu "recipe name" "position [1-9] 9: no saving" "confirm_start [True/False]" the following error occurs:
Traceback (most recent call last): File "/home/user/.local/bin/miiocli", line 5, in from miio.cli import create_cli File "/home/user/.local/lib/python3.8/site-packages/miio/init.py", line 43, in from miio.integrations.ihcooker.ihcooker import IHCooker File "/home/user/.local/lib/python3.8/site-packages/miio/integrations/ihcooker/ihcooker.py", line 11, in from .click_common import command, format_output ModuleNotFoundError: No module named 'miio.integrations.ihcooker.click_common'

Hi. https://github.com/rytilahti/python-miio/blob/9b402c0585bf97820adc9ea69dcafb30dfd7d5a0/miio/integrations/ihcooker/ihcooker.py is on line 10 from miio.click_common import command, format_output and here https://github.com/rytilahti/python-miio/tree/9b402c0585bf97820adc9ea69dcafb30dfd7d5a0/miio i file click_common.py so try in the ihcooker.py write miio. before click_common
=============================================================

@cudab,

I replaced the click_common.py file, but the error stayed the same.

Thank you for your attention.

Someone could provide the installation form to allow use on devices that are not supported in the official version (python-miio 0.5.9.1). Or also the availability of compressed files in case it is difficult to detail. I tried to find without success.

The device I am trying to use is the Xiaomi induction cooker chunmi.ihcooker.v1

Thanks

@cudab
Copy link

cudab commented Dec 7, 2021

miiocli ihcooker --ip <my_ip> --token <my_token> set_menu "recipe name" "position [1-9] 9: no saving" "confirm_start [True/False]"

================================================================================
Thanks Cudab!
I downloaded several files and made changes to the files as errors came up.
The address used was https://github.com/rytilahti/python-miio/tree/9b402c0585bf97820adc9ea69dcafb30dfd7d5a0/miio. To download the files I needed to open each one of them and click on the RAW button to get an address that could be downloaded by wget in linux.
In the /.local/lib/python3.8/site-packages/miio directory cli.py discovery.py init.py
In the /.local/lib/python3.8/site-packages/miio/integrations directory init.py custom_construct.py ihcooker.py recipe_profile.py
In the /.local/lib/python3.8/site-packages/miio/integrations/ihcooker directory init.py custom_construct.py ihcooker.py recipe_profile.py
In the ~/.local/lib/python3.8/site-packages/miio/integrations/ihcooker/data directory ihcooker_profiles.json ihcooker_rice_recipe.json
When I run the command miiocli ihcooker --ip <my_ip> --token <my_token> set_menu "recipe name" "position [1-9] 9: no saving" "confirm_start [True/False]" the following error occurs:
Traceback (most recent call last): File "/home/user/.local/bin/miiocli", line 5, in from miio.cli import create_cli File "/home/user/.local/lib/python3.8/site-packages/miio/init.py", line 43, in from miio.integrations.ihcooker.ihcooker import IHCooker File "/home/user/.local/lib/python3.8/site-packages/miio/integrations/ihcooker/ihcooker.py", line 11, in from .click_common import command, format_output ModuleNotFoundError: No module named 'miio.integrations.ihcooker.click_common'

Hi. https://github.com/rytilahti/python-miio/blob/9b402c0585bf97820adc9ea69dcafb30dfd7d5a0/miio/integrations/ihcooker/ihcooker.py is on line 10 from miio.click_common import command, format_output and here https://github.com/rytilahti/python-miio/tree/9b402c0585bf97820adc9ea69dcafb30dfd7d5a0/miio i file click_common.py so try in the ihcooker.py write miio. before click_common

@cudab,

I replaced the click_common.py file, but the error stayed the same.

Thank you for your attention.

Someone could provide the installation form to allow use on devices that are not supported in the official version (python-miio 0.5.9.1). Or also the availability of compressed files in case it is difficult to detail. I tried to find without success.

The device I am trying to use is the Xiaomi induction cooker chunmi.ihcooker.v1

Thanks

@edimarcr
I do not know, if it is help you, but here https://ulozto.cz/tamhle/lCkGhs0IMJdv#!ZGR1AQR2AmN1ATSxAmV3ZTEyMGVmAKMxFx1aMRgUGaMPE2EyZj== is my miio in python. It is older version without integrations. I had same problem, never find, how add nosupported deviced and now i do not remember how i make it.

@edimarcr
Copy link

edimarcr commented Dec 7, 2021

miiocli ihcooker --ip <my_ip> --token <my_token> set_menu "recipe name" "position [1-9] 9: no saving" "confirm_start [True/False]"

================================================================================
Thanks Cudab!
I downloaded several files and made changes to the files as errors came up.
The address used was https://github.com/rytilahti/python-miio/tree/9b402c0585bf97820adc9ea69dcafb30dfd7d5a0/miio. To download the files I needed to open each one of them and click on the RAW button to get an address that could be downloaded by wget in linux.
In the /.local/lib/python3.8/site-packages/miio directory cli.py discovery.py init.py
In the /.local/lib/python3.8/site-packages/miio/integrations directory init.py custom_construct.py ihcooker.py recipe_profile.py
In the /.local/lib/python3.8/site-packages/miio/integrations/ihcooker directory init.py custom_construct.py ihcooker.py recipe_profile.py
In the ~/.local/lib/python3.8/site-packages/miio/integrations/ihcooker/data directory ihcooker_profiles.json ihcooker_rice_recipe.json
When I run the command miiocli ihcooker --ip <my_ip> --token <my_token> set_menu "recipe name" "position [1-9] 9: no saving" "confirm_start [True/False]" the following error occurs:
Traceback (most recent call last): File "/home/user/.local/bin/miiocli", line 5, in from miio.cli import create_cli File "/home/user/.local/lib/python3.8/site-packages/miio/init.py", line 43, in from miio.integrations.ihcooker.ihcooker import IHCooker File "/home/user/.local/lib/python3.8/site-packages/miio/integrations/ihcooker/ihcooker.py", line 11, in from .click_common import command, format_output ModuleNotFoundError: No module named 'miio.integrations.ihcooker.click_common'

Hi. https://github.com/rytilahti/python-miio/blob/9b402c0585bf97820adc9ea69dcafb30dfd7d5a0/miio/integrations/ihcooker/ihcooker.py is on line 10 from miio.click_common import command, format_output and here https://github.com/rytilahti/python-miio/tree/9b402c0585bf97820adc9ea69dcafb30dfd7d5a0/miio i file click_common.py so try in the ihcooker.py write miio. before click_common

@cudab,
I replaced the click_common.py file, but the error stayed the same.
Thank you for your attention.
Someone could provide the installation form to allow use on devices that are not supported in the official version (python-miio 0.5.9.1). Or also the availability of compressed files in case it is difficult to detail. I tried to find without success.
The device I am trying to use is the Xiaomi induction cooker chunmi.ihcooker.v1
Thanks

@edimarcr I do not know, if it is help you, but here https://ulozto.cz/tamhle/lCkGhs0IMJdv#!ZGR1AQR2AmN1ATSxAmV3ZTEyMGVmAKMxFx1aMRgUGaMPE2EyZj== is my miio in python. It is older version without integrations. I had same problem, never find, how add nosupported deviced and now i do not remember how i make it.
================================================================================

Thanks @cudab!

Now it worked. I just needed to add the following line to the __init__.py file:
from miio.ihcooker import IHCoker

@edimarcr
Copy link

edimarcr commented Dec 7, 2021

I made a brief walkthrough based on @cudab and @coolibry tips to use Mi induction cooker chunmi.ihcooker.v1 solution and it will certainly work on other cookers of the same line.

I used WSL on Windows:
1 - WSL Installation: https://docs.microsoft.com/en-us/windows/wsl/install

2 - Python Installation: https://www.digitalocean.com/community/tutorials/how-to-install-python-3-nd-set-up-a-programming-environment-on-an-ubuntu-20-04-server

3 - Obtaining the cooker token: https://python-miio.readthedocs.io/en/latest/discovery.html

4 - Python-miio installation: https://python-miio.readthedocs.io/en/latest/discovery.html

5 - To make it easier, you can access the Linux files using Windows explorer through the path \wsl$

6 - Delete the folder \wsl$\Ubuntu\home\user.local\lib\python3.8\site-packages\miio (Windows) or /home/user/.local/lib/python3.8/site- packages/miio (Linux).

7 - Download the miio.tar.gz file from https://ulozto.cz/tamhle/lCkGhs0IMJdv#!ZGR1AQR2AmN1ATSxAmV3ZTEyMGVmAKMxFx1aMRgUGaMPE2EyZj==

8 - Unzip the file miio.tar.gz in the directory /home/user/.local/lib/python3.8/site-packages/miio

9 - In this folder, change the __init__.py file and include in line 16 (to keep the file organize):

from miio.ihcooker import IHCoker

Thanks to @cudab

10 - From now on you will need the token and IP obtained in step 3 and replace this data in the commands you will send to your device. To test if you got the right data do a test with the following command:

miiocli ihcooker --ip 192.168.x.x --token 123456789000abcd123456ddd88a6b7c info

11 - Change the file ihcooker.py from line 741 to line 747 and make the power, time, and temperature changes according to the instructions already in that file.

12 - To save the recipe, use the command, where ReciceName can be up to 6 characters long. RecipeNumber can range from 1 to 8 and will replace the recipe of the position you choose and if you type 9 the recipe will be saved temporarily. The last option is to execute or not the recipe with the options True or False. On my device the True option did not work:

miiocli ihcooker --ip 192.168.x.x --token 123456789000abcd123456ddd88a6b7c set_menu RecipeName RecipeNumber True

Thanks to @coolibry

@rytilahti
Copy link
Owner

Have you already tried out the #832 by @basveeling to see if that is working fine on your devices? If not, it'd be great if you could report your precise findings on that PR so that they could be fixed. It should be much easier to use when we get this merged, but adding some documentation on how to use specific features (like recipe saving etc.) would be much appreciated in a separate PR.

@edimarcr
Copy link

edimarcr commented Dec 8, 2021

Have you already tried out the #832 by @basveeling to see if that is working fine on your devices? If not, it'd be great if you could report your precise findings on that PR so that they could be fixed. It should be much easier to use when we get this merged, but adding some documentation on how to use specific features (like recipe saving etc.) would be much appreciated in a separate PR.
=================================================================================

@rytilahti ,

I searched for all projects related to the Mi induction cooker chunmi.ihcooker.v1 device line, including #832 by @basveeling, but I couldn't make the changes or install these projects because I didn't know the correct procedure. Perhaps the solution for the project indicated by @cudab is already included in project #832, but I still don't know the correct procedure to use it.
If I know and can share the installation procedure, I will test it to see if it works.

@joecmtang
Copy link

Hello, wanna check if anyone is still using it? I have installed the package and able to get the info & status, however I cannot create new profile and start a specific profile cooking, thanks for your advice.

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