xcy1231 / Ha-GreeCentralClimate

87 stars 29 forks source link

一段时间后出现错误,需重启HA #46

Closed my5123 closed 2 weeks ago

my5123 commented 4 weeks ago

日志记录器: root 来源: custom_components/gree2/fake_server.py:69 集成: gree2 (文档, 问题) 首次出现: 07:08:06 (2 次总计出现) 上次记录: 10:27:48

Uncaught thread exception Traceback (most recent call last): File "/config/custom_components/gree2/fake_server.py", line 57, in receive data = conn.recv(65535) ^^^^^^^^^^^^^^^^ ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.12/threading.py", line 1073, in _bootstrap_inner self.run() File "/usr/local/lib/python3.12/threading.py", line 1010, in run self._target(*self._args, *self._kwargs) File "/config/custom_components/gree2/fake_server.py", line 69, in receive ' Connection Exception: {} on message: {}'.format(e, str(data))) ^^^^ UnboundLocalError: cannot access local variable 'data' where it is not associated with a value

my5123 commented 3 weeks ago

删除了所有实体,重新自动添加了一遍还是不行,目前的问题就是一段时间后,状态不更新了,开关机、调温度等所有设置都不生效。 日志记录器: homeassistant.components.climate 来源: components/climate/init.py:371 集成: 空调 (文档, 问题) 首次出现: 14:19:04 (36 次总计出现) 上次记录: 15:19:23

Entity None (<class 'custom_components.gree2.device.Gree2Climate'>) does not set ClimateEntityFeature.TURN_ON but implements the turn_on method. Please create a bug report at https://github.com/xcy1231/Ha-GreeCentralClimate/issues Entity None (<class 'custom_components.gree2.device.Gree2Climate'>) implements HVACMode(s): auto, cool, dry, fan_only, heat, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please create a bug report at https://github.com/xcy1231/Ha-GreeCentralClimate/issues Entity xiaomi_miot.lumi_mcn02_a6c1_air_conditioner (<class 'custom_components.xiaomi_miot.climate.MiotClimateEntity'>) does not set ClimateEntityFeature.TURN_OFF but implements the turn_off method. Please create a bug report at https://github.com/al-one/hass-xiaomi-miot/issues Entity xiaomi_miot.lumi_mcn02_a6c1_air_conditioner (<class 'custom_components.xiaomi_miot.climate.MiotClimateEntity'>) does not set ClimateEntityFeature.TURN_ON but implements the turn_on method. Please create a bug report at https://github.com/al-one/hass-xiaomi-miot/issues Entity xiaomi_miot.lumi_mcn02_a6c1_air_conditioner (<class 'custom_components.xiaomi_miot.climate.MiotClimateEntity'>) implements HVACMode(s): auto, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please create a bug report at https://github.com/al-one/hass-xiaomi-miot/issues

xcy1231 commented 3 weeks ago

第一断日志是确实有个bug,不过那个逻辑分支我这边确实没走进去过,等下我改个版本你再试试,第二段看起来像是ha更新最新版本有些啥变更吧,我也升一下看看

xcy1231 commented 3 weeks ago

这个bug出现在云控跟fakeserver断连的分支处理中,改了之后插件应该不会直接死掉,还会进行重新连接的尝试,能不能重连成功还是需要观察下,还有为啥云控会断开可能需要你自己查找下原因,我这里还没遇到过这个情况

my5123 commented 3 weeks ago

感谢,我试试看

my5123 commented 3 weeks ago

过了一夜,还是不行。开机都没反应

日志记录器: root 来源: custom_components/gree2/fake_server.py:69 集成: gree2 (文档, 问题) 首次出现: 01:04:54 (4 次总计出现) 上次记录: 09:23:54

Uncaught thread exception Traceback (most recent call last): File "/config/custom_components/gree2/fake_server.py", line 61, in receive data, host, conn.getpeername())) ^^^^^^^^^^^^^^^^^^ OSError: [Errno 107] Socket not connected

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.12/threading.py", line 1073, in _bootstrap_inner self.run() File "/usr/local/lib/python3.12/threading.py", line 1010, in run self._target(*self._args, *self._kwargs) File "/config/custom_components/gree2/fake_server.py", line 69, in receive ' Connection Exception: {} on message: {}'.format(e)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ IndexError: Replacement index 1 out of range for positional args tuple

xcy1231 commented 3 weeks ago

抱歉没改好,再试试看

my5123 commented 3 weeks ago

抱歉没改好,再试试看

不行,这次直接重启完就不能控制设备,无反应也无日志

xcy1231 commented 3 weeks ago

日志应该还是有的,你看看跟custom_components同级的home-assistant.log

my5123 commented 3 weeks ago

日志应该还是有的,你看看跟custom_components同级的home-assistant.log

这是开机的log

2024-06-25 18:02:08.949 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'gree2' calls async_track_state_change instead of async_track_state_change_event which is deprecated and will be removed in Home Assistant 2025.5 at custom_components/gree2/device.py, line 67: async_track_state_change(, please create a bug report at https://github.com/xcy1231/Ha-GreeCentralClimate/issues 2024-06-25 18:02:08.968 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.gree2.device.Gree2Climate'>) does not set ClimateEntityFeature.TURN_ON but implements the turn_on method. Please create a bug report at https://github.com/xcy1231/Ha-GreeCentralClimate/issues 2024-06-25 18:02:08.968 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.gree2.device.Gree2Climate'>) implements HVACMode(s): auto, cool, dry, fan_only, heat, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please create a bug report at https://github.com/xcy1231/Ha-GreeCentralClimate/issues 2024-06-25 18:02:08.979 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.gree2.device.Gree2Climate'>) does not set ClimateEntityFeature.TURN_ON but implements the turn_on method. Please create a bug report at https://github.com/xcy1231/Ha-GreeCentralClimate/issues 2024-06-25 18:02:08.979 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.gree2.device.Gree2Climate'>) implements HVACMode(s): auto, cool, dry, fan_only, heat, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please create a bug report at https://github.com/xcy1231/Ha-GreeCentralClimate/issues 2024-06-25 18:02:08.982 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.gree2.device.Gree2Climate'>) does not set ClimateEntityFeature.TURN_ON but

my5123 commented 3 weeks ago

日志应该还是有的,你看看跟custom_components同级的home-assistant.log

重启ha实测,大约20分钟后就失效了

有效的时候日志里有记录 餐厅空调 已关闭 由服务触发 空调: Set HVAC mode

失效后就没任何记录了 .log里也没有

xcy1231 commented 3 weeks ago

现在重启刚开始是可以的么?针对你上面的日志我又改了点东西,如果对于你的失效还没有解决的话,最好把你重启到失效前的完整home-assistant.log日志附上来,你这应该还是网络断连的问题,我看看有没有办法解决重新连接的问题,免得你重启。不过为什么会断连这个最好你自己查查你的网络有没有啥问题。另外你的ha版本是多少

my5123 commented 3 weeks ago

现在重启刚开始是可以的么?针对你上面的日志我又改了点东西,如果对于你的失效还没有解决的话,最好把你重启到失效前的完整home-assistant.log日志附上来,你这应该还是网络断连的问题,我看看有没有办法解决重新连接的问题,免得你重启。不过为什么会断连这个最好你自己查查你的网络有没有啥问题。另外你的ha版本是多少

重启8分钟就不行了,log如下

2024-06-25 19:13:42.668 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration gree2 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-06-25 19:13:42.670 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration localtuya which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-06-25 19:13:42.671 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-06-25 19:13:42.671 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration state_grid which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-06-25 19:13:42.672 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration ha_sidebar which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-06-25 19:13:42.673 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration iphonedetect which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-06-25 19:13:42.674 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration midea_ac_lan which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-06-25 19:13:42.675 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration nodered which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-06-25 19:13:42.676 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration xiaomi_miot which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-06-25 19:13:42.676 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration bemfa which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-06-25 19:13:43.807 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template<template=(

XXX本月{{ states('sensor.state_grid_3507645854483_month_ele_num')|round(1)}}度,上月{{ states('sensor.state_grid_3507645854483_last_month_ele_num')|round(1)}}{{ states('sensor.state_grid_3507645854483_last_month_ele_cost')|round(1)}}元({{ ((states('sensor.state_grid_3507645854483_last_month_ele_cost') | float(0)) / states('sensor.state_grid_3507645854483_last_month_ele_num') | float(0) ) | round(2)}}元/度)
西街本月{{ states('sensor.state_grid_3500600056145_month_ele_num')|round(1)}}度,上月{{ states('sensor.state_grid_3500600056145_last_month_ele_num')|round(1)}}{{ states('sensor.state_grid_3500600056145_last_month_ele_cost')|round(1)}}元({{ ((states('sensor.state_grid_3500600056145_last_month_ele_cost') | float(0)) / states('sensor.state_grid_3500600056145_last_month_ele_num') | float(0) ) | round(2)}}元/度)
充电桩本月{{ states('sensor.state_grid_3550001523894_month_ele_num')|round(1)}}度,上月{{ states('sensor.state_grid_3550001523894_last_month_ele_num')|round(1)}}{{ states('sensor.state_grid_3550001523894_last_month_ele_cost')|round(1)}}元({{ ((states('sensor.state_grid_3550001523894_last_month_ele_cost') | float(0)) / states('sensor.state_grid_3550001523894_last_month_ele_num') | float(0) ) | round(2)}}元/度)
冠亚本月{{ states('sensor.state_grid_3507546826066_month_ele_num')|round(1)}}度,上月{{ states('sensor.state_grid_3507546826066_last_month_ele_num')|round(1)}}{{ states('sensor.state_grid_3507546826066_last_month_ele_cost')|round(1)}}元({{ ((states('sensor.state_grid_3507546826066_last_month_ele_cost') | float(0)) / states('sensor.state_grid_3507546826066_last_month_ele_num') | float(0) ) | round(2)}}元/度)
更新至:{{states('sensor.state_grid_3500600056145_daily_lasted_date' | default )}}

) renders=2> Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1872, in forgiving_round value = round(float(value), precision) ^^^^^^^^^^^^ ValueError: could not convert string to float: 'unknown'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 603, in async_render render_result = _render_with_context(self.template, compiled, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2616, in _render_with_context return template.render(kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/jinja2/environment.py", line 1304, in render self.environment.handle_exception() File "/usr/local/lib/python3.12/site-packages/jinja2/environment.py", line 939, in handle_exception raise rewrite_traceback_stack(source=source) File "