Skip to content
Stand with Ukraine flag

Daily Energy Budget Alarm

  • Alarm Rule
  • 173 installs
  • v1.0.0
  • Jun 15, 2026
  • MIT license
  • v4.3+

Monitor a building or site’s daily energy use against a budget and raise an alarm when consumption stays above budget for several readings in a row — kWh, m³, therms.

Type
  • Alarm
Category
  • Threshold
  • Energy
Use Cases
  • Smart Energy
  • Smart Metering
  • Smart Building

Who it’s for

Building managers, facility operators, and energy / sustainability teams asking “are we above yesterday’s daily total again?”, “is a water leak showing up as days of higher m³ readings?”, “is this site quietly over its production target every shift?” — when a daily metric should stay below a budget and repeated overruns deserve an alarm, not a manual dashboard check.

What it does

Reads dailyEnergyConsumption telemetry and raises a Major alarm when the daily total stays above budget for several readings in a row. One reading back under budget clears the alarm.

Daily Energy Budget Alarm diagram

How to set up

The rule has default values for every threshold, so it works as soon as it is installed. Install on a device or asset profile so the alarm covers every entity of that type at once and automatically picks up any new entity added later. Single-device or single-asset installs are also supported.

This rule reads dailyEnergyConsumption telemetry. Pair it with the upstream template that aggregates a raw energy counter (e.g. energyTotal) into the daily total:

Daily Energy Consumption Total Dmytro Shvaika

How to customize

  • To monitor a different telemetry — change the Time series key on the metric argument (e.g. dailyEnergyConsumptiondailyWaterConsumption, dailyGasConsumption).
  • To use different budget or repeat-count attribute names — change the Attribute key on the budget or repeatCount arguments to match what your devices or assets already use (e.g. dailyEnergyBudgetdailyKwhLimit).
  • To change the budget used when no per-entity attribute is set — change the Default value on the budget argument.
  • To change how many consecutive over-budget readings must occur before firing — change the Default value on the repeatCount argument.
  • To fire the alarm on the first over-budget reading — change the Trigger condition type from Repeating to Simple. The repeatCount argument is no longer referenced and can be removed.
  • To tune the budget or the repeat count at runtime without editing the rule — set the value on the entity as a regular server-side attribute. It can be edited directly from a dashboard using Update Multiple Attributes input widget:
    • Per device or asset — set the attribute (e.g. dailyEnergyBudget, dailyEnergyOverBudgetRepeatCount) on the device or asset itself. The per-entity value overrides the Default value.
    • Per customer (in deployments that use customers) — change Entity type on the relevant argument to Current owner, then set the attribute on the customer. Every device that customer owns picks up that value.
    • Tenant-wide — change Entity type to Current tenant, then set the attribute on the tenant. The value applies across every device.
  • To make the alarm manual-clear-only — remove the Clear condition. The alarm then stays active until an operator clears it.
  • To restrict firing to specific days — in the Trigger condition’s Schedule, choose Active at a specific time range (or Custom schedule for different intervals per day) — e.g. weekdays only for office-building energy budgets. For per-entity schedules — different buildings with different operating calendars — switch to Dynamic mode and source the schedule JSON from an attribute on the entity.
  • To control where the alarm shows up — toggle the propagation flags under Advanced settings.

Share Your Alarm Rule with the Community

Built a reliable alarm rule? Export it as a JSON from ThingsBoard and publish it to the IoT Hub. Share it with thousands of ThingsBoard developers and help the community react to incidents faster.