dermotduffy / frigate-hass-card

A Lovelace card for Frigate in Home Assistant
MIT License
538 stars 60 forks source link

Casting the card to a TV no longer works after 6.0.0 #1578

Open felipecrs opened 6 days ago

felipecrs commented 6 days ago

Checklist:

Release with the issue:

6.0.0-beta.3

Last working release (if known):

5.2.0

Browser and Operating System:

Tested on Android TV 9 and Google TV with Android 12, same behavior.

Description of problem:

Casting the card (using cast.show_lovelace_view action) no longer works after 6.0.0, following this conversation.

I was able to confirm it's working with 5.2.0 by downgrading it.

Frigate card diagnostic information

N/A

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

N/A

Additional information:

Not working on 6.0.0:

https://github.com/user-attachments/assets/1dd3b82f-c90b-46fb-be53-3bc55e0b0186

Working on 5.2.0:

https://github.com/user-attachments/assets/b063a86f-65d9-40e2-9c9f-bed15e85d84f

felipecrs commented 6 days ago

@dermotduffy, replying to https://github.com/dermotduffy/frigate-hass-card/pull/1575#issuecomment-2368466011:

Had a quick go, I can get the cast device to sit at "Connected" with the Nabu Casa logo but cannot get any dashboard contents (whether it involves the card or not) to actually show up on the device. Either I'm doing something wrong, or something is up with HA casting...

I was able to get past that issue by clearing the Google Cast App Data in my Android TV settings.

And then, I was able to pinpoint that this issue was introduced by 6.0.0.

PS: it's amazing to see how well it works (casting with very low latency) on 5.2.0.

felipecrs commented 6 days ago

Sorry for not providing more details (I have no idea on how to collect browser logs in such case, although it should be possible).

I am hoping that you will be able to reproduce this issue by yourself.

dermotduffy commented 6 days ago

Mind including the config you are using for both standard and dashboard casting?

felipecrs commented 6 days ago

I am not even trying the cast button of the card; I am trying to call the action through HA dev tools:

action: cast.show_lovelace_view
data:
  entity_id: media_player.tv_da_cozinha
  dashboard_path: dashboard-casting
  view_path: video-porteiro

Such dashboard YAML is:

views:
  - title: Vídeo porteiro
    type: panel
    cards:
      - type: custom:frigate-card
        cameras:
          - camera_entity: camera.video_porteiro
            live_provider: go2rtc
            image:
              refresh_seconds: 1
        profiles:
          - low-performance
        menu:
          style: none
        live:
          controls:
            builtin: false
          show_image_during_load: true
          auto_unmute:
            - selected
            - visible
        dimensions:
          aspect_ratio_mode: static
          aspect_ratio: '16:9'
    path: video-porteiro
felipecrs commented 6 days ago

I just rebuilt my card against latest main to include https://github.com/dermotduffy/frigate-hass-card/pull/1576, but the same problem remains.

With the latest main branch, I simplified my config to:

type: custom:frigate-card
cameras:
  - camera_entity: camera.video_porteiro
    live_provider: go2rtc
profiles:
  - low-performance
  - casting
dermotduffy commented 6 days ago

@felipecrs And just to confirm, with v6, you have the issue with both the standard and dashboard casting methods?

felipecrs commented 6 days ago

No, standard casting method works just fine with v6 (with the expected 10 seconds delay).

dermotduffy commented 3 days ago

Home Assistant + Casting is just so fragile. But I did manage to get this working, once I figured out how to cast any dashboard. It just worked with the v6 code base, so seems to work for me but not for you for some reason:

Service I am calling (can also just use the menu cast button):

action: cast.show_lovelace_view
data:
  entity_id: media_player.nesthub50be
  dashboard_path: lovelace
  view_path: clock

Card config:

type: custom:frigate-card
cameras:
  - camera_entity: camera.office
    live_provider: go2rtc
    cast:
      method: dashboard
      dashboard:
        dashboard_path: lovelace
        view_path: clock
profiles:
  - casting

"clock" is a named path on the main lovelace dashboard of my HA instance.

PS: The low latency is really cool! PPS: I don't think the menu style should be none in the casting profile, since that hides the button most people would use for casting! I think calling the service manually is more an "advanced users" kind of thing...

felipecrs commented 3 days ago

Interesting, you are using it in a completely different way I am.

In my case, I have my regular dashboard with the card where I have all buttons normally.

Then, I have a separate, hidden dashboard, which I only use for casting.

I think it makes more sense doing this way, so that you can have a card fully configured for the best looking and performance on a TV.

