Skip to content

Blueprints & Statistics

Two importers. import_blueprint pulls an automation or script blueprint straight from a community-forum topic, GitHub file, or Gist. Tell Claude “set up that blueprint” with a link and it can import and configure it in one conversation.

import_statistics writes long-term statistics rows directly: repair a broken energy dashboard, migrate meter history from a previous system, or feed external data (solar forecasts, utility bills) into HA’s statistics store. brAIn reads long-term statistics for its energy analysis, so backfilled history makes those insights smarter too.

Import blueprint

brain.import_blueprint

Import an automation or script blueprint from a URL (Home Assistant community forum, GitHub, or GitHub Gist). Returns the blueprint domain, name, and file path as response data.

FieldTypeRequiredDescription
urltextyesThe URL to import the blueprint from.
service: brain.import_blueprint
data:
url: https://community.home-assistant.io/t/motion-activated-light/123456

🗣️ “Import that motion-activated-light blueprint from the forum and set it up for the hallway.”

Import statistics

brain.import_statistics

Import or backfill long-term statistics rows. Use an entity ID (sensor.gas_meter) for recorder statistics, or an external ID (bruh:solar_forecast) for external statistics; the source is derived automatically.

FieldTypeRequiredDescription
statistic_idtextyesEntity ID (sensor.gas_meter) or external ID (domain:object_id).
has_meanbooleanyesWhether the rows carry mean/min/max values (measurements).
has_sumbooleanyesWhether the rows carry sum values (metered totals like energy).
nametextnoDisplay name for the statistic.
unit_of_measurementtextnoUnit of measurement of the values.
statslist of objectsyesList of statistics rows. Each row needs a start timestamp (top of an hour) plus mean/min/max and/or state/sum values.
service: brain.import_statistics
data:
statistic_id: sensor.gas_meter
has_mean: false
has_sum: true
unit_of_measurement: ""
stats:
- start: "2026-07-01T00:00:00+00:00"
state: 1234.5
sum: 1234.5
- start: "2026-07-01T01:00:00+00:00"
state: 1235.1
sum: 1235.1

🗣️ “My energy dashboard has a gap from when the meter was offline — backfill it from this CSV.”