Chromecast integration, Thanks HE Team!

I have modified the drivers that were ported over to add some functionality. For volume control, the setLevel command has to be modified to the hubitat method which doesn't just pass the level but the fade time as well. Plus there were a few other functions as well that were added but as built, the driver works fine. The latest version of cast-web is built using the latest release version of node rather than the older version. So, that might have been part of your problem. I am not using it though hublink it is linked to Hubitat.

Hi,

I would like to know if my TV is switched on and I thought of using the Chromecast which is powered from the TV's USB out.

Would be possible to add a "online" attribute please?

Thanks,

Mark

2 Likes

@mike.maxwell - Is it possible to add next / previous track to the chromecast integration? - if so please add this to the list!

What action would you want performed on the Chromecast when you do this? It doesn't support "playlist" functionality. The playlist is on the device that you are using to cast from.

The chrome cast api supports a media queue - is that what you mean by playlist?

Either way it is possible to skip to the next track for sure: Class: RemotePlayerController  |  Cast  |  Google Developers

Adding nextTrack() and previousTrack() would also bring the driver one step closer to supporting most of the Music Player capability.

As it stands now, the play() and pause() commands don't really seem to be tied to any capability - having them tied to a capability would make it easier and cleaner to expose them to apps in a meaningful way.

Attributes Device Music Player Mirrors
level :white_check_mark:* :white_check_mark: volume
mute :white_check_mark: :white_check_mark:
status :white_check_mark: :white_check_mark:
trackData :white_check_mark:
trackDescription :white_check_mark:
Commands Device Music Player
mute :white_check_mark: :white_check_mark:
nextTrack :white_check_mark:
pause :white_check_mark: :white_check_mark:
play :white_check_mark: :white_check_mark:
playText(text) :white_check_mark:* :white_check_mark: speak()
playTrack(trackuri) :white_check_mark: :white_check_mark:
previousTrack() :white_check_mark:
restoreTrack(trackuri) :eight_spoked_asterisk: :white_check_mark: playTrack()
resumeTrack(trackuri) :eight_spoked_asterisk: :white_check_mark: playTrack()
setLevel(volumelevel) :white_check_mark:* :white_check_mark: setVolume()
setTrack(trackuri) :eight_spoked_asterisk: :white_check_mark: playTrack()
stop() :white_check_mark: :white_check_mark:
unmute() :white_check_mark: :white_check_mark:

:white_check_mark:* clear direct mappings to existing attributes/commands
:eight_spoked_asterisk: could use other commands as a proxy (eg. playTrack())

2 Likes

Just ordered my hubitat. I use tasker and ifttt mainly for my automation using Rf and ir hubs (broadlink) Touched on Home assistant for a while which showed promise but got a corrupt image and had problems connecting to it even after reinstalling and wasted lots of time... So here I am hoping to incorporate hubitat and my first lot of zwave/zigbee

So get to the point I hear you... I'm hoping to detect if a chromecast or a group is playing and then act on that (command one of my broadlink rm pro to change the receiver channel). Is it possible to detect the status of a chromecast in hubitat or is the compatibility more just for casting and controlling a chromecast?

I’m not sure exactly, but my Google Home devices using the inbuilt chromecast app/driver all show a ‘status’ of idle or running whether they are speaking or not.

They also have a ‘mediaSource’ attribute which shows as ‘Hubitat’ when I’m using them with TTS or None when silent
So I would think it would be easy to action on either of these two driver attributes.

Edit.
As I don’t use my GH devices for anything other than tts I can’t advise on what they show when playing music etc.

Andy

1 Like

Oh sounds positive. I only ordered the hubitat today so I'll look into this when it arrives (I'm on Australia so it may be a while).

Is it possible to get the current playing song? useful in dashboards..
image

1 Like

Hubitat is not a multimedia remote control. I would rather have Hubitat working on Home Automation improvements to the hub rather than making this a universal remote control for your google home speakers. Especially since you are talking about a device you can control from another app on the device in your hand. Have we become that lazy that we don't want to change apps?

1 Like

I couldn't see how to get the status of my chromecast, it just stayed as idle. The status of a chromecast should change when playing google music, YouTube, netflix etc yes? The play button didn't seem to work when I added the multimedia tile.

I was hoping to trigger a few things when something started playing.

Did you try "refreshing" the device while it was playing?

I think so... Because I usually do that. Let me check it more thoroughly over the weekend. I just wanted to check to see if this behaviour was normal but seems like it's not.

I don't want to control the CC i want to have a quick glance of who / what song is playing.. without having to pull my phone out, the dashboard is on the tv above my desk.. your use cases may not apply, but im guessing many other peoples do..

3 Likes

And I'm saying that is not what Hubitat was designed for. And not what I think the developers should devote their time to. Your entitled to want the feature and I'm entitled to think it's a waste of time. That's the great thing about opinions. EVERYONE is allowed to have them.

1 Like

This is working for me with my Sonos. The music player template displayed the current metadata. In this case it's the track, artist and album. So it seems that functionality could be included. Have you filed a Feature Request?

16%20PM

Yeah, right. Nonsense. You have Cast-Web-API running for these same and other reasons, so there's no reason to talk that way to another member who is just asking about a feature he wants that you've found another (complex) way to get.

I second the desire to have this feature (and I too use Cast-web, BTW) eventually. So count me as another vote FOR "this is what Hubitat is designed for and what developers should spend time working on" The fact that it is a standard feature of the sonos and cast-web devices is evidence enough that it is an implementable feature here as well and would be a natural fit. No need to pretend to be the arbiter of what definitively is and is not worth someone's time or "what a device is for." The device is for what we bought it for. Enjoy your opinions, though.

3 Likes

Currently, this isn't a feature of the native CC support in Hubitat. but Cast-web, which was originally developed for SmartThings, and has been ported over to Hubitat works well enough to get it on your dashboards.

The native CC support beware: non-strictly technical terms ahead isn't implemented as a music player device type, so instead of following that template and passing every possible attribute and control through, it is basically just a custom multi-variable device type which contains a subset of them. In short, it's a bit stripped down, and if it were implemented as a music player currently, too many of the features wouldn't work, and it would be confusing.
(People would be clicking the skip track button and posting questions about why doesn't it work, etc.)

Cast-Web is a pretty neat API/app/device that brings a lot of the features you're looking for, if you're not familiar with it.
Cast-web can be found here, on Hubitat, and it's a bit of a rabbit hole (you have to have a separate server, for which many people use a raspberry pi or an old PC. I use a container running on a QNAP NAS I already had). But if you decide to give it a try, there are quite a few of us using it, and we should be able to help you out.

Like you, I have dashboards in rooms that I like to have music status, playback controls, volume controls, etc. integrated into. FOR ME...the point of home automation is to tie in the things I want my house to do, and control it all seamlessly from the most convenient places in my house, and for me that includes full featured dashboards. I'm glad I don't leave it up to someone else to tell me what my home automation system is for.

I'm running Sharptools as my dashboards because I'm a tinkerer for fun and a designer for work, but I also maintain built-in Hubitat dashes for quick pocket control.

Here's a small thread about getting these features where I wanted them, which just led to me continuing with the use of my already-running cast-web from ST days. As you can see, there is active discussion about getting these features going, and it's come up as a topic a few times before.

Hopefully any of that is helpful to at least get up to speed with the state of things. If we're not attempting to help each other figure out what makes our experience better, what are we doing here, right?

3 Likes

I recently started mucking about with Docker. What container are you using for this?