Using CATT

Hello Dennis.
Can you help me?
Where I can find the cast.sh file?
Thanks a lot.

Hi John,

Could you explain how can I put the cast.sh file in the config folder?

Thank you

It has been a while that I had HA on my Raspberry PI (I now run it on a Synology), so not sure how I did it. I think I created the file on Windows and then used WinSCP to put it to the Config folder on the PI.

I have HA running on a Raspberry Pi:

Operating System: Home Assistant OS 5.11
Version: supervisor-2021.02.6

Separately I’ve tasked a FreeNAS machine to make “catt calls” to cast to a Google Nest Hub. This works about 50% of the time, and when it doesn’t work it seems to be because CATT scan didn’t find the relevant device, or any device for that matter.

The error returned is “Error: No devices found.”, which in turn causes CATT to return this error “Error: Specified device "Kitchen Display" not found.

I’m doing these 3 commands on the FreeNAS box via separate cron jobs, on 9-minute repeating cycles:

  1. ping -c 2 <nest-ip-address>

  2. CATT scan

  3. catt -d "Kitchen Display" cast_site http://nest-ip-address:8123/lovelace/nest-hub

The frequent pings are an attempt to have the FreeNAS not “forget about” the Nest Hub. But obviously it’s doing a poor job of that. Any advice?

I would have no idea why the FreeNAS would “forget about” the Nest Hub. This is not needed on PI or Synology. Seems like a FreeNAS issue. So not much I can answer.

Well, here’s the thing: I’ve run catt on my Hass.io-based RPi and I get very similar behavior. Sometimes the scan works, sometime the scan fails to find any devices, sometimes the scan finds a subset of relevant devices, sometimes the scan finds all relevant devices but the ensuing cast call doesn’t work. In all cases the preceding ping works fine. Occasionally everything works and I get a brief period of seeing the Nest Hub show what it’s expected to.

That is indeed very strange. I myself never use the Ping or Scan command. I just use catt straight away to cast. I have never had a failed cast as far as I know.

Perhaps the issue is unrelated to Catt or HA and maybe there is something with your network? Is your Nest HUB in a good range of your wifi? If the scan/ping does not work, it feels as if the Nest HUB got disconnected.

Well now I’ve messed something up good, that’s for sure. In pursuit of better reliability I moved my Nest Hub onto my “main” SSID, so that the Nest and the FreeNAS “catt box” are on the same VLAN. The Hass.io RPi remains on the IoT VLAN for the time being.

I can pretty reliably get the “DashCast” app to launch and I see the message at bottom about “Force loading http://:8123/lovelace/nest-hub”, but then the app goes away pretty quickly and I’m back to the stock Nest UI (be that the screensaver or scrollable panes).

However, casting the HA demo site to my Nest (catt -d "Kitchen Display" cast_site https://demo.home-assistant.io/#/lovelace/0) is solid and reliable. I figure it’s one of two things, and my $$ is on the 2nd bullet.

  1. I need to move the Hass.io box onto the main VLAN as well (not previously a requirement when I had intermittent success)
  2. I need to get back to the login screen w/trusted networks option on the Nest, but I can’t remember how

I have never worked with VLANs so not sure about the details. But I think all you need to do is add the new IP range of where the Nest Hub is to the trusted_networks configuration.

I’ve successfully gotten back to a semi-working state. I had to log out of all instances of HA, and Nabucasa.com, basically deregister the phone app, etc. With no known/active connection to the HA instance I casted to the Nest Hub and was presented with the login page with the option for trusted networks.

Now I can get beyond the transient DashCast problem, but I still have a 50/50 chance of catt scan working and/or casting working. I think I need to understand the following better, and how CATT implements discovery, to know if my network topology is the culprit.

https://developers.google.com/cast/docs/discovery

I have this almost working. I am running HA OS on a raspberry pi. If I reboot, python and catt are unavailable.
I have added:

- python3 -m pip install catt

to the SSH & Web Terminal config, but this isn’t going to help because python is also not available.

Can I add all the other commands and get everything install each time, or is there a better way? Getting python and catt installed on each boot going to extend my boot time.

The command is pip3 install catt

And python3 certainly is available.

pip, pip3 and python3 are not installed on HA OS and must be installed each time the host is rebooted. That also applies to CATT. Basically anything extra installed on HA OS is lost on the next reboot. This doesn’t apply for people running HA supervised on something such as Ubuntu.

I followed the work-around using SSH & Web Terminal, but that didn’t work for me.

It might be worth pointing out these issues at the beginning of the thread to warn people running HA OS.

Just out of interest, how are the posters in this thread running HA?

I am running supervised.

When you log into web terminal & ssh on haos python3 and pip3 are there, from the start.

I just tried it, so I believe you are wrong.

The more traditional casting sources, like a Chrome browser, faithfully and very quickly enumerate all of the available casting targets in my network. The fact that catt scan takes a long time, even when it’s successful, and the fact that it’s only successful about 50% of the time, tells me my primary problem to solve is how catt behaves within my network.

Of course it may just be that chrome is made by the same people as the chromecast, whereas catt is a third party project that may not have access to all the little quirks of the protocol.

Or your network may be at fault,

The fact that other people could have nearly 100% reliability with catt while I had such trouble seemed to indicate that my environment is the root cause. So I followed some instructions from the mfr. of my LAN & WiFi equipment on managing Chromecast / Google Home devices, and walla my calls to catt are far more reliable now. Mostly the fix was around enabling MulticastDNS.

Not sure what HA OS is. Is that the same as HASSIO? I personally now run HA in a Docker container so have no need anymore for the SSH&WebTerminal. But basically that addon is its own container and it contained Python (at least when i used it a year ago or so). Are you 100% sure that you are actually trying to execute the command in the SSH&Web Terminal addon? So dont try to SSH into your Home Assistant setup as you will end up in the HA host and not the SSH@WebTerminal addon. You really need to go to the addon itself and use the command line in the addon.

Hi John, yes HA OS is the new name for HASSIO.
My issue was caused by the SSH&Web Term add-on not starting because I had a port conflict with port 22 already being used, so therefore python and CATT were not getting installed.

I sorted it out in the end. Yes, unfortunately it means that Python and CATT have to be re-installed using the command details provided in an earlier post. If that does not occur, python and CATT are not available.

Thank you for your catt.sh, I am using that successfully.

FYI in case anyone is interested, I worked out that the volume value relates to a percentage.
ie. volume 10 equals 10% Nest Hub volume.

1 Like