Develop and maintain the Beeminder custom integration for Home Assistant
Develop and maintain the Beeminder custom integration for Home Assistant that creates sensors to track goal progress.
This skill helps you work with a Home Assistant custom component that integrates Beeminder goal tracking. The integration fetches data from the Beeminder API and creates sensor entities in Home Assistant to monitor goal progress, targets, and derailment status.
1. **Data Coordinator** (`__init__.py`):
- `BeeminderDataUpdateCoordinator` fetches data from Beeminder API every 5 minutes
- Manages shared state for all sensors to minimize API calls
- Uses Home Assistant's `DataUpdateCoordinator` pattern
2. **Sensor Implementation** (`sensor.py`):
- Creates three sensors per Beeminder goal:
- Current value sensor (cumulative value)
- Goal value sensor (dynamic target)
- Days until derailment sensor (urgency tracking)
- Exposes comprehensive goal data as attributes (pledge, tags, goal type, urgency, last 100 datapoints)
3. **Configuration**:
- YAML configuration via `configuration.yaml` (primary method)
- UI configuration via config flow (basic implementation)
Install Home Assistant for local development:
```bash
pip install homeassistant
```
Start Home Assistant pointing to your config directory:
```bash
hass -c /path/to/config/dir
```
Check logs for integration errors and debugging output:
```bash
tail -f /path/to/config/dir/home-assistant.log
```
The integration uses these Beeminder API endpoints:
- `/goals.json` - Fetch all goals
- `/goals/{slug}/datapoints.json?count=100&sort=daystamp` - Fetch goal datapoints
When modifying the integration code:
Create automations using the sensor data:
**Alert when goal is derailing today:**
```yaml
automation:
- alias: "Beeminder Derailment Alert"
trigger:
- platform: numeric_state
entity_id: sensor.beeminder_*_days_until_derailment
below: 1
action:
- service: notify.notify
data_template:
title: "Beeminder Alert!"
message: "Goal {{ trigger.to_state.attributes.title }} is derailing today!"
```
**Dashboard card for goals due today:**
```yaml
type: entity-filter
entities:
- sensor.beeminder_*_days_until_derailment
state_filter:
- operator: '<'
value: 1
card:
type: entities
title: Goals Due Today
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/beeminder-home-assistant-integration-development/raw