2 Commits

Author SHA1 Message Date
0fee02ae5c feat: add notifications for the local connection to the central hub gateway (#1280)
* feat: add notifications for the central hub gateway connection status (#1103)

* fix: i18n langurage support

* fix: add notification of disconnection when ServiceStateChange.REMOVED
2025-07-21 16:49:42 +08:00
580ff87e7f fix: specs (#1256)
* fix: xiaomi.aircondition.c24 total power consumption unit (#1243)

* fix: adp.motor.adswb4 motor switch (#1257)

* docs: modify README

* fix: cgllc.airm.cgd1st environment temperature (#1270)

* fix: shhf.light.sflt11 fan switch status (#1276)
2025-07-21 16:44:47 +08:00
15 changed files with 86 additions and 4 deletions

View File

@ -83,9 +83,9 @@ Xiaomi Home Integration and the affiliated cloud interface is provided by Xiaomi
## FAQ
- Does Xiaomi Home Integration support all Xiaomi Home devices?
- Does Xiaomi Home Integration support all Xiaomi smart devices?
Xiaomi Home Integration currently supports most categories of Home device. Only a few categories are not supported. They are Bluetooth device, infrared device and virtual device.
Xiaomi Home Integration currently supports most categories of the smart device. Only a few categories are not supported. They are Bluetooth device, infrared device and virtual device.
- Does Xiaomi Home Integration support multiple Xiaomi accounts?
@ -93,7 +93,7 @@ Xiaomi Home Integration and the affiliated cloud interface is provided by Xiaomi
- Does Xiaomi Home Integration support local control?
Local control is implemented by [Xiaomi Central Hub Gateway](https://www.mi.com/shop/buy/detail?product_id=15755&cfrom=search) (firmware version 3.4.0_0000 above) or Xiaomi home devices with built-in central hub gateway (software version 0.8.0 above) inside. If you do not have a Xiaomi central hub gateway or other devices having central hub gateway function, all control commands are sent through Xiaomi Cloud. The firmware for Xiaomi central hub gateway including the built-in central hub gateway supporting Home Assistant local control feature has not been released yet. Please refer to MIoT team's notification for upgrade plans.
Local control is implemented by [Xiaomi Central Hub Gateway](https://www.mi.com/shop/buy/detail?product_id=15755&cfrom=search) (firmware version 3.3.0_0023 and above) or Xiaomi smart devices with built-in central hub gateway (software version 0.8.9 and above) inside. If you do not have a Xiaomi central hub gateway or other devices having central hub gateway function, all control commands are sent through Xiaomi Cloud. The firmware for Xiaomi central hub gateway including the built-in central hub gateway supporting Home Assistant local control feature has not been released yet. Please refer to MIoT team's notification for upgrade plans.
Xiaomi central hub gateway is only available in mainland China. In other regions, it is not available.

View File

@ -99,6 +99,10 @@
"device_list_offline": "\n**{count} Geräte offline:** \n{message}",
"network_status_online": "Online",
"network_status_offline": "Offline",
"central_state_changed_title": "Verbindungsstatus des Zentral-Gateways",
"central_state_changed": "**{nick_name}({uid}, {cloud_server})** Lokale Verbindungsstrecke des Zentral-Gateways: {conn_status}",
"central_state_connected": "verbunden",
"central_state_disconnected": "getrennt",
"device_exec_error": "Fehler bei der Ausführung"
}
},

View File

@ -99,6 +99,10 @@
"device_list_offline": "\n**{count} devices offline:** \n{message}",
"network_status_online": "Online",
"network_status_offline": "Offline",
"central_state_changed_title": "Central Hub Gateway Connection Status",
"central_state_changed":"**{nick_name}({uid}, {cloud_server})** local connection to Xiaomi central hub gateway: {conn_status}",
"central_state_connected": "Connected",
"central_state_disconnected": "Disconnected",
"device_exec_error": "Execution error"
}
},

View File

@ -99,6 +99,10 @@
"device_list_offline": "\n**{count} dispositivos sin conexión:** \n{message}",
"network_status_online": "En línea",
"network_status_offline": "Desconectado",
"central_state_changed_title": "Estado de conexión de la puerta de enlace central",
"central_state_changed": "**{nick_name}({uid}, {cloud_server})** enlace de conexión local de la puerta de enlace central: {conn_status}",
"central_state_connected": "conectado",
"central_state_disconnected": "desconectado",
"device_exec_error": "Error de ejecución"
}
},

View File

@ -99,6 +99,10 @@
"device_list_offline": "\n**{count} appareils hors ligne :** \n{message}",
"network_status_online": "En ligne",
"network_status_offline": "Hors ligne",
"central_state_changed_title": "État de connexion de la passerelle centrale",
"central_state_changed": "**{nick_name}({uid}, {cloud_server})** liaison de connexion locale de la passerelle centrale : {conn_status}",
"central_state_connected": "connecté",
"central_state_disconnected": "déconnecté",
"device_exec_error": "Erreur d'exécution"
}
},

View File

@ -99,6 +99,10 @@
"device_list_offline": "\n**{count} dispositivi offline:** \n{message}",
"network_status_online": "Online",
"network_status_offline": "Offline",
"central_state_changed_title": "Stato di connessione del gateway centrale",
"central_state_changed": "**{nick_name}({uid}, {cloud_server})** collegamento locale del gateway centrale: {conn_status}",
"central_state_connected": "connesso",
"central_state_disconnected": "disconnesso",
"device_exec_error": "Errore di esecuzione"
}
},

