Using CATT

hi @Luitertje,

Unfortunately that log part was indeed containing a type because of I tried some commands. So both don’t work, not directly in the SSL terminal, nor from a shell command. Both attempts:

Double ""

ssh -o StrictHostKeyChecking=no -i /config/ssh/rsa_key [email protected] catt -d "Google nest hub" cast_site https://XXXXXXXXX/lovelace-hub/0

Single ''

ssh -o StrictHostKeyChecking=no -i /config/ssh/rsa_key [email protected] catt -d 'Google nest hub' cast_site https://XXXXXXXXX/lovelace-hub/0

Solved,

The issue was that the name of the cast device contained a whitespace. I changed Google nest hub to Hub and now the issue is fixed.

So in my case the issue return code: 2 was fixed by clearing the whitespaces in the casting device name.

1 Like

same issue here, no idea how to get it running

Up to date Home Assistant install.
I’ve installed CATT using “pip3 install catt” via ssh.
I can run the “catt -d …” command successfully to my Nest Hub
If I reboot home assistant CATT is still installed.
However if I make a change to SSH & Web Terminal and restart SSH, CATT needs reinstalling.

I have a script in /config/bash/ called update_catt.sh, which does install CATT using the command “bash /config/bash/update_catt.sh”.

configuration.yaml has the following entry:

shell_command:
# CATT
  update_catt: bash /config/bash/update_catt.sh

This automation doesn’t work
What am I missing ?
Thanks

alias: "CATT: Init"
description: Installs the latest version of CATT on Home Assistant start
trigger:
  - platform: homeassistant
    event: start
condition: []
action:
  - service: shell_command.update_catt
    data: {}
  - service: notify.notify
    data:
      message: CATT install triggered.
mode: single

Update: I know the automation is executing because I receive the notification.
Just that CATT isn’t installing.

Did you find any solution to the https issue using private IPs?

Nope. I just have up setting up home assistant direct access via Google nest hub

hello
really nice with ha-catt-fix this saves me having to see the recast screen all the time.

But one thing this appears to only work when I have internet access and most times that is ok but lately my internet connection are not that good so I’m trying to make this work local

I have added cast_receiver_framework.js and google-nest-hub.png to my www folder

I have tried using a local adress const cast_api = “//http://192.168.1.226:8123/local/cast_receiver_framework.js”;
and adding the file directly script.src = ‘./cast_receiver_framework.js’;
and its not working
might be be because I have really no clue what I’m doing… but I have been searching and reading and I’m not any closer at all to figure this out
so any ideas or anything?

ha-catt-fix.js(part of it with my tests)

//const cast_api = "//http://192.168.1.226:8123/local/cast_receiver_framework.js";
const cast_api = "//www.gstatic.com/cast/sdk/libs/caf_receiver/v3/cast_receiver_framework.js";
// Taken from: https://stackoverflow.com/a/14786759
function loadScript(url, callback) {
  var head = document.getElementsByTagName("head")[0];
  var script = document.createElement("script");
  script.type = "text/javascript";
  //script.src = url;
  script.src = './cast_receiver_framework.js';
  script.onreadystatechange = callback;
  script.onload = callback;

  head.appendChild(script);
}

// Taken from: https://github.com/home-assistant/frontend/blob/69264b3448e9862025e78090a52af20f796aa32b/cast/src/receiver/entrypoint.ts
function playDummyMedia() {
  const loadRequestData = new cast.framework.messages.LoadRequestData();
  loadRequestData.autoplay = true;
  loadRequestData.media = new cast.framework.messages.MediaInformation();
  //loadRequestData.media.contentId = "https://cast.home-assistant.io/images/google-nest-hub.png";
  //loadRequestData.media.contentId = "http://192.168.1.226:8123/local/google-nest-hub.png";
  loadRequestData.media.contentId = '/.google-nest-hub.png'; 
  loadRequestData.media.contentType = "image/jpeg";
  loadRequestData.media.streamType = cast.framework.messages.StreamType.NONE;
  const metadata = new cast.framework.messages.GenericMediaMetadata();
  metadata.title = "Dummy " + (new Date().toTimeString());
  loadRequestData.media.metadata = metadata;
  loadRequestData.requestId = 0;
  window.playerManager.load(loadRequestData);
  window.setTimeout(playDummyMedia, 60 * 9 * 1000);
}

I couldn’t get it working for me using catt directly on Home Assistant so I’ve created my own ‘ha-cast’ service that runs on a Raspberry Pi continuously and restarts on boot. The service checks the status of all configured Chromecast devices from the config.yaml file and will only cast if there is no media/dashboard already playing. It iterates over every 10 seconds and sleeps throughout the night.

If you want to try it out yourself, here’s the project: GitHub - b0mbays/ha-cast: Python system service to continuously cast Home Assistant to a Google Chromecast device

2 Likes

Hi - should this work with Google TV’s ambient mode? I’ve installed ha-catt-fix and am using Home Assistant’s cast.show_lovelace_view service to cast a dashboard to a Chromecast with Google TV device (connected to a TV).

The problem is that after 10 minutes the CCGTV goes into ambient mode (where it displays whatever is configured e.g. random Google Photos pictures). I was hoping this fix would stop it going into ambient mode, but not sure if it is applicable to CCGTV devices.