RobertD502/home-assistant-flair

Error doing job: Task exception was never retrieved

Closed this issue · 4 comments

I've begun to receive this error very often and the integration does not appear to be functioning any longer. No changes have been made recently. Unable to reproduce as it ocurrs automatically.

`This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/flair/select.py:1033
Integration: Flair (documentation, issues)
First occurred: 4:08:15 AM (433 occurrences)
Last logged: 9:18:38 AM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 229, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 374, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in async_update_listeners
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 431, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 746, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 808, in _async_write_ha_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 752, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/select/init.py", line 147, in state
current_option = self.current_option
^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/flair/select.py", line 1033, in current_option
return self.puck_data.attributes['puck-display-color'].capitalize()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'capitalize'
`

Looks like the puck in question isn't returning the current display color attribute from the API.

Can you elaborate as to what you mean by the integration isn't functioning any longer?

For the puck, use the app to go to the flair device settings page and make sure a background color is selected for your puck(s).

Well, tiddle, I may have gotten ahead of myself on this. I did some digging and found that my puck was not assigned to any rooms in the Flair interface. I have corrected this and the error appears to have stopped.

What I meant by 'the integration isn't functioning any longer' is that this morning we woke up and the temperature was 64F and the vents were open. However, my automation is configured to close the vents should the temperature reach 68F. I was unable to close the vents through Home Assistant/Flair integration. I was able to close the vent through the Flair application. I did a quick dig in my logs and this was the only error I found that related to the Flair integration itself.

I'd add a check to your automation to make sure the fan entity (vent) doesn't have a state of unavailable. Home Assistant currently doesn't raise exceptions if an action is executed on an unavailable entity so users have to add this check themselves.

I haven't gotten any reports of this from about 400 installations on the latest version, which indicates this may be an isolated incident/something within your setup.

Edit: Aside from the fan entity itself being unavailable at the time, it could also be related to your temp sensor. Not sure what temp sensor you are using, but it could also have not been available at the time so the automation never triggered. You'll have to investigate if you automation fired and, if so, where things went wrong.

Yeah, this definitely appears to be an issue isolated to my environment. Thank you very much for the quick responses, it is certainly appreciated.