Automate Your Home Using Go
Build a Personal Data Center with Raspberry Pi, Docker, Prometheus, and Grafana
by: Ricardo Gerardi and Mike Riley
Published | 2024-08-22 |
---|---|
Internal code | gohome |
Print status | In Print |
Pages | 160 |
User level | Intermediate |
Keywords | Go, Raspberry PI, DIY, home automation |
Related titles | Powerful Command-Line Applications in Go by Ricardo Gerardi |
ISBN | 9798888650509 |
Other ISBN |
Channel epub: 9798888651230 Channel PDF: 9798888651247 Safari: 9798888651223 |
BISACs | COM095000TEC004000TEC004000 |
Highlight
Take control of your home and your data with the power of the Go programming language. Build extraordinary and robust home automation solutions that rival much more expensive, closed commercial alternatives, using the same tools found in high-end enterprise computing environments. Best-selling Pragmatic Bookshelf authors Ricardo Gerardi and Mike Riley show how you can use inexpensive Raspberry Pi hardware and excellent, open source Go-based software tools like Prometheus and Grafana to create your own personal data center. Using the step-by-step examples in the book, build useful home automation projects that you can use as a blueprint for your own custom projects.
Description
With just a Raspberry Pi and the Go programming language, build your own personal data center that coordinates and manages your home automation, leveraging the same high-powered software used by large enterprises. The projects in this book are easy to assemble, no soldering or electrical engineering expertise required.
Build a temperature monitor that can send alerts any time defined thresholds are exceeded and report the temperature readings on a time-based series chart. Change the color of lights to visually indicate the current outdoor weather status. Create a networked motion detector that triggers an alert any time motion is detected, such as a door opening or closing, a pet wandering around, or deliveries or visitors arriving on your front porch. Even have these triggers initiate a more complex Go-based automation sequence. Integrate a small, high-resolution camera into a bird feeder that takes excellent, up-close photos whenever a bird perches at the feeder, and broadcasts them to your Discord server where your family and friends can see these wildlife captures in real time.
Control your home with hardware you configure, and manage it with Go code that you create and modify any time you want to enhance your home automation capabilities.
Contents and Extracts
- Introduction
- Setup
- Getting Started excerpt
- Your Personal Data Center
- Selecting a Raspberry Pi
- Adding Other Hardware Components
- Configuring the Software
- Picking a Code Editor
- Next Steps
- Building a REST API Server
- Writing the Code
- Containing the Server
- Next Steps
- Deploying Your Personal Data Center
- Deploying Applications with Linux Containers
- Managing Source Code with Gitea
- Monitoring and Alerting with Prometheus
- Visualizing Data with Grafana
- Next Steps
- Getting Started excerpt
- Projects
- Networking a Temperature Monitor excerpt
- Understanding the Pico W Device
- Polling the Temperature
- Connecting the Pico W to Wi-Fi
- Creating the Pico W REST Server
- Creating the Prometheus Exporter
- Containing and Deploying the Exporter
- Creating the Grafana Dashboard
- Next Steps
- Checking the (Garage) Door
- Understanding the GPIO
- Wiring the Magnetic Switch to the GPIO
- Coding the Magnetic Switch
- Sending Notifications
- Writing the Software
- Configuring and Testing the Application
- Containerizing the Deployment
- Next Steps
- Lighting the Weather excerpt
- Polling the Weather
- Changing the Color
- Putting It All Together
- Configuring the Application Settings
- Containerizing and Deploying the App
- Next Steps
- Watching the Birds
- Setting Up the Camera and InfraRed Sensor
- Writing the Software
- Sending Motion Notifications
- Containing the Application
- Configuring the Bird Feeder
- Next Steps
- Go Build
- Designing Additional Projects
- Expanding the Technologies
- Improving Security
- Advancing Electronics
- Having Fun
- Networking a Temperature Monitor excerpt