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

Exception in target_temperature_message_received #250

Closed
wltng opened this issue Sep 14, 2024 · 13 comments · Fixed by #254
Closed

Exception in target_temperature_message_received #250

wltng opened this issue Sep 14, 2024 · 13 comments · Fixed by #254

Comments

@wltng
Copy link

wltng commented Sep 14, 2024

Every 5 minutes I get the following error message in the HA log:

2024-09-13 12:13:12.508 ERROR (MainThread) [homeassistant.components.mqtt.client] Exception in target_temperature_message_received when handling msg on 'panasonic_heat_pump/main/Z1_Heat_Request_Temp': '0'
Traceback (most recent call last):
File "/config/custom_components/aquarea/climate.py", line 357, in target_temperature_message_received
if self._attr_min_temp != None and self._attr_max_temp != None:
^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 323, in __getattribute__
return super().__getattribute__(__name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 323, in __getattribute__
return super().__getattribute__(__name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'HeishaMonZoneClimate' object has no attribute '__attr_min_temp'. Did you mean: '_attr_min_temp'?

Using latest versions:

  • Home Assistant 2024.9.1
  • Integration 1.4.1

My Pana is set to external thermostat, so the provided climate entity cannot control the temperature.

Trying to change the temperature (which isn't possible when using external thermostat) results in:

2024-09-14 11:01:04.611 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139878762276336] Provided temperature 0.0 is not valid. Accepted range is 7 to 35
2024-09-14 11:01:11.020 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139878762276336] Unexpected exception
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 996, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1068, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 951, in async_service_temperature_set
await entity.async_set_temperature(**kwargs)
File "/config/custom_components/aquarea/climate.py", line 263, in async_set_temperature
raise Exception(f"Unknown climate mode: {self._mode}")
Exception: Unknown climate mode: ZoneTemperatureMode.NAN`

Current attributes of the climate entity are:

hvac_modes: heat, off
min_temp: 7 
max_temp: 35 
current_temperature: 16 
temperature: 0 
friendly_name: Aquarea Zone 1 climate 
supported_features: 385
@kamaradclimber
Copy link
Owner

Hello,

thanks for reporting an issue.
I'm really puzzled by this report:

  • the version 1.4.1 of the integration is very old and does not fit with the stack trace (for instance custom_components/aquarea/climate.py file does not have 357 lines in this old version)
  • the stack trace itself refers to self._attr_min_temp (a single underscore before attr) which is what the current code has but the exception refers to self.__attr_min_temp (with double underscore) which I can't find anywhere in the code.

🤔

@kamaradclimber
Copy link
Owner

#251 will fix the second issue by disabling temperature set when heatpump is in external thermostat mode.

@wltng
Copy link
Author

wltng commented Sep 14, 2024

Thanks for your quick response.

In HACS it shows I have 1.13.0, when I go to Settings -> Devices and Services -> HeishaMon, I see 1.4.1

image

Maybe a removing and reinstalling would be the best option.
I will check the new version and report back

@wltng
Copy link
Author

wltng commented Sep 14, 2024

I removed the intgration completely (aquarea folder in custom_components was gone) and reinstalled from scratch.
With the new version 1.13.1 the errors no longer appear in the logs!
The version number is however still 1.4.1 in the Settings page

@kamaradclimber
Copy link
Owner

Good catch, it seems the version of the integration there is taken from the manifest file while hacs uses the github release title.

@wltng
Copy link
Author

wltng commented Sep 16, 2024

For 2 days I haven't seen the error in the logs, but today I restarted HA, and somehow the same error has returned. The line is different now:

2024-09-16 16:43:20.238 ERROR (MainThread) [homeassistant.components.mqtt.client] Exception in target_temperature_message_received when handling msg on 'panasonic_heat_pump/main/Z1_Heat_Request_Temp': '0'
Traceback (most recent call last):
File "/config/custom_components/aquarea/climate.py", line 362, in target_temperature_message_received
if self._attr_min_temp != None and self._attr_max_temp != None:
^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 323, in __getattribute__
return super().__getattribute__(__name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 323, in __getattribute__
return super().__getattribute__(__name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'HeishaMonZoneClimate' object has no attribute '__attr_min_temp'. Did you mean: '_attr_min_temp'?

@kamaradclimber
Copy link
Owner

For now, I cannot reproduce which is very frustrating 😓

@wltng
Copy link
Author

wltng commented Sep 17, 2024

Is there anything I can supply to help?
If I change the system to internal thermostat the problem is gone immediately.

There is now also an additional warning (that was fixed in the previous update I think)
[HEAT] Target temperature is not within expected range, this is suspicious. 0.0 should be within [10,30]

EDIT: The warning seems to have gone after a reboot of the HA system

@kamaradclimber
Copy link
Owner

It looks very similar to home-assistant/core#124932 and home-assistant/core#118336. I'm reading those issues hoping there will be a hint.

@kamaradclimber
Copy link
Owner

My suspicion is that the (recent) updates in climate component which overloads the fetch of attributes is in cause here. I need to understand better how this works.

@kamaradclimber
Copy link
Owner

Ok I succeeded to reproduce 😅 .
It seems to happen on any access of an attribute defined on the ClimateEntity class (not attributes defined on the child class).

@kamaradclimber
Copy link
Owner

I think https://github.com/kamaradclimber/heishamon-homeassistant/releases/tag/1.13.3 will the situation.
The error was very confusing (this is a bug in HA I think) but the cause was simple.

@wltng
Copy link
Author

wltng commented Sep 21, 2024

I just installed the latest update. The error seems to be gone now!

Thanks for actively approaching this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants