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

node-red-contrib-googleassistant-automation

v1.0.7

Published

Devices that should be synced to Google Assistant can be added in the "Assistant devices" tab on the right-hand side of the screen. Not a lot of devices are supported so far. Here, you can set an ID (usually the topic), a friendly name that's displayed o

Downloads

4

Readme

How to

Settings up devices

Devices that should be synced to Google Assistant can be added in the "Assistant devices" tab on the right-hand side of the screen. Not a lot of devices are supported so far. Here, you can set an ID (usually the topic), a friendly name that's displayed on your phone when adding a device, the device type and which traits that device can fulfill.

Use the ga device input to listen to commands on a device. In the payload you'll find the ID of the device + the value it should be set to.

Google Assistant Project

To set up the Google Assistant project, go to http://console.actions.google.com and set up your project. Upload your action with the gactions utility by running the following: .\gactions test -preview_mins 9999999 -action_package action.json -project <project id>

This integration runs a separate node server on port 1881 so you don't have to expose all of node-red to the outside.

HTTPS

Settings.js

In your settings.js file, add a new key called google_assistant with 2 properties: key and cert. Use the fs.readFileSync(<your location>) method to read your key and cert.

Example:

google_assistant: {
    key: fs.readFileSync('/etc/ssl/private/server.key'),
    cert: fs.readFileSync('/etc/ssl/certs/server.crt')
}

Self-signed certificates don't work anymore.

Other

Another possibility to run HTTPS is to use Docker and letsencrypt. You can use nginx as reverse HTTPS proxy or use something like caddy to reverse proxy to port 1881. Other solutions are possible, but these are the only ones I've tested.

Example:

/opt/docker/caddy/Caddyfile

<your domain> {
    proxy / node-red:1881/ {
        transparent
    }
    gzip
    tls <your email>
}

/opt/docker/docker-compose.yml

version: '3'
services:
  mosquitto: ...

  node-red:
    hostname: nodered
    container_name: nodered
    build:
      context: /opt/docker/node-red-docker
      dockerfile: Dockerfile
    restart: unless-stopped
    volumes:
     - /etc/localtime:/etc/localtime:ro
     - /opt/docker/nodered:/data
    links:
     - mosquitto
    ports:
     - "1880:1880"
     - "1881:1881"
    depends_on:
     - mosquitto


  caddy:
    hostname: caddy
    container_name: caddy
    image: abiosoft/caddy
    restart: unless-stopped
    ports:
     - "80:80"
     - "443:443"
    volumes:
     - /opt/docker/caddy:/srv
    depends_on:
     - node-red

Warning

CAUTION: This project provides a MOCK implementation of OAuth2 and is NOT intended for production usage. An option worth exploring if you're using Docker & Caddy is loginsrv

Testing can be done using ngrok. Currently, Google Assistant Actions don't provide private actions, so your action should NEVER leave testing mode. If you publish it and it somehow passes review, everybody will be able to manage your devices.

Support

Supported devices:

  • Light
  • Switch

Supported traits:

  • OnOff