in today's video we're going to have a look at how
to cast our lovelace dashboards to our google cast devices check it out
what's going on guys i hope you're all doing well so casting dashboards what is it and what does it
do well it's pretty much exactly what it sounds like it's going to allow you to cast a specific
view from one of your home assistant dashboards and just cast that on over to a supported google
device and whether that's a google nest hub or a google chromecast you'll be able to see that set
view on that display and just so we're on the same page here and pun not intended when i say view
what i actually mean is the set page so the actual view that you can see in your dashboard so for
example i've got my demo dashboard here so demo is the name of the dashboard and then inside of
that dashboard i have multiple views you can kind of think of those views as individual pages so a
dashboard contains multiple views and it's these views that will be cast into our google devices to
get started with this video you're obviously going to need a supported google device in this video
i'm going to be making use of a google nest hub gen 2 but you can use any google device that has a
screen and in the case of chromecast you can cast the view to the display but i'm not sure if you
can interact with that casted display just because i don't have a chromecast to test this out on if
you do have a chromecast and you do test this out let me know if you can do those interactions it'd
be cool to know the other thing you'll need is to have your home assistant accessible via https
if you're making use of the home assistant cloud then this is already automatically handled for you
and if you're not then you'll need to set up and configure your external url and if you're not
sure how to do that i'll have a link to this page in the description below so go ahead and follow
those config steps and if you've got those things then we should be good to go so let's get straight
into it if you haven't already you'll need to set up the google cast integration by default
home assistant will just automatically detect any google cast devices on your network and prompt you
to set up this integration when you hit configure it should just automatically pull in any google
devices that you have if you are configuring this for the first time and you hit configure and it
only finds one device just give it a couple of minutes because it's just automatically detecting
any of the devices and if you refresh the page it should just find any extra devices that you have
if you've got the cast integration set up and installed then you're pretty much 90
of the way there i'll just quickly show you how you go about getting the urls for your dashboard
and views and then we'll have a look at some demos and automations getting the url for your dashboard
and views is quite straightforward up at the top in the address bar you'll have the ip address
and the port number for your home assistant instance followed by that you'll have the name
of the dashboard and followed by that you'll have the name of the view so in this case here this
dashboard i'm on now is called lovelace demo and the view that i'm in is home you assign the name
to the dashboard in the dashboard settings in the configuration menu but if you wanted to change the
name of the view or give a view a custom name you can do this by just going into the edit menu so up
at the top click the top three dots and then click edit dashboard you'll then see a little pencil
next to the view that you're currently in and if you select that pencil it'll give you the options
to modify the name so if we select it we can see we've got the title there which is displayed at
the top of the page then you'll see you've got an option here for url and whatever you set here will
be the name of that url and it will be this that you use to call your view in my case i've set this
to home and i'm just going to leave it as that for the purposes of this demo and you can see here in
my next view along which is titled door i've also give that an optional url of door so we know how
to get the urls for our dashboards and views now let's have a look at how we go about casting them
to do this we're going to have a quick look at the developer tools so on the left there we're going
to choose developer tools then up at the top we're going to press services and from here we're going
to need to enter our service the service that we're interested in is called show love lace view
so if you select the service box and start typing cast you should see the list start to populate and
the one that we're interested in is this cast show love lace view so we're going to select
that and from here we just need to provide it with three different parameters the first one is
the entity that we're going to cast to so this is going to be our media player and in my case
it's that google nest herb so if you select the entity drop down it should present you with a list
of all the different entities that are capable of casting and in my option here i've got the
nest hub and i've got the nest mini obviously the nest mini doesn't have a screen so there's
no point using that one so i'm going to select the office display here which is the nest herb
the next parameter is going to be the dashboard path so this was the first part of that url and in
my case i know that it's just called lovelace demo so i'm going to enter that here and then the final
parameter is the view path so you just need to select the box here and then just provide it with
the name of your view and in my case i know that it's called home so i'm just going to enter that
there and with all of those entered we should now be able to hit this cool service button and see
that cast to our display if you're close to your display you'll hear that little ping sound and
you'll know that it was successful then after a second you should see that dashboard flash up and
you'll be able to see the view so that worked for me and i can see that view casted onto my device
and as it's a touch screen if i wanted to i could control these entities so i could turn
on and off those lights or adjust those toggles and that really is all there is to casting just
that simple service call and because it is just a service call you can easily convert this into an
automation or script the way that i've been making use of casting is by creating some simple scripts
to cast specific views then by making use of the home assistant cloud i expose these scripts to
the google assistant and by doing this i can then make use of those scripts within google routines
and then i can set up routines based on specific voice commands then i can say things like
hey google cast lights then i'll hear the little ping and it will show me that specific view
now before you run away to start casting all of your views there are a couple of little gotchas
that you need to know about with cast in the first one being is that that casting session
remains open so if you followed along with that dev tools demo you will have hopefully been
able to cast your specific view to your google device so in my case i casted it to the google
nest and if i was to close this on my nest hub by just swiping left then try and cast another
view to it you'll notice that it'll just stay on this google screen and that's because it's got a
previous session open already there's a couple of different ways around this issue you could
manually go into the integration and just turn off the media player that's currently cast in
you could do a manual service call using the developer tools for mediaplayer.turn off
and again select that target or you can just do what i've done and just create a little script and
then expose this script to the google assistant so you can call that with your voice and what
this does is it just does a service call which calls the media player that turn off and then i
just target my nest herb then from the google app i just create a routine called stop casting and i
have the voice command of stop casting that way when i say it to google it will just immediately
stop that casting session and if you just remember that when you've started casting when you finish
you need to stop then you shouldn't really run into any issues as well as manually triggering
casting or triggering it from a script you can of course trigger it from automations and this can
lead to some pretty creative results one that i've been trying to get work is to trigger a view that
contains some camera feeds so when the cameras detect motion they automatically start casting
to a specific display my idea for this was to use this with a doorbell camera or a camera in your
garden and then if the camera detected anybody it could just automatically start a casting session
and you'd be able to see who's at the door or who's in the garden i have had some success with
this where i've been able to view the camera feed on my nest herb but it hasn't worked reliably more
often than not it fails and it will either have a laggy stream or the stream just won't load at all
i currently don't have many cameras that are set up and also in home assistant so
i haven't done all that much testing to find out if it's the specific camera that i'm using
or some kind of network setting if i do manage to get it working reliably or in a future update
it just magically starts working then i'll definitely be doing a video on it and there
we go guys that's been a quick look at cast in if you have enjoyed this video then don't forget to
drop me a like and if you're not already hit that subscribe button and ding dong the notification
bell you'll then be alerted to any future video that i do as always a massive thank you to these
awesome dudes these awesome dudes my patreons if you're interested in helping support my channel
which in turn allows me to create videos like this then you'll find a link to my patreon in
the description below thank you for watching and i'll catch you in the next one cheers you