qqaatw / JciHitachiHA

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

Automation stopped execution on 2024.05 #78

Closed J1A-T13N closed 3 months ago

J1A-T13N commented 3 months ago

🐛 Describe the bug

透過服務呼叫 climate.turn_off 或自動化設定HVAC模式時會發生錯誤。

[!CAUTION] 錯誤:Detected that custom integration 'jcihitachi_tw' calls async_write_ha_state from a thread at custom_components/jcihitachi_tw/init.py, line 246: self.coordinator.async_set_updated_data(None). Please report it to the author of the 'jcihitachi_tw' custom integration.

Automation script:

alias: 智慧-房間冷氣開關
description: ""
trigger:
- platform: numeric_state
entity_id:
- climate.bedroom_room
for:
hours: 1
minutes: 0
seconds: 0
attribute: temperature
above: sensor.weather_feels_like_temperature
id: off_climate
- platform: device
device_id: 91bb18af911a9a5f2189a6e544daaf50
domain: xiaomi_gateway3
type: action
state: hold
id: on_climate
- platform: time
at: "05:00:00"
id: schedule
condition: []
action:
- choose:
- conditions:
- condition: trigger
id:
- off_climate
- schedule
sequence:
- device_id: 7829ed26160baebf4dd707593af19b91
domain: climate
entity_id: 2d29246024b4a5c03e829991d6c4314a
type: set_hvac_mode
hvac_mode: "off"
- conditions:
- condition: trigger
id:
- on_climate
sequence:
- device_id: 7829ed26160baebf4dd707593af19b91
domain: climate
entity_id: 2d29246024b4a5c03e829991d6c4314a
type: set_hvac_mode
hvac_mode: cool
mode: single

Environment Information

What version of Home Assistant Core has the issue?

core-2024.5.1

What was the last working version of Home Assistant Core?

core-2024.4.1

What type of installation are you running?

Home Assistant OS

What version of Home Assistant Supervisor has the issue?

2024.05.1

What version of Home Assistant Operating System has the issue?

12.2

HACS version

1.34.0

JciHitachiHA version

1.7.0

J1A-T13N commented 3 months ago

See https://github.com/qqaatw/JciHitachiHA/pull/77/checks

J1A-T13N commented 3 months ago

補充錯誤訊息

[!WARNING] Entity None (<class 'custom_components.jcihitachi_tw.climate.JciHitachiClimateEntity'>) does not set ClimateEntityFeature.TURN_ON but implements the turn_on method. Please create a bug report at https://github.com/qqaatw/JciHitachiHA/issues

[!WARNING] Entity None (<class 'custom_components.jcihitachi_tw.climate.JciHitachiClimateEntity'>) implements HVACMode(s): off, cool, dry, fan_only and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please create a bug report at https://github.com/qqaatw/JciHitachiHA/issues

[!WARNING] SUPPORT_PRESET_MODE was used from jcihitachi_tw, this is a deprecated constant which will be removed in HA Core 2025.1. Use FanEntityFeature.PRESET_MODE instead, please report it to the author of the 'jcihitachi_tw' custom integration

[!WARNING] SUPPORT_SET_SPEED was used from jcihitachi_tw, this is a deprecated constant which will be removed in HA Core 2025.1. Use FanEntityFeature.SET_SPEED instead, please report it to the author of the 'jcihitachi_tw' custom integration

[!CAUTION] websocket_api script: Error executing script. Unexpected error for call_service at pos 1: Detected that custom integration 'jcihitachi_tw' calls async_write_ha_state from a thread at custom_components/jcihitachi_tw/init.py, line 246: self.coordinator.async_set_updated_data(None). Please report it to the author of the 'jcihitachi_tw' custom integration. Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 501, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 736, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 699, in _async_run_long_action return await long_task ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2738, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2779, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1047, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 799, in async_turn_on await self.hass.async_add_executor_job(self.turn_on) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/jcihitachi_tw/climate.py", line 284, in turn_on self.update() File "/config/custom_components/jcihitachi_tw/__init__.py", line 246, in update self.coordinator.async_set_updated_data(None) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 450, in async_set_updated_data 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 492, in _handle_coordinator_update self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1008, in async_write_ha_state self.hass.verify_event_loop_thread("async_write_ha_state") File "/usr/src/homeassistant/homeassistant/core.py", line 440, in verify_event_loop_thread frame.report( File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 162, in report _report_integration(what, integration_frame, level, error_if_integration) File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 203, in _report_integration raise RuntimeError( RuntimeError: Detected that custom integration 'jcihitachi_tw' calls async_write_ha_state from a thread at custom_components/jcihitachi_tw/__init__.py, line 246: self.coordinator.async_set_updated_data(None). Please report it to the author of the 'jcihitachi_tw' custom integration.

[!CAUTION] [281472793231424] Error handling message: Unknown error (unknown_error) J1A-T13N from xxx.xxx.xxx.xxx (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response await func(hass, connection, msg) File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 793, in handle_execute_script script_result = await script_obj.async_run( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1731, in async_run return await asyncio.shield(create_eager_task(run.async_run())) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 451, in async_run await self._async_step(log_exceptions=False) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 503, in _async_step self._handle_exception( File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 533, in _handle_exception raise exception File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 501, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 736, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 699, in _async_run_long_action return await long_task ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2738, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2779, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1047, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 799, in async_turn_on await self.hass.async_add_executor_job(self.turn_on) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/jcihitachi_tw/climate.py", line 284, in turn_on self.update() File "/config/custom_components/jcihitachi_tw/__init__.py", line 246, in update self.coordinator.async_set_updated_data(None) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 450, in async_set_updated_data 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 492, in _handle_coordinator_update self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1008, in async_write_ha_state self.hass.verify_event_loop_thread("async_write_ha_state") File "/usr/src/homeassistant/homeassistant/core.py", line 440, in verify_event_loop_thread frame.report( File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 162, in report _report_integration(what, integration_frame, level, error_if_integration) File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 203, in _report_integration raise RuntimeError( RuntimeError: Detected that custom integration 'jcihitachi_tw' calls async_write_ha_state from a thread at custom_components/jcihitachi_tw/__init__.py, line 246: self.coordinator.async_set_updated_data(None). Please report it to the author of the 'jcihitachi_tw' custom integration.

qqaatw commented 3 months ago

As a temporary fix you can install the integration from master.