Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I get the uuid of a chromecast device? #14090

Closed
marcus13371337 opened this issue Jul 26, 2020 · 9 comments
Closed

How do I get the uuid of a chromecast device? #14090

marcus13371337 opened this issue Jul 26, 2020 · 9 comments
Labels
Stale The PR had no activity for quite some time, and is marked as Stale

Comments

@marcus13371337
Copy link

The problem

Previously (< 0.113.1), when adding a specific list of cast devices to the cast integration you were supposed to provide the ip-address to the device (by setting the host attribute in the configuration). Now when I booted up 0.113.1, I got the message that the host attribute is deprecated and supposed to be replaced by the uuid. As I have no idea how I can find the uuid of a cast device I went to the documentation for the cast integration, but I couldn't get any information on how I could find such uuid. Would it be possible to add some kind of explanation on how you could find this uuid?

Also, I noticed that the example in the manual configuration also refers to the deprecated host attribute

@brandoncorry
Copy link
Contributor

Also curious how to go about the same. I was initially confused by the example showing the deprecated host attribute as well. Hope someone can update the documentation and include a couple ways/best way to get UUIDs.

@Smoetzak
Copy link

Any update on this? I am wondering as well.

@OzGav
Copy link
Contributor

OzGav commented Sep 6, 2020

Me three

@IQndk
Copy link

IQndk commented Sep 10, 2020

Same. My integrations does not discover any of my 3 Chromecasts.
And none of the old configurations are working.

@wwilsman
Copy link

wwilsman commented Oct 5, 2020

Hey guys! I took a dive and figured this out! Home Assistant uses a python library, PyChromecast to interact with Chromecast devices. You can see in their example that you can query for Chromecasts by friendly name, then print the resulting UUIDs.

I’m no python expert, so I wonder if there is a one-liner we might be able to use to accomplish this. I ended up using the python REPL to print the UUIDs and copied them over to my secrets file. Here are the steps I took:

  1. SSH into home assistant. (You can do this on your local machine if you prefer. I used an addon that comes with a terminal and did this all from the web interface)

  2. Install PyChromecast: $ pip install pychromecast

  3. Enter the python REPL: $ python3

  4. Type the following (replacing the list of friendly names with your actual Chromecast names):

    import pychromecast
    print(pychromecast.get_listed_chromecasts(friendly_names=["Living Room TV", "Bedroom TV", "Office Chromecast"]))

Since PyChromecast comes with HA, I wonder if we can skip step 2 by being in the correct docker container?

In any case, I hope this helps y'all along with anyone else finding this issue!


Editing to add: you can execute python inline with the -c flag. So you should be able to do something like this in lieu of steps 3 & 4 above: $ python3 -c "import pychromecast; print(pychromecast.get_....."

@OzGav
Copy link
Contributor

OzGav commented Oct 5, 2020

LEGEND!!! Can't believe the docs don't explain how to do this.

I can also confirm if you have access to the HA docker container then step 2 is not required.

Thanks for solving this issue.

@OzGav
Copy link
Contributor

OzGav commented Oct 5, 2020

I have added a pull request to the docs to incorporate this. See if it gets approved...

@Smoetzak
Copy link

Smoetzak commented Oct 6, 2020

Works like a charm!

Mind the name is case sensitive!

Thanks for figuring this out!

@github-actions
Copy link

github-actions bot commented Dec 5, 2020

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved.
If this issue is still relevant, please let us know by leaving a comment 👍
This issue has now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale The PR had no activity for quite some time, and is marked as Stale label Dec 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale The PR had no activity for quite some time, and is marked as Stale
Projects
None yet
Development

No branches or pull requests

6 participants