[HOWTO] Cast your Home Assistant dash via LAN to your Google Hub(s)

Hi ladies & gents,

I couldn’t find a topic about this, so I wanted to share this howto with y’all:
How to cast your Home Assistant dashboard to your Google Hub(s).

In HomeAssistant, you can add the network IP addresses of your hub(s) and HA instance, combined with your (or a user) ID, to create a login without having to enter the, or your, credentials.

Note: this changes the manual logins for any device to the auto-login method;

You can enable it for your subnet (easier, less safe), or you can enable it for every single allowed device IP

  1. Add this code to your HA configuration.yaml (assuming your subnet starts with 192.168.)
homeassistant:
  auth_providers:
    - type: trusted_networks
      trusted_networks:
        ### Choose: pick a whole subnet (less safe), or pick specific device IP('s) which are allowed to auto-login
        ### When uncommented, this allows your devices' subnet (so any device is allowed to auto-login):
        #- 192.168.x.x/24 
        ### This allows your specific devices to auto-login:
        - 192.168.x.x ## your deviceA IP
        - 192.168.x.x ## your other deviceB IP
      trusted_users:
        #192.168.x.x/24:  123xxxxxxxxxxxxxxxxxxxxxxxxxxx9z 
        ### the user id, from any HA instance on your subnet (less safe)
        192.168.x.x:   123xxxxxxxxxxxxxxxxxxxxxxxxxxx9z 
        ### the user id, from a specific HA instance
      allow_bypass_login: true

# The user id can be found here:  http://homeassistant.local:8123/config/users

.

  1. Probably a restart of your HA instance is needed.

  2. Now you should see the screen below, after you pick the Chromecast app card “Cast a webpage”, and enter http://192.168.x.x:8123/lovelace.../..... (8123 is the default HA port number, just copy/paste the URL of your favo dash page here).

.
This might also come in handy for displaying the dash in a browser on a tablet. After entering the HA url, it should show right away (if the tablet IP is in the listing, or if you enabled a subnet)

Have fun
~Peter

3 Likes

Fixed some things, now no interaction is needed :facepunch:t2:

1 Like

Very nice! what device do you use for freezer ?

Thanks! I use standard Aqara Temp/Hum sensors. Only battery drains a bit faster in freezer🙃

1 Like

Can’t get this to work.
Can you help?


Hej Torbjorn,

The necessary leading whitespaces are missing in front of trusted_users and allow_bypass_login
The (number of) whitespaces before the text are critically important.

Please take a look at my example code again and compare.
Screenshot from 2023-05-31 15-43-17

should be identical now, but getting an error.

The last line (42) has no indentation.
When you add 4 whitespaces in front of allow_bypass_login, both errors should disappear.
(The gray-ish dots in my and your screenshot represent whitespaces)

can’t believe i missed that.

still doesn’t work though

I can’t see what’s still wrong here… .
Can’t you save it anyways and run the check config?

I can, but I get the same errors that I posted earlier.

OK, I was fiddling a bit, this seems to work. Those leading whitespaces really are the curse of HA :crazy_face:
(I’ll adjust my earlier posted code)

CopyPaste code:

homeassistant:
  auth_providers:
    - type: trusted_networks
      trusted_networks:
      #- 192.168.x.x/24 ## your devices' subnet (where you want to login) # pick a whole subnet (less safe), or (a) specific device IP('s)
      - 192.168.x.x ## your device IP
      - 192.168.x.x ## your other device IP
      trusted_users:
        #192.168.x.x/24:  123xxxxxxxxxxxxxxxxxxxxxxxxxxx9z ### the user id, from any HA instance on your subnet (less safe)
        192.168.x.x:   123xxxxxxxxxxxxxxxxxxxxxxxxxxx9z ### the user id, from a specific HA instance
      allow_bypass_login: true

Thanks. I’ll try again when I get home tomorrow.
Yeah, the spaces seem highly problematic :sweat_smile:

1 Like

Well, It seems to be correct now, but I can’t get it to work on my Google nest hub. Any pointers?

Edit:
Never mind. Forgot to add http:// to the cast link. Works now.

Thank you for your help on this!

1 Like

Nice to hear it works now. Have fun with it!

Thanks again.

I found that this feature removed the oppurtunity to open HA via the normal ‘homeassistant.local:8123’.
So I had to add all my devices like laptops, phones and tablets to be able to open HA from all my devices.

Ah true that. I will adjust my how-to, thanks!
I just added my subnet for any device to login

Still have to use the ip-adress it seems, but not a problem really

Hmmm… Did you restart HA?
Works here with subnet only.

I adjusted the how-to, is it better / clearer this way?

yes, did restart.

I get this when trying localhost
login