dermotduffy / frigate-hass-card

A Lovelace card for Frigate in Home Assistant
MIT License
535 stars 59 forks source link

Frigate Hass Card sometimes will not open in Firefox and Firefox will exeed 10gb of memory #1522

Open zessi001 opened 1 week ago

zessi001 commented 1 week ago

Checklist:

Release with the issue: Dev Version from April and latest Version

Last working release (if known): Never, because gortc native support is only in Dev as i know

Browser and Operating System:

Description of problem:

Frigate card diagnostic information

{
  "card_version": "5.2.0",
  "browser": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:130.0) Gecko/20100101 Firefox/130.0",
  "date": "2024-09-12T11:28:03.628Z",
  "lang": "en",
  "timezone": "Europe/Berlin",
  "git": {
    "build_version": "5.2.0-dev+g8117747",
    "build_date": "Sat, 31 Aug 2024 19:53:39 GMT",
    "commit_date": "Sat, 31 Aug 2024 12:52:05 -0700"
  },
  "ha_version": "2024.8.3",
  "config": {
    "type": "custom:frigate-card",
    "cameras": [
      {
        "title": "Gartentor",
        "id": "DZNDoorbell-Garden",
        "live_provider": "go2rtc",
        "go2rtc": {
          "url": "https://192.168.0.18:1985",
          "stream": "DZNDoorbell-Garden",
          "modes": [
            "webrtc"
          ]
        },
        "icon": "mdi:doorbell-video"
      }
    ],
    "live": {
      "preload": true,
      "draggable": false,
      "zoomable": false,
      "lazy_load": false,
      "show_image_during_load": false,
      "controls": {
        "builtin": false
      },
      "microphone": {
        "disconnect_seconds": 0,
        "mute_after_microphone_mute_seconds": 2
      }
    },
    "dimensions": {
      "aspect_ratio_mode": "static",
      "aspect_ratio": "16 / 9",
      "max_height": "90vh"
    },
    "performance": {
      "features": {
        "media_chunk_size": 8,
        "animated_progress_indicator": false
      }
    },
    "menu": {
      "style": "overlay",
      "position": "bottom",
      "button_size": 80,
      "alignment": "top",
      "buttons": {
        "microphone": {
          "enabled": true,
          "type": "toggle",
          "alignment": "opposing"
        },
        "screenshot": {
          "enabled": false
        },
        "download": {
          "enabled": false
        },
        "fullscreen": {
          "enabled": false
        },
        "snapshots": {
          "enabled": false,
          "alignment": "opposing"
        },
        "timeline": {
          "enabled": false
        },
        "media_player": {
          "enabled": false
        },
        "clips": {
          "enabled": false
        },
        "live": {
          "enabled": false
        },
        "cameras": {
          "enabled": false
        },
        "frigate": {
          "enabled": true
        },
        "camera_ui": {
          "enabled": false
        },
        "substreams": {
          "enabled": false
        },
        "display_mode": {
          "enabled": false
        }
      }
    },
    "elements": [
      {
        "type": "custom:frigate-card-menu-icon",
        "icon": "mdi:volume-high",
        "tap_action": [
          {
            "action": "custom:frigate-card-action",
            "frigate_card_action": "unmute"
          }
        ],
        "alignment": "opposing"
      },
      {
        "type": "custom:frigate-card-menu-icon",
        "icon": "mdi:volume-off",
        "tap_action": [
          {
            "action": "custom:frigate-card-action",
            "frigate_card_action": "mute"
          }
        ],
        "alignment": "opposing"
      },
      {
        "type": "custom:frigate-card-menu-icon",
        "icon": "mdi:phone",
        "state_color": "red",
        "tap_action": [
          {
            "action": "call-service",
            "service": "script.answer_call"
          },
          {
            "action": "custom:frigate-card-action",
            "frigate_card_action": "unmute"
          },
          {
            "action": "custom:frigate-card-action",
            "frigate_card_action": "microphone_unmute"
          }
        ]
      },
      {
        "type": "custom:frigate-card-menu-icon",
        "icon": "mdi:phone-hangup",
        "tap_action": [
          {
            "action": "custom:frigate-card-action",
            "frigate_card_action": "microphone_mute"
          }
        ]
      },
      {
        "type": "custom:frigate-card-menu-icon",
        "icon": "mdi:door-open",
        "hold_action": [
          {
            "action": "call-service",
            "service": "switch.turn_on",
            "data": {
              "entity_id": "switch.ds_kd8003_door_relay_0"
            }
          }
        ]
      }
    ],
    "profiles": [
      "low-performance"
    ],
    "cameras_global": {
      "dimensions": {
        "layout": {
          "fit": "fill"
        }
      }
    },
    "view": {
      "default": "live",
      "interaction_seconds": 10
    }
  }
}

Javascript errors shown in the web inspector (if applicable):

