MizterB / homeassistant-infinitude-beyond

Home Assistant custom component for controlling Carrier Infinity Touch thermostats through an Infinitude proxy server.
20 stars 4 forks source link

Getting a lot of exceptions #4

Closed brettonw closed 7 months ago

brettonw commented 7 months ago
Logger: homeassistant
Source: custom_components/infinitude_beyond/sensor.py:118
integration: Infinitude Beyond (documentation)
First occurred: April 6, 2024 at 9:02:38 PM (4670 occurrences)
Last logged: 9:30:12 AM

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/infinitude_beyond/sensor.py", line 194, in native_value
    return self.entity_description.value_fn(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/infinitude_beyond/sensor.py", line 118, in <lambda>
    value_fn=lambda entity: entity.zone.activity_scheduled.value,
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'value'
Logger: custom_components.infinitude_beyond.infinitude.api
Source: custom_components/infinitude_beyond/infinitude/api.py:682
integration: Infinitude Beyond (documentation)
First occurred: April 6, 2024 at 9:02:23 PM (4671 occurrences)
Last logged: 9:30:12 AM

'None' is an unknown Activity
greggitter commented 7 months ago

I was just coming to post the same. I tried to reduce the temperature by a degree and got an error message:

This error originated from a custom integration.

Logger: custom_components.infinitude_beyond.infinitude.api
Source: custom_components/infinitude_beyond/infinitude/api.py:598
integration: Infinitude Beyond (documentation)
First occurred: 9:26:46 AM (39 occurrences)
Last logged: 9:29:46 AM

'None' is an unknown HVACAction

Also noticed the new integration is delayed compared to the infinitude proxy server. This may be related to the error (?). One other thing was when I reduced the temperature one degree (while heating), the fan should have remained on as it's set to always on but it was switched off instead. It defaulted to hold until next activity which is expected. The old version did not do this.

Other messages from the log:

2024-04-08 09:29:31.204 WARNING (MainThread) [custom_components.infinitude_beyond.infinitude.api] 'None' is an unknown HVACAction
2024-04-08 09:29:31.205 WARNING (MainThread) [custom_components.infinitude_beyond.infinitude.api] 'None' is an unknown HVACAction
2024-04-08 09:29:31.205 WARNING (MainThread) [custom_components.infinitude_beyond.infinitude.api] 'None' is an unknown HVACAction
2024-04-08 09:29:40.219 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140385004867264] unexpected character: line 1 column 1 (char 0)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2543, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2580, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 971, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1043, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 917, in async_service_temperature_set
await entity.async_set_temperature(**kwargs)
File "/config/custom_components/infinitude_beyond/climate.py", line 155, in async_set_temperature
await self.zone.set_temperature(temperature=temperature)
File "/config/custom_components/infinitude_beyond/infinitude/api.py", line 805, in set_temperature
await self.set_hold_mode(mode=HoldMode.UNTIL, activity=Activity.MANUAL)
File "/config/custom_components/infinitude_beyond/infinitude/api.py", line 767, in set_hold_mode
await self._infinitude._post(endpoint, data)
File "/config/custom_components/infinitude_beyond/infinitude/api.py", line 83, in _post
resp_json: dict = await resp.json(content_type=None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 73, in json
return await super().json(*args, loads=loads, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1182, in json
return loads(stripped.decode(encoding))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/util/json.py", line 48, in json_loads
return orjson.loads(__obj) # type:ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^
orjson.JSONDecodeError: unexpected character: line 1 column 1 (char 0)
2024-04-08 09:29:46.215 WARNING (MainThread) [custom_components.infinitude_beyond.infinitude.api] 'None' is an unknown HVACAction
2024-04-08 09:29:46.215 WARNING (MainThread) [custom_components.infinitude_beyond.infinitude.api] 'None' is an unknown HVACAction
2024-04-08 09:29:46.216 WARNING (MainThread) [custom_components.infinitude_beyond.infinitude.api] 'None' is an unknown HVACAction

Here's what happens when the system is OFF and I choose to set the fan to low:

Source: components/websocket_api/commands.py:239
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 9:29:40 AM (3 occurrences)
Last logged: 1:06:37 PM

[140385004867264] unexpected character: line 1 column 1 (char 0)
[140385004040640] unexpected character: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2543, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2580, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 971, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1043, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 917, in async_service_temperature_set
    await entity.async_set_temperature(**kwargs)
  File "/config/custom_components/infinitude_beyond/climate.py", line 155, in async_set_temperature
    await self.zone.set_temperature(temperature=temperature)
  File "/config/custom_components/infinitude_beyond/infinitude/api.py", line 805, in set_temperature
    await self.set_hold_mode(mode=HoldMode.UNTIL, activity=Activity.MANUAL)
  File "/config/custom_components/infinitude_beyond/infinitude/api.py", line 767, in set_hold_mode
    await self._infinitude._post(endpoint, data)
  File "/config/custom_components/infinitude_beyond/infinitude/api.py", line 83, in _post
    resp_json: dict = await resp.json(content_type=None)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 73, in json
    return await super().json(*args, loads=loads, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1182, in json
    return loads(stripped.decode(encoding))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/json.py", line 48, in json_loads
    return orjson.loads(__obj)  # type:ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^
orjson.JSONDecodeError: unexpected character: line 1 column 1 (char 0)
MizterB commented 7 months ago

@greggitter See #2. You likely need to upgrade your version of Infinitude.

MizterB commented 7 months ago

@brettonw Looks like there is an issue with reading your device schedule. Do you have a schedule defined?

greggitter commented 7 months ago

@MizterB Thanks! Missed that update on infinitude. Seems to have solved the issue with above errors.

brettonw commented 7 months ago

@brettonw Looks like there is an issue with reading your device schedule. Do you have a schedule defined?

I do not have schedules defined. I use home assistant to control the thermostats.

MizterB commented 7 months ago

That would explain the behavior. I have a fix ready to account for that. Will test and push something out shortly.

MizterB commented 7 months ago

Fixed in 2024.4.0