Skip to content

efahsl/sh-over-avs-demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prerequisites:

  • Node v12.11 (node -v)
  • Alexa Mobile App (iOS or Android)
  • Amazon developer account

Create your AVS Device

Configure the AVS Client

  1. Run git clone https://github.com/romaneul/sh-over-avs-demo.git
  2. cd sh-over-avs-demo
  3. npm install
  4. Update the .env file:
    LWA_CLIENT_ID=<LWA Client ID from your Security Profile>
    LWA_CLIENT_SECRET=<LWA Client Secret from your Security Profile>
    LWA_SCOPE="alexa:all"
    LWA_REDIRECT_PORT=8080
    AVS_PRODUCT_ID=<Your AVS Product ID>
    AVS_ENDPOINT=<Select appropriate endpoint from the link below; e.g. https://alexa.eu.gateway.devices.a2z.com>
    
    Select the appropriate AVS_ENDPOINT from here.
  5. Run node bin/login.js
    • Login with your Amazon account (use the same account in the Alexa app)

Exercises

  1. Explore the AVS SH Client Code [10 Minutes]
  • authClient.js implements the LWA logic and Token management
  • avsClient.js manages the HTTP2 connection for AVS
  • /events contains a set of Alexa Smart Home Events
  1. Discover and Control a Light device [5 Minutes]
  • Run node bin/avs-sh-gateway.js to start the AVS SH Client
  • Run a Proactive Discovery - this will send the Event events/discovery.json
  • Control device via voice: "Alexa, turn on living room"
  • Control device via app
  1. Change the Light device [5 Minutes]
  • Change the FriendlyName in events/discovery.json
  • Re-run Discovery
  • Control the device with the new name
  1. Extend the Light device [10 Minutes]
  1. Add a Thermostat device [10 Minutes]
  1. Challenge: Add a device with Range or Mode Controller

Modification from Original

This fork of the original repo (https://github.com/romaneul/sh-over-avs-demo/) is optimized as a prototype for a Mac OS device to turn on the screen saver and to control the screen brightness. Brightness is controlled via the following: https://formulae.brew.sh/formula/brightness

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 98.7%
  • Shell 1.3%