mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2025-03-31 14:55:31 +08:00
* fix: fix miot_device type error * fix: fix type error * feat: remove spec cache storage * feat: update std_lib and multi_lang logic * feat: update entity value-range * feat: update value-list logic * feat: update prop.format_ logic * fix: fix miot cloud log error * fix: fix fan entity * style: ignore type error * style: rename spec_filter func name * feat: move bool_trans from storage to spec * feat: move sepc_filter from storage to spec, use the YAML format file * feat: same prop supports multiple sub * feat: same event supports multiple sub * fix: fix device remove error * feat: add func slugify_did * fix: fix multi lang error * feat: update action debug logic * feat: ignore normal disconnect log * feat: support binary mode * feat: change miot spec name type define * style: ignore i18n tranlate type error * fix: fix pylint warning * fix: miot storage type error * feat: support binary display mode configure * feat: set default sensor state_class * fix: fix sensor entity type error * fix: fix __init__ type error * feat: update test case logic * fix: github actions add dependencies lib * fix: fix some type error * feat: update device list changed notify logic
224 lines
25 KiB
JSON
224 lines
25 KiB
JSON
{
|
|
"config": {
|
|
"flow_title": "Xiaomi Home Integration",
|
|
"step": {
|
|
"eula": {
|
|
"title": "Risk Notice",
|
|
"description": "1. Your Xiaomi user information and device information will be stored in the Home Assistant system. **Xiaomi cannot guarantee the security of the Home Assistant storage mechanism**. You are responsible for preventing your information from being stolen.\r\n2. This integration is maintained by the open-source community. There may be stability issues or other problems. When encountering issues or bugs of this integration, **you should seek help from the open-source community rather than contacting Xiaomi customer service**.\r\n3. You need some technical ability to maintain your local operating environment. The integration is not user-friendly for beginners.\r\n4. Please read the README file before starting.\n\n5. To ensure stable use of the integration and prevent interface abuse, **this integration is only allowed to be used in Home Assistant. For details, please refer to the LICENSE**.",
|
|
"data": {
|
|
"eula": "I am aware of the above risks and willing to voluntarily assume any risks associated with the use of the integration."
|
|
}
|
|
},
|
|
"auth_config": {
|
|
"title": "Basic configuration",
|
|
"description": "### Login Region\r\nSelect the region of your Xiaomi account. You can find it in the Xiaomi Home APP > Profile (located in the menu at the bottom) > Additional settings > About Xiaomi Home.\r\n### Language\r\nSelect the language of the device and entity names. Some sentences without translation will be displayed in English.\r\n### OAuth2 Redirect URL\r\nThe OAuth2 authentication redirect address is **[http://homeassistant.local:8123](http://homeassistant.local:8123)**. The Home Assistant needs to be in the same local area network as the current operating terminal (e.g., the personal computer) and the operating terminal can access the Home Assistant home page through this address. Otherwise, the login authentication may fail.\r\n### Integrated Network Configuration\r\nCheck if the local network is functioning properly and if the related network resources are accessible. **It is recommended to select this when adding for the first time.**\r\n### Note\r\n- For users with hundreds or more Mi Home devices, the initial addition of the integration will take some time. Please be patient.\r\n- If Home Assistant is running in a Docker environment, please ensure that the Docker network mode is set to host, otherwise local control functionality may not work properly.\r\n- The local control functionality of the integration has some dependencies. Please read the README carefully.",
|
|
"data": {
|
|
"cloud_server": "Login Region",
|
|
"integration_language": "Language",
|
|
"oauth_redirect_url": "OAuth2 Redirect URL",
|
|
"network_detect_config": "Integrated Network Configuration"
|
|
}
|
|
},
|
|
"network_detect_config": {
|
|
"title": "Integrated Network Configuration",
|
|
"description": "## Usage Introduction\r\n### Network Detection Address\r\nUsed to check if the network is functioning properly. If not set, the system default address will be used. If the default address check fails, you can try entering a custom address.\r\n- You can enter multiple detection addresses, separated by commas, such as `8.8.8.8,https://www.bing.com`\r\n- If it is an IP address, detection will be done via ping. If it is an HTTP(s) address, detection will be done via HTTP GET request.\r\n- If you want to restore the system default detection address, please enter a comma `,` and click 'Next'.\r\n- **This configuration is global, and changes will affect other integration instances. Please modify with caution.**\r\n### Check Network Dependencies\r\nCheck the following network dependencies one by one to see if they are accessible. If the related addresses are not accessible, it will cause integration issues.\r\n- OAuth2 Authentication Address: `https://account.xiaomi.com/oauth2/authorize`.\r\n- Xiaomi HTTP API Address: `https://{http_host}/app/v2/ha/oauth/get_token`.\r\n- Xiaomi SPEC API Address: `https://miot-spec.org/miot-spec-v2/template/list/device`.\r\n- Xiaomi MQTT Broker Address: `mqtts://{cloud_server}-ha.mqtt.io.mi.com:8883`.",
|
|
"data": {
|
|
"network_detect_addr": "Network Detection Address",
|
|
"check_network_deps": "Check Network Dependencies"
|
|
}
|
|
},
|
|
"oauth_error": {
|
|
"title": "Login Error",
|
|
"description": "Click NEXT to try again."
|
|
},
|
|
"homes_select": {
|
|
"title": "Select Family and Device",
|
|
"description": "## Introduction\r\n### Import Device's Family\r\nThe integration will add devices from the selected family.\r\n### Room Name Sync Mode\r\nWhen syncing devices from the Mi Home APP to Home Assistant, the naming of the area in Home Assistant will follow the rules below. Note that the sync process will not change the family and room settings in the Mi Home APP.\r\n- Do not sync: The device will not be added to any area.\r\n- Other options: The area to which the device is added will be named after the family or room name in the Mi Home APP.\r\n### Advanced Settings\r\nShow advanced settings to modify the professional configuration options of the integration.\r\n\r\n \r\n### {nick_name} Hello! Please select the family to which you want to add the device.",
|
|
"data": {
|
|
"home_infos": "Import Device's Family",
|
|
"area_name_rule": "Room Name Sync Mode",
|
|
"advanced_options": "Advanced Settings"
|
|
}
|
|
},
|
|
"advanced_options": {
|
|
"title": "Advanced Settings",
|
|
"description": "## Introduction\r\n### Unless you are very clear about the meaning of the following options, please keep the default settings.\r\n### Filter Devices\r\nSupports filtering devices by room name and device type, and also supports device dimension filtering.\r\n### Control Mode\r\n- Auto: When there is an available Xiaomi central hub gateway in the local area network, Home Assistant will prioritize sending device control commands through the central hub gateway to achieve local control. If there is no central hub gateway in the local area network, it will attempt to send control commands through Xiaomi OT protocol to achieve local control. Only when the above local control conditions are not met, the device control commands will be sent through the cloud.\r\n- Cloud: All control commands are sent through the cloud.\r\n### Action Debug Mode\r\nFor the methods defined by the device MIoT-Spec-V2, in addition to generating notification entities, a text input box entity will also be generated. You can use it to send control commands to the device during debugging.\r\n### Hide Non-Standard Generated Entities\r\nHide entities generated by non-standard MIoT-Spec-V2 instances with names starting with \"*\".\r\n### Binary Sensor Display Mode\r\nDisplay binary sensors in Xiaomi Home as text sensor entity or binary sensor entity。\r\n### Display Device Status Change Notifications\r\nDisplay detailed device status change notifications, only showing the selected notifications.",
|
|
"data": {
|
|
"devices_filter": "Filter Devices",
|
|
"ctrl_mode": "Control Mode",
|
|
"action_debug": "Action Debug Mode",
|
|
"hide_non_standard_entities": "Hide Non-Standard Generated Entities",
|
|
"display_binary_mode": "Binary Sensor Display Mode",
|
|
"display_devices_changed_notify": "Display Device Status Change Notifications"
|
|
}
|
|
},
|
|
"devices_filter": {
|
|
"title": "Filter Devices",
|
|
"description": "## Usage Instructions\r\nSupports filtering devices by home room name, device access type, and device model, and also supports device dimension filtering. The filtering logic is as follows:\r\n- First, according to the statistical logic, get the union or intersection of all included items, then get the intersection or union of the excluded items, and finally subtract the [included summary result] from the [excluded summary result] to get the [filter result].\r\n- If no included items are selected, it means all are included.\r\n### Filter Mode\r\n- Exclude: Remove unwanted items.\r\n- Include: Include desired items.\r\n### Statistical Logic\r\n- AND logic: Take the intersection of all items in the same mode.\r\n- OR logic: Take the union of all items in the same mode.\r\n\r\nYou can also go to the [Configuration > Update Device List] page of the integration item, check [Filter Devices] to re-filter.",
|
|
"data": {
|
|
"room_filter_mode": "Filter Family Rooms",
|
|
"room_list": "Family Rooms",
|
|
"type_filter_mode": "Filter Device Connect Type",
|
|
"type_list": "Device Connect Type",
|
|
"model_filter_mode": "Filter Device Model",
|
|
"model_list": "Device Model",
|
|
"devices_filter_mode": "Filter Devices",
|
|
"device_list": "Device List",
|
|
"statistics_logic": "Statistics Logic"
|
|
}
|
|
}
|
|
},
|
|
"progress": {
|
|
"oauth": "### {link_left}Click here to login{link_right}\r\n(You will be automatically redirected to the next page after a successful login)"
|
|
},
|
|
"error": {
|
|
"eula_not_agree": "Please read the risk notice.",
|
|
"get_token_error": "Failed to retrieve login authorization information (OAuth token).",
|
|
"get_homeinfo_error": "Failed to retrieve home information.",
|
|
"mdns_discovery_error": "Local device discovery service exception.",
|
|
"get_cert_error": "Failed to retrieve the central hub gateway certificate.",
|
|
"no_family_selected": "No home selected.",
|
|
"no_devices": "There are no devices in the selected home. Please select a home with devices and continue.",
|
|
"no_filter_devices": "Filtered devices are empty. Please select valid filter criteria and continue.",
|
|
"no_central_device": "[Central Hub Gateway Mode] requires a Xiaomi central hub gateway available in the local network where Home Assistant exists. Please check if the selected home meets the requirement.",
|
|
"invalid_network_addr": "Invalid IP address or HTTP address detected, please enter a valid address.",
|
|
"invalid_ip_addr": "Unreachable IP address detected, please enter a valid IP address.",
|
|
"invalid_http_addr": "Unreachable HTTP address detected, please enter a valid HTTP address.",
|
|
"invalid_default_addr": "Default network detection address is unreachable, please check network configuration or use a custom network detection address.",
|
|
"unreachable_oauth2_host": "Unable to reach OAuth2 authentication address, please check network configuration.",
|
|
"unreachable_http_host": "Unable to reach Xiaomi HTTP API address, please check network configuration.",
|
|
"unreachable_spec_host": "Unable to reach Xiaomi SPEC API address, please check network configuration.",
|
|
"unreachable_mqtt_broker": "Unable to reach Xiaomi MQTT Broker address, please check network configuration."
|
|
},
|
|
"abort": {
|
|
"ha_uuid_get_failed": "Failed to get Home Assistant UUID.",
|
|
"network_connect_error": "Configuration failed. The network connection is abnormal. Please check the equipment network configuration.",
|
|
"already_configured": "Configuration for this user is already completed. Please go to the integration page and click the CONFIGURE button for modifications.",
|
|
"invalid_auth_info": "Authentication information has expired. Please go to the integration page and click the CONFIGURE button to re-authenticate.",
|
|
"config_flow_error": "Integration configuration error: {error}."
|
|
}
|
|
},
|
|
"options": {
|
|
"step": {
|
|
"auth_config": {
|
|
"title": "Authentication Configuration",
|
|
"description": "Local authentication information has expired. Please restart the authentication process.\r\n### Current Login Region: {cloud_server}\r\n### OAuth2 Redirect URL\r\nThe OAuth2 authentication redirect address is **[http://homeassistant.local:8123](http://homeassistant.local:8123)**. The Home Assistant needs to be in the same local area network as the current operating terminal (e.g., the personal computer) and the operating terminal can access the Home Assistant home page through this address. Otherwise, the login authentication may fail.",
|
|
"data": {
|
|
"oauth_redirect_url": "OAuth2 Redirect URL"
|
|
}
|
|
},
|
|
"oauth_error": {
|
|
"title": "An error occurred during login.",
|
|
"description": "Click NEXT to retry."
|
|
},
|
|
"config_options": {
|
|
"title": "Configuration Options",
|
|
"description": "### Hello, {nick_name}\r\n\r\nXiaomi ID: {uid}\r\nCurrent Login Region: {cloud_server}\r\nIntegration Instance ID: {instance_id}\r\n\r\nPlease select the options you need to configure, then click NEXT.",
|
|
"data": {
|
|
"integration_language": "Integration Language",
|
|
"update_user_info": "Update user information",
|
|
"update_devices": "Update device list",
|
|
"action_debug": "Debug mode for action",
|
|
"hide_non_standard_entities": "Hide non-standard created entities",
|
|
"display_binary_mode": "Binary Sensor Display Mode",
|
|
"display_devices_changed_notify": "Display device status change notifications",
|
|
"update_trans_rules": "Update entity conversion rules",
|
|
"update_lan_ctrl_config": "Update LAN control configuration",
|
|
"network_detect_config": "Integrated Network Configuration"
|
|
}
|
|
},
|
|
"update_user_info": {
|
|
"title": "Update User Nickname",
|
|
"description": "Hello {nick_name}, you can modify your custom nickname below.",
|
|
"data": {
|
|
"nick_name": "Nick Name"
|
|
}
|
|
},
|
|
"homes_select": {
|
|
"title": "Re-select Home and Devices",
|
|
"description": "## Usage Instructions\r\n### Import devices from home\r\nThe integration will add devices from the selected homes.\r\n### Filter Devices\r\nSupports filtering devices by home room name, device access type, and device model, and also supports device dimension filtering. **{local_count}** devices have been filtered.\r\n### Control mode\r\n- Auto: When there is an available Xiaomi central hub gateway in the local area network, Home Assistant will prioritize sending device control commands through the central hub gateway to achieve local control. If there is no central hub gateway in the local area network, it will attempt to send control commands through Xiaomi LAN control function. Only when the above local control conditions are not met, the device control commands will be sent through the cloud.\r\n- Cloud: All control commands are sent through the cloud.",
|
|
"data": {
|
|
"home_infos": "Import devices from home",
|
|
"devices_filter": "Filter devices",
|
|
"ctrl_mode": "Control mode"
|
|
}
|
|
},
|
|
"devices_filter": {
|
|
"title": "Filter Devices",
|
|
"description": "## Usage Instructions\r\nSupports filtering devices by home room name, device access type, and device model, and also supports device dimension filtering. The filtering logic is as follows:\r\n- First, according to the statistical logic, get the union or intersection of all included items, then get the intersection or union of the excluded items, and finally subtract the [included summary result] from the [excluded summary result] to get the [filter result].\r\n- If no included items are selected, it means all are included.\r\n### Filter Mode\r\n- Exclude: Remove unwanted items.\r\n- Include: Include desired items.\r\n### Statistical Logic\r\n- AND logic: Take the intersection of all items in the same mode.\r\n- OR logic: Take the union of all items in the same mode.\r\n\r\nYou can also go to the [Configuration > Update Device List] page of the integration item, check [Filter Devices] to re-filter.",
|
|
"data": {
|
|
"room_filter_mode": "Filter Family Rooms",
|
|
"room_list": "Family Rooms",
|
|
"type_filter_mode": "Filter Device Connect Type",
|
|
"type_list": "Device Connect Type",
|
|
"model_filter_mode": "Filter Device Model",
|
|
"model_list": "Device Model",
|
|
"devices_filter_mode": "Filter Devices",
|
|
"device_list": "Device List",
|
|
"statistics_logic": "Statistics Logic"
|
|
}
|
|
},
|
|
"update_trans_rules": {
|
|
"title": "Update Entities Transformation Rules",
|
|
"description": "## Usage Instructions\r\n- Update the entity information of devices in the current integration instance, including MIoT-Spec-V2 multilingual configuration, boolean translation, and model filtering.\r\n- **Warning**: This is a global configuration and will update the local cache. It will affect all integration instances.\r\n- This operation will take some time, please be patient. Check \"Confirm Update\" and click \"Next\" to start updating **{urn_count}** rules, otherwise skip the update.",
|
|
"data": {
|
|
"confirm": "Confirm the update"
|
|
}
|
|
},
|
|
"update_lan_ctrl_config": {
|
|
"title": "Update lan control configuration",
|
|
"description": "## Usage Instructions\r\nUpdate the configurations for Xiaomi LAN control function. When the cloud and the central hub gateway cannot control the devices, the integration will attempt to control the devices through the LAN. If no network card is selected, the LAN control function will not take effect.\r\n- Only MIoT-Spec-V2 compatible IP devices in the LAN are supported. Some devices produced before 2020 may not support LAN control or LAN subscription.\r\n- Please select the network card(s) on the same network as the devices to be controlled. Multiple network cards can be selected. If Home Assistant have two or more connections to the local area network because of the multiple selection of the network cards, it is recommended to select the one with the best network connection, otherwise it may have bad effect on the devices.\r\n- If there are terminal devices (Xiaomi speaker with screen, mobile phone, etc.) in the LAN that support local control, enabling LAN subscription may cause local automation and device anomalies.\r\n- **Warning**: This is a global configuration. It will affect all integration instances. Please use it with caution.\r\n{notice_net_dup}",
|
|
"data": {
|
|
"net_interfaces": "Please select the network card to use",
|
|
"enable_subscribe": "Enable LAN subscription"
|
|
}
|
|
},
|
|
"network_detect_config": {
|
|
"title": "Integrated Network Configuration",
|
|
"description": "## Usage Introduction\r\n### Network Detection Address\r\nUsed to check if the network is functioning properly. If not set, the system default address will be used. If the default address check fails, you can try entering a custom address.\r\n- You can enter multiple detection addresses, separated by commas, such as `8.8.8.8,https://www.bing.com`\r\n- If it is an IP address, detection will be done via ping. If it is an HTTP(s) address, detection will be done via HTTP GET request.\r\n- If you want to restore the system default detection address, please enter a comma `,` and click 'Next'.\r\n- **This configuration is global, and changes will affect other integration instances. Please modify with caution.**\r\n### Check Network Dependencies\r\nCheck the following network dependencies one by one to see if they are accessible. If the related addresses are not accessible, it will cause integration issues.\r\n- OAuth2 Authentication Address: `https://account.xiaomi.com/oauth2/authorize`.\r\n- Xiaomi HTTP API Address: `https://{http_host}/app/v2/ha/oauth/get_token`.\r\n- Xiaomi SPEC API Address: `https://miot-spec.org/miot-spec-v2/template/list/device`.\r\n- Xiaomi MQTT Broker Address: `mqtts://{cloud_server}-ha.mqtt.io.mi.com:8883`.",
|
|
"data": {
|
|
"network_detect_addr": "Network Detection Address",
|
|
"check_network_deps": "Check Network Dependencies"
|
|
}
|
|
},
|
|
"config_confirm": {
|
|
"title": "Confirm Configuration",
|
|
"description": "Hello **{nick_name}**, please confirm the latest configuration information and then Click SUBMIT.\r\nThe integration will reload using the updated configuration.\r\n\r\nIntegration Language: \t{lang_new}\r\nNickname: \t{nick_name_new}\r\nDebug mode for action: \t{action_debug}\r\nHide non-standard created entities: \t{hide_non_standard_entities}\r\nDisplay device status change notifications:\t{display_devices_changed_notify}\r\nDevice Changes: \tAdd **{devices_add}** devices, Remove **{devices_remove}** devices\r\nTransformation rules change: \tThere are a total of **{trans_rules_count}** rules, and updated **{trans_rules_count_success}** rules",
|
|
"data": {
|
|
"confirm": "Confirm the change"
|
|
}
|
|
}
|
|
},
|
|
"progress": {
|
|
"oauth": "### {link_left}Please click here to re-login{link_right}"
|
|
},
|
|
"error": {
|
|
"not_auth": "Not authenticated. Please click the authentication link to authenticate user identity.",
|
|
"get_token_error": "Failed to retrieve login authorization information (OAuth token).",
|
|
"get_homeinfo_error": "Failed to retrieve home information.",
|
|
"get_cert_error": "Failed to retrieve the central hub gateway certificate.",
|
|
"no_devices": "There are no devices in the selected home. Please select a home with devices and continue.",
|
|
"no_filter_devices": "Filtered devices are empty. Please select valid filter criteria and continue.",
|
|
"no_family_selected": "No home selected.",
|
|
"no_central_device": "[Central Hub Gateway Mode] requires a Xiaomi central hub gateway available in the local network where Home Assistant exists. Please check if the selected home meets the requirement.",
|
|
"mdns_discovery_error": "Local device discovery service exception.",
|
|
"update_config_error": "Failed to update configuration information.",
|
|
"not_confirm": "Changes are not confirmed. Please confirm the change before submitting.",
|
|
"invalid_network_addr": "Invalid IP address or HTTP address detected, please enter a valid address.",
|
|
"invalid_ip_addr": "Unreachable IP address detected, please enter a valid IP address.",
|
|
"invalid_http_addr": "Unreachable HTTP address detected, please enter a valid HTTP address.",
|
|
"invalid_default_addr": "Default network detection address is unreachable, please check network configuration or use a custom network detection address.",
|
|
"unreachable_oauth2_host": "Unable to reach OAuth2 authentication address, please check network configuration.",
|
|
"unreachable_http_host": "Unable to reach Xiaomi HTTP API address, please check network configuration.",
|
|
"unreachable_spec_host": "Unable to reach Xiaomi SPEC API address, please check network configuration.",
|
|
"unreachable_mqtt_broker": "Unable to reach Xiaomi MQTT Broker address, please check network configuration."
|
|
},
|
|
"abort": {
|
|
"network_connect_error": "Configuration failed. The network connection is abnormal. Please check the equipment network configuration.",
|
|
"options_flow_error": "Integration re-configuration error: {error}",
|
|
"re_add": "Please re-add the integration. Error message: {error}",
|
|
"storage_error": "Integration storage module exception. Please try again or re-add the integration: {error}",
|
|
"inconsistent_account": "Account information is inconsistent. Please login with the correct account."
|
|
}
|
|
}
|
|
} |