Using CATT

Perfect thanks so much!

I think you need to remove the single quotes around the the address.

Removed the single quotes but still not working. Had the same error.

then its probably best to create an issue on https://github.com/skorokithakis/catt

I did see other people cast directly from their http address instead of external (https) in your case:

catt -d ‘Google Cast’ cast_site ‘http://ip:8123/lovelace-hub/begin-hub

also using only single or double quotes for the entire string

Thanks Juan, also tested with the local IP address, but stil no luck :S

But when I check the github, there is also an issue what’s looks like the same errors: https://github.com/skorokithakis/catt/issues/273

why are you using -d? That is used to set defaults.

For using the default device Google Cast (Nest device)

Well think I found the problem was related with the issue on github.
I did an upgrade from catt and now it will cast to my Nest hub.

So the command was just fine but he couldn’t found any cast devices. :ok_hand:

Hi @john2014 I have the cast working. Now I was checking with your options for the script and automation.
I have changed the script and automation with my own cast name and cast site.

But when I run the automation and checking the SSH log I see an error:
This was the first time checking. It told the Nest hub was offline. It was in standby, so when I turned it on that message is gone.
But still get the from line 1, and I don’t know what is wrong.

[15:27:20] INFO: Received external command to execute:
[15:27:20] INFO: > bash /config/configuration/cast.sh
Error: Chromecast is inactive.
/config/configuration/cast.sh: line 1: $'\r': command not found
Casting https://name.duckdns.org/lovelace-hub/begin-hub
 on "Google Nest"...
[15:27:38] INFO: Command completed successfully.

I have 3 Nest Hub, how can i set this up for 3 hubs?

I have edit the cast.sh,

if ! catt -d 192.168.196.210 status | grep 'PLAYING'; then 
    catt -d 192.168.196.210 volume 0
    catt -d 192.168.196.210 cast_site http://192.168.196.156:8123/


elif ! catt -d 192.168.196.144 status | grep 'PLAYING'; then 
    catt -d 192.168.196.144 volume 0
    catt -d 192.168.196.144 cast_site http://192.168.196.156:8123/


elif ! catt -d 192.168.196.111 status | grep 'PLAYING'; then 
    catt -d 192.168.196.111 volume 0
    catt -d 192.168.196.111 cast_site http://192.168.196.156:8123/
fi

but this will not work, i get an error:

20-07-01 15:30:00 ERROR (MainThread) [supervisor.utils] Can't execute write_stdin while a task is in progress

Is the cast.sh exactly the same? Best to also post the commands you did when posting an error. I cant tell what is on line 1 from your post.

The IF command wont work like this I think. If the first cast does succeed, the other 2 wont be cast I think. Try this (the sleep 5 waits a bit, because your error seems to show that there is an issue with some process already doing something)

if ! catt -d 192.168.196.210 status | grep 'PLAYING'; then 
    catt -d 192.168.196.210 volume 0
    catt -d 192.168.196.210 cast_site http://192.168.196.156:8123/
fi

sleep 5

if ! catt -d 192.168.196.144 status | grep 'PLAYING'; then 
    catt -d 192.168.196.144 volume 0
    catt -d 192.168.196.144 cast_site http://192.168.196.156:8123/
fi

sleep 5

if ! catt -d 192.168.196.111 status | grep 'PLAYING'; then 
    catt -d 192.168.196.111 volume 0
    catt -d 192.168.196.111 cast_site http://192.168.196.156:8123/
fi

Hi John,
Yes the code is exactly the same. Only changed with the name and cast site

if ! catt -d "Google Nest" status | grep 'PLAYING'; then 
    catt -d "Google Nest" volume 0
    catt -d "Google Nest" cast_site https://name.duckdns.org/lovelace-hub/begin-hub
fi

How did you create the cast.sh file? Did you do it in windows? I think there are hidden characters in it. If you are using Windows, try editing the file with Notepad++

thanks, but with “sleep” it dont work. I have it now with “wait”, so it will wait until the first command is finished and the go to next. Now it is working.

#!/bin/bash

if ! catt -d 192.168.196.210 status | grep 'PLAYING'; then 
    catt -d 192.168.196.210 volume 0
    catt -d 192.168.196.210 cast_site http://192.168.196.156:8123/
fi

wait

if ! catt -d 192.168.196.144 status | grep 'PLAYING'; then 
    catt -d 192.168.196.144 volume 0
    catt -d 192.168.196.144 cast_site http://192.168.196.156:8123/
fi

wait

if ! catt -d 192.168.196.111 status | grep 'PLAYING'; then 
    catt -d 192.168.196.111 volume 0
    catt -d 192.168.196.111 cast_site http://192.168.196.156:8123/
fi
1 Like

Yes I created the file in Windows. After looking it up on the internet it has to do with the format.
Had to change te format in Notepad++ to unix format and then the script doesn’t give any errors anymore.

Thanks for the help.

3 Likes

Is anyone else having issues using Catt to set the volume. I can mute the volume fine but when I use the same command to turn it back up with a number. It doesn’t turn the media volume back up but a different one?

Edit: So you don’t need to read all this if you aren’t having issues, It turns out having one instance of home assistant in dark mode (For me it was a stand alone tablet in dark mode) will cause the black screen with start button. Thanks!

I’m new to all of this but I managed to get CATT to work, now I’m also stuck on the black screen with a home assistant logo at the top and the blue “START OVER” button just floating there.
I’ve been reading and reading and this page seems to be all over the place so I figured I would ask plainly with as much information as I can…
I have CATT installed and working to cast a website like google site to my
two Google Home Hub (original ones) from my Raspberry Pi 4 using the following:

`catt -d “NAME_OF_DEVICE” cast_site google site (I can’t post many links in my post as i’m fairly new so from now on, I’m just going to space out the http or https at the start of links)
So, That works.

I am using Home assistant Cloud if that matters

I have the following in my home assistant configurtion.ymal

homeassistant:
  auth_providers:
    - type: trusted_networks
      trusted_networks:
        - 192.168.2.25
        - 192.168.2.27
      trusted_users:
        192.168.2.25: USER ID # HERE 
        192.168.2.27: USER ID # HERE
      allow_bypass_login: true

The Trusted users ip is the ip associated to my actual google home hubs.
Now, I have 3 users under my users tab in home assistant… {Hassio , Home Assistant Cloud, and My name) I’ve gone in and used the actual user ID number associated with the user names. I’ve tried all 3 putting the same one under each trusted users and restarting the server each time being advised that the configuration is valid. I then go to terminal and put in the following:
Either…

catt -d “NAME_OF_DEVICE” cast_site
h t t p s ://MYHOMEASSISTANTCLOUDNABUCASA linkthatisonthehomeassistantcloudinformation/lovelace/0 (Goes to the black screen with a home assistant logo at the top and the blue “START OVER” button just floating there)

Then for my custom lovelace ui:

catt -d “NAME_OF_DEVICE” cast_site
h t t p s ://MYHOMEASSISTANTCLOUDNABUCASA linkthatisonthehomeassistantcloudinformation/lovelace/home-oberview/lights (Goes to the black screen with a home assistant logo at the top and the blue “START OVER” button just floating there)

or

catt -d “NAME_OF_DEVICE” cast_site
h t t p s ://MYHOMEASSISTANTCLOUDNABUCASA linkthatisonthehomeassistantcloudinformation/lovelace/home-oberview (Goes to the black screen with a home assistant logo at the top and the blue “START OVER” button just floating there)

or

catt -d “NAME_OF_DEVICE” cast_site
h t t p ://MYHOMEASSISTANTCLOUDNABUCASA linkthatisonthehomeassistantcloudinformation/lovelace/home-oberview (This results in the forced loading Dash cast screen)

Or using the local

catt -d “NAME_OF_DEVICE” cast_site
h t t p ://homeassistant.local:8123/a0d7b954_ssh which results in the hub going to Dash cast then making a couple tones and returning to the Hub home screen…

Or using the

catt -d “NAME_OF_DEVICE” cast_site h t t p ://192.168.2.210:8123/lovelace/0 (which is the actual local IP) which gives me something new… the black screen with Home assistant logo and User with a down arrow and the blue NEXT button… The screen won’t let me tap on anything but the next button which then goes to black screen with logo and “Error: Something went wrong” in red.
This same error shows up with taking the 0 out of the link, and taking the lovelace/0 out of it, and having it end with just the port.

Are you all sick of reading this yet? Sorry….

Basically, This thing just refuses to work for me. I think I’ve put in all relevant information and I hope someone can help me as all the links and posts I’ve looked at so far have not been able to.

Thanks!

To start off, I am confused by "I am using Home assistant Cloud if that matters* as there is no need to use the Cloud when you are using CATT.

But lets see if we can get you going:

Solution direction 1:
Based on this part

"catt -d “NAME_OF_DEVICE” cast_site h t t p ://192.168.2.210:8123/lovelace/0 (which is the actual local IP) which gives me something new… the black screen with Home assistant logo and User with a down arrow and the blue NEXT button… The screen won’t let me tap on anything but the next button which then goes to black screen with logo and “Error: Something went wrong” in red. "

I think its just a matter that you dont see the Select networks drop-downlist because you are using a dark theme. I also had this at first. I then switched to a light theme and did see the dropdown. The drop down is under the NEXT button, You can see an example here.

Solution Direction 2:
I personally dont use Users for the trustednetwork part.
Perhaps if you first try something like this:

homeassistant:
  auth_providers:
    - type: trusted_networks
      trusted_networks:
        - 192.168.2.0/24

Which would trust all devices on your network. And then cast a LOCAL non SSL page using the IP Address and see what happens. If this works, then at least you know that it has something to do with trusted networks.

1 Like