The purpose of this repo is to provide an updated implementation for accessing data from your local Ambient Weather Station (AWS) on the SmartThings platform. This was done in the past using a SmartThings SmartApp that was built with groovy, but that has since been deprecated. SmartThings now utilizes a Node.js SDK for developing SmartApps for their platform
- An API Keys need to be created on the Ambient Weather Network (AWN) before being able to access the Ambient Weather API
applicationKey
apiKey
- The Ambient Weather API (python, node.js) allows for REST calls through Websockets
- "Create a SmartApp" inside of the SmartThings Developers Workspace, some examples and tutorials to look into:
- Simple SmartApp Tutorial (SmartApp SDK) (specifically the video)
- Set the color of a light based on the weather
- The scope of this project will initially be local testing so
Node.js
,ngrok
, andnpm
will be needed as dependenciessudo apt install nodejs npm snap install ngrok
server.js
: This is where the SmartApp will be created for the platform; for now it just starts a simple app with the Express framework.- The
ambient-weather-api/ambient-api
andSmartThings SmartApp Node.js SDK
will need to be imported in.
- The
- Run the server:
node server.js
- The app can be exposed to a public URL using ngrok:
ngrok http 3000
- A
ngrok
account is needed for this step (it's free!) - The app needs to be running for public URL access through ngrok
- A
-
Following the steps provided in Create a SmartApp.
- "Services with a Complex App" will be needed since we want to reach out to transmit/receive data from Ambient Weather.
-
Need to have the app running with the public URL
-
SmartThings Developer Workspace -> Create a New Project -> Automation for the SmartThings App
-
Project Name: "Ambient Weather"
-
Select "Register App" -> Webhook Endpoint
-
There is a requirement by the SmartThings SmartApp to handle a confirmation request from SmartThings by issuing a HTTP GET request to confirmationURL:
-
The current implemenation for the SmartApp is returning a
404
whenever SmartThings attempts to verify it with this request: -
This is due to how barebones the implementation is now, but it lets us know that we're in a position to start developing the actual implementation for the SmartApp!
- Repo Refactor: update readme, move
unsupported
to newsmartthings
folder - Added readme to
unsupported
directory - Initial Simple App set-up with local server for testing/development
- SmartThings SmartApp creation on the Developer Workspace
-
ambient-api
Integration: locally serve weather data at the endpoint
- ambientweather.net fails to load at points
- glitch.com fails to load at points
- Web-hosting fees depending on the size/service calls of the SmartApp
ngrok
generates a random URL everytime the server is started; this could potentially be fixed by following these steps.