Skip to content
Hard Hub
Back to Chromecast and Chromecast with Google TV

Hack · Chromecast and Chromecast with Google TV

Cast and control it from your own script

Find it on the network by mDNS and send it a video URL, a pause command or a volume change, all over the local Cast protocol.

Finding the Chromecast on your network and sending it a video URL, a pause command or a volume change, all from your own Python script, over the local network.

Does it work on mine

Chromecast and Chromecast with Google TV's models, not checked against this hack specifically yet

ChromecastChromecast UltraChromecast with Google TV HDChromecast with Google TV 4K

What it costs

An evening~30 minNo risk

pychromecast relies on mDNS, so the README's own network requirements matter before anything else: multicast UDP must be forwarded by your Wi-Fi router, the machine running the script must allow inbound and outbound traffic on port 5353, and it must sit on the same subnet as the Chromecast, since mDNS packets are not routed across subnets. When any of that is not possible, the README's fallback is to pass known IP addresses straight to the discovery functions instead of relying on mDNS.

Steps

  1. Install the library from PyPI with pip install PyChromecast, per its own PyPI listing; the project's README lists requests, protobuf and zeroconf as its dependencies.
  2. Call get_listed_chromecasts() with the device's friendly name to find and connect to it, as shown in the same README's quick start.
  3. Call cast.wait() to wait for it to be ready, then send a video URL or control playback and volume through its media controller, per the same README.
  4. If a media center device nearby misbehaves over CEC, add it to pychromecast's IGNORE_CEC list, as documented in the same README.

Risks and undo

Nothing is flashed on the device. The worst case the README describes is a CEC incompatibility with another media center device, worked around with IGNORE_CEC rather than fixed on the Chromecast itself. Undo is closing the script and casting from the official app exactly as before.

Projects used

Sources

Other hacks for Chromecast and Chromecast with Google TV

Checked on Oct 26, 2026