A Go CLI application for trash pickup reminders via AWTRIX 3 displays.
- š Fetches monthly trash pickup schedules from public API
- š¾ Smart caching (month-based, never refetches)
- šŗ Two display modes:
- Status: Persistent display showing next pickup
- Alarm: Tomorrow-only notification with button dismiss
- šØ Visual color-coded indicators for trash types
- š Designed for cron-based automation
- š Zero dependencies except MQTT and CLI framework
Download the latest release for your platform from the releases page.
Available platforms:
- Linux (amd64, arm64, arm)
- macOS (amd64, arm64)
- Windows (amd64)
Extract the archive and move the binary to your PATH:
# Linux/macOS tar -xzf bdg_Linux_x86_64.tar.gz sudo mv bdg /usr/local/bin/ # Or just run from current directory ./bdg --help
- AWTRIX 3 compatible display (Ulanzi)
- MQTT broker access
# Clone the repository git clone https://github.com/llxff/bdg.git cd bdg # Install dependencies go mod download # Build task build # OR go build -o bin/bdg .
The binary will be created at bin/bdg.
The status command shows a persistent view with color-coded chips representing each trash type and the date of the next pickup:
- Color chips: 4Ć7 pixel rectangles, one per trash type (Bio, Gelbe Tonne, Papier, etc.)
- Date text:
- "TOM" in red for tomorrow
- Weekday abbreviations (MON, TUE, etc.) for next 7 days
- "DD.MM" format for dates beyond 7 days
The alarm command sends a prominent notification when pickup is tomorrow:
- Red background with blinking text
- Lists all trash types scheduled for tomorrow
- Requires button press to dismiss (hold=true)
- Silent exit if pickup is not tomorrow
Check the installed version:
./bdg version
Update to the latest release:
./bdg update
Force update even if already on latest version:
./bdg update --force
Updates the AWTRIX display with a persistent status showing the next pickup day.
./bdg status \ --city-id=123 \ --area-id=456 \ --mqtt-broker=tcp://192.168.1.10:1883 \ --mqtt-prefix=awtrix_abc123
Recommended cron schedule: Every hour
0 * * * * /path/to/bdg status --city-id=123 --area-id=456 --mqtt-broker=tcp://192.168.1.10:1883 --mqtt-prefix=awtrix_abc123
Sends a notification ONLY if the next pickup is tomorrow. Otherwise exits silently.
./bdg alarm \ --city-id=123 \ --area-id=456 \ --mqtt-broker=tcp://192.168.1.10:1883 \ --mqtt-prefix=awtrix_abc123
Recommended cron schedule: Once daily at 8 PM
0 20 * * * /path/to/bdg alarm --city-id=123 --area-id=456 --mqtt-broker=tcp://192.168.1.10:1883 --mqtt-prefix=awtrix_abc123
| Flag | Required | Default | Description |
|---|---|---|---|
--city-id |
ā | - | City ID from trash API |
--area-id |
ā | - | Area ID from trash API |
--mqtt-broker |
ā | - | MQTT broker URL (e.g., tcp://192.168.1.10:1883) |
--mqtt-prefix |
ā | - | AWTRIX MQTT prefix |
--mqtt-username |
ā | - | MQTT username (if authentication required) |
--mqtt-password |
ā | - | MQTT password (if authentication required) |
--cache-dir |
ā | ~/.cache/bdg |
Local cache directory |
--ignore |
ā | [] |
Trash types to ignore (repeatable) |
- Visit the BDG waste calendar and select your municipality and street
- Open your browser's developer tools (F12) and go to the Network tab
- Look for API calls to
https://bdg.jumomind.com/webservice.php?idx=termins - Extract
city_idandarea_idfrom the URL parameters
To ignore specific trash types (e.g., bio waste):
./bdg status \ --city-id=123 \ --area-id=456 \ --mqtt-broker=tcp://192.168.1.10:1883 \ --mqtt-prefix=awtrix_abc123 \ --ignore=BARNIM_BIO \ --ignore=BARNIM_PAP
If your MQTT broker requires authentication:
./bdg status \ --city-id=123 \ --area-id=456 \ --mqtt-broker=tcp://192.168.1.10:1883 \ --mqtt-prefix=awtrix_abc123 \ --mqtt-username=your_username \ --mqtt-password=your_password
Security Note: Avoid exposing credentials in cron jobs or shell history. Consider using environment variables or a configuration file in production.
- Shows color-coded chips for each trash type (4Ć7 pixel rectangles)
- Displays date information:
- Tomorrow: "TOM" in red
- Within 7 days: Weekday abbreviation (MON, TUE, etc.) in white
- More than 7 days: Date format (DD.MM) in white
- Multiple pickups on the same day show multiple color chips
- Published to:
[PREFIX]/custom/trash
- Only triggered if pickup is tomorrow
- Red background with blinking text
- Shows all trash types for tomorrow
- Requires button press to dismiss (
hold: true) - Published to:
[PREFIX]/notify
The app caches API responses per month in ~/.cache/bdg/YYYY-MM.json:
- ā Never refetches existing months
- ā Automatically fetches next month if needed (when today + 7 days crosses month boundary)
- ā Stores raw JSON from API
- ā Thread-safe atomic writes
To clear cache: rm -rf ~/.cache/bdg/
task test # OR go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
View coverage:
go tool cover -html=coverage.txt
Install golangci-lint:
# macOS brew install golangci-lint # Linux curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
Run linter:
task lint
# OR
golangci-lint run ./...bdg/
āāā cmd/ # CLI commands (root, status, alarm)
āāā internal/
ā āāā api/ # HTTP client for trash API
ā āāā cache/ # File-based caching
ā āāā domain/ # Core business logic (pure functions)
ā āāā mqtt/ # MQTT publisher
ā āāā awtrix/ # AWTRIX payload builders
āāā main.go # Entry point
See AGENTS.md for detailed architecture and contribution guidelines.
- Verify MQTT broker is running:
telnet <broker-ip> 1883 - Check firewall rules
- Ensure broker URL format:
tcp://IP:PORT
- Verify
city-idandarea-idare correct - Check if all trash types are in
--ignorelist - Clear cache and refetch:
rm -rf ~/.cache/bdg/
- Check MQTT prefix matches your AWTRIX device
- Verify MQTT broker connectivity from AWTRIX device
- Check AWTRIX logs for incoming messages
- Cache location:
~/.cache/bdg/ - Format:
YYYY-MM.json(e.g.,2025-12.json) - Delete specific month:
rm ~/.cache/bdg/2025-12.json
MIT License - See LICENSE file for details.
Releases are automatically built and published using GoReleaser when a new tag is pushed:
# Create a new version tag git tag -a v1.0.0 -m "Release v1.0.0" git push origin v1.0.0
This will trigger the GitHub Actions workflow to:
- Build binaries for Linux, macOS, and Windows
- Create checksums
- Generate release notes from CHANGELOG.md
- Publish the release to GitHub
Test the release process locally:
# Check GoReleaser configuration task release-check # Build snapshot (without publishing) task release
See CONTRIBUTING.md for contribution guidelines.

