thomasloven / lovelace-auto-entities

🔹Automatically populate the entities-list of lovelace cards
MIT License
1.24k stars 113 forks source link

View navigation fails #46

Open tomlut opened 4 years ago

tomlut commented 4 years ago

Hassio NUC image, v0.102.2 Windows 10 Pro 64 bit 1903 (build 18362.418) Firefox 64 bit 70.0.1

With the following card configuration, view navigation stops responding or becomes very delayed if the view with this card is left open in the browser for some time (less than 15 minutes):

cards:
  - card:
      style: |
        ha-card {
          border: solid 2px #FF6262;
          --ha-card-background: rgba(0, 0, 0, 0);
          --primary-text-color: rgb(250,98,98);
          box-shadow: 0px 0px 10px 3px #FF6262;
        }
      title: Smoke Detected
      type: glance
    filter:
      include:
        - entity_id: binary_sensor.smoke*
          state: 'on'
    show_empty: false
    type: 'custom:auto-entities'
  - card:
      style: |
        ha-card {
          border: solid 2px #FF6262;
          --ha-card-background: rgba(0, 0, 0, 0);
          --primary-text-color: rgb(250,98,98);
          box-shadow: 0px 0px 10px 3px #FF6262;
        }
      title: Water Leak
      type: glance
    filter:
      include:
        - entity_id: binary_sensor.dishwasher_leak
          state: 'on'
        - entity_id: binary_sensor.laundry_leak
          state: 'on'
        - entity_id: binary_sensor.sink_leak
          state: 'on'
    show_empty: false
    type: 'custom:auto-entities'
  - card:
      style: |
        ha-card {
          border: solid 2px #FF6262;
          --ha-card-background: rgba(0, 0, 0, 0);
          --primary-text-color: rgb(250,98,98);
          box-shadow: 0px 0px 10px 3px #FF6262;
        }
      title: Unavailable
      type: glance
    filter:
      exclude:
        - entity_id: '*mailbox*'
        - entity_id: '*laneway*'
        - entity_id: '*lane_gate*'
        - entity_id: binary_sensor.shed_door
        - entity_id: binary_sensor.updater
      include:
        - domain: sensor
          state: unavailable
        - domain: binary_sensor
          state: unavailable
        - domain: light
          state: unavailable
        - domain: switch
          state: unavailable
    show_empty: false
    type: 'custom:auto-entities'
type: vertical-stack

Example gif:

ezgif com-video-to-gif

(Apologies I just realised I cropped the card out in an effort to reduce the gif size, but it is the delayed navigation that is the focus).

The more auto-entities cards in the view the quicker the problem appears and the more severe it becomes - to the point that view navigation stops altogether and a page reload is required.

The really bad news is that there are no errors in the inspection console and task manager does not show excessive RAM or CPU use for the browser.

Likewise home assistant is not showing excessive CPU, network or RAM use.

This issue occurs worst in Firefox. It does occur in Chrome but takes a lot longer.

tomlut commented 4 years ago

I remade all my auto entities cards as entity-filter filter cards (so much entity typing!) and it has prevented this issue occurring. There were two cards I just could not convert as they were using domain filters:

entities:
  - card:
      style: |
        ha-card {
          border: solid 2px #FF6262;
          --ha-card-background: rgba(0, 0, 0, 0);
          --primary-text-color: rgb(250,98,98);
          box-shadow: 0px 0px 10px 3px #FF6262;
        }
      title: Unknown
      type: glance
    filter:
      exclude:
        - entity_id: sensor.mailbox_*
        - entity_id: sensor.laneway_*
      include:
        - domain: sensor
          state: unknown
        - domain: binary_sensor
          state: unknown
        - domain: light
          state: unknown
        - domain: switch
          state: unknown
    show_empty: false
    type: 'custom:auto-entities'
  - card:
      style: |
        ha-card {
          border: solid 2px #FF6262;
          --ha-card-background: rgba(0, 0, 0, 0);
          --primary-text-color: rgb(250,98,98);
          box-shadow: 0px 0px 10px 3px #FF6262;
        }
      title: Unavailable
      type: glance
    filter:
      exclude:
        - entity_id: '*mailbox*'
        - entity_id: '*laneway*'
        - entity_id: '*lane_gate*'
        - entity_id: binary_sensor.shed_door
        - entity_id: binary_sensor.updater
      include:
        - domain: sensor
          state: unavailable
        - domain: binary_sensor
          state: unavailable
        - domain: light
          state: unavailable
        - domain: switch
          state: unavailable
    show_empty: false
    type: 'custom:auto-entities'
show_header_toggle: false
style: |
  ha-card {
    border: solid 2px var(--primary-color);
  }
title: Unknown or Unavailable Entities
type: entities

I've moved this to another view and confirmed the issue followed it. i.e. I can now leave my Home view open without a problem but if I leave the view with the above card open the issue occurs.

tomlut commented 4 years ago

Still an issue with v1.9.

tomlut commented 4 years ago

Still an issue with v14.