Cast and re-cast a lovelace view to a Google Hub

Heyhey,

can you please share the corresponding config?

Thanks and regards

Jakob

Good day all

Thanks for sharing the awesome Blueprint. I can finally put my Nest Hub to good use. However my Nest Hub goes into picture mode after about 30 minutes. When i check the automation i can see is getting triggered every 9 minutes… Does anyone know what i can do to resolve this.

Thanks in advance

1 Like

Hello. I need some help please. If my device is in the photo gallery view, and I click run on the blueprint, it says executed a few seconds ago but does not actually display the dashboard. I am able to display the dashboard using a script. I am using nabu casa so I am using the dashboard name on one field, and the view path below it. Am I supposed to change the dashboard path to my nabu casa url instead and use my dashboard name for the view path? Or what am I doing wrong?

I have two problems when using this blueprint

  1. It switches my TV on at ā€œrandomā€ times (often in the middle of the night)
  2. When an app on my TV is on (e.g, Plex), this automation takes over (especially when i click pause, but also when i am browsing and did not start a media yet)

For some reason that I cannot graps, my Google Hub 2 returns to the screensaver at some point in time.
I do not know why and I cannot find a reliable pattern to reproduce it. Sometimes it happens almost immediately, sometimes it takes hours.

I tried setting this up yesterday to cast to an Android / Google TV. I get a message on the TV that the view cannot be found. I tried so many variations of view/path that I was going crazy.

Can someone please point me in the right direction? It would be great if the instructions were clearer…

I want to cast this dashboard / view:
xxxxxxui.nabu.casa/lovelace-dave/dave-cast

locally this is http://192.168.0.14:8123/lovelace-dave/dave-cast

So what do I put in here?

alias: Cast Security Dashboard to Bedroom TV
description: ""
use_blueprint:
  path: kind3r/cast-and-re-cast-a-lovelace-view-to-a-google-hub.yaml
  input:
    player: media_player.bedroom_tv
    view: lovelace-dave/dave-cast

The above wasn’t working, I get the HA logo screen on the TV with a message saying it can’t find the view.

The view setting maybe should just be ā€œdave-castā€ā€¦ read below and let me know what you think -

What is the content of ā€œcast-and-re-cast-a-lovelace-view-to-a-google-hub.yamlā€ ?

Also, this may not be relevant (as I am not using a blueprint), but I cast a certain view to my google nest hub on my desk when it becomes available via an automation. This is because it is attached to a smart plug which has no power when I am not in the office, hence when the lights go on and the google nest hub is powered and becomes available, the view is casted.

