"Error doing job: Task exception was never retrieved" (was Version 0.61+ and ISY994i)

Hi,

Apparently, version 0.61 introduced a lot of changes related to ISY994i. Since the update, every 10 minutes or so, I get the following in my logs:

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 218, in async_update_ha_state
device_attr = self.device_state_attributes
  File "/usr/lib/python3.6/site-packages/homeassistant/components/isy994.py", line 472, in device_state_attributes
for name, val in self._node.aux_properties.items():
AttributeError: 'list' object has no attribute 'items'

Does anyone have any idea what could be wrong or point me in the right direction? Should I do anything about it. Everything seems to work.

Thanks!

EDIT: my issue persists up to the latest version (currently 0.64.3).

Can you go into your dev-state page in HA and search for ā€œaux_propertiesā€. It seems the code expects, that if found, that should be a dictionary, but in your instance, it is a list.

I also have an ISY but Iā€™m on the old 4.x series firmware and I donā€™t have anything with ā€œaux_propertiesā€.

I canā€™t see anything related to ā€œaux_propertiesā€ in The States tool.

Iā€™m on the 5.0.11B Release of ISY.

Sorry, I guess aux_props is actually a PyISY thing. In PyISY, aux_props is a list of dictionary. I think inside isy994.py itā€™ll need to be changed to iterate the list of dictionary.

You might be able to copy the isy994.py file over to custom_components and change

    for name, val in self._node.aux_properties.items():
        attr[name] = '{} {}'.format(val.get('value'), val.get('uom'))

to

	for prop in self._node.aux_properties:
		attr[prop.get('id')] = '{} {}'.format(prop.get('value'), prop.get('uom'))

This is just speculation based on what I see in github. Not tested.

Might want to wait for @OverloadUT

Ok, thanks. Note that Iā€™m running HASS.io, so Iā€™m limited to what I can doā€¦

Hm, thatā€™s a new one to me. Iā€™ll need to do some digging.

I think that you can ignore the error, as it doesnā€™t drive anything terribly important. Iā€™d like to get it fixed though.

Figured Iā€™d chime in, Iā€™m also getting the same error in the logs:

2018-01-19 18:58:42 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/helpers/entity_component.py", line 399, in async_process_entity
    new_entity, self, update_before_add=update_before_add
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/helpers/entity_component.py", line 247, in async_add_entity
    yield from entity.async_update_ha_state()
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/helpers/entity.py", line 218, in async_update_ha_state
    device_attr = self.device_state_attributes
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/isy994.py", line 472, in device_state_attributes
    for name, val in self._node.aux_properties.items():
AttributeError: 'list' object has no attribute 'items'

I think that a new error that was introduced by the last 0.61 update. I donā€™t recall seeing it beforeā€¦

Can someone add this to Github so that it eventually gets corrected in a future release? Not sure how to do thisā€¦

Thanks!

I would, but I donā€™t have anything with aux_properties, so I canā€™t really test if my suggestion would work. Iā€™m pretty sure it would, but it would also be nice to know.

I can be a tester if needed.

I am not familiar with Hass.io. Do you have the ability to modify a component? We would need to make a copy of the isy994.py file and then make some changes to the original.

I donā€™t think soā€¦ At least, I donā€™t see howā€¦

We might try to do it as a custom component.

https://community.home-assistant.io/t/editing-component-files-in-hassio/
See the link of the topic above.

You would need to create a custom_components folder inside your config directory, and then we would put a modified copy of isy994.py there. Does that seem like something you want to try?

Also, what version are you running?

Yes, I could do that. Thatā€™s a great idea. A custom component would override the existing one. Can you post the original one and the modification required? I will testā€¦

Iā€™m always on the latest version of HAā€¦

  1. Create a custom_components folder inside your config directory
  2. Add the referenced file inside that directory
  3. Restart
  4. ???
  5. Profit

Hopefully itā€™ll work the first time. Iā€™m not in a position to be able to test anything right now.

Is #3 in the following pull to address this issue:

If so, I will wait until the next update. If not, I will try the custom componentā€¦

No, it does not address this specific issue

Here is what I did: I copied the isy994.py file from:


to my local ā€œcustom_componentsā€ directory. I edited the file as suggested above (line 472 and 473 of isy994.py), then restarted HA. I think thatā€™s the only thing I need to do. That new file should automatically be used instead of the ā€œoldā€ built-in one.

The results are exactly the same. Nothing got broken from what I can see, but I get the same error message in my logs:

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
    result = coro.send(None)
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 223, in async_update_ha_state
    device_attr = self.device_state_attributes
  File "/usr/lib/python3.6/site-packages/homeassistant/components/isy994.py", line 472, in device_state_attributes
    for name, val in self._node.aux_properties.items():
AttributeError: 'list' object has no attribute 'items'

How can I tell if that new file is really used?

It isnā€™t using your edits from the custom_components directory for some reason. Not sure why. Your config folder looks like:?

custom_components\
     isy994.py
configuration.yaml

If so, then I donā€™t know. Either a hass.io thing or the changes didnā€™t get saved.