Proxy api for providing custom endpoints for Alexa TTS use cases.
My personal installation of this project
·
Report Bug
·
Request Feature
Proxy api for providing custom endpoints for Alexa TTS use cases:
- Jenkins Job Notifications (pass job run parameters and it dispatches a formatted announcement)
- HomeAssistant Notifications (TBD)
- Custom Notifications (directly provide the text to be announced)
To get a local copy up and running follow these simple steps.
All you need is Docker as well as Git!
Once docker is installed, you must follow these steps:
- Alexa Setup
- Activate the skills Text Vorlesen and Webhook Routine Trigger in your Alexa and follow the skills' setup instructions.
- Open the skills' administration pages (i.e. https://esp8266-server.de/alexa/TextVorlesen/ and https://trigger.esp8266-server.de/ respectively) and note down the
id
andhash
parmaeter of both skill sessions, which can be found in the sample links.
- Set up your environment, which will serve this API:
- Clone this repository.
git clone https://github.com/Dherlou/alexa-tts
- Create your
secrets.json
:- Copy the
secrets.template.json
to a location where you store your credential files and rename it tosecrets.json
. - Update the content of this file by pasting the previously noted
id
andhash
values of each skill. - Create a php password hash with password_hash and paste the resulting hash in the webhook hash field.
- Create an environment variable
ALEXA_TTS_SECRETS
which points to the directory in which yoursecrets.json
file is located.
- Copy the
- Create the docker network for the containers, e.g.:
docker network create --subnet 172.16.1.7/24 --attachable -d bridge jenkins
- Start the docker run:
- production version:
docker-compose up -d
- or development version (mounts repository into the container and doesn't verify tls for local setups):
docker-compose -f docker-compose.yml -f docker-compose-local.yml up -d
- production version:
Once docker is running, you can make API calls from arbitrary scripts/sources.
You can use the endpoints for the different scenarios (e.g. /scenarios/jenkins.php
) or the generic one at /index.php
.
For authentication against your proxy api, you have to add the header X-WEBHOOK-SECRET
with the plaintext password used while creating the php password hash during the environment setup as the header's value.
Further payload depends on the given scenario. The generic endpoint expects the text as a POST parameter, whereas the Jenkins scenario expects a json encoded body with the required data. Check the code for your use case.
- implement endpoint for HomeAssistant notifications
- feel free to contribute further endpoints or improve existing ones for your required services
Distributed under the GNU Affero General Public License. See LICENSE for more information.
Lucas Kinne - [email protected]
Project Link: https://github.com/Dherlou/alexa-tts
Special thanks to Michael Dworkin for developing and providing the Alexa skills Text Vorlesen and Webhook Routine Trigger that do the actual heavy lifting. Check out his skills and leave a positive rating, if the skills are helpful to you. :)