Then, in my normal dashboard, I'd just setup the Frigate card to cast using my casting dashboard.

BTW Since you can't reproduce it, I will try a little more. See if I can figure something out.

Thank you!

dermotduffy commented 3 days ago

I think it makes more sense doing this way, so that you can have a card fully configured for the best looking and performance on a TV.

This does make sense, but I think for a user just trying to cast a dashboard "casually", I don't think they'd start with this and perhaps be a little confused the menu is suddenly gone. In addition, you can cast to a touch device (e.g. Nest hub) where you actually can use the menu, so I think it might make more sense to not be opinionated as to the menu in the profile.

felipecrs commented 3 days ago

Sure. If you think so. The user would have the ability of hiding it anyway.

cvroque commented 1 day ago

Just wanted to say I have the same issue, this is my card config on 6.0 Beta 4: type: custom:frigate-card

title: Câmera Externa Deck
path: externa_deck
type: panel
cards:
  - type: custom:frigate-card
    cameras:
      - camera_entity: camera.externa_deck
        live_provider: go2rtc
    profiles:
      - casting

I'm trying to cast the dashboard to my Google TV devices straight from HA. The previous version works fine

dermotduffy commented 1 day ago

I'm trying to cast the dashboard to my Google TV devices straight from HA.

@cvroque Not sure this is the same issue, since you're not using the dashboard casting method in your config. How are you actually doing the casting in this case?

felipecrs commented 19 hours ago

@dermotduffy, he's probably doing the same as me. He's triggering the cast using the media browser or through the cast.show_lovelace_view action:

action: cast.show_lovelace_view
data:
  entity_id: media_player.tv_da_cozinha
  dashboard_path: dashboard-casting
  view_path: video-porteiro
felipecrs commented 19 hours ago

BTW Since you can't reproduce it, I will try a little more. See if I can figure something out.

I did more testing and was unable to find anything useful. I'm surprised you can't reproduce it. Are you trying with a similar configuration as we?

dermotduffy commented 19 hours ago

Config and service shown in this comment. It casts fine on a NestHub, let me try some different devices when I get a chance in case it's a device specific success.

felipecrs commented 19 hours ago

This is how it looks like when I try casting my main dashboard, which has three Frigate cards in it:

image

felipecrs commented 19 hours ago

If only I could access the browser logs for it... but according to this page, I need to pay a 5 USD fee for it (unbelievable!).

I don't have any Nest Hub myself, but my brother does. When I get the chance, I will try on his house as well.

In my case I only have Android TV devices with Chromecast built in.

dermotduffy commented 18 hours ago

In my case I only have Android TV devices with Chromecast built in.

... I also have one of these. Will try.

cvroque commented 9 hours ago

I'm trying to cast the dashboard to my Google TV devices straight from HA.

@cvroque Not sure this is the same issue, since you're not using the dashboard casting method in your config. How are you actually doing the casting in this case?

Hey! I was on mobile and left out a few details, sorry.

I had been casting an entire dashboard with a single frigate card for a while through HA (in order to get the lowest latency), then I saw the newly added beta option and decided to update and configure it.

After adding the new cast method none of my cameras worked and then I noticed that even casting directly stopped working.

In order to provide helpful information, I created a very simple card:

type: custom:frigate-card
cameras:
  - camera_entity: camera.sala

In order to test casting from the card, after updating to Beta 4 I added:

type: custom:frigate-card
cameras:
  - camera_entity: camera.sala
    cast:
      method: dashboard
      dashboard:
        dashboard_path: dash-cast
        view_path: sala

Here are the results:

Device Version Casting Method Result Details
Nest Hub v1 V5.2 Standard Delay
Nest Hub v1 V5.2 HA (cast.show_lovelace_view) No Delay
Nest Hub v1 V6.0 Standard Delay
Nest Hub v1 V6.0 HA (cast.show_lovelace_view) No Delay
Nest Hub v1 V6.0 Dashboard No Delay
Google TV 4k V5.2 Standard Delay
Google TV 4k V5.2 HA (cast.show_lovelace_view) No Delay
Google TV 4k V6.0 Standard Delay
Google TV 4k V6.0 HA (cast.show_lovelace_view) Endless Spinning
Google TV 4k V6.0 Dashboard Endless Spinning
dermotduffy commented 7 hours ago

Thanks so much @cvroque, that's really helpful. So it does look like there's some sort of device specific behavior going on. I just tried on my Android TV, and like you -- I get the loading "spinner" that just just spins forever.

Guess I'll give this a shot: https://developers.google.com/cast/docs/android_tv_receiver/debugging