You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The version is under development and will be called v4.0.0
This post has been updated over time
It is highly recommended to make a backup before upgrading!
Why? With the yet another Home Assistant update, the mechanism of creating entities was broken. They only worked when the Home Assistant was started. And became unavailable with any restart of the integration.
Creating entities is a very complicated part of integration. Some may be created on the first connection to the gateway. Some may appear when new devices are connected. If there are no converters for the device - entities can be created when the first data from the device appears.
But the most difficult part is that multiple integrations (gateways) may try to create the same entity. This works for BLE, Mesh, and sometimes even Zigbee devices. This behavior is not supported by the Home Assistant core. And needs to be coded very carefully.
So I decided to rework the entire component once again.
Breaking changes
A lot of things have changed in the integration and something may not work and something has to be manually updated.
Converters
All converters moved to /xiaomi_gateway3/core/devices.py.
All entities descriptions moved to /xiaomi_gateway3/hass/entity_description.py.
Basic converter class simplified
# before@dataclassclassConverter:
attr: str# hass attributedomain: Optional[str] =None# hass domainmi: Optional[str] =Noneparent: Optional[str] =Noneenabled: Optional[bool] =True# support: True, False, None (lazy setup)poll: bool=False# hass should_poll# don't init with dataclass because no type:childs=None# set or dict? of children attributeszigbee=None# str or set? with zigbee cluster# after@dataclassclassBaseConv:
attr: strdomain: str=Nonemi: str|int=Noneentity: dict=None
Now EVERY device has command select. Options list depends to device type:
Device info - shows full device info in the Home Assistant notification. Same info you get in the stats sensors and in device diagnostics
Device update - request state update from device. BLE devices and many battery Zigbee devices can't be requested
Device delete - only Zigbee device option. Sends leave signal to Zigbee device
Cloud Integration
Now supports multiple accounts
Now supports reloading the integration to update data
Shows more information about devices
Fixed name support for new Zigbee devices
Zigbee force pairing
In the default "zigbee pairing" mode you can pair supported MiHome zigbee devices and 3rd party zigbee devices. But you can't pair unsupported MiHome zigbee devices.
In this mode you can pair any zigbee device, but it won't be displayed in the MiHome even if supported.
RSSI
Now supported for BLE and Mesh. Data is logged separately for each gateway.
Mesh groups
Now Mesh groups is another device type. Groups of different models (light, cover) are also supported.
Matter
Support Matter child devices for Xiaomi Miltimode Gateway 2 (EU) on fw 1.0.7_0019.
Device triggers
Was changed from multiple types and multiple actions. To one type - action and multiple states.
If you used device triggers - them should be updated manually.
Delete device
Now deleting Home Assistant device won't delete it from Gateway. For deleting Zigbee device you can use "command select". For deleting other devices you should use MiHome.
Gateway alarm
Now has trigger for enabling and disabling.
Gateway disabling
Now gateways has disable and enable options via "command select". Them just for test, so you can check if your BLE/Mesh devices still can be controlled when some of your gateways down.
The text was updated successfully, but these errors were encountered:
IMPORTANT
Why? With the yet another Home Assistant update, the mechanism of creating entities was broken. They only worked when the Home Assistant was started. And became unavailable with any restart of the integration.
Creating entities is a very complicated part of integration. Some may be created on the first connection to the gateway. Some may appear when new devices are connected. If there are no converters for the device - entities can be created when the first data from the device appears.
But the most difficult part is that multiple integrations (gateways) may try to create the same entity. This works for BLE, Mesh, and sometimes even Zigbee devices. This behavior is not supported by the Home Assistant core. And needs to be coded very carefully.
So I decided to rework the entire component once again.
Breaking changes
A lot of things have changed in the integration and something may not work and something has to be manually updated.
Converters
All converters moved to
/xiaomi_gateway3/core/devices.py
.All entities descriptions moved to
/xiaomi_gateway3/hass/entity_description.py
.Basic converter class simplified
Deprecated enabled=False
entity.enabled=False
paramDeprecated enabled=None
entity.lazy=True
paramDeprecated parent="..."
Setup entity description inside converter
Multiple models
hhcc.plantmonitor.v1
)BLE old converters
MiBeacon
)BLETemperature
...)mi
param now supporteid
from MiBeacon messagesBLEByteConv
,BLEMathConv
,BLEFloatConv
supports unpack MiBeacon dataBLE new converters
MiOT spec buttons
ButtonMIConv("button")
deprecated,ConstConv("action")
should be usedMiOT events
mi="3.e.1012"
changed to"3.e.1012.p.1"
if event has paramsZigbee converters
Custom entities for models
Customize deprecated
xiaomi_gateway3.devices
Stats sensors
Now can be either
sensor
orbinary_sensor
. The sensor data has also changed:uid
,did
,mac
,brand
,model
, market and cloud namesStats table
Attributes template
Logging
Log format also have been reworked. Now you can control basic and mqtt logs from:
configuration.yaml
Command select
Now EVERY device has command select. Options list depends to device type:
Cloud Integration
Zigbee force pairing
In the default "zigbee pairing" mode you can pair supported MiHome zigbee devices and 3rd party zigbee devices. But you can't pair unsupported MiHome zigbee devices.
In this mode you can pair any zigbee device, but it won't be displayed in the MiHome even if supported.
RSSI
Now supported for BLE and Mesh. Data is logged separately for each gateway.
Mesh groups
Now Mesh groups is another device type. Groups of different models (
light
,cover
) are also supported.Matter
Support Matter child devices for Xiaomi Miltimode Gateway 2 (EU) on fw 1.0.7_0019.
Device triggers
Was changed from multiple types and multiple actions. To one type - action and multiple states.
If you used device triggers - them should be updated manually.
Delete device
Now deleting Home Assistant device won't delete it from Gateway. For deleting Zigbee device you can use "command select". For deleting other devices you should use MiHome.
Gateway alarm
Now has trigger for enabling and disabling.
Gateway disabling
Now gateways has disable and enable options via "command select". Them just for test, so you can check if your BLE/Mesh devices still can be controlled when some of your gateways down.
The text was updated successfully, but these errors were encountered: