Google Cast error - Unable to find a view with path xxxx

I can confirm what you are saying @vasseurf.
If i cast using https://cast.home-assistant.io/ the correct views are shown and with the latest configs.
But if i use developer tools or with an automation, i can only get defalut_view to work, and some really old version of it aswell.
I have tried both with yaml-mode and normal config-mode, same result when using developer tools.

All I get is the Nabu Casa and connected. It doesn’t show the view. This is via automation. Same thing happens if I use the front end but heres the kicker… it has the button “show” next to it. That is how you get it to actually show up on the screen. Problem is, there isn’t a “show” for the automation. Documentation on this is seriously lacking.

This is my code:

- alias: cast_to_google_kitchen
  hide_entity: true
  trigger:
    - platform: state
      entity_id: media_player.kitchen_display
      to: 'off'
    - platform: state
      entity_id: media_player.kitchen_display
      from: 'playing'
      to: 'idle'
  action:
    - service: cast.show_lovelace_view
      data:
        entity_id: media_player.kitchen_display
        view_path: default_view

I only cast.show_lovelace_view with view_path: default_view, other fail.
Need help.

And this is the result what i expect


And these are what i don’t and I don’t know the reason why.
I hope it will be fixed soon or I am wrong.

Sometime
Stopped at “Connected” and load nothing.

Sometime
Cast with mess

I’ve slapped this on the end of an open Github issue. Not sure if we should open a dedicated issue for the devs? A bit of your activity on that thread would proabably help raise the profile either way?

1 Like

Hi!

I have the same error as well.

So I was planning on adding the token today… already added the port to my base URL as I don’t use 443… and then it just worked right off the bat. I had all the stupid errors other people reported in this thread but today it’s working. I can even trigger the script from my iPad. I didn’t set a URL path or anything.

Example part of Lovelace:

  - title: Weather
    path: weather
    icon: mdi:weather-cloudy
    cards:

script:

'castweather':
  alias: Cast Weather
  sequence:
  - data:
      entity_id: media_player.lounge_room_tv
      view_path: weather
    service: cast.show_lovelace_view

No explanation!

1 Like

Mine just started showing me the corresponding lovelace view rather than the old states view when I refer to the view by index. Weird.

Update: And it just reverted back to old behaviour of showing the ‘state’ view after a Google Hub restart. very confused now…

exact the same problem here…

I have also problem, some of my Lovelace Views work to cast, and some don’t. Some show it exactly as on the computer, some views have cards that has dissapeared, sometimes 1 camera, or History Graph-cards don’t show up at all. And for some views It wont show up at all, the message Connected “Error: Unable to find a view with path XXX_XX” is there. But the PAth really exists.

There must be some problem with the savings of “path:” I had a Lovelace View called “koket_gr” if I casted to my nesthub it worked. But If I change name to “koket” save and restart HA and try again, It doesnt work to cast to “koket” If I check in raw-config editor the name is changed to “koket” but if i try again to cast to the old name “koket_gr” it work as before I changed name of the view. Weird.

This worked for me after getting the unable to find view with path error:

  1. Changed the URL path for Home from ‘default_view’ to ‘home_assistant’. Assume the name doesn’t matter but changing it may have helped somehow.

  2. Connect using the web browser (https://cast.home-assistant.io/)

  3. Go back and try service call from HA and it worked.

UPDATE: don’t think it has anything to do with changing the URL path. Been restarting HA while doing some other config stuff and anytime the path error shows (seems to come back after a restart) if I go to the web browser and launch a different view then go back to HA and launch the required view from there it works again and looks like it continues to work unless HA is restarted.

Hopefully this gets fixed soon. From what I’ve seen and tried there’s a few problems with this implementation

  1. The docs say the service is cast.show_lovelace_ui when the service should be cast.show_lovelace_view

  2. If you are using lovelace yaml mode, there’s no way to make the path work properly.

  3. You still need to authenticate with a google chrome browser

Hopefully this gets fixed in the next release. I was so hopeful the service would work out if the box but it’s got a ways to go.

1 Like

No you don’t

Works for me

@DavidFW1960 Do you mind sharing your automation or script and the lovelace view then? It seems quite a few of us can’t get it working correctly and I’m running out of ideas what the problem is

I have the exact same setup and I got it to work once! But every other time, it displays either the “Connected” or the “Connected” and “Error: Unable to find a view with path google” so there’s still obviously an issue. Glad it works for you, but it doesn’t explain why it works very sporadically for me and other users.

4 Likes

I see a lot of people saying that it works if they reauthorize at https://cast.home-assistant.io/ first.
This worked for me but only if I cast from there and left it on the display, and then followed up with a service call from HA. If I wasn’t already casting from there when I ran the service call then it didn’t work.

So what I tried instead was logging out of https://cast.home-assistant.io/

Now that I’m logged out at https://cast.home-assistant.io/, it works fine from HA!

1 Like

HERO :slight_smile:

It looks like this was the problem.

to bad :frowning: its only working one time.

I have found it’s slow to switch views and also haven’t found a way to stop casting from the backend.