npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

homebridge-cast

v1.0.0

Published

Homebridge plugin to control volume and media streaming status of Google Cast devices, and control Android/Google TVs using iOS remote

Downloads

154

Readme

homebridge-cast

npm

Homebridge Cast is a Homebridge plugin for controlling Google TVs, Android TVs or any Google Cast / Chromecast devices.

For Google/Android TVs, a TV service is exposed allowing the device to be powered on/off, the current application to be viewed/changed and remote control from your phone in control centre.

For all devices, a light service can be exposed for controlling media streaming status and volume.

A motion sensor service can also be exposed which becomes active when the Chromecast is streaming, useful for automations.

Installation

Please ensure you are running the latest version of Homebridge (heres how to install if you haven't already). To install this plugin, go to the Homebridge web interface Plugins page and search for Cast. Alternatively, from command line run:

npm i -g homebridge-cast

Setup

Configure your devices in Homebridge Web Interface > Plugins > Homebridge Cast > Settings

Name or IP: The device name of your Chromecast (as seen in Google Home app) - or IP address if static

Display Name: Optional different display name for your Chromecast in Homebridge and the Home app (leave blank for same as above)

Device Type: Select Android TV for Android TVs, Chromecast Streaming Stick for Google TVs and Chromecast Audio for other Google Cast devices

Note: TV accessories must be added separately in the Home app, remember to click Add Accessory > More Options in the Home app and add it after adding a Android/Google TV in the config

Check on Volume Service and/or Streaming Service to expose a lightbulb for media/volume control and/or motion sensor for streaming status, respectively

For Android/Google TVs, apps to show in Homekit can also be entered. Enter the app bundle identifier in App ID (e.g. com.netflix.ninja), and optionally the apps deeplink domain in App Link for the ability to open the app from Homekit (e.g. https://www.netflix.com/title.*)

IMPORTANT: For Android/Google TVs, you will also need to obtain an authentication certificate, see the below section

TV Authentication

For Android/Google TV types, you will need to obtain an authentication certificate using the included certgen.js script. This can be run with the following command from the command line:

node $(npm root -g)/homebridge-cast/certgen.js

The script will prompt you to enter your device name, which should be the same as the Name set in the plugin config (the exact name of the device in the Google Home app).

A code will then be displayed on your TV screen and the script will prompt you to enter it. It will then output the authentication certificate if successful.

This should be copied into the config for the TV by going to the Homebridge Web Interface > Plugins > Homebridge Cast > ... menu > JSON Config

Within the JSON Config, find your device and paste the certificate as the tvCert property underneath the other properties (remove all the +s in the JSON output to create single string for the key and cert).

An example Android/Google TV config:

{
    "name": "Living Room TV",
    "displayName": "Living Room Android TV",
    "type": "tv",
    "volumeService": true,
    "motionService": false,
    "tvApps": [
        {
            "id": "com.google.android.apps.tv.launcherx",
            "name": "Home"
        },
        {
            "link": "https://www.netflix.com/title.*",
            "id": "com.netflix.ninja",
            "name": "Netflix"
        },
        {
            "id": "com.google.android.youtube.tv",
            "name": "YouTube"
        }
    ],
    "tvCert": {
        "key": "-----BEGIN RSA PRIVATE KEY-----\r\nMIIEogIBA.......hdU6z34m11tFjjry2wec4wxA=\r\n-----END RSA PRIVATE KEY-----\r\n",
        "cert": "-----BEGIN CERTIFICATE-----\r\nnMIIEogIBA.......4m11tFjjry2wec4wxA\r\n-----END CERTIFICATE-----\r\n"
    }
}

A custom settings UI for the Homebridge web interface will be coming soon to automatically configure TV accessories when added