Wake-up with smartthings and webcore
Page content
Goal: configure my house to wake me up gently.
Tools: smartthings, zwave dimmer, led strip, chromecast audio, bash
Steps:
Created a virtual switch on my smartthings. The house will wake me up only if the switch is on.
Create a webcore piston. This piston runs at 7:30:
This piston does the following:
- Starts the gentle wake up switch
- Use text to speech on my chromecast
- Play some random music from my Synology
- Play a podcast I downloaded earlier in the morning using my Synology
This is the bash script that cron runs every morning:
#!/bin/bash
/usr/local/bin/podcatcher --dir /podcasts/ -S one http://feeds.feedburner.com/npr/POtf
ls -t /podcasts/cache | head -n 1 | xargs -I '{}' mv /podcasts/cache/'{}' /music/alarm/alarm.mp3
shopt -s globstar
flacfiles=(/music/some\ subfolder/**/*.flac)
cp "${flacfiles[RANDOM % ${#flacfiles[@]}]}" /music/alarm/music.flac
Ideally, I would like to have something better than a virtual switch to turn this on and off. For example, I would like to have a smart app that allows me to set the time and other podcasts, etc. Alas, no clue how to do that yet.