Skip to content

biofects/Google-Home-Messages

Repository files navigation

Google Home Messages

Google Home Messages - Send Messages using tts to a Google Home Device. Use this to create events in IFTTT or schedule messages. This is Docker ready or stand alone NPM. I am running this on a Raspberry PI

Getting Started

Google Home Messages is written in Javascript for NodeJS and will install all required packages as needed. This uses TTS to send messages to google home.

Prerequisites

nodejs --version
v8.9.3

docker --version
Docker version 17.09.1-ce, build 19e2cf6

Port Forwarding needs to be set up on your netowrk in order to make the calls externally.

Installing

Clone this repo

git clone https://github.com/biofects/Google-Home-Messages.git

Go into Google-Home-Messages

cd Google-Home-Messages

Edit setting

vim config/settings.json

        "mytoken" : "CreateAGoodToken", 
        "lang" : "en",
        "speed" : 1,
	"port" : 8092,
        "debug" : "true"

Install the NodeJS App

npm install

Test package

npm start

Build Docker Image if using Docker

sudo docker build -t <user>/googlehomemessages  /path/to/Aapp/Google-Home-Messages/

Start Docker

sudo docker run -p 8092:8092 -d <user>/googlehomemessages

Set up IFTTT with your Google Home

Go to [IFTTT](https://ifttt.com)
For *THIS* I use wifi check.
For *THAT* choose: *Maker Webhooks*
    1. Choose *Make a web request*
    2. In *URL* enter:
      >YOUR_Public_iP/google-home-messages
    3. Post with JSON data
    4. Body 
      >{"text":"Hello, From Biofects","ipaddress":"Internal ip of google home","token":"TokenFromSettings"}

Running the tests

Using curl on linux

curl -d '{"text":"Hello, Lee. Have a nice day","ipaddress":"192.168.1.26","token":"hejd%ya83!!"}' -H "Content-Type: application/json" -X POST http://192.168.1.113:8092/google-home-messages
192.168.1.26 will say: Hello, Lee. Have a nice day.

Thank you sepodele [issue 3] On windows you need to use double quotes around the json.

Found the solution. In Windows Powershell I have to do this:

curl -d '{\"text\":\"hello\", \"ipaddress\":\"10.0.0.200\", \"token\":\"jabbadabbadu\"}' -H "Content-Type: application/json" -X POST http://10.0.0.5:8092/google-home-messages

And in cmd.exe I have to do this:

curl -d "{\"text\":\"hello\", \"ipaddress\":\"10.0.0.200\", \"token\":\"jabbadabbadu\"}" -H "Content-Type: application/json" -X POST http://10.0.0.5:8092/google-home-messages

Note the single quotes vs double quotes. Stupid Windows..

Authors

  • Lee Thompson - Initial work

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Donate to get geek stuff(sorry no beer here)

paypal

About

This will allow you to post a message to a Google Home with tts without a prompt. You can use this for proximity sensor, mail sensor and many more things.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published