It makes Google Home spoken something and is inspired by google-home-notifier.
There are 3 modes.
- speak message
- play sound data
- run as server mode then http request with messages can be handled to speak
- Google Home device should be in same local network with installed machine
- Google Home device IP address would be detected automatically. So it's not necessarily to specify device IP address.
- Golang 1.15+
- direnv for MacOS user under development
- Ngrok if you want to access installed machine from outside
$ brew install hiromaily/tap/go-google-home
# config file is installed in /usr/local/etc/google-home/gh.toml
# modify `gh.toml` if settings wanna be changed
# run
$ gh speak -msg "Hi guys, thank you for using. Have fun."
subcommand | example | |
---|---|---|
speak | speak message on google home | gh speak -msg "hello guys" |
play | play sound data on google home | gh play -url xxxxx.mp3 |
server | run web server to handle http request with message | gh server -port 8888 |
options | type | example | |
---|---|---|---|
toml | TOML file path | string | -toml ./configs/default.toml |
addr | specify address of Google Homee | string | -addr xxx.xxx.xxx.xxx:8009 |
lang | spoken language, default is english | string | -lang en |
v | show version | bool | -v |
environment variable GO_GOOGLE_HOME_CONF
is used as default config path
# saying something in English
$ gh speak -msg "Thank you."
# saying something in Japanese
$ gh -lang ja speak -msg "ありがとうございます"
# saying something in Dutch
$ gh -lang nl speak -msg "Dank je"
# saying something in German
$ gh -lang de speak -msg "Danke."
# saying something in French
$ gh -lang fr speak -msg "Merci."
# playing music
$ gh play -url "https://github.com/hiromaily/go-google-home/raw/master/assets/music/bensound-dubstep.mp3"
# using specific IP address of Google Home.
$ gh -addr "10.0.0.1:8009" -msg "It reaches to specific IP address."
# server mode
$ gh server -port 8888
# then post message to server by HTTPie
$ http POST http://localhost:8080/speak text="It's sunny day today."
- create http endpoint from Slack using Google Apps Script
- script is server.gs
- deploy it and get endpoint URL
- create new App
google-home
from slack apps on your slack workspace - use Slack Events API
Use Ngrok
$ brew install --cask ngrok
# If you use 8080 port for that local server.
$ ngrok http 8080