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

人体传感器2报错 #2315

Open
anyshpm opened this issue Jan 20, 2025 · 0 comments
Open

人体传感器2报错 #2315

anyshpm opened this issue Jan 20, 2025 · 0 comments

Comments

@anyshpm
Copy link

anyshpm commented Jan 20, 2025

Device model / 设备型号

lumi.motion.bmgl01

Component version / 插件版本

1.0.8

HA core version / HA版本

No response

Integrated mode / 集成方式

Automatic (自动模式)

The problem / 问题详情

后台一直报错

Entity attributes / 实体属性

sensor.lumi_bmgl01_22b7_no_motion_duration: unavailable

Home Assistant Logs / 系统日志

2025-01-20 06:23:01.758 ERROR (MainThread) [custom_components.xiaomi_miot.core.device.lumi.motion.bmgl01] Unexpected error fetching 54:fe:aa:12:12:12-01JSDFCXDFSTSDFDSJ6M57-miot_status data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 640, in state
    numerical_value = float(value)  # type:ignore[arg-type]
ValueError: could not convert string to float: '5 minutes'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 379, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 280, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_miot/core/device.py", line 513, in _update
    result = await self.update_miot_status(mapping)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_miot/core/device.py", line 904, in update_miot_status
    self.dispatch(self.decode(results))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_miot/core/device.py", line 616, in dispatch
    handler(data, only_info=only_info)
    ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_miot/core/hass_entity.py", line 183, in on_device_update
    self._async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1148, in _async_write_ha_state
    self.__async_calculate_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1085, in __async_calculate_state
    state = self._stringify_state(available)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1029, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 642, in state
    raise ValueError(
    ...<5 lines>...
    ) from err
ValueError: Sensor sensor.lumi_bmgl01_22b7_no_motion_duration has device class 'None', state class 'None' unit 'minutes' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: '5 minutes' (<class 'str'>)
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