Additional information:

dermotduffy commented 1 week ago

Can you try with the latest dev version, and let me know if you how how to trigger it?

zessi001 commented 1 week ago

Hello, thanks for your help. I tried latest version and on firefox, problem is now 100%. Its not possible, to open card on firefox browser. I tried it more than 10 times, always it freezes. I tried on edge browser and in edge its working perfectly. So seems that its a problem with firefox browser. I will try it later on a chrome browser.

What do you mean with triggering? Card i open manually in dashboard. The problem always occurs, when i open the dashboard with the card. In this case, nothing of the card is visilbe. I can not see the buttons of frigate card.

Webinspector Trace looks similar to the one above:

`14:59:20.640 GET https://192.168.0.18:8123/frontend_latest/5157.-f-fR0MqGzU.js [HTTP/1.1 200 OK 0ms]

14:59:20.654 GET https://192.168.0.18:8123/frontend_latest/30048.eAaOX1cxCA4.js [HTTP/1.1 200 OK 0ms]

14:59:20.655 GET https://192.168.0.18:8123/hacsfiles/frigate-hass-card/engine-generic-8d3e5d34.js [HTTP/1.1 200 OK 0ms]

15:00:02.368 Die Ressource unter "https://192.168.0.18:8123/static/fonts/roboto/Roboto-Regular.woff2" wurde vorab geladen ("link-preload"), aber nicht innerhalb der ersten Sekunden verwendet. Es wird eine Überprüfung empfohlen, ob alle preload-Attribute korrekt gesetzt sind. tuer_gartenzaun 15:00:02.368 Die Ressource unter "https://192.168.0.18:8123/static/fonts/roboto/Roboto-Medium.woff2" wurde vorab geladen ("link-preload"), aber nicht innerhalb der ersten Sekunden verwendet. Es wird eine Überprüfung empfohlen, ob alle preload-Attribute korrekt gesetzt sind. tuergartenzaun 15:02:18.649 Script terminated by timeout at: Qp@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:75:141351 initializeMultipleIfNecessary@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:88:4831 initializeMandatory@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:88:6560 async*shouldUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:489:2751 performUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4802 scheduleUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4423 $ET@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4331 asyncrequestUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4120 Pb/this.update@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:88:7836 initializeMandatory@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:88:6933 asyncshouldUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:489:2751 performUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4802 scheduleUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4423 $ET@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4331 asyncrequestUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4120 Pb/this.update@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:88:7836 initializeMandatory@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:88:6933 asyncshouldUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:489:2751 performUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4802 scheduleUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4423 $ET@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4331 asyncrequestUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4120 Pb/this.update@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:88:7836 initializeMandatory@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:88:6933 asyncshouldUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:489:2751 performUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4802 scheduleUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4423 $ET@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4331 asyncrequestUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4120 Pb/this.update@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:88:7836 initializeMandatory@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:88:6933 asyncshouldUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:489:2751 performUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4802 scheduleUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4423 $ET@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4331 asyncrequestUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4120 Pb/this.update@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:88:7836 initializeMandatory@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:88:6933 asyncshouldUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:489:2751 performUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4802 scheduleUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4423 _$ET@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4331 async*requestUpdate@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:12:4120 Pb/this.update@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:88:7836 initializeMandatory@https://192.168.0.18:8123/hacsfiles/frigate-hass-card/card-1bd5ee54.js:88:6933 card-1bd5ee54.js:75:141351

` Problem is always in Module frigate-hass-card/card-1bd5ee54.js on line 88.

br

dermotduffy commented 1 week ago

Well, at least 100% of the time is reproducible!

For what it's worth, the dev branch of the card loads fine for me in Firefox 130.0 (64-bit) using a simple go2rtc config like this:

type: custom:frigate-card
cameras:
  - camera_entity: camera.office
    live_provider: go2rtc

Can you give me the config the card is running with? If the card can load at all, it would be great to hold down the Frigate button for a few seconds and paste the diagnostics that are shown into this issue (but sounds like it may not load at all).

dermotduffy commented 1 week ago

PS: If you cannot get me the diagnostics, please paste in the message the Frigate card prints onto the JS console that shows the precise version number.

zessi001 commented 1 week ago

Hello, here the configuration for go2rtc camera. The initial post does not show this.

