Closed Stooovie closed 2 months ago
Update: same with release version. Views just don't filter properly in most cases. Resetting frontend cache or restarting HA does not fix the issue.
I cannot reproduce it with "Devices" filtered by "Area":
Also, cannot reproduce with "Automations" filtered by "Area":
It's the same with all browsers, even in virgin state with all extensions disabled.
You will need to provide the "Javascript errors shown in your browser console/inspector" section of the issue, since the video clearly shows you're receiving some errors. You can click the arrow to expand the unknown error.
Sure! How deep do we need to go though? It's all Unknown errors. I'm not a developer of any kind, I need guidance for more specificity. Thanks!
No problem. Given it's an unknown error, that trace didn't help much further unfortunately. It seems to get stuck somehow to find the related items to show when you click any filter. Most of that logic is directed to the "search" integration. Do you have any related errors in the logbook (config > system > logbook)? Can you find the "search" integration in the list of integration startup times (config > system > repairs, right corner menu, integration startup times)?
Integration startup time shows 0 on Search (HA running as a VM on fast Intel CPU).
I don't know where is the Search integration used but other than broken filtering, search works everywhere as expected.
There's a relevant error of the search component in the logs that points to automations and entities.
You may want to clean up these and perhaps that fixes it. You can also try safe mode to see if it reproduced there, since you have a lot of custom integrations loaded.
And the related error, copied for clearness:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/connection.py", line 223, in async_handle
handler(self.hass, self, schema(msg))
File "/usr/src/homeassistant/homeassistant/components/search/__init__.py", line 75, in websocket_search_related
msg["id"], searcher.async_search(msg["item_type"], msg["item_id"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/search/__init__.py", line 101, in async_search
getattr(self, f"_async_search_{item_type}")(item_id)
File "/usr/src/homeassistant/homeassistant/components/search/__init__.py", line 318, in _async_search_device
self._async_search_entity(entity_entry.entity_id, entry_point=False)
File "/usr/src/homeassistant/homeassistant/components/search/__init__.py", line 333, in _async_search_entity
automation.automations_with_entity(self.hass, entity_id),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 203, in automations_with_entity
return _automations_with_x(hass, entity_id, "referenced_entities")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 181, in _automations_with_x
if referenced_id in getattr(automation_entity, property_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/backports/functools.py", line 68, in __get__
val = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 574, in referenced_entities
referenced = self.action_script.referenced_entities
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/backports/functools.py", line 68, in __get__
val = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1506, in referenced_entities
Script._find_referenced_entities(referenced_entities, self.sequence)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1523, in _find_referenced_entities
_referenced_extract_ids(data, ATTR_ENTITY_ID, referenced)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1238, in _referenced_extract_ids
found.add(item_id)
TypeError: unhashable type: 'dict'
I've setup an automation with an unexisting device and the filtering keeps working everywhere. You may want to try out safe mode first to see if it continues to reproduce.
Fixing those borked automations (haven't had time to redo these after redoing the entire zigbee network) did not have an effect on the buggy behavior.
Nor did starting in Safe mode.
I'm a bit out of easy ideas to check: I'm pretty confident you're having an automation that is causing trouble. The stacktrace points towards a service call action somewhere in an unknown automation (it doesn't say which one) where the entity id is a dictionary.
In yaml code this should look like this:
entity_id:
some_key: light.hallway
some_key2: light.landing
It should be in an service call action somewhere.
Thanks! Even if faulty automation is the culprit (which it shouldn't be now as I fixed those), it still is a HA bug, it shouldn't just silently fail.
If you're able to find the automation with a faulty entity_id section in a service call action and the cause of the issue, a fix can be written.
There was one automation with a dictionary with an entity that doesn't exist anymore, and one malformed line that had mode: single
on the same line as the entity (not sure how that even passed the check, but it did), but even fixing that doesn't fix the issue.
Have you restarted your Home Assistant since then? You may need to do so, since the related entities are cached into memory for performance reasons. Still, whatever is going wrong is something I cannot reproduce, even if I insert faulty automations in the automations.yaml
file.
Yes I have restarted HA after every change.
Unfixed as of 2024.5.1.
How many automations do you have? Would you be willing to share the automations.yaml privately to look further into this?
Sure, here you go. Thanks!
I found 2 automations "Tag ELO scanned" and "Tag Beatles scanned" where this is in the actions:
- service: media_player.media_stop
data: {}
target:
entity_id:
- media_player.living_room_echo mode: single
That mode: single doesn't belong there.
Hey, whaddya know! This fixed my issue! I don't know how that got in there as I didn't write it manually and didn't touch the YAML myself in years (also it shouldn't pass the config check, but it did), but you've solved it.
Thanks!
Checklist
Describe the issue you are experiencing
With 2024.4 betas (b9 as of now), filtering by Device, Entity or Area doesn't work (all is shown even with a device, an entity or an area is selected in Filters). This applies to both Devices & Services and Automations & Scenes control panels.
Describe the behavior you expected
Automations are filtered by what is actually selected.
Steps to reproduce the issue
All automations are still showing, unfiltered. ...
What version of Home Assistant Core has the issue?
2024.4 betas
What was the last working version of Home Assistant Core?
No response
In which browser are you experiencing the issue with?
All browsers and the HA app
Which operating system are you using to run this browser?
Any
State of relevant entities
No response
Problem-relevant frontend configuration
No response
Javascript errors shown in your browser console/inspector
No response
Additional information
No response