- Moved Strike integration to integrations/strike/ - Created main README.md with repository overview - Updated URLs to Gitea repository (git.martien.io) - Removed old root-level custom_components directory - Set up structure to support multiple future integrations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Strike Bitcoin Sensor for Home Assistant
A custom Home Assistant integration that fetches Bitcoin price data from the Strike API and creates sensor entities for monitoring cryptocurrency prices.
Features
- 🔄 Real-time Bitcoin (BTC) price tracking from Strike API
- 💱 Configurable currency pairs (default: BTC/USD)
- ⏱️ Customizable update intervals
- 🔐 Secure API key storage
- 🎨 Home Assistant UI configuration flow
- 📊 Additional state attributes (currency, source, last update)
- 🛡️ Comprehensive error handling and logging
- ✨ Follows Home Assistant development best practices
Installation
HACS (Recommended)
- Open HACS in your Home Assistant instance
- Click on "Integrations"
- Click the three dots in the top right corner
- Select "Custom repositories"
- Add the repository URL:
https://git.martien.io/Martien/hass-to-be-good - Select category: "Integration"
- Click "Add"
- Search for "Strike Bitcoin" in HACS
- Click "Download"
- Restart Home Assistant
Manual Installation
- Copy the
custom_components/strikefolder to your Home Assistantcustom_componentsdirectory - Restart Home Assistant
Configuration
Prerequisites
You need a Strike API key to use this integration:
- Visit Strike and create an account
- Navigate to the API section in your Strike dashboard
- Generate a new API key
- Copy the API key for use in Home Assistant
Setup via UI
- Go to Settings → Devices & Services
- Click + Add Integration
- Search for Strike Bitcoin
- Enter your Strike API key
- (Optional) Configure currency pair (default: BTCUSD)
- (Optional) Set update interval in seconds (default: 300 seconds / 5 minutes)
- Click Submit
Usage
Once configured, the integration will create a sensor entity:
- Entity ID:
sensor.strike_btcusd - State: Current Bitcoin price
- Unit: Currency (e.g., USD)
- Icon:
mdi:bitcoin
State Attributes
The sensor provides additional information as attributes:
currency: Target currency (e.g., USD)source: Currency pair (e.g., BTC/USD)last_update: Timestamp of last update
Example Automation
automation:
- alias: "Bitcoin Price Alert"
trigger:
- platform: numeric_state
entity_id: sensor.strike_btcusd
above: 50000
action:
- service: notify.notify
data:
message: "Bitcoin price is above $50,000!"
Example Lovelace Card
type: entities
entities:
- entity: sensor.strike_btcusd
name: Bitcoin Price
icon: mdi:bitcoin
Configuration Options
Options Flow
You can modify the integration settings after setup:
- Go to Settings → Devices & Services
- Find Strike Bitcoin integration
- Click Configure
- Adjust the update interval
- Click Submit
Troubleshooting
Integration Not Loading
- Check Home Assistant logs for errors
- Verify API key is correct
- Ensure you have internet connectivity
- Restart Home Assistant
API Errors
Common errors and solutions:
- 401 Unauthorized: Invalid API key - regenerate in Strike dashboard
- 403 Forbidden: API key doesn't have required permissions
- Connection timeout: Check network connectivity or increase timeout in
const.py
Enable Debug Logging
Add to your configuration.yaml:
logger:
default: info
logs:
custom_components.strike: debug
Development
Repository Structure
hass-to-be-good/
├── custom_components/
│ └── strike/
│ ├── __init__.py # Integration setup
│ ├── config_flow.py # Configuration UI
│ ├── const.py # Constants and configuration
│ ├── manifest.json # Integration metadata
│ └── sensor.py # Sensor implementation
├── .gitignore
├── hacs.json # HACS configuration
└── README.md
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Testing
Before submitting changes:
- Test the integration in a Home Assistant development environment
- Verify configuration flow works correctly
- Check logs for errors or warnings
- Ensure code follows Home Assistant style guidelines
Strike API Reference
This integration uses the Strike API v1:
- Base URL:
https://api.strike.me - Endpoint:
/v1/rates/ticker - Authentication: Bearer token (API key)
- Documentation: Strike API Docs
License
This project is provided as-is for educational and personal use.
Support
For issues, questions, or feature requests:
- Open an issue on Gitea
- Check existing issues for solutions
- Provide Home Assistant logs when reporting bugs
Changelog
Version 1.0.0
- Initial release
- Bitcoin price sensor with Strike API integration
- UI configuration flow
- Configurable update intervals
- Secure API key storage
- Comprehensive error handling
Acknowledgments
- Built for Home Assistant
- Uses Strike API
- Follows Home Assistant integration development guidelines