Tell Google Assistant to show Lovelace view

I like to tell my Google Nest Hub Display to show my Lovelace view, I understand that it is possible by linking a Script to Google Assistant, I can however not get this script to work:

'1586867807497':
  alias: Show Home Assistant
  sequence:
  - data:
      entity_id: media_player.family_room_display
      view_path: Main
    entity_id: media_player.family_room_display
    service: cast.show_lovelace_view

I get this error: Failed to call service script/1586867807497. value should be a string for dictionary value @ data['entity_id'] but it is a string…

I think you need to remove the part entity_id from the data section.

Gives the same error:

Failed to call service script/1586867807497. value should be a string for dictionary value @ data['entity_id']

'1586867807497':
  alias: Show Home Assistant
  sequence:
  - data:
      view_path: Main
    entity_id: media_player.family_room_display
    service: cast.show_lovelace_view

I think you found a bug. I get the same error as you. When trying this script in Developer Tools > Services it works, only without the expected outcome.

Except from that I can’t get casting to work, the screen of my Nest Hub shows only the “Connected” screen. Since the implementation of the Lovelace dashboard implementation is doesn’t work for me.

I can get the service call working with this settings:

I managed to get it to work with this config:

'1586867807497':
  alias: Show Home Assistant
  sequence:
  - data:
      dashboard_path: lovelace
      entity_id: media_player.family_room_display
      view_path: main
    service: cast.show_lovelace_view

So the entity_id should be empty for the service call. I’ll update the documentation.

Now the fun thing, how do I get the Google Nest Hub to trigger that script?

Edit:

I just had to say: hey google run ‘Show Home Assistant’ :slight_smile:

Edit2:

The documentation is updated now: https://github.com/home-assistant/home-assistant.io/pull/13110
Perhaps CATT (https://github.com/skorokithakis/catt) is a better option though.

I’ve created a similar script but for some reason it displays sometimes, displays the nabu casa screen sometimes, doesn’t display anything sometimes. Anyone have any idea how to make it work consistently?