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

青萍动作和环境光传感器光照度实体消失了 #1997

Open
MarcPolaris opened this issue Dec 3, 2024 · 6 comments
Open

青萍动作和环境光传感器光照度实体消失了 #1997

MarcPolaris opened this issue Dec 3, 2024 · 6 comments

Comments

@MarcPolaris
Copy link

MarcPolaris commented Dec 3, 2024

Device model / 设备型号

cgllc.motion.cgpr1

Component version / 插件版本

1.0.1

HA core version / HA版本

2024.11.3

Integrated mode / 集成方式

Automatic (自动模式)

The problem / 问题详情

插件更新到1.0.1版本之后,青萍动作和环境光传感器(cgllc.motion.cgpr1),光照度实体消失了,无法使用,删除重新添加也不行,重新下载1.0.1集成也不行。更新1.0.1版本之前的0.7.25,是可以使用的。

Entity attributes / 实体属性

info: 客厅青萍传感器
model: cgllc.motion.cgpr1
did: blt.3.1jh2istbc4k00
mac: 58:2D:34:61:05:BC
lan_ip: ""
app_link: mihome://device?uid=xxxx&did=blt.3.1jh2istbc4k00
miot_type: urn:miot-spec-v2:device:motion-sensor:0000A014:cgllc-cgpr1:1
available: true
home_room: 北辰的家庭 客厅
icon: mdi:information
updater: cloud
updated_at: "2024-12-03 18:04:59.357937+08:00"
converters:
  - info
  - battery_level
customizes: {}
battery_level: 84
motion_sensor.illumination: 0
no_motion_duration-2-2: 10
device_class: update
friendly_name: 客厅青萍传感器 信息

Home Assistant Logs / 系统日志

No response

@ympchuan
Copy link

ympchuan commented Dec 4, 2024

问题相同

@MarcPolaris
Copy link
Author

'cgllc.motion.cgpr1': {
    'sensor_properties': 'illumination,no_motion_duration',
},

增加这段代码之后,设备页面多出“ 运动侦测 No Motion Duration ”实体,实体属于不可用状态。截屏2024-12-05 07 45 34

@al-one
Copy link
Owner

al-one commented Dec 5, 2024

再次提供Info实体属性及debug日志

@MarcPolaris
Copy link
Author

device_class: update
icon: mdi:information
friendly_name: 客厅青萍 信息
info: 客厅青萍
model: cgllc.motion.cgpr1
did: blt.3.1jh2istbc4k00
mac: 58:2D:34:61:05:BC
lan_ip: ""
app_link: mihome://device?uid=16319620&did=blt.3.1jh2istbc4k00
miot_type: urn:miot-spec-v2:device:motion-sensor:0000A014:cgllc-cgpr1:1
available: true
home_room: 北辰的家庭 客厅
updater: none
updated_at: ""
converters:

  • info
  • battery_level
  • motion_sensor.illumination
  • no_motion_duration-2-2
    customizes:
    sensor_properties: illumination,no_motion_duration

@MarcPolaris
Copy link
Author

日志记录器: homeassistant
来源: components/sensor/init.py:679
首次出现: 17:17:43 (4 次总计出现)
上次记录: 17:17:43

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 677, in state
numerical_value = float(value) # type:ignore[arg-type]
ValueError: could not convert string to float: '30 minutes'

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

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1552, in _async_process_registry_update_or_remove
self.async_write_ha_state()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in async_write_ha_state
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 679, in state
raise ValueError(
...<5 lines>...
) from err
ValueError: Sensor sensor.cgllc_cgpr1_0c20_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: '30 minutes' (<class 'str'>)

@MarcPolaris
Copy link
Author

感谢,实体已经正常,但是“运动侦测 No Motion Duration” 未能正常翻译。

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

3 participants