Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[功能建议]门锁增加operator_id的sensor。 #750

Closed
befantasy opened this issue Aug 19, 2022 · 8 comments
Closed

[功能建议]门锁增加operator_id的sensor。 #750

befantasy opened this issue Aug 19, 2022 · 8 comments

Comments

@befantasy
Copy link

问题:
从Xiaomi MIoT RAW迁移过来的用户。使用的loock智能锁,在Xiaomi MIoT RAW中可以显示operator_id,这个sensor对于开门人员的识别很有意义,但是在本插件中并没有这个sensor,只有一个Lock Operation Method lock_key_id,还总变,没找到规律,很难做人员识别。

请求:
1、可否考虑增加operator_id的sensor。
2、对sensor的状态进行汉化。虽然问题不大,但很别扭。

图示:
以下是Xiaomi MIoT RAW中门锁的设备信息,有operator_id,且状态均为中文。
image

以下是本插件中门锁的设备信息。
image

@befantasy
Copy link
Author

请问这个操作者ID可以考虑增加吗?现在为了这个,同时使用两个miot的integration。。。搞得API老是超时。

@al-one
Copy link
Owner

al-one commented Sep 26, 2022

image

本插件会生成一个lock_key_id实体,不知道它能否满足你的需求。

该值在大于一定数值时为错误代码

@befantasy
Copy link
Author

我之前试过这个lock_key_id。但是在我的loock门锁上,同一个指纹同一个开锁方式,这个id有时候会变,也没找出来变化规律。

@befantasy
Copy link
Author

刚才又在插件里启用了门锁试了几次,同一个开锁方式lock_key_id没变,我再观察观察,看是不是之前家人有时候是用密码而不是指纹开的门,让我误以为lock_key_id是随机不固定的。

另外的那个问题,门锁实体属性的汉化和图标可否完善一下。实体名和图标到还可以自己手动改,但是属性就没办法了。
我刚才自己试了试,照葫芦画瓢在core/translation_languages.py里的_globals里加了行‘biological’: '指纹',哈哈好像不行。
还请指教一下如何汉化,我试着自己改改提个PR,多谢啦~

@befantasy
Copy link
Author

还有一个问题,门锁只有一个“Lock Operation Method timestamp”,好像是锁有任何状态变化就记录。

而大多门锁应该是会上报两个timestamp的,一个是door,一个是lock。比如我这个,https://home.miot-spec.com/spec/loock.lock.v8
区别是无论屋内屋外开锁,反锁,都会触发door的时间属性变化。
只有屋外开锁会触发lock的时间属性变化。

这个在实际使用中是有用处的,可以区分从外开门和从内开门的时间。

@befantasy
Copy link
Author

这个问题的优先级是否可以提升一下,实体属性的汉化和图标已经困扰半年了。自己尝试汉化也没有成功。

al-one added a commit that referenced this issue Nov 28, 2022
@al-one
Copy link
Owner

al-one commented Nov 28, 2022

门锁实体的翻译现已支持,请更新至master分支体验。需要通过下面的配置启用:

# configuration.yaml
xiaomi_miot:
  language: zh

如果想自己调整译文:

# configuration.yaml
xiaomi_miot:
  language: zh
  translations:
    door_state:
      open: 开门
      ...
    lock_method:
      bluetooth: 蓝牙
      ...
    lock_action:
      outside_unlock: 门外开锁
      ...

@befantasy
Copy link
Author

befantasy commented Nov 28, 2022

门锁实体的翻译现已支持,请更新至master分支体验。需要通过下面的配置启用:

# configuration.yaml
xiaomi_miot:
  language: zh

如果想自己调整译文:

# configuration.yaml
xiaomi_miot:
  language: zh
  translations:
    door_state:
      open: 开门
      ...
    lock_method:
      bluetooth: 蓝牙
      ...
    lock_action:
      outside_unlock: 门外开锁
      ...

多谢~我试试看。

@al-one al-one closed this as completed Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants