lovelace-auto-entities
lovelace-auto-entities copied to clipboard
Adding hidden_by field to filters to handle hidden entities
Hey @thomasloven,
I have implemented a basic support of the new feature from hass 2022.4 where entities can be hidden. My solution is more of a quick fix. To include or exclude hidden entities a new filter have to be added with the syntax:
include:
hidden_by: user
A more user friendly solution would be, to add a toggle in the UI. If you prefer the toggle solution it would be great, if we can have a little chat, how to implement this toggle ;)
Addresses #270/#272
Does not work for me with minimalist UI idk why
- type: "custom:auto-entities" card: type: "grid" columns: 2 square: false card_param: "cards" filter: include: - domain: switch area: Гостиная options: type: "custom:button-card" template: card_power_outlet exclude: - hidden_by: user - entity_id: switch.mute_3 - entity_id: switch.restart - entity_id: switch.volume_down - entity_id: switch.volume_up_2
I tried "user", actual user id, user name, nothing helps :(
What if you did hidden_by: //
(empty regex)?
Still same :(
Hey @dankarization,
did you test it with the standard UI components? Does this work?
If not you can check the following:
- Open the following file:
config/.storage/core.entity_registry
- Search for a entity which is selected to be hidden by the UI
- What kind of value is present in
hidden_by
?
If this value matches your auto-entities-rules it should probably work. You should also clear you cache to apply the changes.
Please let me know if that helps you.
I'm sorry for such a long answer. I found that some of entities were hidden by "integration", and some are from actual username in config/.storage/core.entity_registry, but even when I added all of these options in exclude, none of them were actually excluded. And yes, I tested it on standard UI and I'm getting same results there :(
I'm sorry for such a long answer. I found that some of entities were hidden by "integration", and some are from actual username in config/.storage/core.entity_registry, but even when I added all of these options in exclude, none of them were actually excluded. And yes, I tested it on standard UI and I'm getting same results there :(
I can not reproduce your behaviour. The following is working for me. Please have a look at this config and compare it with yours:
type: custom:auto-entities
card:
type: entities
title: Living room
state_color: true
filter:
include:
- area: LivingRoom
exclude:
- hidden_by: '*'
show_empty: true
Also make sure that you updated the compiled files manually inside /root/config/www/community/lovelace-auto-entities
, until this MR is merged.
Any timeline as to when this change might get merged?
I'm sorry for such a long answer. I found that some of entities were hidden by "integration", and some are from actual username in config/.storage/core.entity_registry, but even when I added all of these options in exclude, none of them were actually excluded. And yes, I tested it on standard UI and I'm getting same results there :(
I can not reproduce your behaviour. The following is working for me. Please have a look at this config and compare it with yours:
type: custom:auto-entities card: type: entities title: Living room state_color: true filter: include: - area: LivingRoom exclude: - hidden_by: '*' show_empty: true
Also make sure that you updated the compiled files manually inside
/root/config/www/community/lovelace-auto-entities
, until this MR is merged.
Which files do we copy to /root/config/www/community/lovelace-auto-entities?
I would love to see this merged. I wonder if the default should be changed to hide anything hidden unless specified to include it.
Which files do we copy to /root/config/www/community/lovelace-auto-entities?
https://raw.githubusercontent.com/Eckii24/lovelace-auto-entities/master/auto-entities.js I replaced the auto-entities.js with the one linked and deleted the 2 .gz files (not sure if that was needed or not). Be sure to clear your cache/force a reload. Works for me.
That worked thanks, deleting the gz files was the answer.
Any progress on this?
Any progress on this?
I too have found the excellence of Auto-Entities and hoping the "hidden_by: '*'"
to hide those Switch as X entities to be added soon! 🤞🚀
Any progress on this?
It works, but @thomasloven hasn't been working on this particular project in months. I'd recommend uninstalling and manually installing the updated version from @mash2k3 if you need the feature now.
Thanks!
Thanks @thomasloven! I really didn't expect it, but this is a great Christmas present!
What is expected behaviour? I am probably missing something
Hidden entity:
{
"aliases": [],
"area_id": null,
"capabilities": {
"supported_color_modes": [
"onoff"
]
},
"config_entry_id": "fa17776c20aec9037dbad3f93116feeb",
"device_class": null,
"device_id": null,
"disabled_by": null,
"entity_category": null,
"entity_id": "light.vsechna_svetla",
"hidden_by": "user",
"icon": null,
"id": "56cf997c8e4c0402d5e6b659604fa81b",
"has_entity_name": false,
"name": "All lights",
"options": {},
"original_device_class": null,
"original_icon": "mdi:lightbulb-group",
"original_name": "Všechna světla",
"platform": "group",
"supported_features": 0,
"translation_key": null,
"unique_id": "fa17776c20aec9037dbad3f93116feeb",
"unit_of_measurement": null
}
if I change exclude state to on (filter out state on
) entity is not shown as expected
but changing hidden_by
to anything does nothing
Edit:
excluding null
value for hidden_by
does include only hidden entities which are not in group of lights
Edit 2 : ~~this PR ignores Groups of entities - it works only for devices itself~~
Edit 3: Browser needs a refresh when manipulating with entities (hidding/disabling) otherwise changes are cached
What is expected behaviour? I am probably missing something
Hidden entity:
{ "aliases": [], "area_id": null, "capabilities": { "supported_color_modes": [ "onoff" ] }, "config_entry_id": "fa17776c20aec9037dbad3f93116feeb", "device_class": null, "device_id": null, "disabled_by": null, "entity_category": null, "entity_id": "light.vsechna_svetla", "hidden_by": "user", "icon": null, "id": "56cf997c8e4c0402d5e6b659604fa81b", "has_entity_name": false, "name": "All lights", "options": {}, "original_device_class": null, "original_icon": "mdi:lightbulb-group", "original_name": "Všechna světla", "platform": "group", "supported_features": 0, "translation_key": null, "unique_id": "fa17776c20aec9037dbad3f93116feeb", "unit_of_measurement": null }
if I change exclude state to on (filter out state
on
) entity is not shown as expectedbut changing
hidden_by
to anything does nothingEdit: excluding
null
value forhidden_by
does include only hidden entities which are not in group of lightsEdit 2 : this PR ignores Groups of entities - it works only for devices itself
I found that I sometimes have to clear my browser cache and refresh the page before updates to hidden entities are accounted for (on the Android app, I have to force close and reopen the app). I don't know if that's the issue you are having here, but it may be worth giving that a go to see if it helps.
I found that I sometimes have to clear my browser cache and refresh the page before updates to hidden entities are accounted for (on the Android app, I have to force close and reopen the app). I don't know if that's the issue you are having here, but it may be worth giving that a go to see if it helps.
Woah, now it works! Thanks for quick suggestion!
Super appreciate this as a manual file setting. Any chance it can be added to the card UI? Or just replicate the prior behavior where "hidden" items are also hidden in lovelace? And maybe have the manual code tweak to override the default behavior to respect the hidden attribute?