{
  "card_version": "5.2.0",
  "browser": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:130.0) Gecko/20100101 Firefox/130.0",
  "date": "2024-09-12T11:28:03.628Z",
  "lang": "en",
  "timezone": "Europe/Berlin",
  "git": {
    "build_version": "5.2.0-dev+g8117747",
    "build_date": "Sat, 31 Aug 2024 19:53:39 GMT",
    "commit_date": "Sat, 31 Aug 2024 12:52:05 -0700"
  },
  "ha_version": "2024.8.3",
  "config": {
    "type": "custom:frigate-card",
    "cameras": [
      {
        "title": "Gartentor",
        "id": "DZNDoorbell-Garden",
        "live_provider": "go2rtc",
        "go2rtc": {
          "url": "https://192.168.0.18:1985",
          "stream": "DZNDoorbell-Garden",
          "modes": [
            "webrtc"
          ]
        },
        "icon": "mdi:doorbell-video"
      }
    ],
    "live": {
      "preload": true,
      "draggable": false,
      "zoomable": false,
      "lazy_load": false,
      "show_image_during_load": false,
      "controls": {
        "builtin": false
      },
      "microphone": {
        "disconnect_seconds": 0,
        "mute_after_microphone_mute_seconds": 2
      }
    },
    "dimensions": {
      "aspect_ratio_mode": "static",
      "aspect_ratio": "16 / 9",
      "max_height": "90vh"
    },
    "performance": {
      "features": {
        "media_chunk_size": 8,
        "animated_progress_indicator": false
      }
    },
    "menu": {
      "style": "overlay",
      "position": "bottom",
      "button_size": 80,
      "alignment": "top",
      "buttons": {
        "microphone": {
          "enabled": true,
          "type": "toggle",
          "alignment": "opposing"
        },
        "screenshot": {
          "enabled": false
        },
        "download": {
          "enabled": false
        },
        "fullscreen": {
          "enabled": false
        },
        "snapshots": {
          "enabled": false,
          "alignment": "opposing"
        },
        "timeline": {
          "enabled": false
        },
        "media_player": {
          "enabled": false
        },
        "clips": {
          "enabled": false
        },
        "live": {
          "enabled": false
        },
        "cameras": {
          "enabled": false
        },
        "frigate": {
          "enabled": true
        },
        "camera_ui": {
          "enabled": false
        },
        "substreams": {
          "enabled": false
        },
        "display_mode": {
          "enabled": false
        }
      }
    },
    "elements": [
      {
        "type": "custom:frigate-card-menu-icon",
        "icon": "mdi:volume-high",
        "tap_action": [
          {
            "action": "custom:frigate-card-action",
            "frigate_card_action": "unmute"
          }
        ],
        "alignment": "opposing"
      },
      {
        "type": "custom:frigate-card-menu-icon",
        "icon": "mdi:volume-off",
        "tap_action": [
          {
            "action": "custom:frigate-card-action",
            "frigate_card_action": "mute"
          }
        ],
        "alignment": "opposing"
      },
      {
        "type": "custom:frigate-card-menu-icon",
        "icon": "mdi:phone",
        "state_color": "red",
        "tap_action": [
          {
            "action": "call-service",
            "service": "script.answer_call"
          },
          {
            "action": "custom:frigate-card-action",
            "frigate_card_action": "unmute"
          },
          {
            "action": "custom:frigate-card-action",
            "frigate_card_action": "microphone_unmute"
          }
        ]
      },
      {
        "type": "custom:frigate-card-menu-icon",
        "icon": "mdi:phone-hangup",
        "tap_action": [
          {
            "action": "custom:frigate-card-action",
            "frigate_card_action": "microphone_mute"
          }
        ]
      },
      {
        "type": "custom:frigate-card-menu-icon",
        "icon": "mdi:door-open",
        "hold_action": [
          {
            "action": "call-service",
            "service": "switch.turn_on",
            "data": {
              "entity_id": "switch.ds_kd8003_door_relay_0"
            }
          }
        ]
      }
    ],
    "profiles": [
      "low-performance"
    ],
    "cameras_global": {
      "dimensions": {
        "layout": {
          "fit": "fill"
        }
      }
    },
    "view": {
      "default": "live",
      "interaction_seconds": 10
    }
  }
}

Thanks

dermotduffy commented 1 week ago

here the configuration for go2rtc camera.

That's the v5.2.0 codebase, which whilst it's the latest release, has substantially changed. The new release is imminent, so I'll ask you to test again once it's out (probably this weekend).

dermotduffy commented 1 week ago

Please try new release: https://github.com/dermotduffy/frigate-hass-card/releases/tag/v6.0.0-beta.1

zessi001 commented 1 week ago

Hello, thanks for the update. I tried it and its a bit more stable as the previous version. On Edge, its working perfectly. Never occured the problem On IOS Homeassistant APP its now working and i could not reproduce the problem On Firefox ist more stable as before, but crashed 3 times on testing. Tried it round about 30 times. Can i do something to help you in finding the cause of this problem? Do you need additional data?

Card diagnostics. Please review for confidential information prior to sharing

