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

Apparently yes, just discovered this issue.

Hello all,
Casting to my Google Nest Hub 2 is working. But i encounter problems with casting multiple views.
In my main view i have created links to some rooms or eg the lights.
When my main view is displayed, and i touch the link to the lights, the cast jumps to that view.

In these views i have a button to jump back to the main view.
But for some reason the jump back does not work. I have created in the lights view two different buttons, Each button with an different link back. See the snippets of code.

Doe anyone has an idea what i am doing wrong?

Main view:

type: custom:mushroom-template-card
primary: Lampen
secondary: ''
icon: mdi:lightbulb
icon_color: amber
layout: vertical
tap_action:
  action: navigate
  navigation_path: /g-home/lampen

Lights view, button to return back to main view, version 1:

type: custom:mushroom-chips-card
chips:
  - type: action
    tap_action:
      action: navigate
      navigation_path: https://192.168.178.221:8123/g-home
    icon: mdi:arrow-left-bold-outline
alignment: justify

Lights view, button to return back to main view, version 2:

type: custom:mushroom-chips-card
chips:
  - type: action
    tap_action:
      action: navigate
      navigation_path: /g-home
    icon: mdi:home
alignment: justify

So, jumping to an other view from main view works, but jumping back to the main view is the issue.
Kind regards, Bert

I found a solution by using an other card (custom:mushroom-template-card) for the return to the Home View, which works!

Hi all, I am trying to cast my Lovelace dashboard to a Google Nest Hub. And run in to an error. Hope someone has a good idea!

I go to https://cast.home-assistant.io/ and enter my nubu.casa url.
Then I log in to my HA. and select the appropriate google nest hub. Then the Google Nest Hub indicates that it is connected. And I get an overview of my HA Views. When I click one of my views it gives an Error on the Google Nest hubs Display

ā€œError: Cannot show Lovelace because weā€™re not connected to the same Home Assistant instance.ā€.

itā€™s a bit strange because I do see my own HA views on de cast webpage it looks like the same instance. Maybe i have to contact Nubu Casa for this problem? Maybe someone else has run into this problem?

1 Like

Hi! I think this automation is great.
I like to watch my dashboard during daytime. But during nighttime it lights up the entire room where I have my Google Hub.
How can I make the automation to be active just from 7:00 to 23:00?

This works for me, but doesnā€™t seem to recast every 9 minutes to avoid the picture timeout. Looking at the traces, I can see it triggered at the 9 minute mark, but completely bypasses the recast because of the conditions. This leads to the picture card timing out for my camera.

Does the https://cast.home-assistant.io browser page have to remain open for this to keep functioning? It seems like if I close the tab that initiates the cast it will eventually stop working after a native google home task is preformed.

Hey all, Iā€™ve recently created a new HACS integration to continuously cast dashboards to multiple different Chromecast displays.

More info here: GitHub - b0mbays/ha-continuously-casting-dashboard: HACS Integration for continuously casting a Home Assistant dashboard to your Google Chromecast Displays

Features:

  • Automatically casts specified Home Assistant dashboards to Chromecast devices continuously.
  • Monitors the casting state of each device and resumes casting if interrupted.
  • Configurable time window for active casting.
  • Entity changed dashboard casting (cast specific dashboards when an entity state changes).
  • Configurable casting interval.
1 Like

Cool HACS integration is there anyway that you can think of to store the last view of a dashboard that was used and recast that instead of casting a specific view.
For Clarity sake say I have a dashboard that has 5 views. The first view is cast to a google nest hub. Someone then switches to the 5th view to control some sonos speakers or something. Then somebody uses a voice command to the hub to turn off some lights. The hub will then get the first view recast to it after the interruption from the voice command. Would there be way to broadcast the last view which was the 5th view in this case

I can try to implement this, I have a couple of ideas. Can you send me what your views look like in the URL? Just the end part

sorry havent got back to you. Just working some shift work

