Bitty 2.0
Overview
Bitty 2.0 is a complete rewrite of my Bitcoin price notification system, migrating from a Home Assistant integration to a standalone Python bot running serverless on GitHub Actions. The migration fixed critical timing issues, eliminated duplicate notifications, and resolved baseline logic problems that plagued the original implementation.
The bot runs completely serverless, executing every five minutes via scheduled GitHub Actions workflows. It sends Discord notifications for significant Bitcoin price movements with configurable alert thresholds and automatic spam prevention.
Key Features
Smart Timing
Runs every 5 minutes with daily midnight baseline resets
Tiered Alerts
Configurable price bands (5%, 10%, 15%) with escalating notification urgency
Spam Prevention
Intelligent cooldown system prevents duplicate notifications within the same price band
ATH Tracking
Automatic all-time high detection and alerts with celebratory notifications
Summary Reports
Weekly and monthly performance summaries with price statistics and percentage changes
Serverless
Zero infrastructure costs - runs entirely on GitHub Actions free tier
Technical Details
Problems Solved
- Timing Issues: Home Assistant's automation timing was unreliable. Migration to GitHub Actions cron ensures consistent 5-minute intervals.
- Duplicate Notifications: Fixed baseline reset logic to properly trigger at midnight CST/CDT, eliminating duplicate alerts.
- Baseline Logic Problems: Rewrote percentage calculation logic to properly handle daily baselines and prevent false positives.
- Alert Fatigue: Added smart cooldown system that prevents spam while ensuring important price movements aren't missed.
Why Rewrite?
The original Bitty bot was tightly coupled to Home Assistant, which created several limitations:
- Home Assistant is tied to home network so any network or electric outages inhibit functionality/reliability
- YAML-based logic became unwieldy for complex price tracking algorithms
- Testing required full Home Assistant restart cycles
- State management in Home Assistant was unreliable for financial data
- Limited observability into what the bot was actually doing
Moving to standalone Python with GitHub Actions provided:
- Proper version control with Git
- Easy local testing and debugging
- Complete control over timing and execution
- GitHub Actions logs for full observability
- Zero hosting costs (GitHub Actions free tier)