Using CATT

Thanks for taking the time to explain this and write out the detail. It lead me to a solution for my setup with duckdns addon after a few hours of fiddling.

The main thing was to map a new domain to my local hassio ip (as I had most of the other steps already in place)

1 Like

Nice… Working! Was stuggling with getting my commands working, but this does the job!

1 Like

Catt seems to play well with the Browser_mod media player and the Google Assistant Webserver. For example, you can cast your lovelace frontend to your Google hub, then play a seperate audio with Browser mod. Then you can send audio notifications (broadcasts) to the hub and it won’t interupt the music playing. In fact you can set your hub to show the broadcast text on the screen.

1 Like

Okay I have a problem, I installed Catt and after running the command I get an error:
Running HA on a pi.

Could some one told me what’s wrong?

Traceback (most recent call last):
  File "/usr/bin/catt", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python3.8/site-packages/catt/cli.py", line 570, in main
    return cli(obj={}, default_map=get_default_map())
  File "/usr/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/usr/lib/python3.8/site-packages/catt/cli.py", line 235, in cast_site
    cst = setup_cast(settings["device"], controller="dashcast", action="load_url", prep="app")
  File "/usr/lib/python3.8/site-packages/catt/controllers.py", line 144, in setup_cast
    cast, cc_info = get_cast(device_name)
  File "/usr/lib/python3.8/site-packages/catt/controllers.py", line 92, in get_cast
    cache = Cache()
  File "/usr/lib/python3.8/site-packages/catt/controllers.py", line 222, in __init__
    devices = get_chromecasts()
  File "/usr/lib/python3.8/site-packages/catt/controllers.py", line 45, in get_chromecasts
    devices.sort(key=lambda cc: cc.name)
AttributeError: 'tuple' object has no attribute 'sort'

Sorry to reply on an old post but does your google home make the alert noise every 10 minutes or is there a way to disable as could see that getting a bit annoying?

(see this link for install instructions)

yes, i was also getting the beep every 10 minutes, to solve it, i created this in the cast.sh file that I now use:

if ! catt -d "Living Room display" status | grep 'PLAYING'; then 
    catt -d "Living Room display" volume 0
    catt -d "Living Room display" cast_site http://192.168.178.87:8123/lovelace-test/0
fi

It checks if anything is playing, then it wont cast. If nothing is playing, it turns the volume off and casts the screen. I just leave the volume off. Whenever I say “ok google” the volume goes back on anyway. you could turn the volume back on after the cast, but that also makes a sound.

The automation I use to cast the cast.sh file is:

- id: '1589529246400'
  alias: CastToHub
  description: ''
  trigger:
  - minutes: /10
    platform: time_pattern
  condition:
  - after: '5:00'
    before: '23:30'
    condition: time
  action:
  - data:
      addon: a0d7b954_ssh
      input: bash /config/cast.sh
    service: hassio.addon_stdin
5 Likes

Can you also give “the command” that you mention?

Yes sure. The command is:
catt -d “Google Cast” cast_site ‘https://name.duckdns.org:8123/lovelace-hub/begin-hub

Tried alsof without the port number.

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.