hass.tibber_prices/docs/user/versioned_docs/version-v0.31.0/sensors-timing.md

3.6 KiB
Raw Permalink Blame History

Timing Sensors

:::tip Entity ID tip <home_name> is a placeholder for your Tibber home display name in Home Assistant. Entity IDs are derived from the displayed name (localized), so the exact slug may differ. Can't find a sensor? Use the Entity Reference (All Languages) to search by name in your language. :::

Timing sensors provide real-time information about Best Price and Peak Price periods: when they start, end, how long they last, and your progress through them.

stateDiagram-v2
    direction LR

    IDLE: ⏸️ IDLE<br/><small>No active period</small>
    ACTIVE: ▶️ ACTIVE<br/><small>In period</small>
    GRACE: ⏳ GRACE<br/><small>60s buffer</small>

    IDLE --> ACTIVE: period starts
    ACTIVE --> GRACE: period ends
    GRACE --> IDLE: 60s elapsed
    GRACE --> ACTIVE: new period starts<br/><small>(within grace)</small>

IDLE = waiting for next period (shows countdown via next_in_minutes). ACTIVE = inside a period (shows progress 0100% and remaining_minutes). GRACE = short buffer after a period ends, allowing back-to-back periods to merge seamlessly.

Available Timing Sensors

For each period type (Best Price and Peak Price):

Sensor When Period Active When No Active Period
End Time Current period's end time Next period's end time
Period Duration Current period length (minutes) Next period length
Remaining Minutes Minutes until current period ends 0
Progress 0100% through current period 0
Next Start Time When next-next period starts When next period starts
Next In Minutes Minutes to next-next period Minutes to next period

Usage Examples

Show Countdown to Next Cheap Window

Show YAML: Countdown to Next Cheap Window
type: custom:mushroom-entity-card
entity: sensor.<home_name>_best_price_next_in_minutes
name: Next Cheap Window
icon: mdi:clock-fast

Display Period Progress Bar

Show YAML: Display Period Progress Bar
type: custom:bar-card
entity: sensor.<home_name>_best_price_progress
name: Best Price Progress
min: 0
max: 100
severity:
    - from: 0
      to: 50
      color: green
    - from: 50
      to: 80
      color: orange
    - from: 80
      to: 100
      color: red

Notify When Period Is Almost Over

Show YAML: Period Ending Notification
automation:
    - alias: "Warn: Best Price Ending Soon"
      trigger:
          - platform: numeric_state
            entity_id: sensor.<home_name>_best_price_remaining_minutes
            below: 15
      condition:
          - condition: numeric_state
            entity_id: sensor.<home_name>_best_price_remaining_minutes
            above: 0
      action:
          - service: notify.mobile_app
            data:
                title: "Best Price Ending Soon"
                message: "Only {{ states('sensor.<home_name>_best_price_remaining_minutes') }} minutes left!"