User Tools

Site Tools


kodi:kodi-alexa

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
kodi:kodi-alexa [2020/08/15 23:54] – config:kodi-alexa renamed to kodi:kodi-alexa Wuffkodi:kodi-alexa [2024/05/13 12:56] (current) – removed Wuff
Line 1: Line 1:
-====== Kodi & Alexa ====== 
- 
-https://forum.kodi.tv/showthread.php?tid=254502 
-https://lexigr.am/docs/getting-started.html 
- 
-1.) An Amazon developer profile is required for custom Alexa skills. Log in with normal amazon account on this page and create a developer account: https://developer.amazon.com/ 
- 
-2.) NodeJS framework v8.11.1 is required. Do not use default ubuntu package of NodeJS as this is is an older version. Installation using NVM https://github.com/nvm-sh/nvm#installation-and-update 
-<code> 
-wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash 
-</code> 
-close and reopen terminal after installation 
- 
-3.) Install NodeJS 8.11.1 
-<code> 
-nvm install 8.11.1 
-nvm use 8.11.1 
-</code> 
- 
-4.) Install lexigram-cli 
-<code> 
-npm install -g lexigram-cli 
-</code> 
- 
-5.) Use the cli to log in to Amazon and initialise the Alexa skill (Kanzi) 
-<code> 
-lexigram login --no-browser true 
-# select default profile and confirm with yes to enter Amazon credentials 
-# copy url into browser, grant access and paste the resulting Auth key back into terminal 
-</code> 
- 
-6.) Download an empty config file 
-<code> 
-lexigram init-config 
-</code> 
- 
-7.) Initialise the skill kanzi 
-<code> 
-lexigram init-skill kanzi 
-</code> 
- 
-8.) Kodi setup\\  
-Go to settings -> system -> Services -> Web server and allow remote control 
-  - via http 
-  - from applications on this system 
-  - from applications on other systems 
-Supply username/password 
- 
-9.) A reverse caching proxy may be useful to cache search results. This is primarily useful for external access and not for local access, however, even local access may benefit from this.  
- 
-10.) Adjust configuration file kodi.config with backend/proxy details, local timezone and as required. 
-<code> 
-vi kodi.config 
-</code> 
-<code> 
-shutdown = 'quit' 
-timezone = Europe/London 
-</code> 
- 
-11.) Set up webserver as target for the alexa command 
-<code> 
-sudo apt-get install apache2 libapache2-mod-wsgi 
-sudo a2enmod ssl 
-sudo systemctl restart apache2 
-sudo mkdir /etc/apache2/ssl 
-sudo openssl genrsa -out /etc/apache2/ssl/apache.key 2048 
-sudo cat > ssl-key-conf.cnf << EOF 
-[req] 
-distinguished_name = req_distinguished_name 
-x509_extensions = v3_req 
-prompt = no 
- 
-[req_distinguished_name] 
-C = GB 
-ST = . 
-L = . 
-O = wuff 
-CN = kodi-alexa 
- 
-[v3_req] 
-keyUsage = keyEncipherment, dataEncipherment 
-extendedKeyUsage = serverAuth 
-subjectAltName = @subject_alternate_names 
- 
-[subject_alternate_names] 
-DNS.1 = wuff.dyndns.org 
-EOF 
- 
-openssl req -new -x509 -days 365 -key /etc/apache2/ssl/apache.key -config ssl-key-conf.cnf -out /etc/apache2/ssl/apache.crt 
- 
- 
-sudo vi /etc/apache2/apache.conf 
-# set ServerName example.dyndns.org 
- 
-sudo vi /etc/apache2/sites-available/default-ssl.conf 
-# set DocumentRoot /var/www/html 
-# set SSLCertificateFile /etc/apache2/ssl/apache.crt 
-# set SSLCertificateKeyFile /etc/apache2/ssl/apache.key 
-# add WSGIScriptAlias /kodi-alexa /var/www/kodi-alexa/alexa.wsgi 
-sudo a2ensite default-ssl.conf 
- 
-sudo apt-get install python-tz 
-sudo apt-get install python-pip 
-sudo pip install flask-ask 
-sudo pip install kodi-voice 
-sudo pip install python-Levenshtein 
- 
-sudo systemctl restart apache2 
-</code> 
- 
- 
-12.) Deploy kanzi 
-<code> 
-cp -r /home/kodi/kanzi/source/repo /var/www/kodi-alexa 
-chown -R www-data:www-data /var/www/kodi-alexa 
- 
-lexigram deploy kanzi 
-</code> 
-Set invocation name (2 for kodi) 
-#set skill server to local ip address https://example.dyndns.org/kodi-alexa 
- 
-possible adjustment required. not sure if external access is absolutely required. 
-<code> 
-In Alexa Skill Set, Add your IP and service name as the HTTPS URL: https://XXXX.ddns.net/kodi-alexa 
-Upload x509 certificate file for the endpoint (copy the /etc/apache2/ssl/apache.crt to the local PC or use cat and copy & paste the code into a local text file and upload that text file. 
- 
-Finally, if you haven't already, you'll have to open your apache server to the Internet with port forwarding.  
- 
-13.) To limit requests to your own alexa skill only, use the skill ID and add it to kodi.config 
-<code> 
-skill_id = [set to amzn1.ask.skill.xxxxxxx as per url on developer.amazon.com 
-</code> 
-then re-deploy 
-<code> 
-lexigram deploy kanzi 
-</code> 
- 
-===== Updates ===== 
-<code> 
-npm upgrade -g lexigram-cli 
-lexigram deploy kanzi 
-</code> 
- 
- 
- 
- 
- 
  
kodi/kodi-alexa.1597532057.txt.gz · Last modified: (external edit)