Evangelizing WebRTCHaving gone to the hackathon early on Friday evening I was, initially, unable to find hackers that would use WebRTC. To change that, I needed to put in some leg work and talk with the teams and spread the gospel of WebRTC and callstats.io. Luckily, I bumped into my friends from Aalto University that were putting together a one-button home automation system.
Their idea was that home automation system user interfaces are too complex and, thus, there should be a system with only a single button to make the user interface as easy as possible to use. One thing led to another and eventually they promised to implement something WebRTC-based if I joined their team RöRö (pronounced as: __RoeRoe__).
I joined the team and the hack outcome of the weekend indeed was a one-button home automation system with WebRTC. In short, pressing the button turns on disco mode at your home. Essentially, disco lights are turned on, cheesy music starts playing and the system starts recording video over a WebRTC stream. See the video below for people’s reactions of pressing the button.
RöRö-button technical setupFor a more detailed explanation of the setup of the system see the figure below and follow the steps counterclockwise.
- When user presses bt.tn
- It sends a message to the bt.tn server in Ireland
- Which sends an HTTP request to our cloud server in Frankfurt
- Which sends another HTTP request through a reverse SSH tunnel to the laptop of Joonas
- Which starts playing music, starts a WebRTC conference to our server, and forwards the HTTP request over WLAN to Air Station
- Which forwards the message over Ethernet to Cozify home automation controller
- Which then turns on the lights.
To make it intuitive for the user, we made pressing the button a second time turn everything off. Being engineers and short on time, we managed to create the most complex way of turning on lights, audio and video surveillance. But most of the technical complexity was hidden from the user with the use of a one-button user interface. The only hint that there is a complex system running behind the scenes was the seemingly long delay (usually at least 3 seconds) between pressing the button and the disco mode turning on.
We based our WebRTC video stream recording on Muaz Khan’s RecordRTC since it seemed to be the most straight-forward way of doing the trick. If you want to see the ugly details, please see our GitHub repo.
Hacking at Junction with a laid-back yet skilled team was a lot of fun. I’ll definitely attend Junction next year as well. With this hack, we won the Junction Cozify track! Yay! Now we’ll have to figure out what WebRTC stuff we could develop with the Cozify prize devices.
During the hackathon Juho also had time to update the documentaton for our demo app and we the Github repo has been made publicly available for anyone to download and re-use as they see fit. Check it out and tell us what you think of it!