Skip to content

Latest commit

 

History

History
108 lines (74 loc) · 4.53 KB

README.md

File metadata and controls

108 lines (74 loc) · 4.53 KB

Alexa TTS Proxy API

Proxy api for providing custom endpoints for Alexa TTS use cases.

My personal installation of this project · Report Bug · Request Feature

About The Project

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)

Getting Started

To get a local copy up and running follow these simple steps.

Current build status:

My personal installation:       Build Status

Prerequisites

All you need is Docker as well as Git!

Installation

Once docker is installed, you must follow these steps:

  1. Alexa Setup
    1. Activate the skills Text Vorlesen and Webhook Routine Trigger in your Alexa and follow the skills' setup instructions.
    2. 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 and hash parmaeter of both skill sessions, which can be found in the sample links.
  2. Set up your environment, which will serve this API:
    1. Clone this repository.
    git clone https://github.com/Dherlou/alexa-tts
    1. Create your secrets.json:
      1. Copy the secrets.template.json to a location where you store your credential files and rename it to secrets.json.
      2. Update the content of this file by pasting the previously noted id and hash values of each skill.
      3. Create a php password hash with password_hash and paste the resulting hash in the webhook hash field.
      4. Create an environment variable ALEXA_TTS_SECRETS which points to the directory in which your secrets.json file is located.
    2. Create the docker network for the containers, e.g.:
    docker network create --subnet 172.16.1.7/24 --attachable -d bridge jenkins
    1. 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

Usage

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.

Roadmap

  • implement endpoint for HomeAssistant notifications
  • feel free to contribute further endpoints or improve existing ones for your required services

License

Distributed under the GNU Affero General Public License. See LICENSE for more information.

Contact

Lucas Kinne - [email protected]

Project Link: https://github.com/Dherlou/alexa-tts

Acknowledgements

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. :)