/TempAlert

Sends Email/SMS when hot tub has reached a specified temperature

Primary LanguageRuby

Temperature Alert

CircleCI

Summary

TempAlert is an application that receives temperature notifications from an outside source as a webhook and records them. It has a light front-end that displays the current temperature. TempAlert also allows you to login and subscribe to certain notifications, for example, when the temperature of the hot tub reaches 104 Degrees!

Setup

Prerequisites

Installation

  • Clone the repo: git clone git@github.com:KidA001/TempAlert.git
  • Instantiate rails secrets with $ rails secrets
  • Add your rails secrets with $ rails secrets:edit - you'll need the following:
    • api_key - Auth Key for incoming webhooks to this server
    • google_client_id - Google Client ID for OAuth
    • google_client_secret - Google Client Secret for OAuth
    • production_url - the URL you plan to host the application from in Production
    • lat_lon - your local lat/lon to calculate sun rise/set
    • local_timezone - your local timezone to calculate sun rise/set
  • Install gem dependencies: $ bundle install
  • Setup the database $ rake db:setup
  • Start the server with rails s
  • View the application at http://localhost:3000
  • In order to properly load the variables for the Arduino.ico file, you need to create a config.h file with the following:
char ssid[] = "YourSSID";
char pass[] = "SuperSecretPW";
String host = "somehost.herokuapp.com";
char server[] = "http://somehost.herokuapp.com";
String authToken = "youllneverguess123";

Other Notes

The Arduino.ico file contains the Arduino code I used to for the temperature sensor that connects and sends temperatures to this server. I used the following parts: TinyDuino Processor as the main Arduino board, USB TinyShield which allows me to connect/power the Arduino via USB, WIFI TinyShield for connecting to WiFi, Proto Board TinyShield for adding on external sensors, and lastly the DS18b20 waterproof digital temperature sensor w/4.7k resistor.

At some point I'll make a blog post on how I created this. Please feel free to use this software freely and reach out if you have any questions.

Testing

We use rspec for testing.

Run rspec in the terminal to run all tests.