I had alot of trouble figuring out the path as it was not very obvious and I struggled with it too. First I went to the browser URL for the view I was using (###.###.###.### is the IP of my HA instance):

http://###.###.###.###:8123/dashboard-motion/0

With the above in mind, this action does the casting:

And here is the .YAML:

data:
  entity_id: media_player.basement_google_nest_hub_max
  dashboard_path: dashboard-motion
  view_path: "0"
enabled: true
action: cast.show_lovelace_view

Note, if the device to be casted to is not on the same vlan (or subnet) as HA (for example if HA is on 192.168.0.X and the device to be casted to is not on 192.168.0.x but instead, 192.168.10.x) - casting will only work if mDNS reflection is turned on, utilizing the bonjour service id ā€œ_googlecast._tcp.localā€.

If they are on the same vlan then disregard the ā€œNote:ā€ above…

Hope that helps -

Is it possible to make the automation run at 7 in the morning and stop casting at 11 in the evening?

You could end and trigger the automation at your desired times, I’m doing something similar to switch between bright and dark mode:

alias: Cast Dashboard restart
description: ""
mode: single
triggers:
  - event: sunrise
    offset: "300"
    trigger: sun
  - event: sunset
    offset: "300"
    trigger: sun
conditions: []
actions:
  - metadata: {}
    data: {}
    target:
      device_id: 103eafd2323696288a4ffb83b932ce86
    action: media_player.turn_off
  - delay:
      hours: 0
      minutes: 0
      seconds: 30
      milliseconds: 0
  - metadata: {}
    data:
      skip_condition: true
    target:
      entity_id: automation.cast_to_google_hub
    action: automation.trigger

I’m having an issue with the dark mode on my Nest Hub:

The dark mode gets somehow butchered when I cast my dashboard, is this rather an issue of HASS or of the blueprint?

Home Assistant is running at the latest release 2025.1.3. I tried already to re-setup the blueprint, but with no improvement


For me the dark/bright mode is working now.

I do have an issue where the cast stops randomly every couple of minutes tho.

1 Like

I have the same but it comes back as I have a lame workaround of an automation that when the device becomes available, then I stop casting and recast to it. I’d love to figure out how to troubleshoot my issue as well.

Do you mind sharing the work around? It’s weird, one day both my hubs are casting just fine and one day one keeps disconnecting and connecting. There’s no consistency.

I’ve tried the creators other way of casting but I don’t really like having to use kiosk mode and just like this better.

Sorry I took so long to get back to you -

Sure - the below code is pretty self explanatory, used when HA starts up but you get the idea… When HA restarts, if the device I am casting to (Google Nest Hub Max) is not unavailable, unknown or playing, then stop whatever might be casting, waitg one second, then cast. The parallel mode is not really needed here, that is kind of silly… Anyway, look at the URL for the dashboard you wish to cast, for example the dashboard I am casting below has this url:

http://:8123/dashboard-motion/0

Note the ā€œdashboard_pathā€ below and copmpare it to the above url -

alias: On Startup/Reboot - Re-Cast to Google Nest Hub Max
description: Stops Casting and Then Re-Casts to Google Nest Hub Max
triggers:
  - event: start
    trigger: homeassistant
conditions:
  - condition: not
    conditions:
      - condition: state
        entity_id: media_player.basement_google_nest_hub_max
        state: unavailable
      - condition: state
        entity_id: media_player.basement_google_nest_hub_max
        state: unknown
      - condition: state
        entity_id: media_player.basement_google_nest_hub_max
        state: playing
actions:
  - data: {}
    target:
      entity_id: media_player.basement_google_nest_hub_max
    action: media_player.turn_off
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - data:
      entity_id: media_player.basement_google_nest_hub_max
      dashboard_path: dashboard-motion
      view_path: "0"
    action: cast.show_lovelace_view
mode: parallel
max: 100

Hope that helps

Oh so it’s when HA restarts? I thought it was when the Hub became since that can be chosen as a trigger. Haven’t tried but I guess that when it shows the screensaver it stops and casts?

Sorry I actually have that as well, in an autromation which calls a script:

alias: Basement Google Nest Hub Max changes FROM being unavailable -> Cast Lovelace
description: ""
triggers:
  - entity_id:
      - media_player.basement_google_nest_hub_max
    from: unavailable
    trigger: state
    to: idle
conditions:
  - condition: state
    entity_id: light.basement_stairs_shelly_1
    state: "on"
  - condition: not
    conditions:
      - condition: device
        device_id: a703cb8684f75a1ab6dca0a6dbdfc1d3
        domain: media_player
        entity_id: d9e77394e19db7710c92e96675af947d
        type: is_playing
      - condition: device
        device_id: a703cb8684f75a1ab6dca0a6dbdfc1d3
        domain: media_player
        entity_id: d9e77394e19db7710c92e96675af947d
        type: is_paused
      - condition: device
        device_id: a703cb8684f75a1ab6dca0a6dbdfc1d3
        domain: media_player
        entity_id: d9e77394e19db7710c92e96675af947d
        type: is_buffering
actions:
  - delay:
      hours: 0
      minutes: 0
      seconds: 30
      milliseconds: 0
  - data: {}
    action: script.cast_dashboard
mode: single
alias: Start Casting Dashboard
sequence:
  - data: {}
    target:
      entity_id: media_player.basement_google_nest_hub_max
    enabled: true
    action: media_player.turn_off
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
    enabled: true
  - data:
      entity_id: media_player.basement_google_nest_hub_max
      dashboard_path: dashboard-motion
      view_path: "0"
    enabled: true
    action: cast.show_lovelace_view
mode: single
icon: mdi:tablet-dashboard

I probably have some old code in there that is useless, I changed is many times but that was a long time ago… for instanve the 30 second delay before calling the script doesn’t make any sense but you get the idea!

Thanks? Is it working? Does it sense the state as idle and cast when the Hub goes to screensaver?

To be honest - most of the time. Every time I manually run it however it does work perfectly. I have the Google Nest Hub on a different VLAN than my RPI5 runing HAOS on a VM, but I have mDNS reflection turned on going both way across vlans which does work for every device…

Does this not work anymore? Im not able to press my Nest hub anymore to use the dashboard?

Did you ever find an answer to this?
Would like to have Music Assistant homepage on Nest Hub.