Closed guyluz11 closed 8 months ago
Yes, you can control the devices after authentication. It is the same as the API that gets the list of devices, but with different paths:
Note: that different model devices have different props or actions. You can get some of them by referring to the MIOT spec. Here are some references:
Hope that is helpful.
Yes, you can control the devices after authentication. It is the same as the API that gets the list of devices, but with different paths:
* getDevicelist: /home/device_list * getProps: /miotspec/prop/get * setProps: /miotspec/prop/set * action: /miotspec/action
Note: that different model devices have different props or actions. You can get some of them by referring to the MIOT spec. Here are some references:
* [Official miot spec](https://home.miot-spec.com/) * [Official doc](https://iot.mi.com/new/doc/accesses/direct-access/other-platform-access/control-api#%E5%9F%BA%E7%A1%80%E6%A6%82%E5%BF%B5) * [A metadata fetcher ](https://www.merdok.org/miotspec/) * [A homebridge plugin for miot](https://github.com/merdok/homebridge-miot)
Hope that is helpful.
Cool, Can we put those functions as part of the package?
Sure, please feel free to make a PR.
I have updated it to version 1.0.0, which now supports control of more devices through the Miiot cloud. Additionally, the API has been replaced by MiCloud
. Therefore, You must update your code to use this package.
v1.0.0
Very cool man, Thanks for the hard work it's being appreciated.
I will probably test it next weekend integrate it into the Smart Home system 😄
I have tested the package with my Mi Cloud and it works for my Mi IoT devices. However, if you want to control your devices, you need to find the device specification form at https://home.miot-spec.com/. Furthermore, we can planning to add more device specifications to a device support library for this project.
Does this package support all Xiaomi smart device vendors?
They have: Xiaomi Yeelink Xiaomi Miio Xiaomi Yeelight
I am going throw the code and I think we can improve it a little bit.
First of all we need documentation of each field in the device class, I am not sure what is for example did
and showMode
vars.
Furthermore, we can planning to add more device specifications to a device support library for this project.
I would love to, it can make the process easier, please add one so that I will have the concept of how you would like to implement it.
We can differentiate between devices using the model
field (I was expecting a number but this is ok too).
Does this package support all Xiaomi smart device vendors?
They have: Xiaomi Yeelink Xiaomi Miio Xiaomi Yeelight
I'm not sure(have't test), but it will work properly if the device is compatible with the MIOT protocol and link the micloud.
I don't know the meanings of some of these fields. I debugged these methods by looking at some device parameters and official documentation, as I haven't found a detailed and user-friendly official documentation.
I created a wiki to compile some information I had collected. wiki
I would love to, it can make the process easier, please add one so that I will have the concept of how you would like to implement it.
I don't think it's easy because there are many devices with significant differences, and there isn't a detailed instruction manual. I don't know the meaning of many fields.
Does this package support all Xiaomi smart device vendors? They have: Xiaomi Yeelink Xiaomi Miio Xiaomi Yeelight
I'm not sure(have't test), but it will work properly if the device is compatible with the MIOT protocol and link the micloud.
I don't know the meanings of some of these fields. I debugged these methods by looking at some device parameters and official documentation, as I haven't found a detailed and user-friendly official documentation.
I created a wiki to compile some information I had collected. wiki
The wiki is beautiful, and it should also be documented in the code with 3 /
For example:
/// IID (Instance ID): Instance ID is expressed as a /// natural number, and it is incremented from 1 at /// each level in devices and homes. String iid;
Testing getDevices
and I am getting weird results.
In the Mi Home app I have only (1) Bulb type: Mi Smart LED Bulb Essential (White and Color) But the result from the method is my Xiaomi router at home without the bulb.
I can see the router on the list of results, which appears to be normal. However, as you mentioned there is no bulb, I am unable to determine if there is an issue or not.
Could you please provide more details such as the device model( I find the model is [yeelink.light.color5](https://home.miot-spec.com/spec/yeelink.light.color5)
, is that? ), a screenshot of the MiHome app, or any additional information that you can share?
I can see the router on the list of results,
But it does not appear in the official app on the same account. I made sure that it is the same account as on the app by account id
I have no idea. Here is a screenshot of my MiHome app.
I'm thinking my bulb is not yeelink.light.color5
Maybe it is not supported 🥲
I would love to be able to control mi IoT devices from dart code so that I will be able to control them using cbj (open source platform to control different smart home vendors).
Did you find a way to control your devices from the dart code? I know about miio package but don't know how to pass the token from here or if it is even the same token that is needed.
Are the token works for LAN or is it for the remote Xiaomi servers (maybe it is the same).