|
| 1 | +title: DTE-Rates-for-Home-Assistant |
| 2 | +type: Home Automation |
| 3 | +year: 2025 |
| 4 | +technologies: Python, Home Assistant, HACS, Lovelace, PDF Parsing, Custom Integration |
| 5 | + |
| 6 | +# DTE Rates for Home Assistant |
| 7 | + |
| 8 | +## Real-Time DTE Electric Rates in Your Smart Home |
| 9 | + |
| 10 | +DTE Rates for Home Assistant is a custom integration that pulls the official DTE residential electric rate card PDF, parses plans and time-of-use windows dynamically, and exposes import/export price sensor entities that update based on time-of-day and season. |
| 11 | + |
| 12 | +## Why It Matters |
| 13 | +- Eliminates manually hardcoding rate schedules that change with every DTE tariff update. |
| 14 | +- Enables energy automations and dashboards to react to live pricing (off-peak charging, export decisions, cost tracking). |
| 15 | +- Integrates directly with the Home Assistant Energy Dashboard as a `USD/kWh` price entity. |
| 16 | +- HACS-installable — no manual file copying required for most users. |
| 17 | + |
| 18 | +## What It Exposes |
| 19 | + |
| 20 | +| Entity | Type | Description | |
| 21 | +|---|---|---| |
| 22 | +| `sensor.dte_import_rate` | monetary | Current import price (USD/kWh) | |
| 23 | +| `sensor.dte_export_rate` | monetary | Current export/generation price (USD/kWh) | |
| 24 | +| `sensor.dte_current_rate_name` | string | Active period name (e.g. `Winter Off-Peak`) | |
| 25 | +| `sensor.dte_rate_schedule` | structured | Full parsed schedule with attributes for dashboards | |
| 26 | + |
| 27 | +## Architecture |
| 28 | +``` |
| 29 | +DTE Rate Card PDF (dteenergy.com) |
| 30 | + ↓ (weekly refresh) |
| 31 | +PDF Parser → Plan/Period/Window/Component extraction |
| 32 | + ↓ |
| 33 | +Home Assistant Config Flow (rate plan + net metering selection) |
| 34 | + ↓ |
| 35 | +Sensor entities (updated on time boundary events) |
| 36 | + ↓ |
| 37 | +Energy Dashboard / Automations / Lovelace Cards |
| 38 | +``` |
| 39 | + |
| 40 | +## Key Features |
| 41 | +- **Dynamic PDF parsing:** Rates are parsed live from the official DTE PDF — no hardcoded values that go stale. |
| 42 | +- **Time-of-use awareness:** Sensors reflect the correct rate for the current time window and season automatically. |
| 43 | +- **Net metering support:** Export calculation adjusts based on whether net metering is enabled. |
| 44 | +- **Warning system:** Persistent notifications and `warning` attributes fire when a previously selected rate plan disappears from the latest card. |
| 45 | +- **Custom Lovelace card:** Ships a `custom:dte-rates-card` for at-a-glance rate display on any dashboard. |
| 46 | +- **Service calls:** Force refresh, inspect the parsed schedule, and generate card YAML examples via HA services. |
| 47 | + |
| 48 | +## Custom Lovelace Card |
| 49 | +```yaml |
| 50 | +type: custom:dte-rates-card |
| 51 | +title: DTE Residential Rates |
| 52 | +import_entity: sensor.dte_import_rate |
| 53 | +export_entity: sensor.dte_export_rate |
| 54 | +name_entity: sensor.dte_current_rate_name |
| 55 | +schedule_entity: sensor.dte_rate_schedule |
| 56 | +``` |
| 57 | +
|
| 58 | +## Services |
| 59 | +
|
| 60 | +| Service | Description | |
| 61 | +|---|---| |
| 62 | +| `dte_rates.refresh_rate_card` | Force re-download and re-parse of the DTE PDF | |
| 63 | +| `dte_rates.show_rate_schedule` | Dumps parsed schedule to a persistent notification | |
| 64 | +| `dte_rates.show_lovelace_card_example` | Generates card resource + YAML example notification | |
| 65 | + |
| 66 | +## Status |
| 67 | +- **State:** Active, publicly available via HACS. |
| 68 | +- **Role:** Full design + implementation (PDF parsing pipeline, HA integration, config flow, Lovelace card). |
| 69 | +- **Next Up:** Support for additional DTE rate plans, multi-utility expansion. |
| 70 | + |
| 71 | +[GitHub](https://github.com/javaDevJT/DTE-Rates-for-Home-Assistant) |
0 commit comments