No cooker is WiFi device only. Mirobo token extraction process is step-by-step shold not be a problem. The only catch is the mihome app should older version.
That was painlessly ez with the miio tool…thanks, got token now.
Now just add custom component and setup yaml for cooker. Good luck automating cooking process.
As long as it works, thats easy
But how much Ill automate here, probably not a lot
Well I have a couple:
- The cooker startsvto cook when proximity sennsor goes below surten threshold and direction is towards home. I have boolean input which is condition for the automation and should be activated if cooker is loaded
- Notification to devices when cooking is done.
- Notification when automstic heating is abou to be disabled (after 24 hour) to unload and wash the cooker.
Just couple of exampls…
@bachulator If you provide some of the generic/basic automations (notification f.e.) I will add it to the README.md of the github repository!
Very straight forward automation the part with proximity more complex since will involve more custom eliments which I have implemented.
- id: cooker_meal_is_ready_notify
alias: cooker_meal_is_ready_notify
trigger:
- platform: state
entity_id: sensor.xiaomi_cooker_stage_name
to: "Cooking finished"
action:
service: notify.notify_all
data:
message: "Kitchen cooker is finishing preporation. Bon appetit!"
- id: cooker_keep_waprm_done_notify
alias: cooker_keep_waprm_done_notify
trigger:
- platform: numeric_state
entity_id: sensor.xiaomi_cooker_remaining
above: 1400
condition:
condition: state
entity_id: sensor.xiaomi_cooker_mode
state: 'AutoKeepWarm'
action:
service: notify.notify_all
data:
message: "Kitchen cooker almost done keeping worm the meal. Empty and clean the cooker!"
Cool. always good with ideas. Now i just need to find some recipes so i can cook not just rice in it…
“keeping worm” …!! I hope you aren’t cooking worms in it! sorry, couldn’t resist…
Well regarding recipes it much wider then just rice. But to each it’s own. It is generally any grains or porridge (temperature curve mostly is the same). Plus there is a section whete you can steam pretty much anything (meat, fish, vegetables). Haven’t tried but people report good results with yogurt making Backing still an option. Just lookitup there is plenty of creative things people doing there.
And, no, no worms in my cooker. But now when you pointed this out it sounds bit funny.
Awesome work that has already been done on this component.
I’m currenty trying to get the component working as custom component within hass.io. Unfortunately I haven’t succeeded. The error messages basically read that the custom_component could not be found:
Testing configuration at /config
Failed config
General Errors:
- Component not found: xiaomi_cooker
Successful config (partial)
and
Integrations need to be in their own folder. Change sensor/xiaomi_cooker.py to xiaomi_cooker/sensor.py. This will stop working soon.
The most important message seems to be:
Error loading custom_components.xiaomi_cooker.sensor. Make sure all dependencies are installed
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homeassistant/loader.py", line 147, in _load_file
module = importlib.import_module(path)
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 962, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'custom_components.xiaomi_cooker.sensor'; 'custom_components.xiaomi_cooker' is not a package
I just wonder if anyone was able to set the component up on hass.io before. I would be glad to contribute in any way and will definitely write some documentation steps if I get it to work.
I have been running the component in Hass.io successfully. Just coping the files to custom_component and configured the yaml. Next release of HA seems to change custom element setup structure.
Thank you very much. I just copied the files from the repo so that it looks like this on my pi:
/config/custom_components/xiaomi_cooker.py
/config/custom_components/sensor/xiaomi_cooker.py
Here is my yaml part:
xiaomi_cooker:
name: Mi IH Rice Cooker
host: <ip of my rice cooker>
token: <my 32 byte token>
model: chunmi.cooker.normal2
but I do get the same error message:
Error loading custom_components.xiaomi_cooker.sensor. Make sure all dependencies are installed
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homeassistant/loader.py", line 147, in _load_file
module = importlib.import_module(path)
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 962, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'custom_components.xiaomi_cooker.sensor'; 'custom_components.xiaomi_cooker' is not a package
I’m running version 088.1 of hass.io. Sorry for the trouble but this is the first custom component I use. The rest of my setup is pretty much add-ons only.
I will update the custom component tonight to be compatible with HA 0.88.
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.
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