Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a device filter slows down a performance #379

Open
madasus opened this issue Aug 29, 2023 · 9 comments · May be fixed by #476
Open

Using a device filter slows down a performance #379

madasus opened this issue Aug 29, 2023 · 9 comments · May be fixed by #476

Comments

@madasus
Copy link

madasus commented Aug 29, 2023

Hello,

I've been trying to figure out why my fire tablets are running slowly (i know - they are always slow) but i believe it is being caused by the auto-entities card. When I remove it from my dashboard the performance returns to normal.

I am running v1.12.1

Here is my YAML. Any ideas why this might be causing slowness? I have a lot of entities in my instance and the goal of this it to show me open security related items (doors, windows, garage doors, etc)

Is there a good way to optimize?

Thank you

M

type: custom:auto-entities
card:
  type: entities
  title: House Security
filter:
  include:
    - device: omnilink
      domain: binary_sensor
      state: 'on'
    - domain: cover
      state: open
    - domain: lock
      state: unlocked
    - domain: lock
      state: locking
  exclude:
    - domain: binary_sensor
      attributes:
        device_class: motion
    - entity_id: binary_sensor.light_sensor
    - entity_id: binary_sensor.generator_on
    - entity_id: cover.*somfy_shade*
sort:
  method: last_updated

@ildar170975
Copy link

Test with last-changed.

@madasus
Copy link
Author

madasus commented Aug 31, 2023

@ildar170975 minor improvement in speed but still causes the tablet to respond slowly.

Example - When that component is disabled in the dashboard selecting another tab in the dashboard responds almost immediately. With the original config above it takes probably 20-30 seconds to response. With last-changed it takes 10-20 seconds.

@ildar170975
Copy link

ildar170975 commented Aug 31, 2023

What about a normal desktop PC? Does it have slow performance too?
Also, test w/o "device" entities (just in case).

In my experience, I may notice slow performance only when number of rows is large.

@madasus
Copy link
Author

madasus commented Aug 31, 2023

@ildar170975 The performance issues are not noticeable on my desktop.

I removed the device rows (the three below) and the performance does appear much better. Is this expected?

- device: omnilink
  domain: binary_sensor
  state: 'on'

@ildar170975
Copy link

are not noticeable on my desktop.

My experience:
-- iPhone 5S - works, but slowly;
-- iPad Air 2 - works more-or-less ok;
-- iPhone 12 - ok (but slower than a PC).
And ofc it depends on a server's hardware.

Is this expected?

No idea.... To test it, here is what you can do:
-- assume some device XYZ has some binary_sensor entities;
-- rename these entities into smth like binary_sensor.test_xyz_*;
-- then compare two cards: with filtering by the device option & by filtering by the entity_id option.

@madasus
Copy link
Author

madasus commented Aug 31, 2023

I think your on to something.

I switched to try sensor instead of binary_sensor (as my alarm panel has both) and the performance issue was still there when using the device filter.

Then I switched to this

type: custom:auto-entities
card:
  type: entities
  title: House Security
filter:
  include:
    **- domain: sensor
      state: Not Ready**
    - domain: cover
      state: open
    - domain: lock
      state: unlocked
    - domain: lock
      state: locking
  exclude:
    - domain: binary_sensor
      attributes:
        device_class: motion
    - entity_id: binary_sensor.light_sensor
    - entity_id: sensor.generator_on
    - entity_id: cover.*somfy_shade*
sort:
  method: last_changed

Basically removed the device filter and just said to include the sensor domain and the performance is really good again (even though I have extra items being returned that I don't want). Is there just a bug with how the device filter is applying? or is this a known performance issue?

@ildar170975
Copy link

  1. The code you posted is unformatted. Suggest to edit it.
  2. Rename the issue into smth like "Using a device filter slows down a performance" if you think that this is a reason.

@madasus madasus changed the title Terrible performance on Fire Tablets Using a device filter slows down a performance Aug 31, 2023
@madasus
Copy link
Author

madasus commented Aug 31, 2023

Thanks - updated both.

@mash2k3
Copy link

mash2k3 commented Dec 26, 2023

Yes this is correct, been having same performance issues. I was able to improve it by minimizing how many entities i have on the exclude filter. I was able to accomplish this by using - hidden_by: '*' filter and disabling visibility on entities i dont want showing up in auto-entities. It was especially slow when editing auto-entities cards now it is much better.

@mrnerdhair mrnerdhair linked a pull request Nov 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants