Xioami cooker integration

I have exactly same setup except I have added cooker_profiles.json to custom_component folder.

I just checked your commit regarding HA 0.88 version and everything seems to work properly now. Thank you very much!

One more question: Can anyone give me a hint on how to retrieve what model I use and should therefore be added to the yaml file? It works fine with the auto detection but since my rice cooker is unplugged most of the time, I would like to add the actual model to the config.

Thanks @syssi.

Well I guess you can see this if you dump DB from MiHome app or use mirobo discovery feature. I just used common sense and trial and error approach.

@bigbenme You can see the auto-detected model name at the device card / as attribute in the device list. The key is called model.

syssi just gave me the tip that the autodetected model can also be seen from the logs.

Here is his tip:

I just had to add the logging to the configuration.yaml

logger:
  default: warn
  logs:
    custom_components.xiaomi_cooker: info
    custom_components.xiaomi_cooker.sensor: info
    miio: info

Reboot HA and inspect the home-assistant.log. I was then able to compare. You should see some network traffic (requests and responses). The reponse of miIO.info is what are you looking for. It will contain one of these values from the source code:

https://github.com/syssi/xiaomi_cooker/blob/master/custom_components/xiaomi_cooker/ init .py#L30-L36

2 Likes

Anybody have a nice Lovelace card to control the cooker? I did some searching but couldn’t find anything.

Hi, someone could explain in detail how to install the component files in ha?
I can see in previous post that the way is/was:
to copy as follows:
/config/custom_components/xiaomi_cooker.py
/config/custom_components/sensor/xiaomi_cooker.py
but the current files on github have not a “xiaomi-cooker.py” file but a custom-component folder.
I have copied that folder and its content (only) on my HA and is not working.
Is is necessary also to copy the cooking profiles to the same folder to make it work?
what to do with the other files on github? (.hound.yaml, flake8.ini …)

Thanks in advance!

1 Like

Hello, I have been successful finding the Token and connecting to the rice cooker via mirobo commands. It seems that everything is working, but I cant actually start the cooking, when I try to send command mirobo raw_command set_start '["K2A profiles"]' it will always end up with error -9999 ‘time out’. My model is chunmi.cooker.normal2. Did anyone else encounter this issue? Any solutions? Thank you.

Do you really use one of the K2A profiles? f.e.

mirobo raw_command set_start '["0001E101000000000000800200A00069030103730000085A020000EB006B040103740000095A0400012D006E0501037400000A5A0401FFFF00700601047600000C5A0401052D0A0F3C0A1E91FF820E01FF05FF78826EFF10FF786E02690F0DFF826EFF691000FF826EFF69100069FF5AFF00000000000081E9"]'

Yep, still the same error. I even tried different profiles but nothing is working.

1 Like

Could you provide the output of

mirobo info

I want to know the model name and firmware version(s).

Sure: chunmi.cooker.normal2 v2.0.4 (04:CF:8C:54:9C:65) @ 192.168.0.8 - token: xxx

Anyone has chunmi.pre_cooker.eh1 ?
Looks like I have different model of the Xiaomi Cooker.
I tried to get anything but it looks like it is something new…

INFO:miio.vacuum_cli:Debug mode active
DEBUG:miio.vacuum_cli:Read stored sequence ids: {'seq': 1, 'manual_seq': 0}
DEBUG:miio.vacuum_cli:Connecting to  with 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\x06^a\t\x00\x00\x16\xd0' (total 16)
        value = Container: 
            length = 32
            unknown = 0
            device_id = b'\x06^a\t' (total 4)
            ts = 1970-01-01 01:37:20
        offset1 = 0
        offset2 = 16
        length = 16
    checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)
