A collection of Node-RED nodes to control your smart home devices via Google Assistant or the Google Home app.
This is done by implementing a smart home provider that runs on your own host. So you don't have to rely on any third party services (other than Google) that can go offline, charge you, or leak your data.
What this module does NOT do:
Follow our setup instructions.
online
is set to false
for a node, Google SmartHome will not be able to control the node. It will also show up
as offline
in the Google Home app.ON
and it will be converted to true
./
. E.g. my/topic/on
. The nodes will only look
for the part after the last /
, if any.This is a generic node that supports the following Google devices:
and the following Google traits:
Example flow: See the flow used for the automated tests here
topic
can be restart_server
, report_state
or request_sync
.
payload
is not used for anything.
restart_server
restarts the built-in web server.
report_state
will force an update of all states to Google. Mostly useful for debugging.
request_sync
will ask Google for a sync to learn about new or changed devices. This is usually done automatically.
Name
: A name for your config node.
Enable Node Debug
: If enabled, debug messages will be written to Node-RED's log output.
Default Language
: The language of your project.
Local Authentication
Use Google Login
: If checked, use Google login authentication.
Login Client ID
: If Google Login is enabled, the client ID you received from the Google Sign-In integration.
Authorized emails
: If Google Login is enabled, the email addresses authorized to log in.
Username
and Password
: If Google Login is disabled, a username and password used during account linking in the
Google Home app.
Actions on Google Project Settings
Client ID
: The client ID you entered in the Actions on Google project.
Client Secret
: The client secret you entered in the Actions on Google project.
Google HomeGraph Settings
Jwt Key
: Path to the JSON file that you downloaded during setup. Can be an absolute path or a path relative to
Node-REDs user dir (where your settings.js, flows.json etc. are stored).
Web Server Settings
Port
: TCP port of your choice for incoming connections from Google. Must match what you specified in the
Actions on Google project. If empty, it will use the same port as Node-RED.
URL subpath
: URL subpath to add to the URL. If set, the URL will change from https://example.com:3001/check
to
https://example.com:3001/<subpath>/check
(resp. /<subpath>/smarthome
, /<subpath>/oauth
, /<subpath>/token
).
Use http Node-RED root path
: If enabled, use the same http root path prefix configured for Node-RED, otherwise use /.
Use external SSL offload
: If enabled, the smarthome service will use HTTP instead of HTTPS. Check if you want to
do SSL termination on a reverse proxy.
Public Key
: Full path to the SSL certificate file, e.g. fullchain.pem
from Let's Encrypt.
Private Key
: Full path to private SSL key file, e.g. privkey.pem
from Let's Encrypt.
Note: Certificates are automatically reloaded after renewal. You don't need to restart Node-RED.
Local Fulfillment
Scan Type
: The service discovery method to use. Must match what is set in the Actions on Google project.
Discovery Port
: A port number to use for UDP or mDNS service discovery.
HTTP Port
: A port number to use for the connection from your smart speaker to Node-RED. If empty, it will use the
same port as Node-RED. If you are using Node-RED's built-in HTTPS encryption or have a httpAdminRoot set,
you need to set a port. Don't create a forwarding rule for this port!
Advanced Settings
Token Duration
: The duration of the authorization token used by Google SmartHome to identify itself to the Node-RED
SmartHome plugin. Default is 60 minutes.
Report Interval (m)
: Time in minutes between sending report updates to Google (default is 60 minutes).
Request sync delay (s)
: Delay in seconds, for requesting devices sync after a deployment. 0 or empty for disable
(default is 0).
Set state delay (s)
: Delay, in seconds, for sending the set_state message after state changes, 0 or empty to disable
(default value 0).
Some devices support sending spoken notifications to your smart speaker. For example, you can play a notification on your speaker when someone rings at the front door or when the washing machine completes a cycle. Unfortunately, you cannot send custom notifications, you can only trigger predefined notifications.
See https://developers.google.com/assistant/smarthome/develop/notifications.
You can invite other people into your smart home in the app by following these steps.
Inviting people will not work in all cases. For example, it won't work if either you or the other person has a commercial Google Workspace account. If this is the case, you can share access to your Smart Home project as follows:
Test
tab, select Settings
and disable On device testing
.
Then click Start testing
.Restart Flows
option in the dropdown menu of the deploy button) while the debug panel
is open to see any error messages during initialization.journalctl -u nodered
, docker logs <container>
or a file in /var/log
.Test
click Reset Test
. If this
doesn't do anything, click the Settings
button, disable and re-enable On device testing
.For problems related to local fulfillment, see Troubleshooting local fulfillment.
Parts of this README and much of the code come from Google. In particular, Actions on Google: Smart Home sample using Node.js was of great value.
Copyright 2018 - 2024 Michael Jacobsen and others under the GNU General Public License version 3.