Skip to content

simlu/aqi-monitor

Repository files navigation

Build Status Test Coverage Dependabot Status Dependencies Gardener

AQI Monitor

Monitor AQI using AWS Lambda

Notifies Slack Channel with Status Message when the level changes.

Allows monitoring of multiple Cities by using multiple deploys.

Only works for Cities from BC.

How can I run this for my slack team?

Very easy! Just follow the instructions below for setup and testing. Then configure a city and deploy.

Setup and Testing

Requires npm and serverless framework to be installed globally.

Install Dependencies and Test

In your project folder run

npm install

then

npm test

This project uses js-gardener and lambda-tdd. More details on testing and debuggging are documented under those projects.

Configure a City / Workspace

  1. Create config under config/[FILL CONFIG NAME].yml
  2. Fill in variables
REGION: aws-deploy-region (e.g. us-west-2)
STATION: canada-bc-station-number
ROLLBAR_ACCESS_TOKEN: your-rollbar-token (optional)
SLACK_CHANNEL: your-slack-channel
SLACK_WORKSPACE: your-slack-workspace
SLACK_SESSION_TOKEN: your-slack-session-token

Region

Pick a region from the aws availability zones.

Station

Go to https://envistaweb.env.gov.bc.ca/, search for the desired station, click it and then copy the corresponding number from the url, e.g. 9 for Kelowna College`.

Rollbar Access Token

Sign up for Rollbar, create a new Project and use a server token. This is optional - if you prefer not to enable monitoring you can simply set this to an empty string ("").

Slack Channel

Pick a Channel from your slack workspace.

Slack Workspace

Use your Slack Workspace.

Slack Session Token

Follow the instructions provided here.

Deploy

Requires you to have an AWS account setup and credentials configured.

npm t && npm run clean-build && sls deploy --config=[FILL CONFIG NAME] && npm run clean

Releases

No releases published

Packages

No packages published