├── .gitattributes
├── docs
├── _static
│ └── images
│ │ └── IRWiring.jpg
├── homeindicator.rst
├── index.rst
├── updating.rst
├── starting.rst
├── about.rst
├── install.rst
├── rpigpios.rst
├── headless.rst
├── features.rst
├── colorlist.rst
├── Makefile
├── make.bat
├── audioconfig.rst
├── conf.py
└── customization.rst
└── README.rst
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/docs/_static/images/IRWiring.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shivasiddharth/GassistPi-Documentation/master/docs/_static/images/IRWiring.jpg
--------------------------------------------------------------------------------
/README.rst:
--------------------------------------------------------------------------------
1 | Documentation for GassistPi Project
2 | ===================================
3 |
4 | Link to the documentation: https://gassistpi-documentation.readthedocs.io/en/latest/index.html
5 |
--------------------------------------------------------------------------------
/docs/homeindicator.rst:
--------------------------------------------------------------------------------
1 | ================================================
2 | Google Home Like Indicator
3 | ================================================
4 |
5 | 1. This feature requires an Arduino or NodeMCU to be connected to the Pi.
6 | 2. Sketches and wiring diagram have been provided in the Neopixel Indicator folder.
7 | 3. Change the Pin numbers in the given sketch according to your board and upload it.
8 | 4. Follow the given circuit diagram for connecting the arduino and the pi.
9 |
--------------------------------------------------------------------------------
/docs/index.rst:
--------------------------------------------------------------------------------
1 | .. Read the Docs Template documentation master file, created by
2 | sphinx-quickstart on Tue Aug 26 14:19:49 2014.
3 | You can adapt this file completely to your liking, but it should at least
4 | contain the root `toctree` directive.
5 |
6 | Documentation for GassistPi Project
7 | ===================================
8 |
9 | .. toctree::
10 | :maxdepth: 3
11 | :glob:
12 |
13 |
14 | about
15 | features
16 | starting
17 | audioconfig
18 | install
19 | headless
20 | updating
21 | customization
22 | rpigpios
23 | homeindicator
24 | colorlist
25 |
--------------------------------------------------------------------------------
/docs/updating.rst:
--------------------------------------------------------------------------------
1 | ====================
2 | Updating the project
3 | ====================
4 |
5 |
6 | 1. Change directory::
7 |
8 | cd /home/${USER}/
9 |
10 | 2. Make the update script executable::
11 |
12 | sudo chmod +x /home/${USER}/GassistPi/scripts/update.sh
13 |
14 | 4. Run the update script::
15 |
16 | sudo /home/${USER}/GassistPi/scripts/update.sh
17 |
18 | 5. If there is an update available, the project will be updated else the script will make a smooth exit.
19 |
20 | 6. If the Project is updated, reconfigure the **config.yaml** file.
21 |
22 | .. note:: The update script will make a backup of your existing project folder before updating eg. GassistPi.bak-xxxx-xx-xx**
23 |
--------------------------------------------------------------------------------
/docs/starting.rst:
--------------------------------------------------------------------------------
1 | ============
2 | Before Starting
3 | ============
4 |
5 | .. note:: **For Non-Issue Help and Interaction Use Gitter:** https://gitter.im/GassistPi/Lobby/
6 |
7 | Supported Platforms
8 | -------------------
9 | .. note::
10 | - Do not use the prebuilt AIY Image.
11 | - Do not run the upgrade command.
12 | - Skip the updation process when setting up a fresh copy of Raspbian OS.
13 |
14 | Any single board computer or machine running one of the following OS:
15 | - Armbian Buster and Bullseye
16 | - Raspbian Buster and Bullseye
17 | - OSMC Stretch
18 | - Ubuntu Bionic
19 |
20 | Getting Started
21 | ----------------
22 |
23 | .. note::
24 | **${USER}** will automatically take your username. No need to change that. Just copy pasting the commands on terminal will work.
25 |
26 | Install git and clone the project::
27 |
28 | sudo apt-get install git
29 | git clone https://github.com/shivasiddharth/GassistPi
30 |
--------------------------------------------------------------------------------
/docs/about.rst:
--------------------------------------------------------------------------------
1 | .. image:: https://user-images.githubusercontent.com/18142081/100752126-32b76b80-340e-11eb-9cf1-2c7355cd4523.png
2 | :scale: 50%
3 |
4 |
5 | *******************
6 | About this project
7 | *******************
8 |
9 | .. note::
10 | Developments have been stopped and this project is no longer maintained.
11 |
12 |
13 | In May of 2017, Google Released it's AIY Projects kit. Initially not many had access to it, so that is when I started modifying the Google Assistant SDK adding AIY like features to help out the ones left without the kit.
14 |
15 | Every project requires a name and so I named it GassistPi ("G"oogle "Assist"ant on "Pi").
16 |
17 | Fast forwarding to date, the project works not only on Pi boards but on a number of other platforms (checkout the supported platforms page_ for more details).
18 |
19 | It has some interesting custom actions for both entertainment and home-automation needs. Primary language of coding is Python and the project has been structed in a way to allow even inexperienced programmers to modify existing codes and implement their own custom actions.
20 |
21 | This is a project for the single board community community, driven by the community.
22 |
23 | .. _page: https://gassistpi-documentation.readthedocs.io/en/latest/starting.html#supported-platforms
24 |
25 |
26 |
--------------------------------------------------------------------------------
/docs/install.rst:
--------------------------------------------------------------------------------
1 | ===========================
2 | Installing Google Assistant
3 | ===========================
4 |
5 |
6 | 1. Follow the instructions here_ to configure a developer project and account settings.
7 |
8 | .. _here: https://developers.google.com/assistant/sdk/guides/library/python/embed/config-dev-project-and-account
9 | Then follow this guide_ to register the device and obtain the credentials.json file. Refer to the video below for step by step guidelines.
10 |
11 | .. _guide: https://developers.google.com/assistant/sdk/guides/library/python/embed/register-device
12 |
13 |
14 | .. raw:: html
15 |
16 |
17 |
18 |
19 |
20 |
21 | 2. Place the credentials.json file in/home/${USER}/ directory.
22 |
23 | .. note::
24 | Do not rename the credentials file.
25 |
26 | 3. Use the one-line installer for installing Google Assistant.
27 |
28 | 3.1 Change directory::
29 |
30 | cd /home/${USER}/
31 |
32 | 3.2 Make the installer Executable::
33 |
34 | sudo chmod +x ./GassistPi/scripts/gassist-installer.sh
35 |
36 | 3.3 Execute the installer::
37 |
38 | sudo ./GassistPi/scripts/gassist-installer.sh
39 |
40 | .. note:: **When Prompted, enter your Google Cloud console Project-Id, A name for your Assistant and the Full path to the credentials file, including the json extension.**
41 |
42 |
43 | 4. Copy the google assistant authentication link from terminal and authorize using your google account.
44 |
45 |
46 | 5. Copy the authorization code from browser onto the terminal and press enter.
47 |
48 |
49 | 6. Assistant installation is done now.
50 |
51 | .. note:: At the first start of the assistant, the volume may be low. Issue **Hey Google, Set volume to maximum** to set the volume to maximum.
52 |
--------------------------------------------------------------------------------
/docs/rpigpios.rst:
--------------------------------------------------------------------------------
1 | ================================================
2 | List of Raspberry Pi GPIOs used in the project
3 | ================================================
4 |
5 |
6 | +-------------------+-----------------------------------------------------------------------+
7 | | GPIO Number in BCM| Purpose |
8 | +===================+=======================================================================+
9 | | 25 | Assistant activity indicator for AIY Kits |
10 | +-------------------+-----------------------------------------------------------------------+
11 | | 23 | Pushbutton to stop music/radio AIY and others |
12 | +-------------------+-----------------------------------------------------------------------+
13 | | 05 and 06 | Google assistant listening and responding |
14 | +-------------------+-----------------------------------------------------------------------+
15 | | 22 | Pushbutton trigger for gRPC API. |
16 | +-------------------+-----------------------------------------------------------------------+
17 | | | Connect a pushbutton between GPIO 22 and GRND for manually triggering.|
18 | +-------------------+-----------------------------------------------------------------------+
19 | | 12,13,24 | Voice control of devices connected to GPIO |
20 | +-------------------+-----------------------------------------------------------------------+
21 | | 27 | Voice control of servo |
22 | +-------------------+-----------------------------------------------------------------------+
23 | | 17 | IR Sensor for preset commands |
24 | +-------------------+-----------------------------------------------------------------------+
25 |
26 | .. note:: Some HATS may use GPIOs 18, 19, 20, 21 for I2S audio please refer to the manufacturer's pinouts
27 |
--------------------------------------------------------------------------------
/docs/headless.rst:
--------------------------------------------------------------------------------
1 | ================================================
2 | Headless Google Assistant
3 | ================================================
4 |
5 |
6 | Setting up Google Assistant to auto start on boot
7 | -------------------------------------------------
8 |
9 | 1. Open the service files in the /GassistPi/systemd/ directory and verify your project and model ids and save the file.
10 |
11 | 2. Change directory::
12 |
13 | cd /home/${USER}
14 |
15 |
16 | 3. Make the service installer executable::
17 |
18 | sudo chmod +x ./GassistPi/scripts/service-installer.sh
19 |
20 |
21 | 4. Run the service installer::
22 |
23 | sudo ./GassistPi/scripts/service-installer.sh
24 |
25 |
26 | 5. Enable the service::
27 |
28 | sudo systemctl enable gassistpi.service
29 |
30 |
31 | 6. Start the service::
32 |
33 | sudo systemctl start gassistpi.service
34 |
35 |
36 | Steps to manually start the assistant
37 | -------------------------------------
38 |
39 | At any point of time, if you wish to manually start the assistant:
40 |
41 | 1. Stop the service if it is already running::
42 |
43 | sudo systemctl stop gassistpi.service
44 |
45 |
46 | 2. **Ok-Google Hotword/Pi4/Pi3/Pi2/Armv7 users**
47 | Open a terminal and execute the following::
48 |
49 | /home/${USER}/env/bin/python -u /home/${USER}/GassistPi/src/main.py --project_id 'replace this with the project id' --device_model_id 'replace this with the model id'
50 |
51 |
52 | 3. **Pushbutton/Pi Zero/Pi B+ and other Non-Armv7 users**
53 | Open a terminal and execute the following::
54 |
55 | /home/${USER}/env/bin/python -u /home/${USER}/GassistPi/src/pushbutton.py --project-id 'replace this with your project id' --device-model-id 'replace this with the model id'
56 |
57 | Insert your Project Id and Model Id in quotes in the mentioned places
58 |
59 |
60 | Disabling assistant's auto start
61 | --------------------------------
62 |
63 | At any point of time, if you wish to stop the auto start of the assistant:
64 |
65 | Open a terminal and execute the following::
66 |
67 | sudo systemctl stop gassistpi.service
68 | sudo systemctl disable gassistpi.service
69 |
--------------------------------------------------------------------------------
/docs/features.rst:
--------------------------------------------------------------------------------
1 |
2 | ========
3 | Features
4 | ========
5 |
6 |
7 | **All features are applicable to all boards, unless and otherwise mentioned.**
8 |
9 | 1. Headless auto start on boot.
10 | 2. Voice control of GPIOs without IFTTT, api.ai, Actions SDK (Only for Raspberry Pi Boards - non OSMC).
11 | 3. Voice control of NodeMCU without IFTTT and MQTT.
12 | 4. Radio streaming.
13 | 5. Voice control of servo connected to RPi GPIO (Only for Raspberry Pi Boards - non OSMC).
14 | 6. Safe shutdown RPi using voice command.
15 | 7. Stream Music from YouTube.
16 | 8. Indicator lights for assistant listening and speaking events.
17 | 9. Startup audio and audio feedback for wakeword detection.
18 | 10. Pushbutton service to stop Music or Radio playback.
19 | 11. Parcel tracking using Aftership API.
20 | 12. RSS Feed streaming.
21 | 13. Control of Kodi or Kodi Integration.
22 | 14. Streaming music from Google Play Music.
23 | 15. Casting of YouTube Videos to Chromecast and Chromecast media control by voice.
24 | 16. Voice control of Radio/YouTube/Google Music volume levels.
25 | 17. Control Sonoff-Tasmota Devices.
26 | 18. Track Kickstarter campaigns.
27 | 19. Emulated Philips Hue HUB service and control of Emulated Hue Lights.
28 | 20. Search recipes and get push message of ingredients and link to recipe.
29 | 21. Remote control of Magic Mirror.
30 | 22. Play your Spotify playlist.
31 | 23. Custom wakeword activation for all Pi boards using Snowboy and Picovoice-Porcupine.
32 | 24. Mute microphones to prevent listening to Ok-Google hotword (Only Raspberry Pi Boards - non OSMC).
33 | 25. Create custom conversations.
34 | 26. Control of lights added to Domoticz.
35 | 27. Stream music from Gaana.com.
36 | 28. Stream your playlist from Deezer.
37 | 29. Custom actions in French, Italian, German, Dutch, Spanish and Swedish.
38 | 30. Send commands over MQTT to the Google Assistant (Only Armv7 boards).
39 | 31. Control Assistant using IR Remote (Only Raspberry Armv7 boards).
40 | 32. Send Voice Messages from the SBC to the Mobile using Pushbullet (Only Armv7 boards).
41 | 33. Send Clickatell SMS messages.
42 | 34. CES 2019 Like Live Translator or Interpreter (Needs Cloud Speech).
43 | 35. Control Demoticz, Sonoff devices from other assistant devices.
44 | 36. Run custom script by voice.
45 | 37. Sending voice messages from phone to the Raspberry Pi.
46 |
--------------------------------------------------------------------------------
/docs/colorlist.rst:
--------------------------------------------------------------------------------
1 | *******************
2 | List of available colors for home automation projects
3 | *******************
4 |
5 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
6 | | | | COLOURS LIST | | |
7 | +======================+=======================+=============================+===================+=====================+===================+
8 | | 'Almond' | 'Antique Brass' | 'Apricot' | 'Aquamarine' | 'Asparagus' | 'Atomic Tangerine'|
9 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
10 | | 'Banana Mania' | 'Beaver' | 'Bittersweet' | 'Black' | 'Blizzard Blue' | 'Just Blue' |
11 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
12 | | 'Blue Bell' | 'Blue Gray' | 'Blue Green' | 'Blue Violet' | 'Blush' | 'Brick Red' |
13 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
14 | | 'Brown' | 'Burnt Orange' | 'Burnt Sienna' | 'Cadet Blue' | 'Canary' | 'Caribbean Green' |
15 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
16 | | 'Carnation Pink' | 'Cerise' | 'Cerulean' | 'Chestnut' | 'Copper' | 'Cornflower' |
17 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
18 | | 'Cotton Candy' | 'Dandelion' | 'Denim' | 'Desert Sand' | 'Eggplant' | 'Electric Lime' |
19 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
20 | | 'Fern' |'Forest Green' | 'Fuchsia' | 'Fuzzy Wuzzy' | 'Gold' | 'Goldenrod' |
21 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
22 | | 'Granny Smith Apple' | 'Gray' | 'Just Green' | 'Green Blue' | 'Green Yellow' | 'Hot Magenta' |
23 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
24 | | 'Inchworm' | 'Indigo' | 'Jazzberry Jam' | 'Jungle Green' | 'Laser Lemon' | 'Lavender' |
25 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
26 | | 'Lemon Yellow' | 'Macaroni and Cheese' | 'Magenta' | 'Magic Mint' | 'Mahogany' | 'Maize' |
27 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
28 | | 'Manatee' | 'Mango Tango' | 'Maroon' | 'Mauvelous' | 'Melon' | 'Midnight Blue' |
29 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
30 | | 'Mountain Meadow' | 'Mulberry' | 'Navy Blue' | 'Neon Carrot' | 'Olive Green' | 'Orange' |
31 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
32 | | 'Orange Red' | 'Orange Yellow' | 'Orchid' | 'Outer Space' | 'Outrageous Orange' | 'Pacific Blue' |
33 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
34 | | 'Peach' | 'Periwinkle' | 'Piggy Pink' | 'Pine Green' | 'Pink Flamingo' | 'Pink Sherbet' |
35 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
36 | | 'Plum' | 'Purple Heart' | "Purple Mountain's Majesty" | 'Purple Pizzazz' | 'Radical Red' | 'Raw Sienna' |
37 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
38 | | 'Raw Umber' | 'Razzle Dazzle Rose' | 'Razzmatazz' | 'Just Red' | 'Red Orange' | 'Red Violet' |
39 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
40 | | 'Robin's Egg Blue' | 'Royal Purple' | 'Salmon' | 'Scarlet' | 'Screamin' Green' | 'Sea Green' |
41 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
42 | | 'Sepia' | 'Shadow' | 'Shamrock' | 'Shocking Pink' | 'Silver' | 'Sky Blue' |
43 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
44 | | 'Spring Green' | 'Sunglow' | 'Sunset Orange' | 'Tan' | 'Teal Blue' | 'Thistle' |
45 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
46 | | 'Tickle Me Pink' | 'Timberwolf' | 'Tropical Rain Forest' | 'Tumbleweed' | 'Turquoise Blue' | 'Unmellow Yellow' |
47 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
48 | | 'Violet (Purple)' | 'Violet Blue' | 'Violet Red' | 'Vivid Tangerine' | 'Vivid Violet' | 'White' |
49 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
50 | | 'Wild Blue Yonder' | 'Wild Strawberry' | 'Wild Watermelon' | 'Wisteria' | 'Yellow' | 'Yellow Green' |
51 | +----------------------+-----------------------+-----------------------------+-------------------+---------------------+-------------------+
52 |
--------------------------------------------------------------------------------
/docs/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile for Sphinx documentation
2 | #
3 |
4 | # You can set these variables from the command line.
5 | SPHINXOPTS =
6 | SPHINXBUILD = sphinx-build
7 | PAPER =
8 | BUILDDIR = _build
9 |
10 | # User-friendly check for sphinx-build
11 | ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
12 | $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
13 | endif
14 |
15 | # Internal variables.
16 | PAPEROPT_a4 = -D latex_paper_size=a4
17 | PAPEROPT_letter = -D latex_paper_size=letter
18 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
19 | # the i18n builder cannot share the environment and doctrees with the others
20 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
21 |
22 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
23 |
24 | help:
25 | @echo "Please use \`make ' where is one of"
26 | @echo " html to make standalone HTML files"
27 | @echo " dirhtml to make HTML files named index.html in directories"
28 | @echo " singlehtml to make a single large HTML file"
29 | @echo " pickle to make pickle files"
30 | @echo " json to make JSON files"
31 | @echo " htmlhelp to make HTML files and a HTML help project"
32 | @echo " qthelp to make HTML files and a qthelp project"
33 | @echo " devhelp to make HTML files and a Devhelp project"
34 | @echo " epub to make an epub"
35 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
36 | @echo " latexpdf to make LaTeX files and run them through pdflatex"
37 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
38 | @echo " text to make text files"
39 | @echo " man to make manual pages"
40 | @echo " texinfo to make Texinfo files"
41 | @echo " info to make Texinfo files and run them through makeinfo"
42 | @echo " gettext to make PO message catalogs"
43 | @echo " changes to make an overview of all changed/added/deprecated items"
44 | @echo " xml to make Docutils-native XML files"
45 | @echo " pseudoxml to make pseudoxml-XML files for display purposes"
46 | @echo " linkcheck to check all external links for integrity"
47 | @echo " doctest to run all doctests embedded in the documentation (if enabled)"
48 |
49 | clean:
50 | rm -rf $(BUILDDIR)/*
51 |
52 | html:
53 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
54 | @echo
55 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
56 |
57 | dirhtml:
58 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
59 | @echo
60 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
61 |
62 | singlehtml:
63 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
64 | @echo
65 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
66 |
67 | pickle:
68 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
69 | @echo
70 | @echo "Build finished; now you can process the pickle files."
71 |
72 | json:
73 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
74 | @echo
75 | @echo "Build finished; now you can process the JSON files."
76 |
77 | htmlhelp:
78 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
79 | @echo
80 | @echo "Build finished; now you can run HTML Help Workshop with the" \
81 | ".hhp project file in $(BUILDDIR)/htmlhelp."
82 |
83 | qthelp:
84 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
85 | @echo
86 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \
87 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
88 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/ReadtheDocsTemplate.qhcp"
89 | @echo "To view the help file:"
90 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/ReadtheDocsTemplate.qhc"
91 |
92 | devhelp:
93 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
94 | @echo
95 | @echo "Build finished."
96 | @echo "To view the help file:"
97 | @echo "# mkdir -p $$HOME/.local/share/devhelp/ReadtheDocsTemplate"
98 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/ReadtheDocsTemplate"
99 | @echo "# devhelp"
100 |
101 | epub:
102 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
103 | @echo
104 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
105 |
106 | latex:
107 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
108 | @echo
109 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
110 | @echo "Run \`make' in that directory to run these through (pdf)latex" \
111 | "(use \`make latexpdf' here to do that automatically)."
112 |
113 | latexpdf:
114 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
115 | @echo "Running LaTeX files through pdflatex..."
116 | $(MAKE) -C $(BUILDDIR)/latex all-pdf
117 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
118 |
119 | latexpdfja:
120 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
121 | @echo "Running LaTeX files through platex and dvipdfmx..."
122 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
123 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
124 |
125 | text:
126 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
127 | @echo
128 | @echo "Build finished. The text files are in $(BUILDDIR)/text."
129 |
130 | man:
131 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
132 | @echo
133 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
134 |
135 | texinfo:
136 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
137 | @echo
138 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
139 | @echo "Run \`make' in that directory to run these through makeinfo" \
140 | "(use \`make info' here to do that automatically)."
141 |
142 | info:
143 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
144 | @echo "Running Texinfo files through makeinfo..."
145 | make -C $(BUILDDIR)/texinfo info
146 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
147 |
148 | gettext:
149 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
150 | @echo
151 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
152 |
153 | changes:
154 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
155 | @echo
156 | @echo "The overview file is in $(BUILDDIR)/changes."
157 |
158 | linkcheck:
159 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
160 | @echo
161 | @echo "Link check complete; look for any errors in the above output " \
162 | "or in $(BUILDDIR)/linkcheck/output.txt."
163 |
164 | doctest:
165 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
166 | @echo "Testing of doctests in the sources finished, look at the " \
167 | "results in $(BUILDDIR)/doctest/output.txt."
168 |
169 | xml:
170 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
171 | @echo
172 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
173 |
174 | pseudoxml:
175 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
176 | @echo
177 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
178 |
--------------------------------------------------------------------------------
/docs/make.bat:
--------------------------------------------------------------------------------
1 | @ECHO OFF
2 |
3 | REM Command file for Sphinx documentation
4 |
5 | if "%SPHINXBUILD%" == "" (
6 | set SPHINXBUILD=sphinx-build
7 | )
8 | set BUILDDIR=_build
9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
10 | set I18NSPHINXOPTS=%SPHINXOPTS% .
11 | if NOT "%PAPER%" == "" (
12 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
13 | set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
14 | )
15 |
16 | if "%1" == "" goto help
17 |
18 | if "%1" == "help" (
19 | :help
20 | echo.Please use `make ^` where ^ is one of
21 | echo. html to make standalone HTML files
22 | echo. dirhtml to make HTML files named index.html in directories
23 | echo. singlehtml to make a single large HTML file
24 | echo. pickle to make pickle files
25 | echo. json to make JSON files
26 | echo. htmlhelp to make HTML files and a HTML help project
27 | echo. qthelp to make HTML files and a qthelp project
28 | echo. devhelp to make HTML files and a Devhelp project
29 | echo. epub to make an epub
30 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
31 | echo. text to make text files
32 | echo. man to make manual pages
33 | echo. texinfo to make Texinfo files
34 | echo. gettext to make PO message catalogs
35 | echo. changes to make an overview over all changed/added/deprecated items
36 | echo. xml to make Docutils-native XML files
37 | echo. pseudoxml to make pseudoxml-XML files for display purposes
38 | echo. linkcheck to check all external links for integrity
39 | echo. doctest to run all doctests embedded in the documentation if enabled
40 | goto end
41 | )
42 |
43 | if "%1" == "clean" (
44 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
45 | del /q /s %BUILDDIR%\*
46 | goto end
47 | )
48 |
49 |
50 | %SPHINXBUILD% 2> nul
51 | if errorlevel 9009 (
52 | echo.
53 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
54 | echo.installed, then set the SPHINXBUILD environment variable to point
55 | echo.to the full path of the 'sphinx-build' executable. Alternatively you
56 | echo.may add the Sphinx directory to PATH.
57 | echo.
58 | echo.If you don't have Sphinx installed, grab it from
59 | echo.http://sphinx-doc.org/
60 | exit /b 1
61 | )
62 |
63 | if "%1" == "html" (
64 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
65 | if errorlevel 1 exit /b 1
66 | echo.
67 | echo.Build finished. The HTML pages are in %BUILDDIR%/html.
68 | goto end
69 | )
70 |
71 | if "%1" == "dirhtml" (
72 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
73 | if errorlevel 1 exit /b 1
74 | echo.
75 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
76 | goto end
77 | )
78 |
79 | if "%1" == "singlehtml" (
80 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
81 | if errorlevel 1 exit /b 1
82 | echo.
83 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
84 | goto end
85 | )
86 |
87 | if "%1" == "pickle" (
88 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
89 | if errorlevel 1 exit /b 1
90 | echo.
91 | echo.Build finished; now you can process the pickle files.
92 | goto end
93 | )
94 |
95 | if "%1" == "json" (
96 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
97 | if errorlevel 1 exit /b 1
98 | echo.
99 | echo.Build finished; now you can process the JSON files.
100 | goto end
101 | )
102 |
103 | if "%1" == "htmlhelp" (
104 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
105 | if errorlevel 1 exit /b 1
106 | echo.
107 | echo.Build finished; now you can run HTML Help Workshop with the ^
108 | .hhp project file in %BUILDDIR%/htmlhelp.
109 | goto end
110 | )
111 |
112 | if "%1" == "qthelp" (
113 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
114 | if errorlevel 1 exit /b 1
115 | echo.
116 | echo.Build finished; now you can run "qcollectiongenerator" with the ^
117 | .qhcp project file in %BUILDDIR%/qthelp, like this:
118 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\complexity.qhcp
119 | echo.To view the help file:
120 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\complexity.ghc
121 | goto end
122 | )
123 |
124 | if "%1" == "devhelp" (
125 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
126 | if errorlevel 1 exit /b 1
127 | echo.
128 | echo.Build finished.
129 | goto end
130 | )
131 |
132 | if "%1" == "epub" (
133 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
134 | if errorlevel 1 exit /b 1
135 | echo.
136 | echo.Build finished. The epub file is in %BUILDDIR%/epub.
137 | goto end
138 | )
139 |
140 | if "%1" == "latex" (
141 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
142 | if errorlevel 1 exit /b 1
143 | echo.
144 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
145 | goto end
146 | )
147 |
148 | if "%1" == "latexpdf" (
149 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
150 | cd %BUILDDIR%/latex
151 | make all-pdf
152 | cd %BUILDDIR%/..
153 | echo.
154 | echo.Build finished; the PDF files are in %BUILDDIR%/latex.
155 | goto end
156 | )
157 |
158 | if "%1" == "latexpdfja" (
159 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
160 | cd %BUILDDIR%/latex
161 | make all-pdf-ja
162 | cd %BUILDDIR%/..
163 | echo.
164 | echo.Build finished; the PDF files are in %BUILDDIR%/latex.
165 | goto end
166 | )
167 |
168 | if "%1" == "text" (
169 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
170 | if errorlevel 1 exit /b 1
171 | echo.
172 | echo.Build finished. The text files are in %BUILDDIR%/text.
173 | goto end
174 | )
175 |
176 | if "%1" == "man" (
177 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
178 | if errorlevel 1 exit /b 1
179 | echo.
180 | echo.Build finished. The manual pages are in %BUILDDIR%/man.
181 | goto end
182 | )
183 |
184 | if "%1" == "texinfo" (
185 | %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
186 | if errorlevel 1 exit /b 1
187 | echo.
188 | echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
189 | goto end
190 | )
191 |
192 | if "%1" == "gettext" (
193 | %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
194 | if errorlevel 1 exit /b 1
195 | echo.
196 | echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
197 | goto end
198 | )
199 |
200 | if "%1" == "changes" (
201 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
202 | if errorlevel 1 exit /b 1
203 | echo.
204 | echo.The overview file is in %BUILDDIR%/changes.
205 | goto end
206 | )
207 |
208 | if "%1" == "linkcheck" (
209 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
210 | if errorlevel 1 exit /b 1
211 | echo.
212 | echo.Link check complete; look for any errors in the above output ^
213 | or in %BUILDDIR%/linkcheck/output.txt.
214 | goto end
215 | )
216 |
217 | if "%1" == "doctest" (
218 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
219 | if errorlevel 1 exit /b 1
220 | echo.
221 | echo.Testing of doctests in the sources finished, look at the ^
222 | results in %BUILDDIR%/doctest/output.txt.
223 | goto end
224 | )
225 |
226 | if "%1" == "xml" (
227 | %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
228 | if errorlevel 1 exit /b 1
229 | echo.
230 | echo.Build finished. The XML files are in %BUILDDIR%/xml.
231 | goto end
232 | )
233 |
234 | if "%1" == "pseudoxml" (
235 | %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
236 | if errorlevel 1 exit /b 1
237 | echo.
238 | echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
239 | goto end
240 | )
241 |
242 | :end
243 |
--------------------------------------------------------------------------------
/docs/audioconfig.rst:
--------------------------------------------------------------------------------
1 | #################
2 | Configuring audio
3 | #################
4 |
5 | .. note::
6 | - Non-Raspberry Pi users and users using other setups, choose the USB-DAC option.
7 | - The speaker-test command is used to initialize alsa, so please do not skip that.
8 | - AIY-HAT users, please reboot the Pi at places mentioned, else it will lead to audio and taskbar issues.
9 | - Those using any other DACs or HATs install the cards as per the manufacturer's guide and then you can use the USB-DAC config file after changing the hardware ids.
10 | - Respeaker users, please do not use their official setup for this project.
11 |
12 |
13 | *******************************************************
14 | Choose the audio configuration according to your setup
15 | *******************************************************
16 | Non-Raspbian users install Alsa first::
17 |
18 | sudo apt-get install alsa-utils
19 |
20 |
21 | Users on Raspberry Pi OS Prior to Dec 2020 Release
22 | ====================================================
23 |
24 | USB DAC or USB Sound Card Users
25 | ---------------------------------
26 | Run the following in the terminal::
27 |
28 | sudo apt-get update
29 | cd /home/${USER}/
30 | sudo chmod +x ./GassistPi/audio-drivers/USB-DAC/scripts/disable-onboard.sh
31 | sudo ./GassistPi/audio-drivers/USB-DAC/scripts/disable-onboard.sh
32 | sudo reboot
33 | cd /home/${USER}/
34 | sudo chmod +x ./GassistPi/audio-drivers/USB-DAC/scripts/install-usb-dac.sh
35 | sudo ./GassistPi/audio-drivers/USB-DAC/scripts/install-usb-dac.sh
36 | speaker-test
37 |
38 |
39 | AIY-HAT Users
40 | ---------------------------------
41 | Run the following in the terminal::
42 |
43 | sudo apt-get update
44 | cd /home/${USER}/
45 | sudo chmod +x ./GassistPi/audio-drivers/AIY-HAT/scripts/configure-driver.sh
46 | sudo ./GassistPi/audio-drivers/AIY-HAT/scripts/configure-driver.sh
47 | sudo reboot
48 | cd /home/${USER}/
49 | sudo chmod +x ./GassistPi/audio-drivers/AIY-HAT/scripts/install-alsa-config.sh
50 | sudo ./GassistPi/audio-drivers/AIY-HAT/scripts/install-alsa-config.sh
51 | speaker-test
52 |
53 |
54 | AIY-VOICE-BONNET Users
55 | ---------------------------------
56 | Run the following in the terminal::
57 |
58 | sudo apt-get update
59 | cd /home/${USER}/
60 | sudo chmod +x ./GassistPi/audio-drivers/AIY-VOICE-BONNET/scripts/configure-driver.sh
61 | sudo ./GassistPi/audio-drivers/AIY-VOICE-BONNET/scripts/configure-driver.sh
62 | sudo reboot
63 | cd /home/${USER}/
64 | sudo chmod +x ./GassistPi/audio-drivers/AIY-VOICE-BONNET/scripts/install-alsa-config.sh
65 | sudo ./GassistPi/audio-drivers/AIY-VOICE-BONNET/scripts/install-alsa-config.sh
66 | speaker-test
67 |
68 | .. note::
69 | Pi users using a release between May 2020 and Dec 2020:
70 | - Copy the USB-MIC-HDMI and USB-MIC-JACK folders from the /Extras/May2020 directory and paste them in the audio-drivers directory and then proceed with the instructions below.
71 |
72 | USB Mic and HDMI Users
73 | ---------------------------------
74 | Run the following in the terminal::
75 |
76 | sudo apt-get update
77 | cd /home/${USER}/
78 | sudo chmod +x ./GassistPi/audio-drivers/USB-MIC-HDMI/scripts/configure.sh
79 | sudo ./GassistPi/audio-drivers/USB-MIC-HDMI/scripts/configure.sh
80 | sudo reboot
81 | cd /home/${USER}/
82 | sudo chmod +x ./GassistPi/audio-drivers/USB-MIC-HDMI/scripts/install-usb-mic-hdmi.sh
83 | sudo ./GassistPi/audio-drivers/USB-MIC-HDMI/scripts/install-usb-mic-hdmi.sh
84 | speaker-test
85 |
86 |
87 | USB Mic and Audio Jack Users
88 | ---------------------------------
89 | Run the following in the terminal::
90 |
91 | sudo apt-get update
92 | cd /home/${USER}/
93 | sudo chmod +x ./GassistPi/audio-drivers/USB-MIC-JACK/scripts/usb-mic-onboard-jack.sh
94 | sudo ./GassistPi/audio-drivers/USB-MIC-JACK/scripts/usb-mic-onboard-jack.sh
95 | speaker-test
96 |
97 |
98 | Custom Voice HAT Users
99 | ---------------------------------
100 | Run the following in the terminal::
101 |
102 | sudo apt-get update
103 | cd /home/${USER}/
104 | sudo chmod +x ./GassistPi/audio-drivers/CUSTOM-VOICE-HAT/scripts/install-i2s.sh
105 | sudo ./GassistPi/audio-drivers/CUSTOM-VOICE-HAT/scripts/install-i2s.sh
106 | sudo reboot
107 | cd /home/${USER}/
108 | sudo chmod +x ./GassistPi/audio-drivers/CUSTOM-VOICE-HAT/scripts/custom-voice-hat.sh
109 | sudo ./GassistPi/audio-drivers/CUSTOM-VOICE-HAT/scripts/custom-voice-hat.sh
110 | speaker-test
111 |
112 |
113 | Respeaker/Waveshare/Raspiaudio 2 Mic HAT Users
114 | ---------------------------------
115 | Run the following in the terminal::
116 |
117 | sudo apt-get update
118 | cd /home/${USER}/
119 | git clone https://github.com/shivasiddharth/WM8960-Audio-HAT
120 | cd ./WM8960-Audio-HAT/
121 | sudo ./install.sh
122 | Before restarting, run::
123 |
124 | sudo nano /etc/pulse/default.pa
125 | In that, add the following lines and save::
126 |
127 | load-module module-alsa-source device = hw: 0,0
128 | load-module module-alsa-sink
129 | Now, you can reboot::
130 |
131 | sudo reboot
132 | speaker-test
133 |
134 |
135 | Users on Raspberry Pi OS Dec 2020 Release or After
136 | ====================================================
137 |
138 |
139 | USB DAC or USB Sound Card or USB Mic Users
140 | ------------------------------------------
141 | From Dec 2020 release, USB audio devices are plug and play.
142 | 1. Insert your USB device.
143 | 2. Right click on the audio/speaker icon on the bar at the top.
144 | 3. Select your Audio Input and Audio Output device.
145 |
146 |
147 | AIY-HAT Users
148 | ---------------------------------
149 | Run the following in the terminal::
150 |
151 | sudo apt-get update
152 | cd /home/${USER}/
153 | sudo chmod +x ./GassistPi/audio-drivers/AIY-HAT/scripts/configure-driver.sh
154 | sudo ./GassistPi/audio-drivers/AIY-HAT/scripts/configure-driver.sh
155 | sudo reboot
156 | speaker-test
157 |
158 |
159 | AIY-VOICE-BONNET Users
160 | ---------------------------------
161 | Run the following in the terminal::
162 |
163 | sudo apt-get update
164 | cd /home/${USER}/
165 | sudo chmod +x ./GassistPi/audio-drivers/AIY-VOICE-BONNET/scripts/configure-driver.sh
166 | sudo ./GassistPi/audio-drivers/AIY-VOICE-BONNET/scripts/configure-driver.sh
167 | sudo reboot
168 | speaker-test
169 |
170 |
171 | Custom Voice HAT Users
172 | ---------------------------------
173 | Run the following in the terminal::
174 |
175 | sudo apt-get update
176 | cd /home/${USER}/
177 | sudo chmod +x ./GassistPi/audio-drivers/CUSTOM-VOICE-HAT/scripts/install-i2s.sh
178 | sudo ./GassistPi/audio-drivers/CUSTOM-VOICE-HAT/scripts/install-i2s.sh
179 | sudo reboot
180 | speaker-test
181 |
182 |
183 | Respeaker/Waveshare/Raspiaudio 2 Mic HAT Users
184 | ---------------------------------
185 | Run the following in the terminal::
186 |
187 | sudo apt-get update
188 | cd /home/${USER}/
189 | git clone https://github.com/shivasiddharth/WM8960-Audio-HAT
190 | cd ./WM8960-Audio-HAT/
191 | sudo ./install.sh
192 | Before restarting, run::
193 |
194 | sudo nano /etc/pulse/default.pa
195 | In that, add the following lines and save::
196 |
197 | load-module module-alsa-source device = hw: 0,0
198 | load-module module-alsa-sink
199 | Now, you can reboot::
200 |
201 | sudo reboot
202 | speaker-test
203 |
204 |
--------------------------------------------------------------------------------
/docs/conf.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | #
3 | # GassistPi documentation build configuration file
4 |
5 |
6 | import sys
7 | import os
8 |
9 | # If extensions (or modules to document with autodoc) are in another directory,
10 | # add these directories to sys.path here. If the directory is relative to the
11 | # documentation root, use os.path.abspath to make it absolute, like shown here.
12 | #sys.path.insert(0, os.path.abspath('.'))
13 |
14 | # -- General configuration ------------------------------------------------
15 |
16 | # If your documentation needs a minimal Sphinx version, state it here.
17 | #needs_sphinx = '1.0'
18 |
19 | # Add any Sphinx extension module names here, as strings. They can be
20 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
21 | # ones.
22 | extensions = ['sphinx.ext.autosectionlabel']
23 |
24 | # Add any paths that contain templates here, relative to this directory.
25 | templates_path = ['_templates']
26 |
27 | # The suffix of source filenames.
28 | source_suffix = '.rst'
29 |
30 | # The encoding of source files.
31 | #source_encoding = 'utf-8-sig'
32 |
33 | # The master toctree document.
34 | master_doc = 'index'
35 |
36 | # General information about the project.
37 | project = u'GassistPi'
38 | copyright = u'2021, Shivasiddharth'
39 |
40 | # The version info for the project you're documenting, acts as replacement for
41 | # |version| and |release|, also used in various other places throughout the
42 | # built documents.
43 | #
44 | # The short X.Y version.
45 | version = '60.38'
46 | # The full version, including alpha/beta/rc tags.
47 | release = '6.0'
48 |
49 | # The language for content autogenerated by Sphinx. Refer to documentation
50 | # for a list of supported languages.
51 | #language = None
52 |
53 | # There are two options for replacing |today|: either, you set today to some
54 | # non-false value, then it is used:
55 | #today = ''
56 | # Else, today_fmt is used as the format for a strftime call.
57 | #today_fmt = '%B %d, %Y'
58 |
59 | # List of patterns, relative to source directory, that match files and
60 | # directories to ignore when looking for source files.
61 | exclude_patterns = ['_build']
62 |
63 | # The reST default role (used for this markup: `text`) to use for all
64 | # documents.
65 | #default_role = None
66 |
67 | # If true, '()' will be appended to :func: etc. cross-reference text.
68 | #add_function_parentheses = True
69 |
70 | # If true, the current module name will be prepended to all description
71 | # unit titles (such as .. function::).
72 | #add_module_names = True
73 |
74 | # If true, sectionauthor and moduleauthor directives will be shown in the
75 | # output. They are ignored by default.
76 | #show_authors = False
77 |
78 | # The name of the Pygments (syntax highlighting) style to use.
79 | pygments_style = 'sphinx'
80 |
81 | # A list of ignored prefixes for module index sorting.
82 | #modindex_common_prefix = []
83 |
84 | # If true, keep warnings as "system message" paragraphs in the built documents.
85 | #keep_warnings = False
86 |
87 |
88 | # -- Options for HTML output ----------------------------------------------
89 |
90 | # The theme to use for HTML and HTML Help pages. See the documentation for
91 | # a list of builtin themes.
92 | html_theme = 'default'
93 |
94 | # Theme options are theme-specific and customize the look and feel of a theme
95 | # further. For a list of options available for each theme, see the
96 | # documentation.
97 | #html_theme_options = {}
98 |
99 | # Add any paths that contain custom themes here, relative to this directory.
100 | #html_theme_path = []
101 |
102 | # The name for this set of Sphinx documents. If None, it defaults to
103 | # " v documentation".
104 | #html_title = None
105 |
106 | # A shorter title for the navigation bar. Default is the same as html_title.
107 | #html_short_title = None
108 |
109 | # The name of an image file (relative to this directory) to place at the top
110 | # of the sidebar.
111 | #html_logo = None
112 |
113 | # The name of an image file (within the static path) to use as favicon of the
114 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
115 | # pixels large.
116 | #html_favicon = None
117 |
118 | # Add any paths that contain custom static files (such as style sheets) here,
119 | # relative to this directory. They are copied after the builtin static files,
120 | # so a file named "default.css" will overwrite the builtin "default.css".
121 | html_static_path = ['_static']
122 |
123 | # Add any extra paths that contain custom files (such as robots.txt or
124 | # .htaccess) here, relative to this directory. These files are copied
125 | # directly to the root of the documentation.
126 | #html_extra_path = []
127 |
128 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
129 | # using the given strftime format.
130 | #html_last_updated_fmt = '%b %d, %Y'
131 |
132 | # If true, SmartyPants will be used to convert quotes and dashes to
133 | # typographically correct entities.
134 | #html_use_smartypants = True
135 |
136 | # Custom sidebar templates, maps document names to template names.
137 | #html_sidebars = {}
138 |
139 | # Additional templates that should be rendered to pages, maps page names to
140 | # template names.
141 | #html_additional_pages = {}
142 |
143 | # If false, no module index is generated.
144 | #html_domain_indices = True
145 |
146 | # If false, no index is generated.
147 | #html_use_index = True
148 |
149 | # If true, the index is split into individual pages for each letter.
150 | #html_split_index = False
151 |
152 | # If true, links to the reST sources are added to the pages.
153 | #html_show_sourcelink = True
154 |
155 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
156 | #html_show_sphinx = True
157 |
158 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
159 | #html_show_copyright = True
160 |
161 | # If true, an OpenSearch description file will be output, and all pages will
162 | # contain a tag referring to it. The value of this option must be the
163 | # base URL from which the finished HTML is served.
164 | #html_use_opensearch = ''
165 |
166 | # This is the file name suffix for HTML files (e.g. ".xhtml").
167 | #html_file_suffix = None
168 |
169 | # Output file base name for HTML help builder.
170 | htmlhelp_basename = 'ReadtheDocsTemplatedoc'
171 |
172 |
173 | # -- Options for LaTeX output ---------------------------------------------
174 |
175 | latex_elements = {
176 | # The paper size ('letterpaper' or 'a4paper').
177 | #'papersize': 'letterpaper',
178 |
179 | # The font size ('10pt', '11pt' or '12pt').
180 | #'pointsize': '10pt',
181 |
182 | # Additional stuff for the LaTeX preamble.
183 | #'preamble': '',
184 | }
185 |
186 | # Grouping the document tree into LaTeX files. List of tuples
187 | # (source start file, target name, title,
188 | # author, documentclass [howto, manual, or own class]).
189 | latex_documents = [
190 | ('index', 'ReadtheDocsTemplate.tex', u'GassistPi Documentation',
191 | u'Shivasiddharth', 'manual'),
192 | ]
193 |
194 | # The name of an image file (relative to this directory) to place at the top of
195 | # the title page.
196 | #latex_logo = None
197 |
198 | # For "manual" documents, if this is true, then toplevel headings are parts,
199 | # not chapters.
200 | #latex_use_parts = False
201 |
202 | # If true, show page references after internal links.
203 | #latex_show_pagerefs = False
204 |
205 | # If true, show URL addresses after external links.
206 | #latex_show_urls = False
207 |
208 | # Documents to append as an appendix to all manuals.
209 | #latex_appendices = []
210 |
211 | # If false, no module index is generated.
212 | #latex_domain_indices = True
213 |
214 |
215 | # -- Options for manual page output ---------------------------------------
216 |
217 | # One entry per manual page. List of tuples
218 | # (source start file, name, description, authors, manual section).
219 | man_pages = [
220 | ('index', 'readthedocstemplate', u'GassistPi Documentation',
221 | [u'Shivasiddharth'], 1)
222 | ]
223 |
224 | # If true, show URL addresses after external links.
225 | #man_show_urls = False
226 |
227 |
228 | # -- Options for Texinfo output -------------------------------------------
229 |
230 | # Grouping the document tree into Texinfo files. List of tuples
231 | # (source start file, target name, title, author,
232 | # dir menu entry, description, category)
233 | texinfo_documents = [
234 | ('index', 'ReadtheDocsTemplate', u'GassistPi Documentation',
235 | u'Shivasiddharth', 'ReadtheDocsTemplate', 'One line description of project.',
236 | 'Miscellaneous'),
237 | ]
238 |
239 | # Documents to append as an appendix to all manuals.
240 | #texinfo_appendices = []
241 |
242 | # If false, no module index is generated.
243 | #texinfo_domain_indices = True
244 |
245 | # How to display URL addresses: 'footnote', 'no', or 'inline'.
246 | #texinfo_show_urls = 'footnote'
247 |
248 | # If true, do not generate a @detailmenu in the "Top" node's menu.
249 | #texinfo_no_detailmenu = False
250 |
--------------------------------------------------------------------------------
/docs/customization.rst:
--------------------------------------------------------------------------------
1 | ========================================
2 | Guide to use the customizations/features
3 | ========================================
4 |
5 |
6 |
7 | Enabling or Disabling Custom Actions
8 | ------------------------------------
9 |
10 | Major custom actions have been provided with a control key or switch in the **config.yaml**.
11 | Set it to **Enabled** to enable the custom actions and set it to **Disabled** to disable them.
12 |
13 |
14 |
15 | Using Custom Actions in Non-English Languages
16 | ---------------------------------------------
17 |
18 | 1. Languages supported: French, Italian, Spanish, Dutch, German and Swedish.
19 | 2. In the **config.yaml** file, under the **Languages and Choice** option set your desired language.
20 | 3. Use the Translated versions of the English syntaxes given for all the custom actions.
21 | 4. You can change the keywords/trigger words for the custom actions in the keywords file.
22 |
23 |
24 |
25 | Controlling Sonoff-Tasmota, Domoticz devices from Google Home
26 | -------------------------------------------------------------
27 |
28 | 1. This has been implemented using Adafruit_IO.
29 | 2. Create an acount and a feed in adafruit.io website.
30 | 3. Enter those details in the config.yaml file.
31 | 4. Register or login into `IFTTT `_ and create an applet to send commands from google assistant to adafruit_io feed.
32 | 5. For controlling domoticz and sonoff devices, the adafruit.io command should match the syntaxes for the respective custom actions.
33 |
34 |
35 |
36 | Using the Interpreter Mode
37 | --------------------------
38 |
39 | .. note:: Google has the interpreter feature enabled in the cloud. That is, you can use the interpreter without this customization hack. You can leave this feature disabled in the config.yaml.
40 |
41 | .. note:: This uses GOOGLE CLOUD SPEECH API. Free usage is limited to `60MINS/MONTH `_.
42 |
43 | 1. Go to the projects `page `_ on your Google Cloud Console.
44 | 2. Select your project from the list.
45 | 3. On the left top corner, click on the hamburger icon or three horizontal stacked lines.
46 | 4. From the **API and services** option, select library and in the search bar type **speech**, select **Cloud Speech API** and click on "ENABLE".
47 | 5. You will be prompted to create a billing account if you already have not created one. Follow the onscreen instructions to create a billing account and then Enable the API.
48 | 6. Create a service account and generate credentials.
49 | 7. Copy the downloaded the JSON key and place it /home/pi/ directory **DO NOT RENAME**.
50 | 8. Enter the path to the Key along with the key name Eg: /home/pi/xxxx.json in the config.yaml file in the "Google_Cloud_Speech_Credentials_Path" field under "Speechtotext".
51 | You can use one key for Cloud Speech and Cloud Text to Speech, but should enter the same path seperately in config.yaml
52 |
53 | **Command Syntax:**
54 |
55 | To start the interpreter::
56 |
57 | Hey Google, Start __Your-Desired-Language__ interpreter.
58 |
59 | To stop the interpreter::
60 |
61 | Hey Google, Stop interpreter.
62 |
63 |
64 |
65 | Using Google Cloud Text to Speech
66 | ---------------------------------
67 |
68 | .. note:: GOOGLE CLOUD TEXT TO SPEECH API has limited free access. Once the quota is exceeded, the program will automatically switch to gTTS.
69 |
70 | 1. Go to the projects `page `_ on your Google Cloud Console.
71 | 2. Select your project from the list.
72 | 3. On the left top corner, click on the hamburger icon or three horizontal stacked lines.
73 | 4. "From the API and services" option, select library and in the search bar type text, select "Cloud Text-to-Speech API" and click on "ENABLE".
74 | 5. In the API window, click on "Credentials" and then on "+ Create Credential".
75 | 6. In the "Add credentials to your project" window, in step-1 under "Which API are you using?" drop down choose "Cloud Text-to-Speech API" and down below choose "No, I’m not using them". Then click on "What credentials do I need?"
76 | 7. In step-2 give your service account a name and on the right in the "Role" drop down choose Project-->Owner and under "Key Type" select "JSON" and click "Continue".
77 | 8. Copy the downloaded key and place it /home/pi/ directory DO NOT RENAME.
78 | 9. Enter the path to the Key along with the key name Eg: /home/pi/xxxx.json in the config.yaml file in the **Google_Cloud_TTS_Credentials_Path** field.
79 |
80 | .. note:: You can use one key for Cloud Speech and Cloud Text to Speech, but should enter the same path seperately in config.yaml
81 |
82 |
83 |
84 | Adding Custom Search API and Generating API Key
85 | -----------------------------------------------
86 | 1. Go to the projects `page `_ on your Google Cloud Console.
87 | 2. Select your project from the list.
88 | 3. On the left top corner, click on the hamburger icon or three horizontal stacked lines.
89 | 4. Move your mouse pointer over **API and services** and choose **Credentials**.
90 | 5. Click on create credentials and select API Key and choose close. Make a note of the created API Key and enter it in the config.yaml script at the indicated location.
91 | 6. "From the API and services" option, select library and in the search bar type **search**, select **Custom Search API** API and click on "ENABLE".
92 | 7. In the API window, click on "All API Credentials" and in the drop down, make sure to have a tick (check mark) against the API Key that you just generated.
93 |
94 |
95 |
96 | Adding YouTube Data API and Generating API Key
97 | -----------------------------------------------
98 | 1. Go to the projects `page `_ on your Google Cloud Console.
99 | 2. Select your project from the list.
100 | 3. On the left top corner, click on the hamburger icon or three horizontal stacked lines.
101 | 4. Move your mouse pointer over **API and services** and choose **Credentials**.
102 | 5. Click on create credentials and select API Key and choose close. Make a note of the created API Key and enter it in the config.yaml script at the indicated location.
103 | 6. "From the API and services" option, select library and in the search bar type **youtube**, select **YouTube Data API v3** API and click on "ENABLE".
104 | 7. In the API window, click on "All API Credentials" and in the drop down, make sure to have a tick (check mark) against the API Key that you just generated.
105 |
106 | .. note:: If a custom action uses both Custom Search and YouTube API, you need to enable both the APIs but only one API KEY needs to be generated.
107 |
108 | .. note:: The same API key can be used for all the associated custom actions.
109 |
110 |
111 |
112 | Controlling Assistant or Sending Preset Commands Using IR Remote
113 | ------------------------------------------------------
114 |
115 | 1. Connect the IR Receiver according to the wiring diagram given below.
116 |
117 | .. figure:: ../docs/_static/images/IRWiring.jpg
118 | :align: center
119 | :scale: 40%
120 | :target: ../docs/_static/images/IRWiring.jpg
121 |
122 | .. note:: The diagram given is for GPIO 17, if you are using another GPIO, please make the suitable changes to the connection.
123 |
124 | 2. Run the sample IR receiver script to get the codes for your desired buttons::
125 |
126 | python /home/${USER}/GassistPi/Extras/IR-Sensor.py
127 |
128 | 3. In the config.yaml under IR, list your codes and corresponding queries/actions. The number of queries should match the number of codes listed.
129 |
130 | 4. If you want to execute the custom actions like Spotify, YouTube playback, Domoticz Control etc, prefix the word custom.
131 |
132 | Eg::
133 |
134 | custom Play God's Plan from Youtube
135 | custom Turn On _Domoticz-device-name__
136 | custom Play all the songs from Google Music
137 |
138 | 5. If you are sending a command to be processed by google assistant, there is no need to prefix custom.
139 |
140 | Eg::
141 |
142 | what is the time
143 | what can you do for me
144 |
145 | **Video for reference:**
146 |
147 | .. raw:: html
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 | Sending Commands or Queries to Google Assistant Over MQTT
156 | ------------------------------------------------------
157 |
158 | 1. Set up your desired MQTT broker.
159 | If you are setting up Raspberry Pi as a MQTT broker, follow the guide below.
160 |
161 | .. raw:: html
162 |
163 |
164 |
165 |
166 |
167 | 2. Enter the MQTT broker credentials and subscription topic in the provided config.yaml file.
168 | 3. Set the **MQTT_Control** to **Enabled**.
169 | 4. Now, you can send queries or commands to google assistant over MQTT.
170 | 5. If you are sending a command for custom actions, prefix custom in the payload.
171 |
172 | Eg::
173 |
174 | custom Play God's Plan from Youtube
175 | custom Turn On __Domoticz-device-name__
176 | custom Play all the songs from Google Music
177 |
178 | 6. If you are sending a command to be processed by google assistant, there is no need to prefix custom.
179 |
180 | Eg::
181 |
182 | what is the time
183 | what can you do for me
184 |
185 | 7. To turn on/off microphone just send the simple command mute.
186 |
187 | Eg::
188 |
189 | mute
190 |
191 | **For more details on the how to use this feature, refer to the video below:**
192 |
193 | .. raw:: html
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 | Streaming Music from Deezer
202 | ---------------------------
203 |
204 | .. note::
205 | - As a roundabout approach, I have programmed the assistant to get the playlist details using Deezer API and then fetch those tracks from YouTube.
206 | - This feature uses a YouTube Data API v3.
207 | - Click `here `_ for guidelines to add YouTube Data API to the project and to generate the required key.
208 |
209 | 1. Add your Deezer user number in the config.yaml under the **Deezer:** and **User_id**.
210 |
211 | 2. In the config.yaml, under **Google_cloud_api_key:** replace **ENTER-YOUR-GOOGLE-CLOUD-API-KEY-HERE** with the key from Google Cloud Console.
212 |
213 | **Command Syntax:**
214 |
215 | To play the playlists added to your Deezer account::
216 |
217 | Hey Google, Play playlist __playlist-number__ from Deezer.
218 |
219 | Example::
220 |
221 | Hey Google, Play __playlist 1__ from Deezer
222 |
223 |
224 |
225 | Streaming Music from Gaana.com
226 | ------------------------------
227 |
228 | .. note::
229 | - As a roundabout approach, I have programmed the assistant to get the playlist details using Deezer API and then fetch those tracks from YouTube.
230 | - This feature uses both YouTube Data API v3 and Custom Search API.
231 | - Click `here `_ for guidelines to add YouTube Data API to the project and to generate the required key.
232 | - Click `here `_ for guidelines to add Custom Search API to the project and to generate the required key.
233 |
234 | 1. Add your playlists in the config.yaml under **Gaana: and Playlists:**.
235 | 2. In the config.yaml, under **Google_cloud_api_key:** replace **ENTER-YOUR-GOOGLE-CLOUD-API-KEY-HERE** with the key from Google Cloud Console.
236 |
237 | **Command Syntax:**
238 |
239 | 1. To play the playlists added in config.yaml file::
240 |
241 | Hey Google, Play playlist __playlist-number__ from Gaana.com
242 |
243 | Example::
244 |
245 | Hey Google, Play __playlist 1__ from Gaana.com
246 |
247 | 2. To play other playlists::
248 |
249 | Hey Google, Play __user-playlist-query__ from Gaana.com
250 |
251 | Example::
252 |
253 | Hey Google, Play __Bollywood top 50__ from Gaana.com
254 |
255 |
256 |
257 | Controlling Domoticz Devices
258 | ----------------------------
259 |
260 | .. note:: As of today, you can control lights and switches only, more controls will be added in the future.
261 |
262 | 1. In the config.yaml file under **Domoticz:** change **Domoticz_Control:** from **Disabled** to **Enabled**.
263 | 2. List the device names and the ids that you want to control in the config.yaml file.
264 | The names should be the same as the ones in the domoticz server.
265 |
266 | **Command Syntax:**
267 |
268 | 1. To On/Off/Toggle::
269 |
270 | Hey Google, Turn On/Turn Off/Toggle __Name of your light__
271 |
272 | Example::
273 |
274 | Hey Google, Turn On __Bedroom Lamp__
275 |
276 | 2. To Change Brightness (between 0 and 100)::
277 |
278 | Hey Google, Set __Name of your light__ brightness to __desired value__
279 |
280 | Example::
281 |
282 | Hey Google, Set __Bedroom lamp__ brightness to __5__
283 |
284 | 3. To Change Colour (refer to the `list of available colors `_)::
285 |
286 | Hey Google, Set _Name of your light_ color to __desired color__
287 | Hey Google, Change __Name of your light__ to __desired color__ color
288 |
289 | Example::
290 |
291 | Hey Google, Set __Bedroom lamp__ color to __red__
292 | Hey Google, Change __Bedroom lamp__ to __red__ color
293 |
294 |
295 |
296 | Custom Conversations
297 | ----------------------------
298 |
299 | 1. Customize the assistant's reply to a specific question.
300 | 2. Add the list of questions and answers in config.yaml under the **Conversation**: option.
301 | 3. **There must be only one question, but corresponding answers can be as many**.
302 | 4. Sample questions and answers has been provided, please follow the same pattern.
303 |
304 |
305 |
306 | Custom Wakeword Activation
307 | ----------------------------
308 |
309 | 1. You can choose to either Enable or Disable the custom wakeword activation in the config.yaml file.
310 | 2. In the config.yaml file, under Wakewords, change the **"Custom_Wakeword"** to **'Enabled'** if you want to use the custom wakeword or set it to 'Disabled' if you dont want to use the custom wakeword option.
311 | 3. You have a choice between Snowboy and Picovoice for the custom wakeword engine.
312 | 4. For Snowboy, change **"Wakeword_Engine"** to **Snowboy** and for Picovoice, change **"Wakeword_Engine"** to **Picovoice**.
313 | 5. For changes to take effect, you need to restart the assistant. Changing status while an instance of assistant is already running will not cause any change.
314 | 6. Create your custom snowboy model `here `_. Add the models to **/GassistPi/src/resources/snowboy_models** directory.
315 | 7. Sample Snowboy and Picovoice models have been provided and placed in the /GassistPi/src/resources/ folder. Set your desired models by setting their paths in the config.yaml file.
316 | 8. To disable the default **"Ok Google"** hotword, set the Ok_Google option to **"Disabled"**.
317 |
318 | .. note:: If you turn off the default **Ok Google** wakeword/hotword, everytime you invoke the assistant using the custom wakeword, you will get a prompt for the Mic being turned Off and On.
319 |
320 | 9. Users using pushbutton.py or Pi Zero users have an option between using custom wakeword and GPIO trigerring. If custom wakeword is enabled, then GPIO trigger will not work. To enable GPIO triggering, set custom wakeword to 'Disabled'.
321 |
322 |
323 |
324 | Playing Spotify Playlist
325 | ----------------------------
326 |
327 | .. note::
328 | - Spotify API currently only supports playback in a web browser, but DRM content is being blocked in the Raspberry Pi.
329 | - As a roundabout approach, I have programmed the assistant to get the playlist details using Spotipy API and then fetch those tracks from YouTube. This custom program has a better accuracy than spotify playlist playback using mpsyt.
330 | - This feature uses a YouTube Data API v3.
331 | - Click `here `_ for guidelines to add YouTube Data API to the project and to generate the required key.
332 |
333 | 1. Click `here `_ and register for a spotify developer account, if you already don't have one.
334 | 2. In the developer's dashboard, choose **CREATE A CLIENT ID**. In the pop-up window provide the requested details.
335 | 3. Set the Redirect URIs to http://localhost:8888
336 | 4. Click on the new app created and copy the **CLIENT ID** and **CLIENT SECRET**. Paste it in the config.yaml file in the indicated space.
337 | 5. Access spotify `here `_ and copy the username to be entered in config.yaml.
338 |
339 | **Command Syntax:**
340 |
341 | To play your playlist::
342 |
343 | Hey Google, Play __user-playlist-query__ from Spotify
344 |
345 | Example::
346 |
347 | Hey Google, Play __Workout playlist__ from Spotify
348 | Hey Google, Play __Top Dance Numbers__ from Spotify
349 |
350 | .. note:: If your playlist name does not have the word **playlist** do not use that in the query.
351 |
352 |
353 |
354 | Tracking Kickstarter Campaigns
355 | --------------------------------
356 | A custom Google search engine for `Kickstarter `_ has been used. This requires an API to be added to your existing project.
357 |
358 | Click `here `_ for guidelines to add Custom Search API to the project and to generate the required key.
359 |
360 | **Command Syntax:**
361 |
362 | To track a Kickstarter campaign::
363 |
364 | Hey Google, Track __your-desired-campaign__ Kickstarter campaign
365 | Hey Google, What is the status of __your-desired-campaign__ Kickstarter campaign
366 |
367 | Example::
368 |
369 | Hey Google, Track __Mycroft 2__ Kickstarter campaign
370 | Hey Google, What is the status of __Mycroft 2__ Kickstarter campaign
371 |
372 |
373 |
374 | Emulated Philips Hue Control
375 | -----------------------------
376 |
377 | 1. Credits for the `Emulated Hue `_ to `Marius Motea `_.
378 | 2. Follow the guidelines given in the `diyHue's documents `_ to setup the Emulated Hue Service.
379 | 3. Download sketches for your NodeMCU/Wemos/ESP Devices from `here `_.
380 | 4. If the Hue config file is not in the default location, change the path to the Hue config file in the following lines of main.py script.
381 |
382 | .. code-block:: python
383 |
384 | if os.path.isfile('/opt/hue-emulator/config.json'):
385 | with open('/opt/hue-emulator/config.json', 'r') as config
386 |
387 | **Command Syntax:**
388 |
389 | 1. To turn On/Off lights::
390 |
391 | Hey Google, Turn __Hue-Light-Name__ On/Off
392 |
393 | 2. To change light color::
394 |
395 | Hey Google, Change __Hue-Light-Name__ colour to __Required-Colour__
396 |
397 | 3. To change brightness::
398 |
399 | Hey Google, Change __Hue-Light-Name brightness__ to __Required-Brightness-Level__
400 |
401 |
402 |
403 | Sending Voice Messages from Pi to Phone/Tablet
404 | ----------------------------------------------
405 |
406 | .. note:: For pushing voice messages, the GassistPi uses Pushbullet API.
407 |
408 | 1. Download and install pushbullet app on your tablet/mobile device.
409 | 2. Visit www.pushbullet.com register for new account or sign in with your existing account.
410 | 3. Choose Settings-->Account and then choose **Create access token**.
411 | 4. Copy this token and paste in config.yaml under **Pushbullet** and **Pushbullet_API_KEY**.
412 |
413 | **Command Syntax:**
414 |
415 | To send message::
416 |
417 | Hey Google, Send message
418 |
419 |
420 |
421 | Send SMS via Clickatell
422 | ------------------------
423 |
424 | 1. Create a free account with clickatell.com.
425 | 2. Sign in to Clickatell SMS Platform.
426 | 3. Create sms integration.
427 | 4. Add your generated clickatell api number in config.yaml at the given point.
428 |
429 | **Command Syntax:**
430 |
431 | To send sms::
432 |
433 | Hey Google, Send clickatell message to __Person-name__
434 |
435 |
436 |
437 | Get Recipe Messaged to Mobile/Tablet
438 | --------------------------------------
439 |
440 | .. note:: This feature uses the Pushbullet API for sending the recipes. Please first setup the Pushbullet feature as given here.
441 |
442 | GassistPi uses `Edamam `_ for getting recipe details/info. To use this feature:
443 | 1. Click `here `_ to visit the developers' porta for Edamam.
444 | 2. Signup as a developer/login with your existing account.
445 | 3. In the Menubar at the top, Click on Dashboard-->Applications-->Create a new applicatiuon-->Recipe Search API and then create a new application.
446 | 4. Copy the application id and application key and paste it in the actions.py script under the getrecipe function.
447 |
448 | .. note:: While copying the application key, do not copy the "—"
449 |
450 | **Command Syntax:**
451 |
452 | To get recipes::
453 |
454 | Hey Google, Get ingredients for __Required-Item__
455 |
456 |
457 |
458 | Control Magic Mirror by Voice
459 | -----------------------------
460 |
461 | 1. You can control either Magic Mirror running on another Pi or Magic Mirror running on the same pi as GassistPi.
462 | 2. As a prerequisite, you should have the remote control module installed in the Pi running Magic Mirror.
463 | 3. Enter the Ip address of Pi running Magic Mirror in the config.yaml against the variable **mmmip** declared.
464 |
465 | **Command Syntax:**
466 |
467 | 1. To show/hide weather module::
468 |
469 | Hey Google, Show/Hide Weather on Magic Mirror
470 |
471 | 2. To turn magic mirror display on/off::
472 |
473 | Hey Google, Turn Magic Mirror display on/off
474 |
475 | 3. To power off/reboot/restart Magic Mirror::
476 |
477 | Hey Google, Power off/Reboot/Restart Magic Mirror
478 |
479 |
480 |
481 | Indicators for Google Assistant's Listening and Speaking Events
482 | ---------------------------------------------------------------
483 |
484 | .. note:: Default GPIOs for the indicators are BCM GPIO05 and GPIO06. If you want to change the pins, change it in the config.yaml file.
485 |
486 | Connect LEDs with colours of your choice to GPIO05 for Listening and GPIO06 for Speaking Events.
487 |
488 |
489 |
490 | Pushbutton to Stop Music/Radio Playback and for Muting the Microphone
491 | ---------------------------------------------------------------------
492 |
493 | .. note:: Default GPIO for the pushbutton is BCM GPIO23. If you want to change the pins, change it in the config.yaml file.
494 |
495 | Connect a pushbutton between GPIO23 and Ground. Single press mutes microphone and double press stops music streaming.
496 |
497 |
498 |
499 | Voice Control of GPIOs, Servo Motor and Safe Shutdown of Pi
500 | -----------------------------------------------------------
501 |
502 | .. note::
503 | - This feature uses a combination of two keywords to prevent false positives. These can be changed in the keywords.yaml file.
504 | - The default main keyword is **trigger**.
505 | - The default keyword for servo motor control is **servo**.
506 | - The default keyword for safe shutdown is **shutdown**.
507 | - Names for devices connected to the GPIOs should be assigned in the config.yaml file.
508 |
509 | **Command Syntax:**
510 |
511 | 1. To turn device connected to GPIO on/off::
512 |
513 | Hey Google, **Trigger** turn __Device-Name__ on/off
514 |
515 | 2. To turn servo motor (example by 90 degrees)::
516 |
517 | Hey Google, **Trigger** **servo** 90
518 |
519 | 3. To power off the Pi::
520 |
521 | Hey Google, **Trigger Shutdown**
522 |
523 | **Check out the demo in the video below:**
524 |
525 | .. raw:: html
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 | Voice Control of NodeMCU
534 | --------------------------
535 |
536 | NodeMCU control has been implemented in two ways:
537 |
538 | 1. Control of NodeMCU running a webserver.
539 | 2. Control of NodeMCU running Sonoff-Tasmota Firmware.
540 |
541 | Controlling NodeMCU Running Webserver
542 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
543 |
544 | 1. Download the Arduino IDE code for Nodemcu from `here `_.
545 | 2. Add the wifi credentials, make the desired changes and upload the Arduino code onto the NodeMCU and get the IP address from the serial monitor.
546 | 3. Add the NodeMCU's IP address in the config.yaml under the **ESP** and **IP**.
547 | 4. Set device names in the config.yaml under **ESP** and **devicename**.
548 | 5. The default keyword for NodeMCU control is **Wireless**. You can change this in the keywords.yaml file.
549 |
550 | **Command Syntax:**
551 |
552 | To turn the device or ESP Pin on/off::
553 |
554 | Hey Google, **Wireless** turn __Device-Name__ on/off
555 |
556 | Controlling NodeMCU Running Sonoff-Tasmota Firmware
557 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
558 |
559 | 1. Download the Tasmota firmware from this `link `_.
560 |
561 | .. note:: This is an old firmware. You can upgrade to the latest firmware from this one.
562 |
563 | 2. Upload the firmware properly. You can use this video for reference.
564 |
565 | .. raw:: html
566 |
567 |
568 |
569 |
570 |
571 | 3. Set your Tasmota details in the under **Tasmota_devicelist** in config.yaml file.
572 |
573 | **Command Syntax:**
574 |
575 | To turn the Tasmota device on/off::
576 |
577 | Hey Google, Turn __Tasmota-Device-Name__ on/off
578 |
579 |
580 |
581 | Casting YouTube Videos to Chromecast and Chromecast Control
582 | -----------------------------------------------------------
583 | .. note::
584 | - This feature uses a YouTube Data API v3. Click `here `_ for guidelines to add YouTube Data API to the project and to generate the required key.
585 | - The default keyword is **Chromecast**. You can change that in the main.py script at ``# if 'chromecast'.lower() in str(usrcmd).lower():``.
586 | - The IP address of Chromecast can be set in the actions.py file at:
587 |
588 | .. code-block:: bash
589 |
590 | def chromecast_control(action):
591 | # Chromecast declarations
592 | # Do not rename/change "TV" its a variable
593 | TV = pychromecast.Chromecast("192.168.1.13") #Change ip to match the ip-address of your Chromecast
594 |
595 | - Google has permitted the Chromecast control on its own. So this feature has been disabled. It can be enabled, if Google disables chromecast control in the future.
596 |
597 | **Command Syntax:**
598 |
599 | 1. To Play Video on Chromecast::
600 |
601 | Hey Google, Play __Desired-Video__ on Chromecast
602 |
603 | 2. To Stop Playback::
604 |
605 | Hey Google, Stop Chromecast
606 |
607 | 3. To Change volume::
608 |
609 | Hey Google, Chromecast Volume Up/Down
610 |
611 |
612 |
613 | Controlling Media or Music Streaming by Voice
614 | ---------------------------------------------
615 |
616 | You can change volume, play, pause, change music/radio. Command syntaxes have been given below with the keyword within * symbols.
617 |
618 | **Command Syntax:**
619 |
620 | 1. To Pause::
621 |
622 | Hey Google, **Pause Music**
623 |
624 | 2. To Resume::
625 |
626 | Hey Google, **Resume Music**
627 |
628 | 3. To Increase/Decrease volume::
629 |
630 | Hey Google, Increase/Decrease **Music Volume** by __A-Number-Between-0-100__
631 |
632 | 4. To Set Volume::
633 |
634 | Hey Google, Set/Change **Music Volume** to __A-Number-Between-0-100__
635 |
636 | 5. To Set Volume to Maximum/Minimum::
637 |
638 | Hey Google, Set/Change **Music Volume** to maximum/minimum
639 |
640 | 6. To Change to Previous Track::
641 |
642 | Hey Google, **Play Previous**
643 | Hey Google, **Play Previous** Song
644 | Hey Google, **Play Previous** Track
645 |
646 | 7. To Change to Next Track::
647 |
648 | Hey Google, **Play Next**
649 | Hey Google, **Play Next** Song
650 | Hey Google, **Play Next** Track
651 |
652 |
653 |
654 | Music Streaming from YouTube
655 | -------------------------------
656 |
657 | 1. Music playback from YouTube is facilitated by the YouTube Data API v3.
658 | 2. Click `here `_ for guidelines to add YouTube Data API to the project and to generate the required key.
659 |
660 | **Command Syntax:**
661 |
662 | 1. To Play a Song::
663 |
664 | Hey Google, Play __Desired-Song-Name__ from YouTube
665 |
666 | 2. To Play and Song and Related 10 Songs::
667 |
668 | Hey Google, Autoplay __Desired-Song-Name__ from YouTube
669 |
670 | 3. To Play a Song from a Playlist::
671 |
672 | Hey Google, Play __Desired-Playlist-Name__ from YouTube
673 |
674 | 4. To Play 10 Songs from a Playlist::
675 |
676 | Hey Google, Autoplay __Desired-Playlist-Name__ from YouTube
677 |
678 | 5. To Play a Song from a Channel::
679 |
680 | Hey Google, Play __Desired-Channel-Name__ from YouTube
681 |
682 | 6. To Play 10 Songs from a Channel::
683 |
684 | Hey Google, Autoplay __Desired-Channel-Name__ from YouTube
685 |
686 | .. note:: Depending upon the internet and the system/board specification, the features that involve 10 tracks will take some time to fetch the track list.
687 |
688 |
689 |
690 | Music Streaming from Google Music
691 | ---------------------------------
692 | ..note:: `Due to Google shutting down the Google Music service/app `_, the parts of codes pertaining to this feature have been commented out.
693 |
694 | The music streaming from Google Music is facilitated by using `gmusicapi. `_
695 |
696 | First you need to authorize the api to access your Google Music data. Run the following script to authorize prior to starting the assistant.
697 |
698 | .. code-block:: bash
699 |
700 | /home/${USER}/env/bin/python -u /home/${USER}/GassistPi/Extras/gmusicauth.py
701 |
702 | **Command Syntax:**
703 |
704 | 1. To Play All Songs in Loop::
705 |
706 | Hey Google, Play All the songs from Google Music
707 |
708 | 2. To Play a Playlist::
709 |
710 | Hey Google, Play songs from the first playlist from Google Music
711 |
712 | .. note:: Playlists are sorted by date created, if you have multiple playlists, use a similar syntax replacing first with second, third etc
713 |
714 | 3. To Play Songs by a Particular Artist::
715 |
716 | Hey Google, Play songs by artist __YOUR-DESIRED-ARTIST__ from Google Music
717 |
718 | 4. To Play Songs from a Particular Album::
719 |
720 | Hey Google, Play songs from album __YOUR-DESIRED-ALBUM-NAME__ from Google Music
721 |
722 |
723 |
724 | Run Custom Scripts
725 | --------------------
726 |
727 | 1. By default, running custom scripts is disabled.
728 | 2. To enable it, change **Script_Control:** in config.yaml from **Disabled** to **Enabled**.
729 |
730 | .. note:: The number of script names mentioned should match the number of script commands in config.yaml.
731 |
732 | **Command Syntax:**
733 |
734 | To Run a Script::
735 |
736 | Hey Google, Run Script __Desired-Script-Name__
737 |
738 |
739 |
740 | Playing Radio Channels
741 | -----------------------
742 |
743 | Radio station names and the associated links are to be set in the config.yaml file
744 |
745 | .. note:: The number of radio station names mentioned should match the number of radio station links in config.yaml.
746 |
747 | **Command Syntax:**
748 |
749 | To Play a Radio Station::
750 |
751 | Hey Google, Play Radio __Desired-Radio-Station-Name__
752 |
753 |
754 |
755 | Tracking Parcels
756 | -----------------
757 |
758 | 1. Regsiter for a free account with `Aftership. `_
759 | 2. Generate an API number and add parcels to the tracking list.
760 | 3. Add the API number in the actions.py file
761 |
762 | For a better understanding follow the attached youtube video.
763 |
764 | .. raw:: html
765 |
766 |
767 |
768 |
769 |
770 | **Command Syntax:**
771 |
772 | To Track Parcels::
773 |
774 | Hey Google, Where is my parcel
775 |
776 | Hey Google, Track my parcel
777 |
778 |
779 | RSS Feeds Streaming
780 | ----------------------
781 |
782 | .. note:: **numfeeds** variable within the feed function in actions.py file is the feed limit. Certain RSS feeds can have upto 60 items and **numfeeds** variable limits the number of items to stream. The default value has been set to 10, which if you want can change.
783 |
784 | **Command Syntax:**
785 |
786 | To Play Feeds::
787 |
788 | Hey Google, Top Tech News please
789 |
790 | Hey Google, Top Sports News please
791 |
792 | Hey Google, Top World News please
793 |
794 | .. note:: You can interrupt the feed playback using the Stop Pushbutton
795 |
796 |
797 |
798 | KODI Control
799 | ------------------
800 |
801 | .. note:: By default, the KODI control is disabled. To enable, in the config.yaml, under kodi, change control option from **'Disabled'** to **'Enabled'**.
802 |
803 |
804 | 1. Music playback from YouTube is facilitated by the YouTube Data API v3.
805 | 2. Click `here `_ for guidelines to add YouTube Data API to the project and to generate the required key.
806 | 3. Enable HTTP COntrol in KODI
807 | i. Settings → Services → Control → Allow remote control via HTTP.
808 | ii. Set the port number to 8080, username to kodi and password to kodi (username and password should be in lowercase).
809 | 4. For Kodi to play the YouTube video, you need to add and enable the YouTube Plugin on Kodi.
810 |
811 | **Command Syntax:**
812 |
813 | +---------------------------------------------------------+----------------------------------------------------------------------+
814 | | Command Syntax | What it does |
815 | +=========================================================+======================================================================+
816 | | Hey Google, Shuffle my songs on kodi | Shuffles all the songs added to the kodi library |
817 | +---------------------------------------------------------+----------------------------------------------------------------------+
818 | | Hey Google, Play songs from _Album name_ on kodi | Plays all the songs under the mentioned Album name |
819 | +---------------------------------------------------------+----------------------------------------------------------------------+
820 | | Hey Google, Play songs by, _Artist name_ on kodi | Plays all the songs rendered by the mentioned artist |
821 | +---------------------------------------------------------+----------------------------------------------------------------------+
822 | | Hey Google, Play _Song name_ song on kodi | Plays the requested song, if it has been added to the library |
823 | +---------------------------------------------------------+----------------------------------------------------------------------+
824 | | Hey Google, Play _Movie name_ movie on kodi | Plays the requested movie, if it has been added to the library |
825 | +---------------------------------------------------------+----------------------------------------------------------------------+
826 | | Hey Google, From YouTube, Play _Youtube Video_ on kodi | Fetches the YouTube video and plays it on kodi |
827 | +---------------------------------------------------------+----------------------------------------------------------------------+
828 | | Hey Google, What is playing? on kodi | Tells you by voice as to what is currently playing |
829 | +---------------------------------------------------------+----------------------------------------------------------------------+
830 | | Hey Google, Repeat this or Repeat one on kodi | Repeats the current track playing |
831 | +---------------------------------------------------------+----------------------------------------------------------------------+
832 | | Hey Google, Repeat all on kodi | Changes repeat mode to all |
833 | +---------------------------------------------------------+----------------------------------------------------------------------+
834 | | Hey Google, Repeat off on kodi | Turns off Repeat |
835 | +---------------------------------------------------------+----------------------------------------------------------------------+
836 | | Hey Google, Turn Shuffle On on kodi | Turns on shuffle mode |
837 | +---------------------------------------------------------+----------------------------------------------------------------------+
838 | | Hey Google, Turn Shuffle Off on kodi | Turns off shuffle mode |
839 | +---------------------------------------------------------+----------------------------------------------------------------------+
840 | | Hey Google, Play Next on kodi | Plays the next track |
841 | +---------------------------------------------------------+----------------------------------------------------------------------+
842 | | Hey Google, Play Previous on kodi | Plays the previous track |
843 | +---------------------------------------------------------+----------------------------------------------------------------------+
844 | | Hey Google, Scroll a bit forward on kodi | Fast forwards a movie/music by a small amount |
845 | +---------------------------------------------------------+----------------------------------------------------------------------+
846 | | Hey Google, Scroll forward on kodi | Fast forwards a movie/track by a large margin |
847 | +---------------------------------------------------------+----------------------------------------------------------------------+
848 | | Hey Google, Scroll a bit backward on kodi | Rewinds a movie/track by a small amount |
849 | +---------------------------------------------------------+----------------------------------------------------------------------+
850 | | Hey Google, Scroll backward on kodi | Rewinds a movie/track by a large margin |
851 | +---------------------------------------------------------+----------------------------------------------------------------------+
852 | | Hey Google, Set volume _Between 0 and 100_ on kodi | Sets the volume to the mentioned number |
853 | +---------------------------------------------------------+----------------------------------------------------------------------+
854 | | Hey Google, Get volume on kodi | Tells you the current volume level by voice |
855 | +---------------------------------------------------------+----------------------------------------------------------------------+
856 | | Hey Google, Toggle mute on kodi | Either mutes or unmutes, depending on mute status |
857 | +---------------------------------------------------------+----------------------------------------------------------------------+
858 | | Hey Google, Pause on kodi | Pauses the current video/track |
859 | +---------------------------------------------------------+----------------------------------------------------------------------+
860 | | Hey Google, Resume on kodi | Resumes playing the video/track |
861 | +---------------------------------------------------------+----------------------------------------------------------------------+
862 | | Hey Google, Stop on kodi | Stops playing and closes the player |
863 | +---------------------------------------------------------+----------------------------------------------------------------------+
864 | | Hey Goolge, goto _Home_ on kodi | Opens the appropriate menu or window mentioned |
865 | +---------------------------------------------------------+----------------------------------------------------------------------+
866 | | Hey Goolge, goto _Settings_ on kodi | Opens the settings menu or window |
867 | +---------------------------------------------------------+----------------------------------------------------------------------+
868 | | Hey Goolge, goto _Videos_ on kodi | Opens the videos menu or window |
869 | +---------------------------------------------------------+----------------------------------------------------------------------+
870 | | Hey Goolge, goto _Weather_ on kodi | Opens the weather menu or window |
871 | +---------------------------------------------------------+----------------------------------------------------------------------+
872 | | Hey Google, goto _Music_ on kodi | Opens the music menu or window |
873 | +---------------------------------------------------------+----------------------------------------------------------------------+
874 | | Hey Google, Move Up on kodi | Moves selection pointer up |
875 | +---------------------------------------------------------+----------------------------------------------------------------------+
876 | | Hey Google, Move Down on kodi | Moves selection pointer down |
877 | +---------------------------------------------------------+----------------------------------------------------------------------+
878 | | Hey Google, Move Left on kodi | Moves selection pointer left |
879 | +---------------------------------------------------------+----------------------------------------------------------------------+
880 | | Hey Google, Move Right on kodi | Moves selection pointer right |
881 | +---------------------------------------------------------+----------------------------------------------------------------------+
882 | | Hey Google, Move Back on kodi | Goes back, equivalent to esc key |
883 | +---------------------------------------------------------+----------------------------------------------------------------------+
884 | | Hey Google, Move Select on kodi | Makes a selection, equivalent to enter key |
885 | +---------------------------------------------------------+----------------------------------------------------------------------+
886 |
--------------------------------------------------------------------------------