Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Enhanced integrations

Recorder

Records all the spooky things that happen in your home.

The Home Assistant recorder icon



The recorder integration in Home Assistant is responsible for registering and storing everything that happens in your home. It is the backbone of the history and logbook features in Home Assistant but it also keeps information in a long-term format to power things like the energy dashboard and other graphs you see in Home Assistant.

Screenshot of the recorder import statistics action on the Tools page.

Figure 1:Spook adds an action that allows importing data into the recorder.

Devices & entities

Spook does not provide any new devices or entities for this integration.

Actions

Spook adds the following new actions to your Home Assistant instance:

Import statistics

Manually import long-term statistics into the recorder database of Home Assistant.

Screenshot of the recorder import statistics action on the Tools page.

Action properties

Action

Recorder: Import statistics 👻

Action name

recorder.import_statistics

Action targets

No targets

Action response

No response

Spook's influence

Newly added action

Tools

Try this action Open your Home Assistant instance and show the Actions tool with a specific action selected.

Action data parameters

Attribute

Type

Required

Default / Example

has_mean

boolean

Yes

has_sum

boolean

Yes

name

string

No

None

source

string

Yes

statistic_id

string

Yes

unit_of_measurement

string

No

None

stats

mapping

Yes

stats attribute mapping

Attribute

Type

Required

Default / Example

start

datetime string

Yes

mean

float

No

min

float

No

max

float

Yes

last_reset

datetime string

No

None

state

float

No

sum

float

No

More information about the mapping/meaning of fields in long-term statistics can be found on the Home Assistant data portal.

Repairs

While Spook is floating around in your Home Assistant instance, it will raise repairs issues if it has found something that is not right.

Orphaned long-term statistics

The recorder keeps long-term statistics separately from the states it records, and it keeps them by statistic ID rather than by entity. That means they outlive the entity they were collected for. Spook compares the statistics in the database against the entities that still exist and raises a repair issue listing the ones with nothing behind them anymore.

These are not harmful, but they are not free either: they take up database space, and they keep showing up in pickers and graphs long after the sensor they belonged to is gone.

The repair itself offers to clear them for you. It gives you three choices:

Spook looks again before it clears anything, and only removes what the list you read and that fresh look agree on. Anything that has an entity behind it again by the time you press the button is left where it is, without being named: the repair comes back for whatever is still orphaned, so nothing gets lost. If none of them still need clearing, Spook says so instead of reporting a job it did not do.

A statistic has to keep looking abandoned for a quarter of an hour before Spook mentions it at all. Sensors go missing briefly all the time, when an integration reloads or while Home Assistant is still starting, and none of those are worth deleting anybody’s history over.

Use cases

Some use cases for the enhancements Spook provides for this integration:

Blueprints & tutorials

There are currently no known blueprints or tutorials for the enhancements Spook provides for this integration. If you created one or stumbled upon one, please let us know in our discussion forums.

Feature requests, ideas, and support

If you have an idea on how to further enhance this integration, for example, by adding a new action, entity, or repairs detection; feel free to let us know in our discussion forums.

Are you stuck using these new features? Or maybe you’ve run into a bug? Please check the Support page on where to go for help.