Wow, what an awesome investigation and solution!
Love it! I had the same issue, and also assumed that kind of problem. Thanks for sharing! Saved me now some time.
And again: VERY VERY nice solution!!

1 Like

I struggled a long time to cast Google Calendar to my Nest Hub (it casted the calendar ā€” but cleared all entries from Google, weird). But now that is working too.

Hi @b0mbays,
Hopefully, I may bother you with thisā€¦
I had a working casting of dashboards, but after being away for vacation and updating to HA 2023.4.5 and OS 10.0, i cant get casting my dashboards working anymore.
So i wanted to try your HACS integration. Btw, I am running HA on a RPi4/ssd.
For the Requirements:

  1. External access is done via DuckDNS, and is working fine from outside my home.
  2. ha-catt-fix, did not install via HACS, because of an error message. So I copied the into the (config)/www/ha-catt-fix/ folder.
    Then I added the resource for ha-catt-fix via to Settings ā†’ Dashboards ā†’ Resources as: /local/ha-catt-fix/ha-catt-fix.js
  3. kiosk-mode was already part of my installation.
  4. Rebooted my RPi4.
  5. Installed your repo for RPi via HACS, which seems to went OK. In my /custom_components folder there was your continuously_casting_dashboards folder with the Python files. But when I checked for the resource, I could not find it in Settings ā†’ Dashboards ā†’ Resources. So I decided to add it there:
    /hacsfiles/continuously_casting_dashboards/dashboard_caster.py as javascript. But I think that is wrong!!! Any advise on this?

I did however found in Integrations your Continuously Cast Dashboards integration, but was not able to add it. I got the following message:

## This device cannot be added from the UI

You can add this device by adding it to your 'configuration.yaml'. See the documentation for more information.

So there is an entry in my (config)/includes/integrations.yaml file:

### Google Nest Hub v2 Casting Dashbard.
continuously_casting_dashboards:
  logging_level: warning    #Required: Set the logging level - debug/info/warning (default is 'warning' - try 'debug' for debugging)
  cast_delay: 45    #Required: Time (in seconds) for casting checks between devices
  start_time: "06:30"    #Required: Start time of the casting window (format: "HH:MM")
  end_time: "02:00"    #Required: End time of the casting window (format: "HH:MM") and must be after "00:00"
  devices:
    "<Display_Name": "Woonkamer display"    #Required: Display name of your device. Find this on the actual device's settings or inside the Google Home app.
    dashboard_url: "https://192.168.178.221:8123/g-home/huis-bl-45"    #Required: Dashboard URL to be casted

I donā€™t know it this is necessary, but i have these trusted_networks in my auth_providers in my (config)/includes/homeassistant.yaml file:

auth_providers:
  - type: trusted_networks
    trusted_networks:
      - 192.168.178.227/32   # Google Nest Huv v2
      - 192.168.178.228/32   # Google Home
      - 192.168.178.226/32   # ChromeCast TV
      - 192.168.178.251/32   # Yamaha receiver
    trusted_users:
      IP_ADDRESS_1: DASHBOARD_USER_ID
      IP_ADDRESS_2: DASHBOARD_USER_ID
      IP_ADDRESS_3: DASHBOARD_USER_ID
    allow_bypass_login: true
    # Note that bypass_login only works if one user is authorized

But I am not sure what to fill-in at the trusted-users: configā€¦ If this is not necessary, please let me know.

I might have made several mistakes here, but i hope you can help me to solve this.
Kind regards, Bert

Hi @deltabert , iā€™m sorry I have only just seen this! I only keep track of the raised issues in Github and not here.

As for your setup, you donā€™t need to add any resources for the integration to your dashboards. The only one you need there is the ha-catt-fix.

There is no UI for the integration, and all is controlled via the configuration.yaml file. I think you need to move your setup there (or maybe it can stay inside the integration.yaml file?)

Your setup for the device name is incorrect.

It should follow the format like this:

