Skip to main content
Selora Homes Selora Homes
Recipe · v1.0.0 · Released Aug 28, 2026

High Energy Usage Alert

Installs a Home Assistant automation that watches your whole-home power draw and warns you when it stays high for longer than it should, so a heater or a forgotten appliance does not run all day unnoticed. Add speakers to hear it, add a smart plug to shed the load.

A space heater left on, an immersion heater that never switched off, an old freezer stuck defrosting: the expensive faults are the ones that draw steadily for hours without anyone noticing. This recipe watches your power reading and speaks up when it stays above a level you set for longer than it should, naming the reading that tripped so you know where to look.

The threshold and the hold time are yours to set. The hold time is what keeps a kettle or an oven preheat from setting it off: normal spikes come and go, and the alert only fires when the draw stays high. Ten minutes above five kilowatts is a sensible starting point for a whole home, tighter if you are watching one circuit.

Hearing it and shedding the load

A push notification is easy to miss. Pick one or more speakers as the optional media-player role and the same warning is read out over text to speech. It works without a paid Home Assistant Cloud subscription, using whichever speech engine your Home Assistant already has.

If the high draw is a load you are happy to drop, pick a smart plug carrying it as the optional role and the recipe switches that plug off when usage stays high, so the load sheds itself rather than waiting for you to get to it.

Files Selora AI's pipeline reads to install this recipe. The manifest declares roles, inputs, and integrations; the package files are Jinja-templated YAML applied to Home Assistant.

# High Energy Usage Alert — warn when a power reading stays above a threshold
# for longer than a normal spike.
#
# One required power role (multi-select, so several circuits can be watched at
# once, each triggering independently). Optional speakers announce the warning
# over TTS, and optional smart plugs are switched off to shed the load. The
# hold time on the numeric_state trigger is what separates a steady fault from
# a kettle.
slug: high-energy-usage-alert
version: 1.0.0
title: High Energy Usage Alert
tagline: When your power draw stays high for too long, get a warning that names the reading that tripped.
description: >-
  Watches the power sensors you pick and warns when any of them holds above the
  threshold for the hold time you set, so a heater or a faulty appliance does
  not run all day unnoticed. Optionally announces over TTS and sheds a load on a
  smart plug.
author: Selora AI
released: "2026-08-28"
min_integration_version: "0.12.0"
tags: [energy, alerts, power]
roles:
  # Power sensors to watch — multi-select. sensor + device_class power.
  # min_count 1. Each triggers independently, so a whole-home reading and a
  # single circuit can both be covered.
  - id: power_sensors
    title: Power sensors
    kind: sensor
    device_class: power
    min_count: 1
    selection: required
    description: >-
      The power sensors to watch. Point them at the whole home or at individual
      heavy circuits.
  # Optional announcement speakers over TTS. media_player. min_count 0.
  - id: announce_speakers
    title: Announcement speakers
    kind: media_player
    min_count: 0
    selection: required
    description: >-
      Optional. Speakers that announce the warning out loud over TTS in
      addition to the push notification. Leave empty to be notified on your
      phone only.
  # Optional smart plugs to switch off (shed) when usage stays high. kind
  # switch. min_count 0.
  - id: shed_plugs
    title: Load-shed smart plugs
    kind: switch
    min_count: 0
    selection: required
    description: >-
      Optional. Smart plugs carrying a non-essential load that the recipe
      switches off when usage stays high. Leave empty to only warn.
inputs:
  # Power above this, held for the hold time, trips the alert. 5000 W suits a
  # whole home; lower it for a single circuit.
  - id: high_watts
    type: number
    label: High threshold (watts)
    description: >-
      A reading above this, held for the hold time, trips the alert.
    default: 5000
    min: 0
    max: 100000
  # How long the reading must stay above the threshold, so a normal spike is
  # ignored and only a steady draw trips the alert.
  - id: sustain_minutes
    type: number
    label: Hold time (minutes)
    description: >-
      How long the reading must stay above the threshold before the alert
      fires.
    default: 10
    min: 0
    max: 240
  # TTS engine entity for the optional spoken announcement. Auto-resolved by the
  # tts_engine resolver from the home's configured tts.* entities, so the wizard
  # never shows this field. tts.speak works without a paid Home Assistant Cloud
  # subscription. The resolver returns an empty string when the home has no TTS
  # engine, and the template then skips the announcement. The default below is
  # only used by the offline recipe-validation gate.
  - id: tts_engine
    type: string
    label: Text-to-Speech engine
    description: >-
      Speech engine entity used for the spoken announcement. Resolved
      automatically from the Text-to-Speech engines configured in Home
      Assistant.
    resolver: tts_engine
    default: "tts.piper"
