Laziness Alarm
Build an affordable monitoring setup!
This project will help you easily get indications on how much time your are sitting in the couch watching TV. This project will have time intervals in which you will get light indications from the board after X time has passed, sound indications, phone notifications and eventually when time has arrived it will mute your TV and turn it OFF.
video: https://www.youtube.com/watch?v=pc7V2HvY3fQ
Supplies
Adafruit Circuit Playground Express - about 25$
Any kind of TV
Overview
First, we will understand the flow of the project. What will we need?
1. Create a webhook in BLYNK app in order to trigger HTTP Requests to Integromat.
2. Create button trigger in Integromat app.
3. Create scenarios in Integromat to handle the custom webhook and trigger the HTTP requests to our CPX board.
4. Configure the code to your needs (optional)
Step 2: Create Webhook in BLYNK App
We will need to download the app from PlayStore / AppStore.
Once downloaded, create a new project. In the project settings we will send the AUTH TOKEN to our mail (for later use). Next step, we will add the webhook in our project. We will see the window popup as shown above. In the webhook settings, there is a URL field where we will write the URL we would like to be triggered. There is an option to send additional values in the URL, it is done as follow: `https:// hook.integromat.com/XXXXXXXXXXXXX...my Param=/ pin/`
Create Button Trigger in Integromat App
Next, we will create a button trigger in Integromat App.
The button will trigger the board to move to Stage1 (regardless the current State). Which basically add more time to watch TV (mmm... lazy). Next, download the Integromat app, and in the buttons section click on the plus (+). Now, give the button a name and an ID that later on we will use the same ID in the Integromat scenario to trigger the function. Once finished, click done.
Create Scenarios in Integromat
Now, we will create the scenarios in Integromat in order to handle the custom webhook from the board, button trigger and HTTP requests to the board.
1. Create an account in Integromat
2. Go to 'Create a new scenario'
3. Add the service you would like and configure. For example for the HTTP request to the board from the button we created we will add the services: 'HTTP Request' and 'Apple IOS - Watch Button'. Then we will need to configure the services as in the pictures.
Configure and Upload the Code
The last step will be to adjust the code provided in the file attached
Adjustments needed:
1. auth - Insert you Authentication code from previous steps
2. ssid - Insert your Wifi network name
3. pass - Insert your Wifi password
4. TV NECx protocol for IR - If you have a Samsung TV then it is already set up. If not, you will need to nd the right protocal commands for your TV brand and paste them there.
Optional:
1. oneMinuteInterval - Currently configured to 60000 which is 1 minute in miliseconds
2. ledPin - Currently 13 which is one of the leds on the board.
3. You can play with the rest of the configuration (tones, colors, music, etc...). Finally upload the code via Arduino and have fun! :)