Closed gx19970920 closed 1 year ago
Try writing your own coverters like this? It is directly copied from current migateway3 code and I just added the spec infomation and it may work.
{
"lumi.lock.bmcn05": ["Xiaomi", "Mi Smart Door Lock with Face Unlock X", "XMZNMS06LM"],
"spec": [
MiBeacon,
# sensors:
Converter("action", "sensor", enabled=None),
Converter("battery", "sensor", enabled=None),
Converter("conductivity", "sensor", enabled=None),
Converter("formaldehyde", "sensor", enabled=None),
Converter("humidity", "sensor", enabled=None),
Converter("idle_time", "sensor", enabled=None),
Converter("illuminance", "sensor", enabled=None),
Converter("moisture", "sensor", enabled=None),
Converter("rssi", "sensor", enabled=None),
Converter("supply", "sensor", enabled=None),
Converter("temperature", "sensor", enabled=None),
# binary_sensors:
Converter("contact", "binary_sensor", enabled=None),
Converter("gas", "binary_sensor", enabled=None),
Converter("light", "binary_sensor", enabled=None),
Converter("lock", "binary_sensor", enabled=None),
Converter("motion", "binary_sensor", enabled=None),
Converter("opening", "binary_sensor", enabled=None),
Converter("sleep", "binary_sensor", enabled=None),
Converter("smoke", "binary_sensor", enabled=None),
Converter("water_leak", "binary_sensor", enabled=None),
],
}]
@gx19970920 try to make some actions with lock. Sensors may appear later.
Try writing your own coverters like this? It is directly copied from current migateway3 code and I just added the spec infomation and it may work.
{ "lumi.lock.bmcn05": ["Xiaomi", "Mi Smart Door Lock with Face Unlock X", "XMZNMS06LM"], "spec": [ MiBeacon, # sensors: Converter("action", "sensor", enabled=None), Converter("battery", "sensor", enabled=None), Converter("conductivity", "sensor", enabled=None), Converter("formaldehyde", "sensor", enabled=None), Converter("humidity", "sensor", enabled=None), Converter("idle_time", "sensor", enabled=None), Converter("illuminance", "sensor", enabled=None), Converter("moisture", "sensor", enabled=None), Converter("rssi", "sensor", enabled=None), Converter("supply", "sensor", enabled=None), Converter("temperature", "sensor", enabled=None), # binary_sensors: Converter("contact", "binary_sensor", enabled=None), Converter("gas", "binary_sensor", enabled=None), Converter("light", "binary_sensor", enabled=None), Converter("lock", "binary_sensor", enabled=None), Converter("motion", "binary_sensor", enabled=None), Converter("opening", "binary_sensor", enabled=None), Converter("sleep", "binary_sensor", enabled=None), Converter("smoke", "binary_sensor", enabled=None), Converter("water_leak", "binary_sensor", enabled=None), ], }]
Thanks,I had solved this problem,the state of lock and door are in the attribute of
entity.
@gx19970920 try to make some actions with lock. Sensors may appear later.
Thanks, after I open and close the door several times, the states of lock and door show in the attribute of entity.
Ok. Anyway I need to add this model to component. So all entity will appear instantly
还行。无论如何,我需要将此模型添加到组件中。因此,所有实体都将立即出现
thanks, if you need some information of this lock please e-mail me at gx19970920@gmail.com
I can see its model on your screen. How many sensors do you have? BLE, Battery and Action?
I can see its model on your screen. How many sensors do you have? BLE, Battery and Action?
it has BLE, Battery and Action,the main information are in the attribute of action
I don't understand. BLE model is always number. (3685) on your first screen. It can't be string (lumi.lock.bmcn05)
I don't understand. BLE model is always number. (3685) on your first screen. It can't be string (lumi.lock.bmcn05)
You are right. The reason why my interface displays the name of the door lock is that I manually wrote the file xaomigateway3.py
Can you attach the file here?
from custom_components.xiaomi_gateway3.core.converters.devices import *
DEVICES = [{
3685: ["lumi", "Mi Smart Door Lock with Face Unlock X", "lumi.lock.bmcn05"],
"spec": [
MiBeacon,
# sensors:
Converter("action", "sensor", enabled=None),
Converter("battery", "sensor", enabled=None),
# binary_sensors:
Converter("contact", "binary_sensor", enabled=None),
Converter("lock", "binary_sensor", enabled=None),
],
}] + DEVICES
Oh. Now is all clear. Thanks. Works as should be.
But can these attributes such as lock status, door status, and unlock method be independent entities? In this way, it is more convenient to set up automations. If you have time and are interested, I hope you can refer to my suggestion
You can make template entities if you want. But you can use them in automations without any modifications. Just learn more about Hass automations https://github.com/AlexxIT/XiaomiGateway3/wiki/Handle-BLE-Locks
THANKS!!!!
the Firmware version is 1.5.0_0026 Only the battery and bluetooth connection status can be viewed