continuously_casting_dashboards:
  logging_level: debug
  cast_delay: 25
  start_time: "06:00"
  end_time: "02:00"
  devices:
    "Kitchen display":
      dashboard_url: "http://192.168.12.104:8123/kitchen-dashboard/default_view?kiosk"
      volume: 5
      start_time: "06:00"
      end_time: "03:00"

That should get things working for you. Also, there have been some updates since 12 days ago so make sure to update :+1:

Hello @b0mbays,

Wonderful work with this HACS. I went through the setup process easily but I am wondering if instead of casting through a defined timeframe I could simply cast on demand. I mean, I want to cast a specific dashboard in my garage TV with a Chromecast (Google TV) on request for a project and time will vary depending on when I start the project and how fast the project is completed. Based on your configuration it seems we must set a defined start and end time or it will default to 7:00 AM.

continuously_casting_dashboards:
  logging_level: warning #Required: Set the logging level - debug/info/warning (default is 'warning' - try 'debug' for debugging)
  cast_delay: 45 #Required: Time (in seconds) for casting checks between each device.
  start_time: "07:00" #Optional: Global start time of the casting window (format: "HH:MM") - Default is set to "07:00" and can be individually overwritten per device below.
  end_time: "01:00" #Optional: Global end time of the casting window (format: "HH:MM") and must be after "00:00". Default is set to "01:00" and can be individually overwritten per device below.
  devices:
    "<Display_Name>": #Required: Display name of your device. Find this on the actual device's settings or inside the Google Home app.
        dashboard_url: "<Dashboard_URL>" #Required: Dashboard URL to be casted (This must be the local IP address of your HA instance, not homeassistant.local)
        volume: 5 #Optional: Volume to set the display. (If you remove this, the device will remain the same volume)
        start_time: "07:00" #Optional: Set the start time for this device
        end_time: "01:00" #Optional: Set the end time for this device

Before discovering your HACS, I had created a button in my garage dashboard to cast on my Garage Google TV, but it would stop after 10min and go into Photo Mode. The only way to go back to displaying my dashboard is to click the BACK button on the physical remote of the Google TV,

Here is my button code:

type: custom:button-card
name: Caster Distillation
icon: mdi:cast
tap_action:
  action: call-service
  service: script.1692141275657
hold_action:
  action: call-service
  service: media_player.turn_off
  service_data:
    entity_id: media_player.google_tv_garage
show_name: true
show_icon: true

And here is the script it is referring to:

alias: Cast Garage
sequence:
  - service: media_player.turn_on
    target:
      entity_id:
        - media_player.google_tv_garage
    data: {}
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: cast.show_lovelace_view
    data:
      entity_id: media_player.google_tv_garage
      dashboard_path: lovelace
      view_path: distillation
mode: single

Any idea if your HACS could work based on time when it is required to cast?

The automation seems to run/repeat itself as it should. However the Lovelace stops actually casting maybe 10min afters its first run. Help?

1 Like

Hello,

First of all, thanks for your work!

Having a little problem, when i want to add ā€œauth_providersā€ to my configuration, i get the following error:

ā€œThe system cannot restart because the configuration is not valid: Integration error: auth_providers - Integration ā€˜auth_providersā€™ not found.ā€

Why is that?

Thanks!

Fixed my stuff on the post above this one, didnā€™t had ā€œhomeassistant:ā€ in my configuration.yaml.

The page is casted tot my Google Hub, but i still have to fill in the username and password, but thatā€™s impossible on a Google Hub.

Is the ā€œauth_providerā€ configuration not working?

Added the following:

homeassistant:
  external_url: "https://myexternallink.casa/lovelace/0"
  auth_providers:
    - type: homeassistant
    - type: trusted_networks
      trusted_networks:
        - 192.168.0.1/32
      trusted_users:
        192.168.0.1: "myverylongkeynumbersandletters"
      allow_bypass_login: true

What am i missing here?

Itā€™s working, was fooling around inside the configuration.yaml.
Very hard to work with for me, no coding experience :slight_smile: