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
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
.
Probably a restart of your HA instance is needed.
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)
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.
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)
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
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.