This guide puts any web page you choose on a Google Nest Hub, full screen, as your own small Cast app. Touch works, so you can tap buttons on your dashboard. It can speak, so your automations can say things like "The car is on its way home, about 20 minutes out". And it stays on screen instead of falling back to the photo frame after a few minutes.
I built this for the two Nest Hub Max displays in my own house, after casting a dashboard with the usual tools kept letting me down: the Hub blocked sound, and every announcement had to switch apps, which dropped the connection and sometimes left the screen stuck on a casting logo for hours. It's tested end to end on a Nest Hub Max. Everything runs on your own computer and your own home network; the only outside service is a $5 one-time Google developer registration.
Why casting a website to a Nest Hub falls short
A Google Nest Hub has no web browser and no kiosk mode. The common workaround is to cast a web page to it with a tool like DashCast (used by CATT and several smart-home apps). That shows the page, and touch works, but two things go wrong:
- No sound. The Hub blocks a web page from playing sound until someone touches it (the error is
NotAllowedError: play() failed because the user didn't interact with the document first). Playing an announcement anyway means switching the Hub to Google's media player, which often drops the connection and can leave the screen stuck. - It doesn't stay up. The Hub ends the cast after a while, and saying "Hey Google" replaces it.
The fix is a Cast app of your own, called a custom receiver. Google lets anyone register one for $5, and an unregistered ("unpublished") one may run on your own Hubs straight from your home network. A Cast app is allowed to play sound without a touch. The catch is touch: in your own app, the Hub doesn't pass taps to the page by default. It only does that while the app has a media session open, and it puts an invisible touch layer on top. So the app keeps a tiny media session open, renewing a blank image every 9 minutes because the Hub ends it after about 10, and it hides the Hub's touch layer. That's the same approach Home Assistant Cast uses, packaged here so it works with any web page.
You get two files: receiver.html, the Cast app that runs on the Hub, and nesthub.py, a small program you run on your computer to start it, show your page, and speak.
What you need
- A Google Nest Hub, Nest Hub (2nd gen) or Nest Hub Max, set up in the Google Home app. I tested on the Nest Hub Max; the others run the same Cast software and should behave the same, but I haven't tested them.
- A computer that stays on, on the same Wi-Fi network as the Hub: a Windows PC, Mac, Linux box or Raspberry Pi. The Hub loads the app from it every time, so if it's off, the app can't start.
- Python 3.11 or newer (free) on that computer. Step 2 installs it.
- $5 and a Google account for the Google Cast SDK Developer Console, a one-time fee. Any Google account works; it doesn't have to be the one your Hub is set up with.
- About 10 minutes in front of the Hub at one point, to read its serial number off the screen and to restart it.
- Your dashboard's web address, if you already have one. It must open on another device on your network without signing in. If you don't have one yet, you can still do the whole guide: the app comes with a test screen.
Give the computer a fixed address. The Hub finds the app by the computer's local IP address (like 192.168.1.50). If your router hands it a different address later, the app stops loading. In your router's settings, look for DHCP reservation (sometimes "address reservation" or "static lease") and reserve the current address for this computer.
Setup, step by step
Steps 1 to 10 are needed. Steps 11 and 12 are optional. Google, Windows and Python update their screens often; if a button is worded slightly differently from what you see here, look for the closest match. Commands are shown for Windows; on a Mac or Linux, type python3 where it says python.
1Find your computer's IP address and make a folder
- Windows: press the Windows key, type
cmd, and open Command Prompt. Typeipconfigand press Enter. Under your Wi-Fi or Ethernet adapter, the IPv4 Address is your computer's IP address. If you see several, ignore any listed under vEthernet, WSL, a VPN or Tailscale; use the one under Wireless LAN adapter Wi-Fi or Ethernet adapter Ethernet. Mac: open System Settings → Wi-Fi → Details next to your network and look for IP address. Linux: runhostname -I. - Write it down. It usually starts with
192.168.or10.. This guide uses192.168.1.50as the example; use yours instead everywhere. - Make a new, empty folder for this project, for example
C:\nesthubon Windows or a folder callednesthubin your home folder on a Mac.
You should now have an IP address written down and an empty folder.
Use this folder only for these files. In Step 4, everything in it becomes readable by any device on your home network.
2Install Python and two add-ons
- Windows: install Python from the Microsoft Store (search for Python and pick the newest version, 3.11 or higher), or from python.org/downloads. If you use the python.org installer, tick Add python.exe to PATH on the first screen. Mac: install it from python.org/downloads. Linux and Raspberry Pi: it's usually already installed.
- Open a new Command Prompt (Mac: Terminal) and run:
python -m pip install pychromecast gTTS
The first add-on, pychromecast, lets your computer talk to Cast devices. The second, gTTS, turns text into speech for announcements. The command should end with Successfully installed .... If it says python isn't recognized, close the window, open a new one and try again; if it still fails, reinstall Python with the PATH box ticked. To check your version, run python --version: it must say 3.11 or higher.
On a Raspberry Pi, Linux or some Macs, pip may refuse with error: externally-managed-environment. Then give the project its own Python instead (a "virtual environment"):
python3 -m venv ~/nesthub-python
~/nesthub-python/bin/pip install pychromecast gTTS
From then on, wherever this guide says python nesthub.py, type ~/nesthub-python/bin/python nesthub.py instead.
3Save the two files into your folder
File 1: receiver.html, the Cast app.
<!doctype html>
<!--
Nest Hub Panel v1.0.0 - receiver page
https://fullyautomatedthings.com/guides/nest-hub-custom-dashboard/
Your own Google Cast app for a Google Nest Hub. It shows any web page you choose full screen with touch
working, and it plays sound you send it (announcements) without the Hub switching to another app.
Host this file, blank.png and nesthub.py together in one folder on your home network; nesthub.py controls it.
How touch works: a Nest Hub only passes touches to a Cast app while that app has a media session, and it puts its
own invisible <touch-controls> layer on top. This page keeps a session open with a blank image (renewed every
9 minutes, because the Hub ends it after about 10) and hides that layer. The same idea Home Assistant Cast uses.
MIT License. Copyright (c) 2026 Fully Automated Things. Provided as is, without warranty of any kind.
-->
<html>
<head>
<meta charset="utf-8">
<title>Nest Hub Panel</title>
<script src="https://www.gstatic.com/cast/sdk/libs/caf_receiver/v3/cast_receiver_framework.js"></script>
<style>
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #10141a; }
#page { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #10141a; }
</style>
</head>
<body>
<iframe id="page" allow="autoplay; fullscreen"></iframe>
<script>
const NS = "urn:x-cast:com.fullyautomatedthings.nesthub";
const RENEW_MS = 9 * 60 * 1000;
// The test screen shown until you send a page of your own: a clock and a button that counts taps.
const DEMO = `<!doctype html><html><head><meta charset="utf-8"><style>
body { margin: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
gap: 32px; background: #10141a; color: #e8edf3; font-family: system-ui, sans-serif; }
#clock { font-size: 120px; font-weight: 300; }
button { width: 460px; height: 160px; border: 0; border-radius: 24px; background: #4F46E5; color: #fff; font-size: 40px; }
</style></head><body><div id="clock"></div><button id="tap">Tap me</button>
<script>
let n = 0;
document.getElementById("tap").addEventListener("click", (e) => { n += 1; e.target.textContent = "Tapped " + n; });
const tick = () => document.getElementById("clock").textContent =
new Date().toLocaleTimeString([], {hour: "numeric", minute: "2-digit"});
tick(); setInterval(tick, 1000);
<\/script></body></html>`;
const frame = document.getElementById("page");
let shown = "";
frame.srcdoc = DEMO; // first, so the page also works in a normal browser (a test)
function show(url) {
shown = url || "";
if (shown) {
frame.removeAttribute("srcdoc");
frame.src = shown;
} else {
frame.removeAttribute("src");
frame.srcdoc = DEMO;
}
}
// ---------------------------------------------------------------- sound
// A Cast app may play sound with nobody touching the screen; an ordinary web page on the Hub may not.
let voice = null; // kept so it isn't cleaned up mid-play
function speak(url, report) {
const au = voice = new Audio(url);
au.addEventListener("playing", () => report("started"), {once: true});
au.addEventListener("ended", () => report("ended"), {once: true});
au.addEventListener("error", () => report("error", "the Hub couldn't load " + url), {once: true});
au.play().catch((err) => report("error", err.name + ": " + err.message));
}
// Your own page can ask for a sound too: window.parent.postMessage({type: "speak", url: "..."}, "*")
window.addEventListener("message", (e) => {
if (e.source !== frame.contentWindow || !e.data || e.data.type !== "speak" || typeof e.data.url !== "string") return;
speak(new URL(e.data.url, shown || location.href).href,
(event, error) => e.source.postMessage({type: "speak-event", event, error}, "*"));
});
// ---------------------------------------------------------------- touch
function hideTouchControls() {
for (const el of document.querySelectorAll("touch-controls")) el.style.display = "none";
}
new MutationObserver(hideTouchControls).observe(document.documentElement, {childList: true, subtree: true});
const player = document.createElement("cast-media-player");
player.style.display = "none";
document.body.append(player);
const ctx = cast.framework.CastReceiverContext.getInstance();
function renewMediaSession() {
const req = new cast.framework.messages.LoadRequestData();
req.autoplay = true;
req.media = new cast.framework.messages.MediaInformation();
req.media.contentId = new URL("blank.png", location.href).href;
req.media.contentType = "image/png";
req.media.streamType = "NONE";
req.media.metadata = new cast.framework.messages.GenericMediaMetadata();
req.media.metadata.title = "Nest Hub Panel";
req.requestId = 0;
ctx.getPlayerManager().load(req).catch(() => {});
}
// ---------------------------------------------------------------- messages from nesthub.py
ctx.addCustomMessageListener(NS, (msg) => {
const d = msg.data || {};
const reply = (data) => ctx.sendCustomMessage(NS, msg.senderId, data);
if (d.type === "show") {
show(typeof d.url === "string" ? d.url : "");
reply({type: "shown", url: shown});
} else if (d.type === "speak" && typeof d.url === "string") {
speak(d.url, (event, error) => reply({type: "speak-event", id: d.id, event, error}));
} else if (d.type === "ping") {
reply({type: "pong", url: shown});
}
});
const options = new cast.framework.CastReceiverOptions();
options.disableIdleTimeout = true;
options.customNamespaces = {[NS]: cast.framework.system.MessageType.JSON};
const ui = new cast.framework.ui.UiConfig();
ui.touchScreenOptimizedApp = true;
options.uiConfig = ui;
try {
ctx.start(options); // only works on a Cast device; in a normal browser it fails here
setTimeout(renewMediaSession, 1000);
setInterval(renewMediaSession, RENEW_MS);
} catch (err) {
console.log("Not on a Cast device, so only the test screen is shown:", err);
}
</script>
</body>
</html>
Version 1.0.0. You don't need to change anything in it.
File 2: nesthub.py, the control program.
"""Nest Hub Panel v1.0.0 - control script
https://fullyautomatedthings.com/guides/nest-hub-custom-dashboard/
Runs your own Cast app (receiver.html, in the same folder) on Google Nest Hubs: a web page of your choice, full
screen, with touch working, and announcements played without the Hub switching apps.
python nesthub.py setup --app APP_ID --web http://THIS-COMPUTER-IP:8000
python nesthub.py find list the Cast devices on your network
python nesthub.py serial HUB show a Hub's serial number on its screen
python nesthub.py show HUB [URL] open the app on a Hub (no URL: the test screen)
python nesthub.py say HUB "Dinner is ready" speak text on a Hub (--mp3 URL plays a sound file instead)
python nesthub.py keep HUB [HUB ...] [--url URL] keep the app on screen; checks every 10 minutes
python nesthub.py stop HUB close the app (the Hub goes back to its normal screen)
HUB is the Hub's name as the Google Home app shows it ("Kitchen Hub") or its IP address. Run the commands on the
computer that serves this folder (python -m http.server 8000).
Needs Python 3.11 or newer, and: pip install pychromecast gTTS
MIT License. Copyright (c) 2026 Fully Automated Things. Provided as is, without warranty of any kind.
"""
import argparse
import base64
import ipaddress
import json
import secrets
import sys
import threading
import time
from pathlib import Path
VERSION = "1.0.0"
HERE = Path(__file__).resolve().parent
CONFIG = HERE / "nesthub.json"
NS = "urn:x-cast:com.fullyautomatedthings.nesthub"
IDENTIFY_APP = "39B1F81E" # Google's own "Cast Device Identification" app (shows the serial number)
IDLE_APPS = {"Backdrop", None} # the Hub's photo frame / clock screen, or nothing running
BLANK_PNG = base64.b64decode( # a 1x1 dark pixel: the image that keeps touch working (see receiver.html)
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGMQEJEBAABTADF6EC3yAAAAAElFTkSuQmCC")
try:
import pychromecast
from pychromecast.controllers import BaseController
except ImportError:
sys.exit("pychromecast isn't installed. Run: python -m pip install pychromecast gTTS")
def load_config():
try:
return json.loads(CONFIG.read_text())
except FileNotFoundError:
sys.exit("Run setup first: python nesthub.py setup --app YOUR_APP_ID --web http://THIS-COMPUTER-IP:8000")
class Panel(BaseController):
"""Talks to receiver.html over its own message channel."""
def __init__(self, app_id):
super().__init__(NS, app_id)
self.replies = []
self.got = threading.Condition()
def receive_message(self, _message, data):
with self.got:
self.replies.append(data)
self.got.notify_all()
return True
def ask(self, data, want, timeout=10, match=None):
"""Send a message and wait for a reply of type `want` (and matching `match`, if given)."""
with self.got:
self.replies.clear()
self.send_message(data)
return self.wait_for(want, timeout, match)
def wait_for(self, want, timeout, match=None):
deadline = time.time() + timeout
with self.got:
while time.time() < deadline:
for r in self.replies:
if r.get("type") == want and (match is None or match(r)):
self.replies.remove(r)
return r
self.got.wait(deadline - time.time())
return None
def connect(hub):
"""A Hub by IP address or by its Google Home name."""
try:
ipaddress.ip_address(hub)
infos, browser = pychromecast.discover_chromecasts(known_hosts=[hub], timeout=10)
casts = [pychromecast.get_chromecast_from_cast_info(i, browser.zc) for i in infos if i.host == hub][:1]
except ValueError:
casts, browser = pychromecast.get_listed_chromecasts(friendly_names=[hub], discovery_timeout=10)
_browsers.append(browser) # keep it running: the connection still needs it
if not casts:
sys.exit(f"No Cast device called {hub!r} found. Try `python nesthub.py find`, or use its IP address.")
cast = casts[0]
cast.wait(timeout=20)
return cast
_browsers = []
def app_name(cast):
return cast.status.display_name if cast.status else None
def open_app(cast, panel, app_id, url=None, fresh=False):
"""Start the app if it isn't running (fresh=True: restart it), then send it the page."""
if fresh and cast.status and cast.status.app_id == app_id:
cast.quit_app(timeout=15)
time.sleep(3)
if not (cast.status and cast.status.app_id == app_id):
try:
cast.start_app(app_id, force_launch=True, timeout=30)
except pychromecast.error.RequestFailed:
sys.exit("The Hub refused to start the app. Check that the app and this Hub's serial number are in the "
"Cast SDK Developer Console, then restart the Hub (unplug it for 10 seconds).")
for _ in range(40):
if cast.status and cast.status.app_id == app_id:
break
time.sleep(0.5)
for _ in range(30): # wait until the page has loaded and listens
if cast.status and NS in (cast.status.namespaces or []):
break
time.sleep(0.5)
else:
sys.exit("The app opened but isn't receiver.html from this guide (it doesn't answer on its message "
"channel). Check the Receiver Application URL in the Cast console. If you changed it, the Hub "
"may still use the old address: restart the Hub (unplug it for 10 seconds).")
for _ in range(3):
if panel.ask({"type": "show", "url": url or ""}, "shown"):
return True
return False
# ------------------------------------------------------------------ commands
def cmd_setup(a):
if not a.web.startswith("http://") and not a.web.startswith("https://"):
sys.exit("--web must start with http:// (for example http://192.168.1.50:8000)")
CONFIG.write_text(json.dumps({"app_id": a.app.strip().upper(), "web": a.web.rstrip("/")}, indent=2))
(HERE / "blank.png").write_bytes(BLANK_PNG)
if not (HERE / "receiver.html").exists():
print("Note: receiver.html isn't in this folder yet. Save it here before you continue.")
print(f"Saved {CONFIG.name} and blank.png. Your Cast app address (Receiver Application URL) is:")
print(f" {a.web.rstrip('/')}/receiver.html")
def cmd_find(_a):
casts, browser = pychromecast.get_chromecasts(timeout=10)
browser.stop_discovery()
if not casts:
print("No Cast devices found. Is this computer on the same Wi-Fi network as your Hub?")
for c in sorted(casts, key=lambda c: c.cast_info.friendly_name):
print(f"{c.cast_info.friendly_name:28} {c.cast_info.host:16} {c.cast_info.model_name}")
def cmd_serial(a):
cast = connect(a.hub)
cast.start_app(IDENTIFY_APP, force_launch=True, timeout=30)
print(f"{cast.cast_info.friendly_name} now shows its serial number. Note it down, then tap the screen or run "
f"`python nesthub.py show \"{a.hub}\"` to clear it.")
def cmd_show(a):
cfg = load_config()
cast = connect(a.hub)
panel = Panel(cfg["app_id"])
cast.register_handler(panel)
if open_app(cast, panel, cfg["app_id"], a.url, fresh=True):
print(f"{cast.cast_info.friendly_name}: showing {a.url or 'the test screen'}.")
else:
sys.exit("The app opened but didn't answer. Check that the Hub can reach receiver.html at the address in "
"the Cast console (open it in a browser on another device).")
def cmd_say(a):
cfg = load_config()
if a.mp3:
url = a.mp3
else:
try:
from gtts import gTTS
except ImportError:
sys.exit("gTTS isn't installed. Run: python -m pip install gTTS (or use --mp3 with a sound file URL)")
for old in HERE.glob("say-*.mp3"): # clean up earlier announcements
if time.time() - old.stat().st_mtime > 3600:
old.unlink(missing_ok=True)
name = f"say-{secrets.token_hex(6)}.mp3"
gTTS(a.text).save(str(HERE / name))
url = f"{cfg['web']}/{name}"
cast = connect(a.hub)
panel = Panel(cfg["app_id"])
cast.register_handler(panel)
if not (cast.status and cast.status.app_id == cfg["app_id"]):
if app_name(cast) not in IDLE_APPS and not a.force:
sys.exit(f"{cast.cast_info.friendly_name} is busy with {app_name(cast)}. Add --force to interrupt it.")
open_app(cast, panel, cfg["app_id"], a.url)
old_volume = cast.status.volume_level if cast.status else None
if a.volume is not None:
cast.set_volume(a.volume / 10)
if cast.status and cast.status.volume_muted:
cast.set_volume_muted(False)
sid = secrets.token_hex(4)
started = panel.ask({"type": "speak", "id": sid, "url": url}, "speak-event", timeout=15,
match=lambda r: r.get("id") == sid)
if not started or started.get("event") != "started":
why = (started or {}).get("error") or "no answer from the app"
sys.exit(f"Couldn't play it: {why}. Check that {url} opens in a browser on another device.")
ended = panel.wait_for("speak-event", 120, match=lambda r: r.get("id") == sid and r.get("event") in ("ended", "error"))
if a.volume is not None and old_volume is not None:
cast.set_volume(old_volume)
print(f"{cast.cast_info.friendly_name}: " + ("played." if ended and ended["event"] == "ended" else
"started playing (didn't hear when it ended)."))
def cmd_stop(a):
cast = connect(a.hub)
cast.quit_app(timeout=15)
print(f"{cast.cast_info.friendly_name}: app closed. (A running `keep` would open it again; stop that first.)")
def cmd_keep(a):
cfg = load_config()
hubs = {}
print(f"Keeping the app on {', '.join(a.hubs)}; checking every {a.every // 60} min. Ctrl+C to stop.", flush=True)
while True:
for hub in a.hubs:
try:
if hub not in hubs:
cast = connect(hub)
panel = Panel(cfg["app_id"])
cast.register_handler(panel)
hubs[hub] = (cast, panel)
cast, panel = hubs[hub]
cast.wait(timeout=20)
app = app_name(cast)
if cast.status and cast.status.app_id == cfg["app_id"]:
pong = panel.ask({"type": "ping"}, "pong", timeout=8)
if pong and pong.get("url", "") == (a.url or ""):
continue # up and showing the right page
why = "not answering" if not pong else "showing another page"
elif app in IDLE_APPS:
why = "idle"
else:
print(f"{time.strftime('%H:%M')} {hub}: busy with {app}, left alone", flush=True)
continue # never interrupt music, video or a call
ok = open_app(cast, panel, cfg["app_id"], a.url, fresh=(why == "not answering"))
print(f"{time.strftime('%H:%M')} {hub}: {why} -> " + ("app opened" if ok else "no answer"), flush=True)
except (Exception, SystemExit) as err: # a Hub rebooting or a Wi-Fi blip: try again next round
print(f"{time.strftime('%H:%M')} {hub}: {err}", flush=True)
hubs.pop(hub, None)
if a.once:
return
time.sleep(a.every)
def main():
p = argparse.ArgumentParser(description=f"Nest Hub Panel {VERSION}")
sub = p.add_subparsers(dest="cmd", required=True)
s = sub.add_parser("setup", help="save your app ID and web address")
s.add_argument("--app", required=True, help="the Application ID from the Cast SDK Developer Console")
s.add_argument("--web", required=True, help="the address this folder is served at, e.g. http://192.168.1.50:8000")
sub.add_parser("find", help="list Cast devices on your network")
s = sub.add_parser("serial", help="show a Hub's serial number on its screen")
s.add_argument("hub")
s = sub.add_parser("show", help="open the app on a Hub")
s.add_argument("hub")
s.add_argument("url", nargs="?", help="the page to show (leave out for the test screen)")
s = sub.add_parser("say", help="speak text (or play an MP3) on a Hub")
s.add_argument("hub")
s.add_argument("text", nargs="?", default="")
s.add_argument("--mp3", help="play this sound file URL instead of text")
s.add_argument("--volume", type=int, choices=range(1, 11), metavar="1-10", help="volume for this message")
s.add_argument("--url", help="page to show if the app has to be opened first")
s.add_argument("--force", action="store_true", help="interrupt whatever the Hub is playing")
s = sub.add_parser("keep", help="keep the app on screen")
s.add_argument("hubs", nargs="+")
s.add_argument("--url", help="the page to keep showing (leave out for the test screen)")
s.add_argument("--every", type=int, default=600, help="seconds between checks (default 600)")
s.add_argument("--once", action="store_true", help="check once and exit")
s = sub.add_parser("stop", help="close the app on a Hub")
s.add_argument("hub")
a = p.parse_args()
if a.cmd == "say" and not a.text and not a.mp3:
p.error("say needs text or --mp3")
{"setup": cmd_setup, "find": cmd_find, "serial": cmd_serial, "show": cmd_show, "say": cmd_say,
"keep": cmd_keep, "stop": cmd_stop}[a.cmd](a)
if __name__ == "__main__":
main()
Version 1.0.0. You don't need to change anything in it.
- Open a plain text editor: Notepad on Windows, TextEdit on a Mac (first choose Format → Make Plain Text).
- Click the first Copy code button, paste into the editor, and save it in your folder as
receiver.html. In Notepad's Save dialog, set Save as type to All files so it doesn't becomereceiver.html.txt. - Do the same with the second box and save it as
nesthub.py.
Your folder should now hold exactly receiver.html and nesthub.py. On Windows, if you can't see file extensions, turn them on in File Explorer under View → Show → File name extensions to check the names.
4Start the small web server
The Hub downloads receiver.html from your computer each time the app starts, so your computer needs to serve the folder on your network. Python has a simple web server built in.
- In Command Prompt, go to your folder:
cd /d C:\nesthub(Mac and Linux:cd ~/nesthub). - Run:
python -m http.server 8000
- Windows: if a Windows Security window asks whether to allow Python on networks, tick Private networks and click Allow. Mac: click Allow if asked about incoming connections.
- Leave this window open. The server only runs while it's open; Step 12 makes it start by itself.
- On your phone (on the same Wi-Fi), open
http://192.168.1.50:8000/receiver.htmlwith your IP address.
Your phone should show a dark page with a big clock and a purple Tap me button. That's the app's test screen, and it means the Hub will be able to load it too. If the phone can't load it, see "The page won't load from another device".
5Sign up for the Google Cast SDK Developer Console
- Go to cast.google.com/publish and sign in with your Google account.
- Tick the box agreeing to the Google APIs Terms of Service and the Google Cast SDK Additional Terms of Service, and click Continue to payment.
- Pay the one-time $5 registration fee.
- Fill in Contact name, Contact email and Contact phone number, and click Save. The marketing email box is optional.
You should land on the console's Overview page, with empty Applications and Cast Receiver Devices lists.
6Register your Cast app
- Click Add new application and choose Custom Receiver.
- Name: anything you like, for example
Home Panel. - Receiver Application URL:
http://192.168.1.50:8000/receiver.htmlwith your IP address. Plainhttpis fine: an unpublished app can load from your home network. - Leave Guest Mode, Google Cast for Audio and the Android TV fields empty, and click Save.
You should see "Your application has been successfully registered" with an Application ID: eight letters and numbers, like AB12CD34. Write it down. The status says Unpublished; leave it that way. Unpublished means only the Hubs you add in Step 8 can run it, which is exactly what you want.
7Tell nesthub.py your app ID and address
Open a second Command Prompt window (leave the server running in the first), go to your folder with cd /d C:\nesthub, and run this with your own Application ID and IP address:
python nesthub.py setup --app AB12CD34 --web http://192.168.1.50:8000
It should answer Saved nesthub.json and blank.png and repeat your app's address. Two new files appear in the folder: nesthub.json holds your settings, and blank.png is the tiny image that keeps touch working. Then run:
python nesthub.py find
You should see a list of the Cast devices on your network with their names, IP addresses and models, including your Hub (for example Kitchen Hub 192.168.1.120 Google Nest Hub Max). From now on, you can refer to the Hub by that name in quotes, or by its IP address. If the list is empty, see "No Cast devices found".
8Read your Hub's serial number and register the Hub
Google only lets an unpublished app run on devices you register by serial number. You don't need to find a sticker: this command makes the Hub show it.
python nesthub.py serial "Kitchen Hub"
- Look at the Hub. It shows Serial Number: and a code of about 14 letters and numbers. (On some Hubs the text literally includes
<br>after the colon. That's a glitch in Google's screen; ignore it.) - Write the code down carefully, or take a photo. Watch for look-alikes: the letter O and the number 0, and the letter I and the number 1. If you can't tell, compare the other characters in the code, or check the serial printed under the Hub's stand or on its box.
- In the developer console, open Devices (or Overview), click Add new device, enter the Serial Number and a Description such as
Kitchen Hub, and click OK. - Repeat for each Hub you want to use.
Each Hub should appear in the device list with the status Ready For Testing. The serial number stays on the Hub's screen until something else replaces it; the restart in the next step clears it.
9Wait 15 minutes, then restart the Hub
- Wait at least 15 minutes after registering. Google takes that long to send the registration out.
- Restart each Hub: unplug its power for 10 seconds and plug it back in. (A Hub refuses restart requests from a computer. If your Google Home app shows a Reboot option in the Hub's settings, that works too.) Wait until it shows its normal home screen again, about a minute.
Restart after any change in the console. A Hub checks for your registration, and for your app's address, only when it starts. If you change the Receiver Application URL later, restart the Hubs again, or they keep loading the old address.
10Open the app on the Hub and make it talk
python nesthub.py show "Kitchen Hub"
show always takes over the screen, even if the Hub is playing something. The Hub should switch to the same test screen you saw on your phone: a big clock and a purple Tap me button, and the command answers Kitchen Hub: showing the test screen. Tap the button a few times; it should count your taps ("Tapped 1", "Tapped 2"). That's touch working.
Now make it speak:
python nesthub.py say "Kitchen Hub" "Hello from my own Cast app" --volume 5
You should hear the sentence, and the command answers played. The --volume part is optional (1 to 10); after the message, the Hub goes back to its previous volume.
Then show your own page in place of the test screen, with your dashboard's address:
python nesthub.py show "Kitchen Hub" http://192.168.1.60:8123/my-dashboard
Your page should fill the screen, and tapping it should work like tapping it on a tablet. If it stays blank or shows an error, see "My dashboard shows a blank or gray screen".
11Optional: keep it on screen
Saying "Hey Google", playing music, or a Google update ends the app. This command checks every 10 minutes and brings it back when the Hub is idle (on its photo frame or clock), or if the app stopped answering. It never interrupts music, video, or a call.
python nesthub.py keep "Kitchen Hub" "Living Room Hub" --url http://192.168.1.60:8123/my-dashboard
It prints a line each time it brings the app back, like 07:45 Kitchen Hub: idle -> app opened, and stays quiet while everything is fine. Leave out --url to keep the test screen up. Like the web server, it runs while its window is open; press Ctrl+C in that window to stop it.
To turn the app off and get the Hub's normal screen back, stop keep first (or it reopens the app), then run:
python nesthub.py stop "Kitchen Hub"
12Optional: start everything when the computer starts
Windows: in your folder, create a text file named start-nesthub.bat (Save as type: All files) containing the lines below, with your own folder, Hub names and page. Then press Windows key + R, type shell:startup, press Enter, and put a shortcut to the .bat file in the folder that opens.
cd /d C:\nesthub
start "Nest Hub web server" python -m http.server 8000
timeout /t 5
python nesthub.py keep "Kitchen Hub" --url http://192.168.1.60:8123/my-dashboard
After you next sign in to Windows, two windows open by themselves: the web server and the keep loop. The computer has to be signed in for them to run.
Raspberry Pi and Linux: run crontab -e (choose nano if it asks for an editor), add these two lines at the bottom with your own folder, Hub names and page, then save with Ctrl+O, Enter, and exit with Ctrl+X. If you made ~/nesthub-python in Step 2, use ~/nesthub-python/bin/python in place of python3.
@reboot cd ~/nesthub && python3 -m http.server 8000 >/dev/null 2>&1
@reboot sleep 30 && cd ~/nesthub && python3 nesthub.py keep "Kitchen Hub" --url http://192.168.1.60:8123/my-dashboard >> ~/nesthub-keep.log 2>&1
After the next restart, both run in the background; ~/nesthub-keep.log shows what keep did. Mac: the simplest way is to leave the two Terminal windows from Steps 4 and 11 open, and tick System Settings → Energy (or Battery) options so the Mac doesn't sleep.
Using it with your own automations
- Announcements from any script or smart-home tool: anything that can run a command can run
python nesthub.py say "Kitchen Hub" "The laundry is done". If the app isn't open,sayopens it first, showing the test screen or the page you give with--url. It only does that when the Hub is idle; add--forceto interrupt whatever is playing. - Your own sound files:
python nesthub.py say "Kitchen Hub" --mp3 http://192.168.1.50:8000/doorbell.mp3plays any MP3 the Hub can reach; put it in your folder to serve it from there. - Sound from your own dashboard page: if you write your own page, it can ask the app to play something, with no tap needed. The app answers with a
speak-eventmessage (started,endedorerror):
window.parent.postMessage({type: "speak", url: "chime.mp3"}, "*");
Under the hood, nesthub.py sends small messages to the app on its own channel (urn:x-cast:com.fullyautomatedthings.nesthub): show, speak and ping. Any program that speaks the Cast protocol can send the same messages.
Troubleshooting: Nest Hub stops casting, no sound, touch not working
"The Hub refused to start the app" or "Failed to execute start app"
The Hub doesn't know your app yet. Check that the Hub's serial number is in the console's device list as Ready For Testing and that the app's Application ID matches the one in nesthub.json. Then wait the full 15 minutes and restart the Hub (Step 9). A typo in the serial number (O for 0, I for 1) looks exactly like this: compare it again with the Hub's screen.
"The app opened but isn't receiver.html from this guide" or "Namespace ... is not supported by current app"
The Hub started your app but loaded a different page. Check the Receiver Application URL in the console. If you changed it, restart the Hub: it keeps using the old address until it restarts.
The Hub shows a loading screen, then goes back to its photos
The Hub started your app but couldn't download receiver.html. The web server from Step 4 isn't running, the computer's IP address changed (see the tip under What you need), or a firewall blocks it. Check with your phone as in Step 4.
The page won't load from another device
Check that the web server window is still open and was started in the folder that holds receiver.html, that you typed :8000, and that the phone is on the same Wi-Fi (not mobile data or a guest network). On Windows, open Windows Security → Firewall & network protection → Allow an app through firewall and make sure Python is allowed on Private networks; also check your Wi-Fi is set to Private, not Public, in Windows' network settings.
"No Cast devices found" or "No Cast device called ... found"
The computer and the Hub must be on the same network; many routers keep a guest network and a "smart home" network separate. Use the Hub's name exactly as find shows it, in quotes, or use its IP address instead. Some mesh Wi-Fi systems block device discovery; the IP address still works there.
Touch not working in your own Cast app
With this app, taps should work within a second or two of the page appearing. If they don't, run show again: the app re-applies its touch fix each time it starts. If touch stopped working for everyone after a Hub update, Google may have changed the touch layer; check the version history for a fix.
The Nest Hub stops casting after a few minutes
The app itself doesn't time out, but the Hub ends it when someone says "Hey Google", plays music, or after some updates. Use keep (Step 11) to bring it back automatically.
"NotAllowedError: play() failed because the user didn't interact with the document first"
You'll see this when a web page cast with DashCast or a similar tool tries to play sound. It's the reason this guide exists: inside your own app, use say, or the postMessage call above, and the app plays it instead.
My dashboard shows a blank or gray screen
Open the dashboard's address on your phone first: if it asks you to sign in, the Hub can't sign in either (it has no keyboard). Use a page that opens without signing in, or one with a long-lived access token in its address if your dashboard supports that. Some sites also refuse to be shown inside another page. Home Assistant does this by default; its http: settings include use_x_frame_options, which you'd have to set to false (I haven't tested Home Assistant myself). The test screen working while your page doesn't points to one of these two.
"Couldn't play it: the Hub couldn't load ..."
The Hub couldn't download the sound. For say with text, the MP3 is saved in your folder and served by the web server, so the server must be running. For --mp3, open the same address on your phone; if it doesn't play there, it won't on the Hub.
Security and privacy
- Everything runs on your network. receiver.html is served from your own computer, and nesthub.py talks to the Hub directly over Wi-Fi. No account, password or token of yours is stored anywhere;
nesthub.jsononly holds your app ID and your computer's address. - Only your Hubs can run the app. An unpublished Cast app runs only on the serial numbers you registered. Leave it unpublished.
- The web server shares that one folder with every device on your home network, and nothing else on your computer. Keep only these files in it, and never forward port 8000 on your router: the Hub doesn't need it, and nobody outside your home should reach it.
- Like any Cast device, your Hub accepts Cast commands from devices on your home network. This app adds nothing beyond showing a page and playing sound, and it ignores messages it doesn't recognize.
- It can't listen or watch. Cast apps get no access to the Hub's microphone or camera. "Hey Google" keeps working as usual, through Google.
- What Google sees: the Hub loads Google's Cast software library from Google's servers, and text you send with
sayis turned into speech by Google's free text-to-speech service (gTTS). Use--mp3with your own sound files if you'd rather not send the text.
Disclaimer
Use at your own risk. The code is provided as is, without warranty of any kind, under the MIT license included in both files.
Things outside my control can change. Google can change how Nest Hubs handle Cast apps, touch or sound at any time, and a Hub update could stop the touch fix from working. Home Assistant's developers gave the same warning about their version.
You're responsible for your setup: your Google account, your network and your devices. Don't rely on announcements for anything safety-critical.
FAQ
Do I need to know how to code?
No. You copy two files, paste a few commands, and fill in two forms on Google's site. If you write your own dashboard page, the one-line postMessage call lets it speak, but that's optional.
What does it cost?
$5 once, for the Google Cast SDK Developer Console. Everything else is free: Python, the two files, and gTTS.
Do I need Home Assistant?
No. It works with any web page your Hub can open: Home Assistant, Node-RED, openHAB, Homey, a page you wrote yourself, or anything else on your network. If you do use Home Assistant, its own Home Assistant Cast is worth a look too; this guide is for everything else, and for spoken announcements.
Is this a Nest Hub kiosk mode?
Close to it. The page fills the screen and stays up with keep, but the Hub is still a Nest Hub: "Hey Google", timers and calls work as normal and take over the screen for a moment. keep brings your page back once the Hub is idle again.
Can it show a page from my local network, like 192.168.x.x?
Yes. Unlike asking Google Assistant to open a website, which refuses local addresses, your own app can show any address the Hub can reach, with plain http.
Why does it renew a blank image every 9 minutes?
The Hub only passes touches to a Cast app while that app has a media session open, and it closes a session that isn't really playing after about 10 minutes. Renewing it every 9 minutes keeps touch working. The image is a single dark pixel from your own computer; you never see it.
Can I use several Hubs?
Yes. Register each Hub's serial number (Step 8), and list them all in keep. Each Hub can show a different page: run one keep per page.
Does the computer have to stay on?
Yes, as long as you want the app to work. The Hub loads receiver.html from it each time the app starts. A Raspberry Pi or any always-on computer is ideal.
How do I turn it off or uninstall it?
Stop keep (Ctrl+C), run python nesthub.py stop "Kitchen Hub", and close the web server. Nothing is installed on the Hub itself. To remove it completely, delete the app and the devices in the Cast developer console and delete your folder.
Should I publish the app?
No. Publishing is for apps that strangers use; it needs an https address on the internet and Google's review. Unpublished is simpler and keeps it to your own Hubs.
Version history
If a fix ships, it's listed here. To update, copy the code again and save it over the old file. Your settings in nesthub.json stay.
| Version | Changes |
|---|---|
| 1.0.0 | First public release. |
Both files are MIT licensed. Questions? contact@fullyautomatedthings.com, or leave a comment below.
Comments and questions
No account needed. I read every comment before it appears, so yours shows up here once it's approved.