Automatically Cast Home Assistant to Nest Hub?

No I never found a good way to do ut, just using the GUI for now. Will look into this again though.

Playing around with this myself, but I found something odd. When casting home assistant the status of the hub never changes from off which is odd.

The Google Home app recognized that it’s playing, hut not HA.

Where did you add that part in the code? When i replace the platform: state to homeassistant and add an extra line for the event (start) it doesn’t validate it. Do you have an example? :slight_smile:

add this to your automation.
It states that the trigger is when homeassistant starts
Can you share your automation?

This is my automation, it is starting successfully now. But i get an white screen and no loading screen or something:

- id: '1590166358190'
  alias: test
  description: test
  trigger:
  - event: start
    platform: homeassistant
  - entity_id: media_player.nesthub1288
    for: 00:01:00
    platform: state
    to: idle
  condition: []
  action:
    service: cast.show_lovelace_view
    data:
      entity_id: media_player.nesthub1288
      dashboard_path: lovelace
      view_path: woonkamer

I think i need the dashboard_path also - my url is like https://example.hass.org/lovelace/woonkamer

There is a problem to cast Lovelace views from the cast function. Only default_view or ‘0’ will work for now.

You can test this when using the following:

    data:
      entity_id: media_player.nesthub1288
      view_path: '0'

I hope Lovelace views can be send through the cast function.
For now when sending other Lovelace view, we see the message Google Cast error - Unable to find a view with path xxxx

Other links where problems was submitted are:
Cast stop working in 106.2

I’m having the same issue.

HA shows the hub as idle for a few seconds, and then shows it as off, even when casting.

I’m also seeing the cast working for about 10 mins, and then it just stops.

Everything was working great until I updated to the latest version of HA.

Any idea what’s going on? I checked the ticket in GitHub but it was closed and reading through it didn’t provide a solution.

That’s quite a bummer, was considering buying a hub and speaker in a nice deal. But this is holding me back now. Is this really a bug, or Google closing down the nest ecosystem for external integration even more?

Seeing as though people are complaining about it from sources other than Hass, I’d imagine it’s a bug. We’ll find out if they push an update with a fix and we’re still SOL.

I put my hub in a wall mount that is flush with the wall so I hope this gets fixed. It worked perfectly before this issue.

the 100% always work method is using:

entity_id: media_player.hub_huiskamer
view_path: '0'

if you want a custom dashboard to load i tinkered around and found out if u use the normal way you will get the "page not found error"but if you do an extra cast in the automation it works:

- id: '1591682005536'
  alias: Test Nest Hub
  description: ''
  trigger:
  - event: start
    platform: homeassistant
  - entity_id: media_player.hub_huiskamer
    platform: state
    to: 'off'
  action:
  - data:
      entity_id: media_player.hub_huiskamer
      view_path: begane-grond
    service: cast.show_lovelace_view
  - delay: '00:00:05'
  - data:
      dashboard_path: nest-hub
      entity_id: media_player.hub_huiskamer
      view_path: begane-grond
    service: cast.show_lovelace_view

here i first cast the wrong code to trigger the page not found error and after a delay i trigger the right dashboard with it and then it works. if i only trigger the right one it doesn’t work it first has te be in the page not found without dashboard input v=before it works with the right code. strange, but it works effective now. i alse tried to make the delay shorter but that doesn’t give a 100% value. this 5 seconds delay does. i uploaded a video on youtube how i made my cast look and how to jump between screen and navigation.

My setup for casting

5 Likes

Hi @licky_lauda thanks for your update. I do want to do some casting to my Google Nest Hub also.
When I call the cast.show_lovelace_view service with entitity id and view_path included like your first method (without the custom dashboard) via DeveloperTools/Services in HASSIO, the casting stops after 10minutes on my Google Nest Hub. But looking to my Chrome, it says Casting is still ongoing. Did you faced this issue also and how did you solved it? Thanks! I’m using the latest version 0.111.2 and HassOS 4.10.

@paullions:
The casting only stops if the nest hub is streaming something else like radio.
if you swipe down on your nest hub go to media and you will see your nest hub and the stream it is receiving, if you tab the strem (home assistant) your view pops right back up.
i ussually say hey google play radio and then hey google stop (im to lazy to touch the screen ;))

or you can do an automation every x minutes to media_player.turn_off and the start the cast again.
i do not do this, i think the screensaver is there for a reason and when the HA screen is up 24/7 i think it will burn in after a while.

1 Like

I tried this and for some reason my Nest Hub shows as off even when casting HA. HA doesn’t recognize anything being sent to the device, but the Google home app does.

Do you see this behavior with your setup?

@paullions
i checked, while casting the state is off. when streaming radio the player is in state playing.
i tried:
media_player.turn_on
and then
media_player.turn_off
after turning off my automation kicks in and the casting starts again.
and you can trigger this every x minutes in a automation.

2 Likes

Just tried this (and blocking access to google’s DNS servers from my nest hub) and it works great! Thanks!

How did you block access to Google DNS from the hub?

All devices in my network have a dhcp reservation based on their mac address, so I made a rule in my opnsense firewall to block access to 8.8.8.8 and 8.8.4.4 for my nest hub.

Do we still need workarounds like this or has .113.0 brought us a fix (I didn’t see it in the changelog). There’s some Nest hub discount running again, so tempted to buy if fixed.

I am also struggling with this. I cannot get the HUB to update status to HA when it is casting. Not sure why this is happening and sadly I do not have a configurable firewall set up right now, and I have not other need for it so the workaround is really not an option without redesign of the network.

Do we know why it has this behaviour and why blocking DNS gives this effect?

Blocking google DNS didn’t do anything for me to stop this issue from happening.

2 Likes