home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.03k stars 28.28k forks source link

Camera livestream in picture-entity-card not shown #110563

Open postaccountgh opened 3 months ago

postaccountgh commented 3 months ago

The problem

I have integrated a Reolink doorbell with Reolink Integration. Camera livestream is shown with picture-entity-card. After Update from 2024.1.6 to 2024.2.1 the livestream in picture-entity-card is not shown anymore. A still image is displayed instead of the livestream. If i switch to anaother view and then go back to the view with the picture-entity-card, the livestream is shown. As long as HA is open, everything works fine. If i close the app or Webbrowser and reopen HA, same issue happens again. Tested on Android-App and Webbrowsers. No errors in log. Till 2024.1.6 everything worked fine.

What version of Home Assistant Core has the issue?

2024.2.1

What was the last working version of Home Assistant Core?

2024.1.6

What type of installation are you running?

Home Assistant OS

Integration causing the issue

picture-entity

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

dselzle commented 3 months ago

I've been seeing this as well lately, both with Reolink cameras via the Reolink integration, and with some Amcrest cameras via ONVIF.

shanefreeman commented 3 months ago

I also observe this. I am using 'amcrest' and 'generic camera' integrations via rtsp, with this front-end dashboard config:

postaccountgh commented 3 months ago

Same issue with 2024.2.2

postaccountgh commented 3 months ago

I tried a fresh install on a different machine: same issue.

crhass commented 3 months ago

I have 3 camera streams configured on the same card and I am only seeing this on the first camera configured. The other 2 are streaming ok. If I change the order of the cameras it is still the first camera configured. If I refresh the page the image is refreshed to the correct time but it still doesn't stream.

postaccountgh commented 3 months ago

I have 3 camera streams configured on the same card and I am only seeing this on the first camera configured. The other 2 are streaming ok. If I change the order of the cameras it is still the first camera configured. If I refresh the page the image is refreshed to the correct time but it still doesn't stream.

Same in my case!

dselzle commented 3 months ago

I have 3 camera streams configured on the same card and I am only seeing this on the first camera configured. The other 2 are streaming ok. If I change the order of the cameras it is still the first camera configured. If I refresh the page the image is refreshed to the correct time but it still doesn't stream.

You're right, same here.

shanefreeman commented 3 months ago

Same thing for me still. Also upgraded last night. Sometimes, however, the dashboard entity will give this error: Error starting stream, see logs for details (Stream never started)

But I don't see any additional logs that look related to this...

versions: Core 2024.2.2 Supervisor 2024.01.1 Operating System 11.5 Frontend 20240207.1

shanefreeman commented 3 months ago

Just guessing, it may be a frontend issue:

Uncaught (in promise) TypeError: $ is undefined
    96996 96996.w7vKRby48d0.js:1
    Webpack 58
96996.w7vKRby48d0.js:1:283709
    value ha-hls-player.ts:166
    AsyncFunctionThrow self-hosted:856
    (Async: async)
    value ha-hls-player.ts:106
    _$AE reactive-element.ts:1378
    performUpdate reactive-element.ts:1343
    scheduleUpdate reactive-element.ts:1261
    _$Ej reactive-element.ts:1233
    AsyncFunctionNext self-hosted:852
    (Async: async)
    requestUpdate reactive-element.ts:1208
    _$Eu reactive-element.ts:946
    _ reactive-element.ts:931
    C lit-element.ts:115
    a ha-hls-player.ts:22
    E scoped-custom-element-registry.js:385
    t scoped-custom-element-registry.js:236
    u lit-html.ts:1129
    g lit-html.ts:1543
    _$AI lit-html.ts:1384
    z lit-html.ts:2183
    update lit-element.ts:165
    performUpdate reactive-element.ts:1329
    scheduleUpdate reactive-element.ts:1261
    _$Ej reactive-element.ts:1233
    AsyncFunctionNext self-hosted:852
    (Async: async)
    requestUpdate reactive-element.ts:1208
    set reactive-element.ts:726
    value ha-camera-stream.ts:161
    AsyncFunctionNext self-hosted:852
    (Async: async)
    value ha-camera-stream.ts:64
    performUpdate reactive-element.ts:1327
    scheduleUpdate reactive-element.ts:1261
    _$Ej reactive-element.ts:1233
irata-coder commented 2 months ago

I am seeing exactly the same here, an exception is being thrown in the browser. It's easy to recreate, place multiple picture glance cards in a view with each pointing to a live camera feed, enable debug tools in the browser and refresh the page.

It looks a bit like a race condition, hence why it is always the first camera stream that fails to load. I have noticed rare occurances when it does load all streams, so it could be this behaves differently depending upon available CPU resource etc.

96996.w7vKRby48d0.js:1 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'KeySystemFormats')
    at 96996 (96996.w7vKRby48d0.js:1:283711)
    at Function.c (bootstrap:19:32)
    at async a.value (ha-hls-player.ts:112:11)
96996 @ 96996.w7vKRby48d0.js:1
c @ bootstrap:19
await in c (async)
value @ ha-hls-player.ts:106
_$AE @ reactive-element.ts:1378
performUpdate @ reactive-element.ts:1343
scheduleUpdate @ reactive-element.ts:1261
_$Ej @ reactive-element.ts:1233
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1208
_$Eu @ reactive-element.ts:946
_ @ reactive-element.ts:931
C @ lit-element.ts:115
a @ ha-hls-player.ts:22
E @ scoped-custom-element-registry.js:385
t @ scoped-custom-element-registry.js:236
u @ lit-html.ts:1129
g @ lit-html.ts:1543
_$AI @ lit-html.ts:1384
z @ lit-html.ts:2183
update @ lit-element.ts:165
performUpdate @ reactive-element.ts:1329
scheduleUpdate @ reactive-element.ts:1261
_$Ej @ reactive-element.ts:1233
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1208
set @ reactive-element.ts:726
value @ ha-camera-stream.ts:161
await in value (async)
value @ ha-camera-stream.ts:64
performUpdate @ reactive-element.ts:1327
scheduleUpdate @ reactive-element.ts:1261
_$Ej @ reactive-element.ts:1233
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1208
_$Eu @ reactive-element.ts:946
_ @ reactive-element.ts:931
C @ lit-element.ts:115
i @ ha-camera-stream.ts:27
E @ scoped-custom-element-registry.js:385
t @ scoped-custom-element-registry.js:236
u @ lit-html.ts:1129
g @ lit-html.ts:1543
_$AI @ lit-html.ts:1384
v @ lit-html.ts:1192
g @ lit-html.ts:1553
_$AI @ lit-html.ts:1384
z @ lit-html.ts:2183
update @ lit-element.ts:165
performUpdate @ reactive-element.ts:1329
scheduleUpdate @ reactive-element.ts:1261
_$Ej @ reactive-element.ts:1233
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1208
_$Eu @ reactive-element.ts:946
_ @ reactive-element.ts:931
C @ lit-element.ts:115
i @ hui-image.ts:40
E @ scoped-custom-element-registry.js:385
t @ scoped-custom-element-registry.js:236
u @ lit-html.ts:1129
g @ lit-html.ts:1543
_$AI @ lit-html.ts:1384
z @ lit-html.ts:2183
update @ lit-element.ts:165
performUpdate @ reactive-element.ts:1329
scheduleUpdate @ reactive-element.ts:1261
_$Ej @ reactive-element.ts:1233
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1208
_$Eu @ reactive-element.ts:946
_ @ reactive-element.ts:931
C @ lit-element.ts:115
r @ hui-picture-glance-card.ts:38
E @ scoped-custom-element-registry.js:385
t @ scoped-custom-element-registry.js:236
window.CustomElementRegistry.upgrade @ scoped-custom-element-registry.js:111
(anonymous) @ create-element-base.ts:145
Promise.then (async)
(anonymous) @ create-element-base.ts:143
h @ create-element-base.ts:236
c @ create-element-base.ts:170
g @ create-card-element.ts:101
value @ hui-stack-card.ts:105
(anonymous) @ hui-stack-card.ts:48
value @ hui-stack-card.ts:47
setConfig @ hui-grid-card.ts:62
r @ create-element-base.ts:95
h @ create-element-base.ts:240
c @ create-element-base.ts:170
g @ create-card-element.ts:101
value @ hui-view.ts:66
(anonymous) @ hui-view.ts:288
value @ hui-view.ts:287
value @ hui-view.ts:216
value @ hui-view.ts:132
performUpdate @ reactive-element.ts:1327
scheduleUpdate @ reactive-element.ts:1261
_$Ej @ reactive-element.ts:1233
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1208
_$Eu @ reactive-element.ts:946
_ @ reactive-element.ts:931
i @ hui-view.ts:45
E @ scoped-custom-element-registry.js:385
t @ scoped-custom-element-registry.js:236
value @ hui-root.ts:862
(anonymous) @ hui-root.ts:587
setTimeout (async)
(anonymous) @ render-status.ts:2
requestAnimationFrame (async)
r @ render-status.ts:2
value @ hui-root.ts:587
_$AE @ reactive-element.ts:1378
performUpdate @ reactive-element.ts:1343
scheduleUpdate @ reactive-element.ts:1261
_$Ej @ reactive-element.ts:1233
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1208
set @ reactive-element.ts:726
j @ lit-html.ts:1883
_$AI @ lit-html.ts:1825
v @ lit-html.ts:1192
g @ lit-html.ts:1540
_$AI @ lit-html.ts:1384
z @ lit-html.ts:2183
update @ lit-element.ts:165
performUpdate @ reactive-element.ts:1329
scheduleUpdate @ reactive-element.ts:1261
_$Ej @ reactive-element.ts:1233
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1208
set @ reactive-element.ts:726
value @ partial-panel-resolver.ts:101
value @ hass-router-page.ts:137
performUpdate @ reactive-element.ts:1329
scheduleUpdate @ reactive-element.ts:1261
_$Ej @ reactive-element.ts:1233
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1208
set @ reactive-element.ts:726
j @ lit-html.ts:1883
_$AI @ lit-html.ts:1825
v @ lit-html.ts:1192
g @ lit-html.ts:1540
_$AI @ lit-html.ts:1384
z @ lit-html.ts:2183
update @ lit-element.ts:165
performUpdate @ reactive-element.ts:1329
scheduleUpdate @ reactive-element.ts:1261
_$Ej @ reactive-element.ts:1233
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1208
set @ reactive-element.ts:726
j @ lit-html.ts:1883
_$AI @ lit-html.ts:1825
v @ lit-html.ts:1192
g @ lit-html.ts:1540
_$AI @ lit-html.ts:1384
z @ lit-html.ts:2183
update @ lit-element.ts:165
performUpdate @ reactive-element.ts:1329
scheduleUpdate @ reactive-element.ts:1261
_$Ej @ reactive-element.ts:1233
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1208
set @ reactive-element.ts:726
r @ home-assistant.ts:113
(anonymous) @ home-assistant.ts:123
r @ fire_event.ts:76
s @ navigate.ts:43
value @ hui-root.ts:757
value @ hui-root.ts:813
handleEvent @ lit-html.ts:2018
fire @ legacy-element-mixin.js:577
_itemActivate @ iron-selectable.js:391
_activateHandler @ iron-selectable.js:383
_activateHandler @ iron-menu-behavior.js:415
_activateHandler @ paper-tabs.js:407
(anonymous) @ template-stamp.js:183
F @ gestures.js:676
q @ gestures.js:1072
click @ gestures.js:1031
k @ gestures.js:464

This references this code in lovelace

  ni.defaultConfig = void 0;
        var oi = $.KeySystemFormats
          , li = $.KeySystems
          , di = $.SubtitleStreamController
          , hi = $.TimelineController

$.KeySystemFormats is undefined.

irata-coder commented 2 months ago

Looks to be related to First Camera stream in the dashboard not starting automarically #19799

sebastian-bugajny commented 2 months ago

Having the same problem since version 2024.2.x

shanefreeman commented 2 months ago

FWIW my camera streams have been flaky on all versions after https://github.com/home-assistant/core/releases/tag/2024.1.6

In my experience HA core version 2024.1.6 will stream 4 streams w/ no issues for days on end in chrome on a raspberrypi. Any version later than this streams will stall/don't load, and I have to refresh the page only for it to stall again sooner or later, or not load the stream.

crhass commented 2 months ago

I am no longer getting this issue in 2024.3.0

shanefreeman commented 2 months ago

Thanks for the heads up! I updated to 2024.3.0 today to confirm. After a few hours of observation it appears as if I can no longer replicate the loading problem, and the error in the console is gone. It also seems to load the cameras more quickly. I'll update here if something to the contrary occurs. Thanks!

johansmitsnl commented 1 week ago

I'm still having the issue with Frigate https://github.com/home-assistant/frontend/issues/19799 but unclear if this is a HA issue or the integration. It seems that in the live view the token is not set.