DEBUG:miio.device:Discovered 065e6109 with ts: 1970-01-01 01:37:20, token: b'ffffffffffffffffffffffffffffffff'
DEBUG:miio.device::54321 >>: {'id': 2, 'method': 'miIO.info', 'params': []}
DEBUG:miio.device::54321 (ts: 1970-01-01 01:37:20, id: 2) << {'id': 2, 'result': {'life': 5840, 'uid': 87255710, 'model': 'chunmi.pre_cooker.eh1', 'token': '', 'fw_ver': '2.0.5_0016', 'miio_ver': '0.0.5', 'hw_ver': 'esp32', 'mmfree': 147108, 'mac': '40:31:3C:47:F4:AB', 'wifi_fw_ver': 'v3.1.4-56-g72a66bc98-dirty', 'ap': {'ssid': '', 'bssid': '', 'rssi': -56, 'primary': 6}, 'netif': {'localIp': '', 'mask': '255.255.255.0', 'gw': ''}}}
chunmi.pre_cooker.eh1 v2.0.5_0016 (40:31:3C:47:F4:AB) @  - token: 
DEBUG:miio.vacuum_cli:Full response: {'ap': {'bssid': '',
        'primary': 6,
        'rssi': -56,
        'ssid': ''},
 'fw_ver': '2.0.5_0016',
 'hw_ver': 'esp32',
 'life': 5840,
 'mac': '40:31:3C:47:F4:AB',
 'miio_ver': '0.0.5',
 'mmfree': 147108,
 'model': 'chunmi.pre_cooker.eh1',
 'netif': {'gw': '', 'localIp': '', 'mask': '255.255.255.0'},
 'token': '',
 'uid': 87255710,
 'wifi_fw_ver': 'v3.1.4-56-g72a66bc98-dirty'}
DEBUG:miio.vacuum_cli:Writing {'seq': 2, 'manual_seq': 0} to .cache/python-miio/python-mirobo.seq

Hi guys,
So i see theres alot of work done on this. Thanks alot

Also i came across this github

Now it does say Rice Cooker V2.
Im about to plunge and buy one right now, but have no idea how to differentiate between different versions (if any) of that rice cooker

Does anyone have a link that they can tell me what to buy? like aliexpress/gearbest?
Thers alot and i dont know which one is what

hello, I am the user of this system and already have a rice cooker. But I could not find a single example of how to use the services. I ask for your help. write an example of using the sart and stop service

1 Like

Hey so i just got it working

You can do a call service

  • Developer Tools > Services > serivce = xiaomi_cooker.start
  • Service Data = {“profile”:“0002E100280000000000800200D20069030103730000075A0200012D006B040103740000075A02000182006E050003740000095A0401FFFF0070060004760000095A040100280A063C0D1E91FF820E01FF05FF78826EFF10FF786E02690F0FFF826EFF69100082826EFF69100069FF5AFF00000000000015B6”}

So the example above is to start the cooker to do 40 min quick rice

If that works for you then you can just create a template switch/script based on that

3 Likes

I could not call the service. and if you can show an example script or template. I’m not good at it yet. Therefore, I ask such questions
Не удалось вызвать службу xiaomi_cooker/start. expected dict for dictionary value @ data[‘service_data’]. Got ‘data = {“profile”:“0002E100280000000000800200D20069030103730000075A0200012D006B040103740000075A02000182006E050003740000095A0401FFFF0070060004760000095A040100280A063C0D1E91FF820E01FF05FF78826EFF10FF786E02690F0FFF826EFF69100082826EFF69100069FF5AFF00000000000015B6”}’

So edit your configuration file to add the following under your switches:

switch:
  - platform: template
    switches:
      xiaomi_cooker:
        value_template: "{{ is_state('sensor.xiaomi_cooker_mode', 'Running') }}"
        turn_on:
          service: xiaomi_cooker.start
          data:
            profile: "0002E100280000000000800200D20069030103730000075A0200012D006B040103740000075A02000182006E050003740000095A0401FFFF0070060004760000095A040100280A063C0D1E91FF820E01FF05FF78826EFF10FF786E02690F0FFF826EFF69100082826EFF69100069FF5AFF00000000000015B6"
        turn_off:
          service: xiaomi_cooker.stop
2 Likes