View File

@ -99,6 +99,10 @@
"device_list_offline": "\n**{count} デバイスがオフライン:** \n{message}",
"network_status_online": "オンライン",
"network_status_offline": "オフライン",
"central_state_changed_title": "中枢ゲートウェイ接続ステータス",
"central_state_changed": "**{nick_name}({uid}, {cloud_server})** 中枢ゲートウェイのローカル接続リンク: {conn_status}",
"central_state_connected": "接続済み",
"central_state_disconnected": "切断されました",
"device_exec_error": "実行エラー"
}
},

View File

@ -99,6 +99,10 @@
"device_list_offline": "\n**{count} apparaten offline:** \n{message}",
"network_status_online": "Online",
"network_status_offline": "Offline",
"central_state_changed_title": "Verbindingsstatus van centrale gateway",
"central_state_changed": "**{nick_name}({uid}, {cloud_server})** Lokale verbinding van centrale gateway: {conn_status}",
"central_state_connected": "verbonden",
"central_state_disconnected": "verbinding verbroken",
"device_exec_error": "Uitvoeringsfout"
}
},

View File

@ -99,6 +99,10 @@
"device_list_offline": "\n**{count} dispositivos offline**: \n{message}",
"network_status_online": "online",
"network_status_offline": "offline",
"central_state_changed_title": "Status de conexão do gateway central",
"central_state_changed": "**{nick_name}({uid}, {cloud_server})** conexão local do gateway central: {conn_status}",
"central_state_connected": "conectado",
"central_state_disconnected": "desconectado",
"device_exec_error": "Erro na execução"
}
},

View File

@ -99,6 +99,10 @@
"device_list_offline": "\n**{count} dispositivos offline**: \n{message}",
"network_status_online": "Online",
"network_status_offline": "Offline",
"central_state_changed_title": "Estado da ligação do gateway central",
"central_state_changed": "**{nick_name}({uid}, {cloud_server})** ligação local do gateway central: {conn_status}",
"central_state_connected": "ligado",
"central_state_disconnected": "desligado",
"device_exec_error": "Erro de execução"
}
},

View File

@ -99,6 +99,10 @@
"device_list_offline": "\n**{count} устройств недоступно:** \n{message}",
"network_status_online": "В сети",
"network_status_offline": "Не в сети",
"central_state_changed_title": "Статус подключения центрального шлюза",
"central_state_changed": "**{nick_name}({uid}, {cloud_server})** локальное подключение центрального шлюза: {conn_status}",
"central_state_connected": "подключено",
"central_state_disconnected": "разъединено",
"device_exec_error": "Ошибка выполнения"
}
},

View File

@ -99,6 +99,10 @@
"device_list_offline": "\n**{count} 个设备离线**: \n{message}",
"network_status_online": "在线",
"network_status_offline": "离线",
"central_state_changed_title": "中枢网关连接状态",
"central_state_changed":"**{nick_name}({uid}, {cloud_server})** 中枢网关本地连接链路: {conn_status}",
"central_state_connected": "已连接",
"central_state_disconnected": "断连",
"device_exec_error": "执行错误"
}
},

View File

