Đang chuẩn bị liên kết để tải về tài liệu:
Apress - Smart Home Automation with Linux (2010)- P48

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Apress - Smart Home Automation with Linux (2010)- P48:Linux users can now control their homes remotely! Are you a Linux user who has ever wanted to turn on the lights in your house, or open and close the curtains, while away on holiday? Want to be able to play the same music in every room, controlled from your laptop or mobile phone? Do you want to do these things without an expensive off-the-shelf kit | CHAPTER 7 CONTROL HUBS This allows me to add other kettles as needs require which makes the configuration script look like this DEVICE 1 xlOcontrol default on kettle.conf DEVICE device sleep kettle.conf DEVICE time xlOcontrol default off kettle.conf DEVICE device Note the abstracted script xlOcontrol instead of heyu which I ll discuss later. There is then one detail to add once the teakettle has switched itself off you use the Festival speech synthesis module to announce the fact. You could alternatively issue a pop-up window on your terminal like this kdialog --msgbox The kettle has boiled Providing a fresh boil when you return from work is a similar combination of simple scripts. In this case you need to know the time the teakettle takes to boil as shown earlier and the travel time from work to home. You then perform a basic subtraction and issue a sleep before the kettle script is called. What calls the script is then a matter of taste no pun intended . If you re used to working on the command line then a simple script could initiate a sequence to awaken the teakettle switch on lights and so on. Naturally this same code could be run from a web page or triggered upon receipt of an e-mail. This works in the specific case where the journey duration is consistent as it is for walkers cyclists and anyone not reliant on public transport or at the mercy of traffic. More complex solutions are also possible by looking at the live train departure boards for example and letting the computer work out which train you are most likely to have caught and check for its arrival time before beginning the boil. This is left as an exercise for you Naturally if you have a fast-boiling teakettle there might be enough time to trigger the script from a pressure mat sensor under the front door mat or when the Bluetooth dongle detects your phone coming into range for the first time that day. In that case by the time you ve approached the house opened the door and taken off your shoes and