#IOT Event Notification
This application serves as a generic event notification engine for IOT enabled routers. The engine will react to any external event and perform some type of notification.
##Examples
- Sending a Spark alert anytime an external temperature sensor hits a certain threshold
- Sending a Tropo notification anytime an external security trigger is tripped
For more detailed information on the technical details behind the modules, please see [developer.md] (developer.md).
##Quick Start To quickly get started with this module, let's configure the application to automatically generate a Spark Notification anytime the weather falls below 50 degrees for zip code 16066.
#####Determine the Spark Room ID to send the alert to#####
- Go to https://developer.ciscospark.com/# and click on the "Log In Button"
- Log in using your Spark Credentials
- Click on the Get Started Button
- Click on the "Rooms" Link under the "API Reference" on the left side
- Click on the List Rooms API
- Click on "Test Mode" to enable Test Mode
- Click on the Run Button
- On the Right Hand Side, you will see JSON off all the rooms that you are a member with, Pick one of the rooms and copy the value of "id" for the room that you want to send notifications
#####Determine your Spark Token#####
- Go to https://developer.ciscospark.com/# and click on the "Log In Button"
- Log in using your Spark Credentials
- Click on your picture in the top right hand corner
- Your Spark Token will be displayed
- You can Select Copy to copy that Spark ID
#####Register For a Weather Underground#####
- Go to https://www.wunderground.com/weather/api/
- Click on Pricing and select the free plan and click on the "Purchase Key" button
- Once you have created an account, you can log in and click on "Key Settings"
- Under the field "Key ID", you will find your Weather Underground API Key.
#####Register For a Breezometer API#####
- Go to https://developers.breezometer.com/signup
- Enter your information and then click on "Get Started!"
- Once you have created an account, you can login and find your Breezometer API Key
- NOTE: This API Key is rate limited to only a few calls a day. Therefore, you will need to limit the amount of calls you do or they will ask you to pay for the full API
#####Setup Application#####
- Download all the files from the github repository to your computer
- Copy the package_config.ini.sample to package_config.ini
- Edit the "package_config.ini" file using your favorite editor
- Under the application section, set the log_level to be 10 for debug purposes
- Under the application section, set the delay value to 20. This represents that we will check the sensor every 10 seconds
- Under the application section, set the operator value to be <. This represents that we want to check to see if the sensor is less than a appropriate value.
- Under the print section, set enabled to True. This will display that data to the screen.
- Under the spark section, set enabled to True. This will active the spark alerting mechanism.
- Under the spark section, set the token to be the token value that you obtained from the developer.ciscospark.com website
- Under the spark section, set the room_id to match the spark room ID that you obtained from the developer.ciscospark.com website to represent the room that you will be writing alerts to.
- Under the wunderground section, set enabled to True
- Under the wunderground section, set api_key to match the api key that you created on the Weather Underground Website
- Under the wunderground section, set zipcode to be 16066 (Or any zip code that you want to find the weather for.
- Under the wunderground section, set compare_date to 50.
- Run the application by using the following:
python IOTEventNotification.py
If everthing worked out correctly you should now see the application starting up and get data from the sensors, compare the data and then display the message.