@ -99,6 +99,10 @@
"device_list_offline": "\n**{count} 個設備離線:** \n{message}",
"network_status_online": "在線",
"network_status_offline": "離線",
"central_state_changed_title": "中枢網關連接狀態",
"central_state_changed":"**{nick_name}({uid}, {cloud_server})** 中枢網關本地連接鏈路: {conn_status}",
"central_state_connected": "已連接",
"central_state_disconnected": "断連",
"device_exec_error": "執行錯誤"
}
},

View File

@ -1115,8 +1115,10 @@ class MIoTClient:
_LOGGER.info('local mips state changed, %s, %s', group_id, state)
mips = self._mips_local.get(group_id, None)
if not mips:
_LOGGER.error(
_LOGGER.info(
'local mips state changed, mips not exist, %s', group_id)
# The connection to the central hub gateway is definitely broken.
self.__show_central_state_changed_notify(False)
return
if state:
# Connected
@ -1150,6 +1152,7 @@ class MIoTClient:
if sub and sub.handler:
sub.handler(did, MIoTDeviceState.OFFLINE, sub.handler_ctx)
self.__request_show_devices_changed_notify()
self.__show_central_state_changed_notify(state)
@final
async def __on_miot_lan_state_change(self, state: bool) -> None:
@ -1915,6 +1918,23 @@ class MIoTClient:
self._show_devices_changed_notify_timer = self._main_loop.call_later(
delay_sec, self.__show_devices_changed_notify)
@final
def __show_central_state_changed_notify(self, connected: bool) -> None:
conn_status: str = (
self._i18n.translate('miot.client.central_state_connected')
if connected else
self._i18n.translate('miot.client.central_state_disconnected'))
self._persistence_notify(
self.__gen_notify_key('central_state_changed'),
self._i18n.translate('miot.client.central_state_changed_title'),
self._i18n.translate(key='miot.client.central_state_changed',
replace={
'nick_name': self._entry_data.get(
'nick_name', DEFAULT_NICK_NAME),
'uid': self._uid,
'cloud_server': self._cloud_server,
'conn_status': conn_status
}))
@staticmethod
async def get_miot_instance_async(

View File

@ -6,6 +6,8 @@ urn:miot-spec-v2:device:air-conditioner:0000A004:xiaomi-c20:1:
unit: none
urn:miot-spec-v2:device:air-conditioner:0000A004:xiaomi-c20:2: urn:miot-spec-v2:device:air-conditioner:0000A004:xiaomi-c20:1
urn:miot-spec-v2:device:air-conditioner:0000A004:xiaomi-c24:1:
prop.8.6:
unit: kWh
prop.10.6:
unit: none
urn:miot-spec-v2:device:air-conditioner:0000A004:xiaomi-c24:2: urn:miot-spec-v2:device:air-conditioner:0000A004:xiaomi-c24:1
@ -26,6 +28,12 @@ urn:miot-spec-v2:device:air-conditioner:0000A004:xiaomi-mt0:1:
prop.10.6:
unit: none
urn:miot-spec-v2:device:air-conditioner:0000A004:xiaomi-mt0:2: urn:miot-spec-v2:device:air-conditioner:0000A004:xiaomi-mt0:1
urn:miot-spec-v2:device:air-monitor:0000A008:cgllc-cgd1st:1:
prop.3.7:
value-range:
- -30
- 100
- 0.1
urn:miot-spec-v2:device:air-monitor:0000A008:cgllc-s1:1:
prop.2.5:
name: voc-density
@ -153,6 +161,9 @@ urn:miot-spec-v2:device:light:0000A001:shhf-sfla10:1:
urn:miot-spec-v2:device:light:0000A001:shhf-sfla12:1:
prop.8.11:
name: on-a
urn:miot-spec-v2:device:light:0000A001:shhf-sflt11:1:0000C802:
prop.11.14:
name: on-power
urn:miot-spec-v2:device:magnet-sensor:0000A016:linp-m1:1:
prop.2.1004:
name: contact-state
@ -168,6 +179,9 @@ urn:miot-spec-v2:device:motion-sensor:0000A014:lumi-acn001:1:
- read
- notify
unit: mV
urn:miot-spec-v2:device:motor-controller:0000A01D:adp-adswb4:1:0000C837:
prop.2.1:
name: motor-switch
urn:miot-spec-v2:device:occupancy-sensor:0000A0BF:ainice-3b:1: urn:miot-spec-v2:device:occupancy-sensor:0000A0BF:ainice-3b:2
urn:miot-spec-v2:device:occupancy-sensor:0000A0BF:ainice-3b:2:
prop.2.8: