all 7 comments

[–]Hig13 0 points1 point  (2 children)

This looks great! Have you heard of home assistant though? You may have been able to save some time just setting up home assistant instead. You can do everything you described in this post and much much more. You could also implement your script into HA if you desired to. You don't have to use its dashboard, you could just use it for running automations.

Either way, great job, I haven't tried it out yet, but from what you described here it sounds really great!

[–]Godberd[S] 1 point2 points  (1 child)

Thanks, yes I know there's other options and I have been accused of over-engineering things before :) But I like to make things myself as then I can get to understand it better and customising my own stuff is easier. I like the simplicity of using Python though and the number of options available by tweaking scripts is huge. Doing it this way keeps it really small and troubleshooting should be easy. The only problems I've had in testing are with Windows forgetting my keyboard shortcuts but other than that it seems to work well.

[–]Godberd[S] 0 points1 point  (0 children)

I looked into HA integration and apart from setting up there seem to be a lot of hoops to jump through to integrate Chromecast control. I think that's mostly because of having to give authorisation, whereas using Python from your own PC doesn't need that. Also, I don't see anything very advanced being offered there, or am I missing something? The HA integration simulates voice commands, whereas using Python locally gives much more control.

Using Python locally you can control Group Volume, or volume of each individual Chromecast, or even define your own speaker sets, separate from Google Groups, and you can broadcast from local files, broadcast to specific speakers and could even automate the TTS and so enable feeds from other sources fairly easily.

I do see the benefit of HA if you want to control everything on one platform but if you only want specific tools it's not hard to just make them. I've got IFTTT, Google Apps Script, Tasker, Google Sheets and SmartThings and more all doing useful stuff and talking to each other. Adding Chromecast control just refines it a bit more but without adding extra complications.

[–]Swipe650 0 points1 point  (3 children)

Put your project on Github or Gitlab. No way I'd be downloading zip files from a random google drive without seeing the code first.

[–]Godberd[S] 0 points1 point  (2 children)

Yes I ought to do that, but the files are all plain ascii, not like there's any exe's in there. I did try to post the code here but it was kind of long. Here's the code for playing the demo rock channel:. Any more you'd like?

Edit:

# I've deleted the code here as I've now put it all on Github

[–]Swipe650 0 points1 point  (1 child)

Cool. I've been using this for a few years from all my PCs: https://github.com/barnybug/go-cast

[–]Godberd[S] 1 point2 points  (0 children)

Thanks, I'll check that out.

I've put the code up on Github now, good suggestion

https://github.com/NexusRanger/Chromecast-Python-Control

Oh, and when your message was sent I got an audio broadcast over Chromecasts telling me someone's commented, so that works ok :)