{
  "card_version": "6.0.0-beta.1",
  "browser": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:130.0) Gecko/20100101 Firefox/130.0",
  "date": "2024-09-15T09:06:26.371Z",
  "lang": "en",
  "timezone": "Europe/Berlin",
  "git": {
    "build_version": "6.0.0-beta.1-main+g554f61e",
    "build_date": "Sat, 14 Sep 2024 19:38:47 GMT",
    "commit_date": "Sat, 14 Sep 2024 12:37:16 -0700"
  },
  "ha_version": "2024.8.3",
  "config": {
    "type": "custom:frigate-card",
    "cameras": [
      {
        "title": "Gartentor",
        "id": "DZNDoorbell-Garden",
        "live_provider": "go2rtc",
        "go2rtc": {
          "url": "https://192.168.0.18:1985",
          "stream": "DZNDoorbell-Garden"
        }
      }
    ],
    "live": {
      "preload": true,
      "draggable": false,
      "zoomable": false,
      "lazy_load": false,
      "show_image_during_load": false,
      "controls": {
        "builtin": false
      },
      "microphone": {
        "disconnect_seconds": 0,
        "mute_after_microphone_mute_seconds": 2
      }
    },
    "dimensions": {
      "aspect_ratio_mode": "static",
      "aspect_ratio": "16 / 9",
      "max_height": "90vh"
    },
    "performance": {
      "features": {
        "media_chunk_size": 8,
        "animated_progress_indicator": false
      }
    },
    "menu": {
      "style": "overlay",
      "position": "bottom",
      "button_size": 80,
      "alignment": "top",
      "buttons": {
        "microphone": {
          "enabled": true,
          "type": "toggle",
          "alignment": "opposing"
        },
        "screenshot": {
          "enabled": false
        },
        "download": {
          "enabled": false
        },
        "fullscreen": {
          "enabled": false
        },
        "snapshots": {
          "enabled": false,
          "alignment": "opposing"
        },
        "timeline": {
          "enabled": false
        },
        "media_player": {
          "enabled": false
        },
        "clips": {
          "enabled": false
        },
        "live": {
          "enabled": false
        },
        "cameras": {
          "enabled": false
        },
        "frigate": {
          "enabled": true
        },
        "camera_ui": {
          "enabled": false
        },
        "substreams": {
          "enabled": false
        },
        "display_mode": {
          "enabled": false
        }
      }
    },
    "elements": [
      {
        "type": "custom:frigate-card-menu-icon",
        "icon": "mdi:volume-high",
        "tap_action": [
          {
            "action": "custom:frigate-card-action",
            "frigate_card_action": "unmute"
          }
        ],
        "alignment": "opposing"
      },
      {
        "type": "custom:frigate-card-menu-icon",
        "icon": "mdi:volume-off",
        "tap_action": [
          {
            "action": "custom:frigate-card-action",
            "frigate_card_action": "mute"
          }
        ],
        "alignment": "opposing"
      },
      {
        "type": "custom:frigate-card-menu-icon",
        "icon": "mdi:phone",
        "tap_action": [
          {
            "action": "call-service",
            "service": "script.answer_call"
          },
          {
            "action": "custom:frigate-card-action",
            "frigate_card_action": "unmute"
          },
          {
            "action": "custom:frigate-card-action",
            "frigate_card_action": "microphone_unmute"
          }
        ]
      },
      {
        "type": "custom:frigate-card-menu-icon",
        "icon": "mdi:phone-hangup",
        "tap_action": [
          {
            "action": "custom:frigate-card-action",
            "frigate_card_action": "microphone_mute"
          }
        ]
      },
      {
        "type": "custom:frigate-card-menu-icon",
        "icon": "mdi:door-open",
        "hold_action": [
          {
            "action": "call-service",
            "service": "switch.turn_on",
            "data": {
              "entity_id": "switch.ds_kd8003_door_relay_0"
            }
          }
        ]
      }
    ],
    "profiles": [
      "low-performance"
    ],
    "cameras_global": {
      "dimensions": {
        "layout": {
          "fit": "fill"
        }
      }
    },
    "view": {
      "default": "live",
      "timeout_seconds": 10
    }
  }
}

br Daniel

zessi001 commented 1 week ago

When opening HA with dashboard of frigate hass card, then problem is nearly all the time. Can u reproduce this on your system? Which version of firefox you are using? Possibly i can try a different version, so make sure, that problem is not Firefox based.

i am using 130.0 on Windows 11. On Ubuntu its 115.15

The performance of version 6 of your card is excellent. It opens much much faster as on version 5. So most time, opening the Card, the video is available in less then 1 Second. On the version 5 it was mostly 3-8 Seconds. Very good, thanks for your great work.

br

dermotduffy commented 3 days ago

There's a new release that also fixes some initialization bugs that were causing it to hang for some people, might also help you: https://github.com/dermotduffy/frigate-hass-card/releases/tag/v6.0.0-beta.2

If you think there's still more to fix after you try that release, please let me know what specifically, otherwise lets close the bug. Thanks and good luck!