Linux Format

Creating mobile apps to control your home

-

Creating your own interface for a project is quite an undertakin­g. For instance, you’ll need to consider what language, framework and protocol to use. But what is common among all these considerat­ions is the likely need to control your home automation project using a mobile device. These devices have taken over our lives and it’s now just as common for a user to control their TV, music and lighting from their tablet or phone as it is for them to surf the web via such devices. So how can we control our home automation project with a mobile device? similar to Scratch. The interface, while looking simple and child-like, hides a powerful framework that has access to Google power.

Our first project uses a speech to text applicatio­n which uses Google’s servers to process your voice into text with ease. This project can be adapted to send an SMS to a dedicated number, such as Twilio which can then be pushed to a Pi controllin­g your home. This means that even from the office you can make sure the central heating is ready for your return home. You can learn more about MIT App Inventor at the official website similar manner to a traditiona­l OS and, second, creating a custom interface using pygame, a library for media/video game creation, eg Spencer Organ used the pygame library to create a radio player with a custom user interface ( Flask is a micro web developmen­t environmen­t for Python that will slot into your project with relative ease and convert a project into a web app that will work with all devices using a browser. Flask bridges the gap between the web and your project by running a server on your Pi that intercepts input on a web page, eg a hyperlink or button, and it calls a Python function to perform an action. To illustrate here is the code to control an Energenie using Flask (see

created by Ben Nuttall from the Raspberry Pi Education team.

Newspapers in English

Newspapers from Australia