Hello everyone, I’m trying to integrate the Xiaomi Rice Cooker (Aka: chunmi.cooker.normal2)
I configure the Xiaomi Mi IO Binding with my account and i get the token of the device, afterwards i added a miio:basic Thing with the ip and the token. The thing recognises the device correctly:
hardwareVersion
ESP8266
mcuFirmware
0026
modelId
chunmi.cooker.normal2
serialNumber
0E5CD9CF
vendor
Xiaomi
wifiFirmware
1.5.0-dev(7efd021)
With the Execute Command Channel i tried different commands (Ex: getProp[“temperature”]) and i get always the same response:
There is a way to take this json and process the information to update Items?
Is possible to create a database json to support this device?
And i try to send commands and i successfully stop the cooking process sending this command set_func[“end”], maybe is possible to create a Switch to start and stop the cooking process.
If I recall right, currently indeed the support for the rice cookers is not there.
So to start, it would need a json file for yor device. You can create some base version of that by using the switch item that creates experimental support.
As the properties are not much like the other devices prob only very few channels are created.
Can you try separately the individual properties by testing the reponse to commands for the properties like this: get_prop["func"] and get_prop["menu"] etc…
If they respond, the created json db file can be extended to pull those properies.
Thanks Marcel for your reply.
I tried to get the properties as you said without success, I put below a trace of the log for some of the properties but the result for all is the same:
But i was investigating and i see the implementation in python someone made, here the link:
as i can see they get the properties with get_prop[“all”] and get the array like appear in openhab with the response.
There is too all the calls for the functions available for the rice cooker (“set_menu”, “set_start”, “set_func”, “get_temp_history”)
I tried to start a cooking program with success sending:
set_start[“0001E101000000000000800200A00069030103730000085A020000EB006B040103740000095A0400012D006E0501037400000A5A0401FFFF00700601047600000C5A0401052D0A0F3C0A1E91FF820E01FF05FF78826EFF10FF786E02690F0DFF826EFF691000FF826EFF69100069FF5AFF00000000000081E9”]
With the profiles for my model of rice cooker (MODEL_NORMAL_GROUP2) works perfectly, and i can stop the process with set_func[“end”]
Now the problem is, how we can get this array of the response get_prop[“all”] and update channels or items with this information, I’m not sure if the Xiaomi Mi IO Binding allows to get this JSON Array and use this information or maybe is necessary to create a new binding for this specific devices.
I hope this information can help anyone to integrate the Xiaomi Rice Cookers in Openhab.
Interesting, so it responds always with all properties… that is not directly supported by the miio binding … but there is maybe a way to cheat… we create a json db file with all of these properties for your device, set the max_properties to 12
So the binding will do a request for all of these properties in 1 go, as it will get the response with all the properties.Hence I expect it will properly map them to the appropriate field.
I don’t know if all of the codes can be mapped with OH transformations to proper values, otherwise indeed on the binding side something needs to be programed to decipher the code (esp the last one) to something meaninfull.
(in the miio binding speak, we need to create custom transformations for them)
So with the json db files we can create an action menu to send those start & stop commands easilly
see example like that here:
the matchvalue would be what you want to see in the dropdown.
e.g. the end command action would look something like this:
The maxProperties dosen’t work, i still see the “Unexpected size different. Request size 1, response size 12.” i tried too with max_properties but looks like has any effect, i have to say im using openHAB 2.5.9 Release Build not the latest OH3. I’m not sure if this parameter works for my version.
For the channels i created (RiceCooker_stop, RiceCooker_start) works well sending the String with a transforms and a small rule, i can live with it but still important to receive the updates from de device.
So you need for every property a channel, so it has all of them, in the right sequence as you get the response.
btw, in the channels no need for the maxproperties entry. The first one is fine as you have it
All these channels need refresh true, except for the one with the end cooking.
I would suggest actually to make some sort of action channel, which would be able to deal with start, end etc. what the condition matchvalue does is only execute that action if the value is matched, so for every type of command you would like to have executed through that channel, you add an action.
Now there are a lot of work for beautify this data and know what does mean (i have to look the result data when is running).
I created some stateDescription but indeed im not on OH3 and i don’t see any difference, i have to solve some incompatibilities i have with the OH3 and try.
Is a good idea to make a customRefreshCommand and see in a graph how is going the cooking process but the data format is quite complex, in this link is explained the format:
Colud be interesting to set some settings in the device too, but i think is necesary to make some rules for create the necessary octets for the device can understand or made a specific binding for make as cleaner and transparent as possible for the users.
Anyway thanks very much for the help, I will try to improve the JSON when i understand better the data and upgrade to the new OH3
With OH3 indeed the mappings will help a lot to make it more readable
If you can figure out how OH likes the data so it is usable in the graph we can create a transformation for it. Maybe some of the other channels also need a custom transformation to slice the right data from the response.
for understand this data is necessary to make some calculations, there is a python plugin (few post before) for Home Assistant what works but i have some troubles to make something similar in OpenHab, maybe necessary to make an additional Addon for this device.