- Node v12.11 (node -v)
- Alexa Mobile App (iOS or Android)
- Amazon developer account
- Go to https://developer.amazon.com/alexa/console/avs/products/new
- In Step 1/2:
- In Step 2/2:
- Run
git clone https://github.com/romaneul/sh-over-avs-demo.git
cd sh-over-avs-demo
npm install
- Update the
.env
file:Select the appropriateLWA_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>
AVS_ENDPOINT
from here. - Run
node bin/login.js
- Login with your Amazon account (use the same account in the Alexa app)
- Explore the AVS SH Client Code [10 Minutes]
authClient.js
implements the LWA logic and Token managementavsClient.js
manages the HTTP2 connection for AVS/events
contains a set of Alexa Smart Home Events
- 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
- Change the Light device [5 Minutes]
- Change the FriendlyName in
events/discovery.json
- Re-run Discovery
- Control the device with the new name
- Extend the Light device [10 Minutes]
- Add a BrightnessController: https://developer.amazon.com/docs/device-apis/alexa-brightnesscontroller.html
- Add a EndpointHealth: https://developer.amazon.com/docs/device-apis/alexa-endpointhealth.html
- Add a Thermostat device [10 Minutes]
- Extent the
endpoints
array inevents/discovery.json
- Add a ThermostatController https://developer.amazon.com/docs/device-apis/alexa-thermostatcontroller.html
- Challenge: Add a device with Range or Mode Controller
- https://developer.amazon.com/docs/device-apis/alexa-rangecontroller.html
- https://developer.amazon.com/docs/device-apis/alexa-modecontroller.html
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