简体中文 | English
应 HACS 要求,临时修改默认 README 语言为英语。点击此处查看中文说明。
This custom component implements the Xiaomi MIoT protocol with the help of python-miio, and the usage is similar to xiaomi_raw.
Currently this custom component supports:
- sensor (get properties from device)
- switch (set binary properties to device)
- cover (supports open/close/set position, get position is not supported yet)
- light (turn on/off, adjust brightness and color temprature)
- fan (turn on/off, set oscillation and speed)
- humidifier (turn on/off, set target humidity and mode)
- media player (Xiaomi AI Speaker)
- Copy the custom_component folder to your Home Assistant configuration folder
or
- From HACS, search and add Xiaomi MIoT
Please refer to the config_example folder
Configuration variables common to each device type:
- host (Required): Device IP.
- token (Required): Device token.
- name (Optional): Device name.
- mapping (Required): The mapping between the function of the device and the id(siid, piid).
- params (Optional): For devices that can be controlled, specify the mapping between their functional status (such as on/off/up/down/stop) and value.
- scan_interval (Optional): Status refresh interval.
- sensor_property (Required): The property in mapping that provides the current state. The rest will be the attributes of the sensor.
- sensor_unit (Optional): The sensor unit.
Required for mapping and params:
- switch_status, to obtain and control the switch status by reading and writing this attribute. The power_on and power_off below specify the on and off state values.
Required for mapping and params:
- motor_control, to obtain and control the motor state by reading and writing this attribute. The open, close and stop below specify the status value of up/down/stop.
Required for mapping and params:
- switch_status, to obtain and control the light switch status by reading and writing this attribute. The power_on and power_off below specify the on and off state values.
Optional:
- brightness: After setting this option, will support brightness adjustment.
- color_temperature: After setting this option, will support color temperature adjustment.
Required for mapping and params:
- switch_status, to obtain and control the fan switch status by reading and writing this attribute. The power_on and power_off below specify the on and off state values.
Optional:
- oscillate: After setting this option, will support oscillation adjustment.
- speed: After setting this option, will support speed adjustment.
- Support the sensor to automatically add units.
- Add Xiao Ai "Broadcast designated text" and "Execute designated instructions" services.
- Support Xiaoai speaker configuration from UI.
- Support action calls for devices e.g. washing machines.
- Support Xiaoai speakers.
- Supports multiple types of automatic configuration for one device. Now devices with sub-devices such as fan-lights and airers can be integrated in one time automatically.
- Due to the reason of 1, the internal data storage method has undergone major changes. Some devices need to be deleted and reconfigured, and the devices that need to be reconfigured have been stated in the notification bar; the file-configured devices are not affected.
- Greatly improve the accuracy of automatic identification.
- **Now supports automatic configuration of some device types. **
- Fix a lot of bugs.
- **Support humidifier. **
- Support UI configuration.
- Support RGB light.
- Support updating states from Mi Home cloud server for alternative. (Only Mainland China server is tested)
- Support fan platform.
- Make the log more detailed.
- **Support light platform, now you can connect to smart lights, and adjust the light and color! **
- The method of value decimal is changed to the configuration item
value_ratio
underparams
. - Refactor the code, greatly optimize the code structure, and prepare for the expansion of device types.
- **After this update, some entities related to this plug-in will be regenerated, with the suffix
_2
, and the original entity is no longer available. Please delete the previous entity, and then modify the entity ID of the new entity to remove_2
. The history and original functions will not be affected. ** - For switch entity that does not support state feedback, create an entity with assumed state.
- Now the switch can also display the attribute value of the device in the state attribute just like the sensor. This type of device does not need to configure the sensor, and can directly merge the mapping content of the previous sensor configuration.
For some property values does not have a decimal point, a mapping of "power_100" is designed to correct the value.
- Support cover platform, now you can access curtains, drying racks and other devices
- **In order to unify the configuration file format of multiple devices and facilitate the later expansion of more types of devices, major adjustments have been made to the configuration file format. The new version is no longer compatible with the previous format. Please pay attention to adaptation when upgrading **
- Optimize the code structure and calling method
If the custom component doesn't work out of the box for your device please update your configuration to increase log level:
# configuration.yaml
logger:
default: warn
logs:
custom_components.xiaomi_miot_raw: debug
miio: debug