- 积分
- 783
- 金钱
- 601
- 威望
- 0
- 贡献
- 0
- HASS币
- 0
高级会员
- 积分
- 783
- 金钱
- 601
- HASS币
- 0
|
发表于 2024-5-6 16:27:55
|
显示全部楼层
目前显示是正常的,但HA的日志有错误。如下:
此错误来自自定义集成。
日志: homeassistant
来源: custom_components/state_grid/sensor.py:185
集成: 国家电网 (文档)
首次发生: 04:00:21 (143 全部发生)
上次记录: 15:50:18
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 414, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 494, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 998, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1119, in _async_write_ha_state
state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1056, in __async_calculate_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1004, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 548, in state
value = self.native_value
^^^^^^^^^^^^^^^^^
File "/config/custom_components/state_grid/sensor.py", line 185, in native_value
return data[self.entity_description.key]
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'balance'
|
|