Automatically Cast Home Assistant to Nest Hub?

I’ve installed the SSH & Web Terminal addon in Supervisor.
In the configuration tab:

ssh:
  username: xxx
  password: xxxx
  authorized_keys: []
  sftp: false
  compatibility_mode: false
  allow_agent_forwarding: false
  allow_remote_port_forwarding: false
  allow_tcp_forwarding: false
zsh: true
share_sessions: false
packages: []
init_commands:
  - python3 -m pip install catt

Than an automation:

- id: '1589529246400'
  alias: CastToHub
  description: ''
  trigger:
  - minutes: /10
    platform: time_pattern
  condition: []
  action:
  - service: media_player.volume_set
    data:
      entity_id: media_player.nesthub7736
      volume_level: '0'
  - delay: '5'
  - data:
      addon: a0d7b954_ssh
      input: bash /config/cast.sh
    service: hassio.addon_stdin
  mode: single

Cast.sh:

if ! catt -d "Keuken" status | grep 'PLAYING'; then 
    catt -d "Keuken" volume 0
    catt -d "Keuken" cast_site http://10.0.0.250:8123/lovelace/default_view
fi

Works fine.

2 Likes

I think i Fixed it
logging out at https://cast.home-assistant.io/
now it works every time with out a turn around

how do you fix the login into HA via catt?
I tried it and I get prompted with the login page, but of course I get no keyboard to enter username or password…
[edit]
Ignore the above, because the page was dark I could not see the “trusted network” option below the login button. All sorted and actually works much better than the standard cast.show_lovelace_view as I can see the background picture that I had set up (cctv feed)

I’m not sure exactly what to do with this info. Got the SSH and web terminal set up some time ago, but the automation part is confusing.

Anyone feel like explaining it like I’m 5?

  auth_providers:
  - type: trusted_networks
    trusted_networks:
      - 192.168.2.0/24
      - 10.0.0.0/24
    **allow_bypass_login: true**
http:
  base_url: https://xxxxxx.ui.nabu.casa/
  cors_allowed_origins:
  - https://cast.home-assistant.io
  - https://xxxxx0emdb4wswvx.ui.nabu.casa/

Not sure what part is nessecary but this is mij configuration in configuration.yaml

1 Like

You can copy/paste this configuration in your automation.yaml and replace my hub name with yours
Make a new file via file editor, name it cast.sh and copy/paste the code I wrote in the post above.

- id: '1589529246400'
  alias: CastToHub
  description: ''
  trigger:
  - minutes: /10
    platform: time_pattern
  condition: []
  action:
  - service: media_player.volume_set
    data:
      entity_id: media_player.nesthub7736
      volume_level: '0'
  - delay: '5'
  - data:
      addon: a0d7b954_ssh
      input: bash /config/cast.sh
    service: hassio.addon_stdin
  mode: single
2 Likes

Great, that’s what I had planned on doing.

In the cast.sh file, what is the “Keuken” reference? That’s what was throwing me off.

That’s te name of mij Google Nest Hub. In the cast.sh file you don’t use the entity ID but the name.

1 Like

hi, i also ended up with log in page in black background. how did you get past that?

tap towards the bottom of the screen / swipe up to bring the trusted network option

thanks :slight_smile:
i kept tapping downwards and found an option to select user…after that its always logging in.

If you are struggling with the cast and recasting to a Nest device (Hub etc) I recommend this blueprint:

Works perfect! Try it :slight_smile:

2 Likes