qqaatw / JciHitachiHA

A home assistant integration for controlling Jci-Hitachi devices, using LibJciHitachi backend. 台灣日立雲端模組
Apache License 2.0
116 stars 32 forks source link

空調溫度顯示與實際不同步 #9

Closed Stardusstt closed 2 years ago

Stardusstt commented 2 years ago

空調溫度顯示與實際不同步,需 reboot ha core 讓他強制更新,但放一段時間又會不同步

RAS-22NJF RAS-25NJF RAS-28NJF RAS-71NJF

qqaatw commented 2 years ago

請提供HA Core和Integration 版本,以及log是否有錯誤訊息

Stardusstt commented 2 years ago

補充 剛剛測試,狀態也沒同步,也噴了一點log 先丟一部份

雖然重啟後目前正常

core-2021.12.10 JciHitachiHA v0.2.2


File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 700, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 470, in async_set_hvac_mode await self.hass.async_add_executor_job(self.set_hvac_mode, hvac_mode) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, self.kwargs) File "/config/custom_components/jcihitachi_tw/climate.py", line 273, in set_hvac_mode self.update() File "/config/custom_components/jcihitachi_tw/init.py", line 262, in update api.refresh_status() File "/usr/local/lib/python3.9/site-packages/JciHitachi/api.py", line 1081, in refresh_status raise RuntimeError( RuntimeError: An error occurred when refreshing status code. 2022-01-22 15:39:19 ERROR (MainThread) [homeassistant.core] Error executing service: <ServiceCall climate.set_swing_mode (c:a28e7016f43658a36fbf31317d576753): swing_mode=both, entity_id=['climate.shu_fang_kong_diao']> Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/core.py", line 1511, in catch_exceptions await coro_or_task File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service await handler.job.target(service_call) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 209, in handle_service await self.hass.helpers.service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 663, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 896, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 700, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 478, in async_set_swing_mode await self.hass.async_add_executor_job(self.set_swing_mode, swing_mode) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, *self.kwargs) File "/config/custom_components/jcihitachi_tw/climate.py", line 340, in set_swing_mode self.update() File "/config/custom_components/jcihitachi_tw/init.py", line 262, in update api.refresh_status() File "/usr/local/lib/python3.9/site-packages/JciHitachi/api.py", line 1081, in refresh_status raise RuntimeError( RuntimeError: An error occurred when refreshing status code. 2022-01-22 15:39:23 ERROR (SyncWorker_3) [AWSIoTPythonSDK.core.protocol.mqtt_core] Publish timed out 2022-01-22 15:39:23 ERROR (SyncWorker_3) [JciHitachi.aws_connection] Publish timed out. 2022-01-22 15:39:29 ERROR (SyncWorker_1) [AWSIoTPythonSDK.core.protocol.mqtt_core] Publish timed out 2022-01-22 15:39:29 ERROR (SyncWorker_1) [JciHitachi.aws_connection] Publish timed out. 2022-01-22 15:40:03 ERROR (SyncWorker_0) [custom_components.jcihitachi_tw] Failed to update data. 2022-01-22 15:40:09 ERROR (SyncWorker_1) [AWSIoTPythonSDK.core.protocol.mqtt_core] Publish timed out 2022-01-22 15:40:09 ERROR (SyncWorker_1) [JciHitachi.aws_connection] Publish timed out. 2022-01-22 15:40:15 ERROR (SyncWorker_3) [custom_components.jcihitachi_tw] Failed to update data. 2022-01-22 15:40:18 ERROR (SyncWorker_0) [AWSIoTPythonSDK.core.protocol.mqtt_core] Publish timed out 2022-01-22 15:40:18 ERROR (SyncWorker_0) [JciHitachi.aws_connection] Publish timed out. 2022-01-22 15:40:28 ERROR (MainThread) [homeassistant.core] Error executing service: <ServiceCall climate.set_hvac_mode (c:f5c8d107e5d8e1384771dae5df488f06): entity_id=['climate.shu_fang_kong_diao'], hvac_mode=fan_only> Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/core.py", line 1511, in catch_exceptions await coro_or_task File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service await handler.job.target(service_call) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 209, in handle_service await self.hass.helpers.service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 663, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 896, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 700, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 470, in async_set_hvac_mode await self.hass.async_add_executor_job(self.set_hvac_mode, hvac_mode) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(self.args, self.kwargs) File "/config/custom_components/jcihitachi_tw/climate.py", line 273, in set_hvac_mode self.update() File "/config/custom_components/jcihitachi_tw/init.py", line 262, in update api.refresh_status() File "/usr/local/lib/python3.9/site-packages/JciHitachi/api.py", line 1081, in refresh_status raise RuntimeError( RuntimeError: An error occurred when refreshing status code. 2022-01-22 15:40:30 ERROR (SyncWorker_3) [AWSIoTPythonSDK.core.protocol.mqtt_core] Publish timed out 2022-01-22 15:40:30 ERROR (SyncWorker_3) [JciHitachi.aws_connection] Publish timed out. 2022-01-22 15:40:40 ERROR (MainThread) [homeassistant.core] Error executing service: <ServiceCall climate.set_hvac_mode (c:6c0bb3d41ce38d24a60f8506afdc2b6b): hvac_mode=fan_only, entity_id=['climate.shu_fang_kong_diao']> Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/core.py", line 1511, in catch_exceptions await coro_or_task File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service await handler.job.target(service_call) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 209, in handle_service await self.hass.helpers.service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 663, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 896, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 700, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 470, in async_set_hvac_mode await self.hass.async_add_executor_job(self.set_hvac_mode, hvac_mode) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/jcihitachi_tw/climate.py", line 273, in set_hvac_mode self.update() File "/config/custom_components/jcihitachi_tw/init.py", line 262, in update api.refresh_status() File "/usr/local/lib/python3.9/site-packages/JciHitachi/api.py", line 1081, in refresh_status raise RuntimeError( RuntimeError: An error occurred when refreshing status code.


2022-01-22 15:48:35 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration jcihitachi_tw 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

2022-01-22 15:52:40 ERROR (Thread-3) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 15:52:40 ERROR (Thread-3) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 15:52:40 ERROR (Thread-3) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0)

qqaatw commented 2 years ago

錯誤發生後一陣子會自行恢復正常還是需要重啟? 用官方App是否有延遲、連不到的狀況? HA的網路連線穩定嗎?

Stardusstt commented 2 years ago

錯誤發生後一陣子會自行恢復正常還是需要重啟?

用官方App是否有延遲、連不到的狀況?

HA的網路連線穩定嗎?

目前

2022-01-22 16:15:09 ERROR (MainThread) [custom_components.jcihitachi_tw] Error fetching jcihitachi_tw data: Error communicating with API: 'DeviceType' 2022-01-22 16:27:19 ERROR (Thread-3) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 16:27:19 ERROR (Thread-3) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 16:27:19 ERROR (Thread-3) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 16:46:33 ERROR (Thread-6) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 16:46:33 ERROR (Thread-6) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 16:46:34 ERROR (Thread-6) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 16:52:49 ERROR (Thread-6) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 16:52:49 ERROR (Thread-6) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 16:52:49 ERROR (Thread-6) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 17:56:46 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 17:56:46 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 17:56:46 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 17:58:37 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 17:58:37 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 17:58:37 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 17:59:08 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 17:59:08 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 17:59:08 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 18:31:49 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 18:31:49 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 18:31:49 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0)

qqaatw commented 2 years ago

2022-01-22 16:15:09 ERROR (MainThread) [custom_components.jcihitachi_tw] Error fetching jcihitachi_tw data: Error communicating with API: 'DeviceType' 2022-01-22 16:27:19 ERROR (Thread-3) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 16:27:19 ERROR (Thread-3) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 16:27:19 ERROR (Thread-3) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 16:46:33 ERROR (Thread-6) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 16:46:33 ERROR (Thread-6) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 16:46:34 ERROR (Thread-6) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 16:52:49 ERROR (Thread-6) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 16:52:49 ERROR (Thread-6) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 16:52:49 ERROR (Thread-6) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 17:56:46 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 17:56:46 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 17:56:46 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 17:58:37 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 17:58:37 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 17:58:37 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 17:59:08 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 17:59:08 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 17:59:08 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 18:31:49 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 18:31:49 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0) 2022-01-22 18:31:49 ERROR (Thread-9) [JciHitachi.aws_connection] Expecting value: line 1 column 1 (char 0)

出現以上這些錯誤的時候狀態是正常還是異常? 重啟後平均多久會開始出現狀態不同步? 狀態不同步發生之後操作(例如調整溫度)是否正常?

Stardusstt commented 2 years ago

目前

平均多久?

Stardusstt commented 2 years ago

2022-01-23 12:57:47 測試 狀態不同步、操作失效


2022-01-23 04:13:26 ERROR (SyncWorker_5) [AWSIoTPythonSDK.core.protocol.mqtt_core] Publish timed out 2022-01-23 04:13:26 ERROR (SyncWorker_5) [JciHitachi.aws_connection] Publish timed out. 2022-01-23 04:14:06 ERROR (SyncWorker_2) [AWSIoTPythonSDK.core.protocol.mqtt_core] Publish timed out 2022-01-23 04:14:06 ERROR (SyncWorker_2) [JciHitachi.aws_connection] Publish timed out. 2022-01-23 04:14:46 ERROR (SyncWorker_6) [AWSIoTPythonSDK.core.protocol.mqtt_core] Publish timed out 2022-01-23 04:14:46 ERROR (SyncWorker_6) [JciHitachi.aws_connection] Publish timed out. 2022-01-23 04:15:26 ERROR (SyncWorker_0) [AWSIoTPythonSDK.core.protocol.mqtt_core] Publish timed out 2022-01-23 04:15:26 ERROR (SyncWorker_0) [JciHitachi.aws_connection] Publish timed out. 2022-01-23 04:16:06 ERROR (SyncWorker_6) [AWSIoTPythonSDK.core.protocol.mqtt_core] Publish timed out 2022-01-23 04:16:06 ERROR (SyncWorker_6) [JciHitachi.aws_connection] Publish timed out. 2022-01-23 04:16:46 ERROR (SyncWorker_4) [AWSIoTPythonSDK.core.protocol.mqtt_core] Publish timed out 2022-01-23 04:16:46 ERROR (SyncWorker_4) [JciHitachi.aws_connection] Publish timed out. 2022-01-23 04:17:26 ERROR (SyncWorker_2) [AWSIoTPythonSDK.core.protocol.mqtt_core] Publish timed out 2022-01-23 04:17:26 ERROR (SyncWorker_2) [JciHitachi.aws_connection] Publish timed out. 2022-01-23 04:18:06 ERROR (SyncWorker_5) [AWSIoTPythonSDK.core.protocol.mqtt_core] Publish timed out 2022-01-23 04:18:06 ERROR (SyncWorker_5) [JciHitachi.aws_connection] Publish timed out. 2022-01-23 04:18:46 ERROR (SyncWorker_3) [AWSIoTPythonSDK.core.protocol.mqtt_core] Publish timed out 2022-01-23 04:18:46 ERROR (SyncWorker_3) [JciHitachi.aws_connection] Publish timed out. 2022-01-23 04:19:26 ERROR (SyncWorker_4) [AWSIoTPythonSDK.core.protocol.mqtt_core] Publish timed out 2022-01-23 04:19:26 ERROR (SyncWorker_4) [JciHitachi.aws_connection] Publish timed out. 2022-01-23 04:20:06 ERROR (SyncWorker_1) [AWSIoTPythonSDK.core.protocol.mqtt_core] Publish timed out 2022-01-23 04:20:06 ERROR (SyncWorker_1) [JciHitachi.aws_connection] Publish timed out.

qqaatw commented 2 years ago

我這邊沒辦法重現該錯誤,目前也沒有其他人反應此問題。有一個可測試的地方是新增Integration時,僅指定一台裝置,然後測試是否還會有此錯誤。 BTW,你的裝置總共是四台嗎?

如果可以的話把整個log檔上傳(附加檔案,不要將文字直接貼在issue內),方便釐清問題點。 開啟Debug mode:https://github.com/qqaatw/JciHitachiHA/issues/4#issuecomment-1008634167

Stardusstt commented 2 years ago

home-assistant.log

Stardusstt commented 2 years ago

第二次測試 home-assistant.log


前面好好的,突然 decode 就炸了? 2022-01-24 15:57:15 ERROR (Thread-3) [JciHitachi.aws_connection] 'utf-8' codec can't decode byte 0xb4 in position 6: invalid start byte

qqaatw commented 2 years ago

看起來兩個log都是decode的問題,我這幾天有空出一個patch version你再試試看。

qqaatw commented 2 years ago

https://github.com/qqaatw/JciHitachiHA/releases/tag/0.2.3

Stardusstt commented 2 years ago

目前測試沒問題

Stardusstt commented 2 years ago

目前同步沒問題 但會每隔一段時間出現decode的錯誤 home-assistant.log


2022-01-27 19:38:05 ERROR (Thread-6) [JciHitachi.aws_connection] Mqtt topic $aws/things/ap-northeast-1:c0da54ff-43cd-4147-a33d-2024654f6ee7_66428598591190/shadow/name/info/get published with payload b'' cannot be decoded: Expecting value: line 1 column 1 (char 0)

2022-01-27 19:38:05 ERROR (Thread-6) [JciHitachi.aws_connection] Mqtt topic $aws/things/ap-northeast-1:c0da54ff-43cd-4147-a33d-2024654f6ee7_66428598591190/shadow/name/conditions/get published with payload b'' cannot be decoded: Expecting value: line 1 column 1 (char 0) 2022-01-27 19:38:05 ERROR (Thread-6) [JciHitachi.aws_connection] Mqtt topic $aws/things/ap-northeast-1:c0da54ff-43cd-4147-a33d-2024654f6ee7_66428598591190/shadow/name/executions/get published with payload b'' cannot be decoded: Expecting value: line 1 column 1 (char 0)

qqaatw commented 2 years ago

已知問題,若不影響功能操作不會做更動。

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.