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 Glitch 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 Glitch, select New project, select Import from GitHub, and enter https://github.com/smartthings-aqi/air-quality-light in the pop-up dialog.
- In the newly created project, set the desire project name or custom domain.
- Select the .env file, and set the value of WAQI_TOKEN to your WAQI API token.
- 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 Glitch 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.
- In the SmartThings app, go to Automations, select the + sign, then select Create routine.
- 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.