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

关于 viomi.lock.lbt51a 无法读取 门状态时间 #503

Open
houfukude opened this issue Apr 23, 2023 · 0 comments
Open

关于 viomi.lock.lbt51a 无法读取 门状态时间 #503

houfukude opened this issue Apr 23, 2023 · 0 comments

Comments

@houfukude
Copy link

最近在HA中重新配置了一下 云米 smart 2 viomi.lock.lbt51a

门状态时间 这项参数变成了 未知

门状态时间 的实体ID为 sensor.lbt51a_event_XXXXXX_door_door_time

查看日志时,出现大量如下日志:

2023-04-24 00:17:17.254 DEBUG (MainThread) [custom_components.xiaomi_miot_raw.deps.miot_coordinator] Finished fetching xiaomi_miot_raw-__我的UID__-event-lock data in 0.053 seconds (success: True)
2023-04-24 00:17:17.258 INFO (MainThread) [custom_components.xiaomi_miot_raw.deps.xiaomi_cloud_new] Response of /user/get_user_device_data from cloud: {'code': 0, 'message': 'ok', 'result': [{'uid': '__我的UID__', 'did': '__DID__', 'type': 'event', 'value': '["01"]', 'time': 1682258422, 'key': '7'}, {'uid': '__我的UID__', 'did': '__DID__', 'type': 'event', 'value': '["00"]', 'time': 1682258418, 'key': '7'}, {'uid': '__我的UID__', 'did': '__DID__', 'type': 'event', 'value': '["01"]', 'time': 1682257624, 'key': '7'}, {'uid': '__我的UID__', 'did': '__DID__', 'type': 'event', 'value': '["00"]', 'time': 1682257619, 'key': '7'}, {'uid': '__我的UID__', 'did': '__DID__', 'type': 'event', 'value': '["01"]', 'time': 1682249385, 'key': '7'}]}
2023-04-24 00:17:17.258 DEBUG (MainThread) [custom_components.xiaomi_miot_raw.deps.miot_coordinator] Finished fetching xiaomi_miot_raw-__我的UID__-event-door data in 0.071 seconds (success: True)
2023-04-24 00:17:17.259 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 193, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 341, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 142, in async_update_listeners
    update_callback()
  File "/config/custom_components/xiaomi_miot_raw/sensor.py", line 331, in _handle_coordinator_update
    self.publish_updates()
  File "/config/custom_components/xiaomi_miot_raw/sensor.py", line 344, in publish_updates
    callback()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 568, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 632, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 574, in _stringify_state
    if (state := self.state) is None:
  File "/config/custom_components/xiaomi_miot_raw/sensor.py", line 483, in state
    return getattr(self._data_processor(dt), self._property)
  File "/config/custom_components/xiaomi_miot_raw/deps/ble_event_parser.py", line 91, in friendly_time
    return datetime.fromtimestamp(self.timestamp).isoformat(sep=' ')
TypeError: 'NoneType' object cannot be interpreted as an integer

感觉是 小米那边没返回这个信息了 然后 ble_event_parser 中没用做对应的空判断。

感谢这个项目!可以接入好多好玩的东西! 如有需要可以联系我联调一下?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant