Send request to Google Assistant by pushing Amazon Dash Button.
Follow the instruction of Google Assistant SDK.
- Configure a Developer Project and Account Settings
- Register the Device Model
- Install SDK and Sample Code
End of the instruction, you would have DEVICE_MODEL_ID
and credentials.json
.
Also, you need to install some libraries.
$ sudo apt install tcpdump
$ pip install -r requirements.txt
Set the following environment values for Google Assistant.
DEVICE_ID
DEVICE_MODEL_ID
Identifier defined by Actions ConsoleCREDENTIALS
Path ofcredentials.json
# example
export DEVICE_ID=`uuid`
export DEVICE_MODEL_ID="my-devices-project-prototype-light-v1"
export CREDENTIALS="/path/to/.config/google-oauthlib-tool/credentials.json"
You could modify config.py directly.
And, please associate your own amazon dash's MAC with Google Assistant request in dashes.yml.
# example of dashes.yml
actions:
# "dash's mac address": "text request to Google Assistantr"
"12:34:56:78:90:AA": "Turn on TV"
"12:34:56:78:90:BB": "Turn off TV"
You can inspect MAC by running amazon_dash.py or use other libraries (e.g. Nekmo/amazon-dash)
Then, run main.py.
$ sudo -E python3 main.py
Ready to press Amazon Dash Button
2020-06-17 21:32:02,384 - root - INFO - 12:34:56:78:90:AA is pressed.
2020-06-17 21:32:02,391 - root - INFO - Turn on TV