A SmartThings SmartApp that changes light color according to air quality data.
| AQI | Air Pollution Level | Light |
|---|---|---|
| 0 - 50 | Good | Off |
| 51 - 100 | Moderate | Yellow |
| 101+ | Unhealthy | Red |
- A Render account
- An Air Quality Open Data Platform API token
- A Samsung account and the SmartThings mobile application
- A Developer Workspace account
- A SmartThings compatible color bulb
- Go to Render Dashboard, then select Add new > Web Service.
- Select Public Git Repository, enter https://github.com/smartthings-aqi/air-quality-light, then select Connect.
- In the newly created project, add an environment variable named
WAQI_TOKENand set its value to your WAQI token, and configure the rest of the settings as needed. - Select Deploy Web Service and wait for the project the be built and deployed.
- Go to Developer Workspace, create a new project, choose Automation for the SmartThings App as the project type, and give the project a name.
- In the newly created project, select Register App.
- In the Hosting tab, select WebHook Endpoint, and enter the Render project URL as the Target URL.
- In Name & Scope tab, enter a name and a description for the app, and select r:devices:* and x:devices:* as required permissions.
- In the Advanced Settings tab, select Save.
- Go to Render Dashboard, then navigate to the web service previously created.
- Navigate to Monitor > Logs, then look for an log entry similar to
SmartThings confirmation URL is ***. - Submit a GET requeat to the confirmation URL to verify the SmartApp.
- Go to Developer Workspace, then navigate to the Automation previously created.
- In Overview, Select Deploy to test.
- In the SmartThings app, go to Routines.
- Select the Discover tab, scroll to the bottom, then select the SmartApp.
- In Location, enter the coordinate to check for air quality in the format of LATITUDE,LONGITUDE, select a checking interval, select which light to change color, then select Done.