Portable Python Projects

Book description

Discover easy ways to control your home with the powerful new Raspberry Pi hardware. Program short Python scripts that will detect changes in your home and react with the instructions you code. Use new add-on accessories to monitor a variety of measurements, from light intensity and temperature to motion detection and water leakage. Expand the base projects with your own custom additions to perfectly match your own home setup. Most projects in the book can be completed in under an hour, giving you more time to enjoy and tweak your autonomous creations. No breadboard or electronics knowledge required!

Get to know the latest Raspberry Pi hardware, and create awesome automation solutions for home or work that don't require an electronics degree, cumbersome add-ons, or expensive third-party subscription services. Create easy to run Python scripts on your own that make your Pi do things that would have required a team of automation experts to build only a few years ago.

Connect to and control popular home automation lighting systems from a Raspberry Pi. Trigger autonomous actions based on movement, temperature, and timer events. Power on your own computer and appliances using your voice. Remotely control infrared-enabled consumer electronics, create chatbots to retrieve personalized items of interest, and implement a temperature-monitoring room fan. These are just some of the projects that the book will show you how to make. Most projects can be completed and operational in under an hour, and do not require any messy schematics or a spaghetti bowl of wires and breadboard-attached circuits to operate.

Control your home or office exactly the way you want instead of relying on an expensive mysterious box of third-party technology to do it for you.

What You Need:

Raspberry Pi (Pi 4 Model B or higher recommended) running Raspberry Pi OS

Publisher resources

View/Submit Errata

Table of contents

  1.  Acknowledgments
  2.  Introduction
    1. About the Book
    2. Online Resources
  3. Part I. Setup
    1. 1. Assembling the Hardware
      1. Raspberry Pi
      2. microSD Card
      3. USB-C Power Supply
      4. Micro-HDMI Adapter
      5. Keyboard, Mouse, and Monitor
      6. Water Sensor
      7. DockerPi SensorHub
      8. Hue Starter Kit
      9. Smart Voice Assistant
      10. USB Infrared Transceiver
      11. Pi Camera Module V2
      12. Next Steps
    2. 2. Setting Up the Software
      1. Raspberry Pi OS
      2. Configuring the Settings
      3. SSH Keys
      4. Python
      5. Pip Pip Hooray
      6. Git
      7. Rclone
      8. Supervisor
      9. Code Editor
      10. Next Steps
  4. Part II. Projects
    1. 3. Twitch Timer
      1. Setup
      2. Creating a Sleep-Timer Script
      3. TwitchTimer Script Improvements
      4. Next Steps
    2. 4. Water Leak Notifier
      1. Setup
      2. Test Script
      3. Water Sensor Email Alerts
      4. Sensor Supervision
      5. Next Steps
    3. 5. Hue Fan
      1. Setup
      2. Seating the Sensor
      3. Bridge Registration
      4. Registered Devices
      5. Turn It On Again
      6. Sensing the Heat
      7. Excessively Warm
      8. All Together Now
      9. Next Steps
    4. 6. Hue Auto Light
      1. Setup
      2. Light Bright
      3. We’ve Got Movement
      4. Next Steps
    5. 7. PiSpeak
      1. Setup
      2. Feeding RSS
      3. Database CRUD
      4. Converting Audio
      5. Processing the Audio
      6. Tagging the Audio
      7. Move It
      8. List It
      9. Play It On the Go
      10. Schedule It
      11. Next Steps
    6. 8. Voice Wake on LAN
      1. Setup
      2. Listen to Wake Up
      3. Scripted WOL
      4. Catching a Bullet
      5. Wake Up
      6. Next Steps
    7. 9. Voice IR Control
      1. Setup
      2. Test It
      3. Add It
      4. Blast It
      5. Next Steps
    8. 10. RedditBot
      1. Setup
      2. Reddit Access
      3. Reddit Commands
      4. Bot Creation
      5. Bot Interaction
      6. Next Steps
    9. 11. PhotoHook
      1. Setup
      2. Camera Attachment
      3. Camera Activation
      4. Take a Picture
      5. Motion Detector
      6. Hook a Photo
      7. Post a Picture
      8. Movement Notification
      9. Next Steps
    10. 12. Continuous Improvement
      1. Maintain
      2. Explore
      3. Enjoy
  5.  Bibliography

Product information

  • Title: Portable Python Projects
  • Author(s): Mike Riley
  • Release date: February 2022
  • Publisher(s): Pragmatic Bookshelf
  • ISBN: 9781680508598