package_files:
  - package/automations/high_usage.yaml.j2
{# High Energy Usage Alert: one automation, triggered per power sensor going
   above the threshold and holding there for the hold time.

   The action names the reading that tripped and its live value, so a home
   watching several circuits knows which one is high. A push notification always
   fires; the load-shed step is rendered only when smart plugs were picked, and
   the TTS announcement only when speakers and an engine resolved. Shedding is
   ordered ahead of the announcement, and the announcement continues on error,
   so the optional spoken half can never stop the load being cut.

   mode: queued so two circuits crossing the threshold close together each get
   handled rather than the second being dropped. #}
{# device_class power allows watts, kilowatts or megawatts, and numeric_state
   compares the raw state with no unit conversion: a 5.2 kW inverter reads as
   5.2 against a watt threshold and never crosses it. This renders the reading
   normalised to watts, so the thresholds mean what their labels say whatever
   the sensor reports. Template triggers still support for:, so the hold times
   below are unchanged. #}
{% macro watts(e) -%}
states('{{ e }}') | float(0) * (1000 if state_attr('{{ e }}', 'unit_of_measurement') == 'kW' else (1000000 if state_attr('{{ e }}', 'unit_of_measurement') == 'MW' else 1))
{%- endmacro %}
automation:
  - id: selora_recipe_{{ slug | replace('-', '_') }}_high_usage
    alias: "High Energy Usage Alert: usage high"
    description: >-
      When a watched power sensor holds above the threshold for the hold time,
      warn about it and optionally announce and shed a load.
    mode: queued
    max: 10
    trigger:
{% for sensor in roles.power_sensors %}
      - platform: template
        value_template: "{% raw %}{{{% endraw %} {{ watts(sensor) }} > {{ inputs.high_watts }} {% raw %}}}{% endraw %}"
        for:
          minutes: {{ inputs.sustain_minutes }}
{% endfor %}
    action:
      # Read live rather than from trigger.to_state. With for: on the trigger,
      # to_state is the reading that first crossed the threshold, captured
      # before the hold time started. Quoting it several minutes later as the
      # current draw is wrong whenever the load has moved since, which on a
      # circuit that is genuinely running high it usually has.
      - variables:
          source: "{% raw %}{{ state_attr(trigger.entity_id, 'friendly_name') | default(trigger.entity_id, true) }}{% endraw %}"
          reading: "{% raw %}{{ states(trigger.entity_id) }}{% endraw %}"
          unit: "{% raw %}{{ state_attr(trigger.entity_id, 'unit_of_measurement') | default('W', true) }}{% endraw %}"
      - service: notify.notify
        data:
          title: "{% raw %}High power usage: {{ source }}{% endraw %}"
          message: "{% raw %}{{ source }} has stayed high for a while and is now at {{ reading }} {{ unit }}. Check what is running.{% endraw %}"
{% if roles.shed_plugs %}
      # Shedding runs before the announcement, and the announcement cannot abort
      # the run. Cutting the load is the consequential half of this recipe; a
      # speaker that has gone offline or a TTS provider that errors must not be
      # able to stop it happening.
      - service: switch.turn_off
        target:
          entity_id:
{% for plug in roles.shed_plugs %}
            - {{ plug }}
{% endfor %}
{% endif %}
{% if roles.announce_speakers and inputs.tts_engine %}
      - service: tts.speak
        continue_on_error: true
        target:
          entity_id: {{ inputs.tts_engine }}
        data:
          media_player_entity_id:
{% for player in roles.announce_speakers %}
            - {{ player }}
{% endfor %}
          message: "{% raw %}Power usage is high. {{ source }} is at {{ reading }} {{ unit }}.{% endraw %}"
{% endif %}

Type to search across

↑↓ navigate ↵ open
⌘K search