More features

Spook's happiness

One number from 0 to 100 for the health of your whole Home Assistant, with a mood on top. Six lenses, the checks behind them, what holds the number down, and the sensors to put on a dashboard or in an automation.

Spook keeps an eye on your home, and has an opinion about it. That opinion is a number from 0 to 100, with a mood on top.

It is about the health of the whole home, not only about what Spook's own repairs find. Do your automations point at things that exist? Is every integration running? Is Home Assistant up to date? Is there a backup that works? Is anything unsafe? Is the machine it runs on doing fine? Over 90 checks count. Each answer comes from Spook's own repairs, or from Home Assistant, the Supervisor or an integration saying so itself.

You find it as the Happiness device under Settings > Devices & services, on the Spook integration. Nothing to set up: it is there once Spook is.

The number

The number is the mean of six lenses, each a score from 0 to 100 of its own. A lens where nothing counts is left out. A lens is made of checks. A check passes or fails. When it fails, it can keep part of its points if it is a matter of degree: a tenth of the batteries low is not the same as all of them.

The number is always rounded down. So 100 means every check that counts passed, never nearly.

A lens with very few checks that count weighs less. Under 6 points worth of checks, a lens counts in proportion: one check of weight 3 makes it count half. So one small check failing in a nearly empty lens cannot take a sixth of your home.

Some findings are too important to vanish in a mean. Those cap the number: whatever the rest says, it does not go above that line.

There are no bonus points, and deleting something unused earns nothing. Only things that are wrong cost something.

Weights

Every check that counts has one of three weights. Each one means something, so nobody has to defend a 4 against a 3.

WeightWhen
5You can lose your home or your data.
3Something does not work.
1It works, but something is off.
NoneOnly noticed. Spook still raises the repair, but it costs nothing.

Seven of Spook's repairs carry no weight: unused blueprints, unused labels, empty areas, empty floors, customizations for entities that are gone, statistics without an entity, and public files in the www folder. Unused is not broken, and an empty area can be a plan.

Mood

The mood follows the number. One rule, no exceptions.

MoodFrom
Over the moon95
Happy85
Okay75
Uneasy60
Spooked0

Over the moon starts at 95, not at 100. One loose end and Spook is still over the moon. Nobody has to chase 100 to see the happiest ghost.

Lenses

Six ways of looking at your home, each with a sensor of its own. Below, every check in each of them, with its weight.

Some checks wait before a finding counts. Bad news waits, good news is instant: a finding counts once it has been there that long, and stops counting at the first look after it is gone. Spook looks again at least every 5 minutes, see After a start. Those timers survive a restart, so a home that restarts every week still gets there.

Configuration

Does what you built point at things that exist? This is where Spook's own repairs count. An automation that calls an entity that is gone, a dashboard card for a view that is not there, a group with a member that was removed.

The lens has three parts, averaged the same way the lenses are: automations and scripts, dashboards, and helpers and entities. Each check below links to the repair it is about.

The last two in the first list are not Spook's repairs: Home Assistant raises those itself, so Spook's repairs leave them alone. They count here all the same.

Reliable

Is everything that should be running, running?

CheckWeightCounts afterIn failed as
An integration failed to set up, or to migrate its settings.315 minutesintegration_setup_failed
An integration asks you to log in again.3At onceintegration_needs_reauth
The code of an integration you set up is gone.3At onceintegration_missing
Any other repair an integration marks as an error or critical. Not Spook's, not one already counted by another check, and not one that says in which version it breaks.3At oncerepairs_from_integrations
Zigbee (ZHA) or Z-Wave devices their own network calls offline or dead. A share of all of them.3A daymesh_devices_offline
An integration is still retrying to set up.1A dayintegration_retrying
An integration failed to unload.1At onceintegration_failed_unload
A device that says its battery is low. A device that does not say so itself is low at 20 percent or lower. A share of all battery devices. Phones, vacuums, lawn mowers and what charges itself are left out.1A daylow_batteries

A disabled or ignored integration is never judged.

A share is plain: healthy devices over all of them. With fewer than 5 devices, it is pass or fail instead: it fails when more than one is low or offline. One of three door sensors is not a third of a home.

Up to date

Is Home Assistant, and what it talks to, recent enough?

CheckWeightCounts afterIn failed as
How many months Home Assistant is behind the newest release. On a curve, see below.5At oncehome_assistant_age
The Supervisor calls the version of Home Assistant, the Operating System or the Supervisor itself unsupported.3At onceunsupported_versions
An integration rejects a firmware or a server as too old: Shelly, Matter, Z-Wave JS, or an ESPHome Bluetooth proxy.3At oncefirmware_rejected
A restart of Home Assistant is waiting.1A dayrestart_waiting
A reboot of the machine is waiting.1A dayreboot_waiting

Home Assistant ships a release every month, named after the year and month. Spook counts how many months yours is behind the newest one, as the Supervisor knows it, or from the calendar without a Supervisor. One release behind is every home on release day, so that costs nothing. After that, the check keeps less of its weight with every month:

Months behindKeeps
0 or 1100%
290%
370%
450%
534%
623%
715%
810%
97%
105%
113%
122%
13 to 161%
17 or more0%

Three in four measured installs are at most 2 months behind, so 2 still keeps 90 percent. A build from the development branch has no release to be behind on, so it is not judged.

Recoverable

Can your home be brought back from a backup?

CheckWeightCapIn failed as
Automatic backups are on: there is a schedule, and somewhere to put the backup.3automatic_backup_on
The automatic backup works: it was made, with every app and folder in it, and it is not overdue. A location that did not get it is the next check's.574automatic_backup_works
The newest automatic backup reached every location it was sent to.3backup_reached_every_location
A copy leaves the machine: not every location is on the disk of this machine.1backup_leaves_machine

A daily backup is overdue once the last one that completed is more than 2 days old. On a schedule of days of the week, more than 8 days. Overdue only counts once Spook has seen the schedule, unchanged, for 25 hours since Home Assistant started. So after a restart, a home that was off at backup time, or a schedule you just changed, the backup gets a chance to catch up first. That wait is for overdue alone: a backup that failed counts at once. A backup that is running is on its way, not overdue.

Without automatic backups, only the first check fails. The other three have nothing to look at: they do not fail along with it.

Secure

Does Home Assistant or the Supervisor say something is not safe?

CheckWeightCapIn failed as
An app uses a password that is known from a leak.574leaked_password
The Supervisor could not put its firewall in front of Docker.574docker_exposed
Apps run without the protection of AppArmor.3apps_unprotected
A Thread network uses a default passphrase or key.3thread_default_passphrase
Home Assistant encrypts its connections with outdated settings.1outdated_encryption

The first three are the Supervisor's to say, so they only apply to a home with one. The encryption is only judged when Home Assistant does it itself. A proxy in front of it may well do the encrypting, and Spook cannot see that one.

System

How is the machine Home Assistant runs on doing?

CheckWeightCapIn failed as
The Supervisor calls the system unhealthy, for any reason not counted under Secure.574supervisor_unhealthy
The disk is running out of space.574low_disk_space
Home Assistant could not read one of its storage files.574storage_corruption
The disk is wearing out.3disk_wearing_out
The recorder says its database is in trouble.3database
A Raspberry Pi saw its power supply fall short.3under_voltage
An app failed to start.1app_failed_to_start
Home Assistant no longer supports how it is installed, or the hardware it runs on.1deprecated_installation
The time of the system is not synchronised.1time_not_synchronised

Every one of these is a repair Home Assistant, the Supervisor or an integration raises itself.

Caps

A mean lets one disaster hide behind a lot of things that are fine. A failed backup in an otherwise tidy home would still be 93. That is not a home Spook is happy with.

So a few findings hold the number down, whatever the rest says. Only findings where being wrong is unlikely get a cap.

The number stays at or belowWhen
94, not over the moonHome Assistant is 4 months behind.
84, not happyHome Assistant is 5 or 6 months behind. Closing in on the 6 months the documentation calls the minimum.
74, not okayHome Assistant is 7 to 24 months behind. Or: the automatic backup was not made in full or is overdue, a leaked password, Docker exposed, the Supervisor calls the system unhealthy, low disk space, or storage corruption.
59, spookedHome Assistant is 25 months behind or more. The Supervisor calls a Core that old unsupported.

Only the lowest cap counts, and only when it is lower than the number would have been. The lens sensors are never capped: they show where the points went.

A cap needs a check that fails. Where a repair is behind it, ignore that repair and the cap is lifted. Home Assistant's age and an overdue backup are different: Spook measures those itself, so an ignored repair leaves their cap in place.

Check states

Every check is in one of six states. Only passed and failed count in the number. The rest leave it, and are counted next to it, so you can always see what the number is based on.

StateWhat it means
PassedSpook looked, and everything is fine.
FailedSpook found something, and you did not ignore it.
OffYou switched the repair off, on the Rules page of Spook's panel. Only Spook's own repairs can be off.
IgnoredEverything the check found, you ignored in the repairs dashboard. A restart or a reboot you put off counts as ignored too.
Could not lookSpook could not tell. The repair did not look yet, or its last look went wrong. Or what the check reads is not there right now, like the backup integration not set up.
Nothing to look atYour home has none of what the check is about. No scripts, no Supervisor, no Zigbee or Z-Wave devices.

Ignored is not passed

Ignoring a repair takes it out of the number. It does not turn it into a pass. The sensors keep counting it as ignored, so a 100 with five ignored checks says so.

That is on purpose. Counting an ignored finding as failed would put 100 out of reach for anybody who ignored a finding that was wrong. And Spook has had those.

When a check finds several things and you ignored only some of them, it still fails. The ones you ignored are counted in findings_ignored.

When Spook could not look

For Spook's own repairs, an open finding fails the check, also when the last look went wrong. A finding Spook already raised does not vanish because a look failed.

A check that reads what Home Assistant or an integration says works the same way. A repair that is open counts, whether the integration is loaded or still retrying. Only a pass needs the integration loaded: until then, the check could not look.

Two exceptions, where Spook can only ask the integration itself. The Supervisor checks wait until the Supervisor integration is loaded and has read what the Supervisor found. The backup checks wait until the backup integration is loaded. Until then, those checks could not look, and they leave the number, caps and all, also with a repair open.

After a start

Right after Home Assistant starts, the sensors are unknown. A score over the few repairs that already had a look would jump at every restart.

Spook waits until your home has settled: every repair that counts has had its first look, and no new entity turned up for a minute. Or 15 minutes after Spook's repairs are set up, whichever comes first. A repair that has not looked by then could not look.

After that the number is live. Spook works it out again when a repair comes or goes, a repair is switched on or off, an integration changes state, and every 5 minutes for what only changes with time, like a backup that is getting overdue.

Sensors

The Happiness device holds eight sensors. Below are their default entity IDs. Renamed one? Use yours.

The happiness sensor

The number, from 0 to 100, in percent. The one to put on a dashboard.

Default entity ID: sensor.spook_happiness

The mood sensor

The mood: over_the_moon, happy, okay, uneasy or spooked. Home Assistant shows it in your language, and its icon follows the mood. It has no attributes: the mood follows the number, and the number carries them.

Default entity ID: sensor.spook_mood

The lens sensors

The score of each lens, from 0 to 100, in percent. Unknown when nothing in the lens counts, like the Secure lens in a home without a Supervisor, a Thread network or encryption of its own.

  • Configuration: sensor.spook_happiness_configuration
  • Reliable: sensor.spook_happiness_reliable
  • Up to date: sensor.spook_happiness_up_to_date
  • Recoverable: sensor.spook_happiness_recoverable
  • Secure: sensor.spook_happiness_secure
  • System: sensor.spook_happiness_system

Attributes

The happiness sensor and every lens sensor say what their number is based on. Checks without a weight are never in these counts.

AttributeWhat it is
checks_passedChecks that passed.
checks_failedChecks that failed.
checks_offChecks you switched off.
checks_ignoredChecks where you ignored everything they found.
checks_could_not_lookChecks that could not look.
checks_nothing_to_look_atChecks your home has nothing for.
findings_ignoredFindings you ignored.
model_versionThe version of how Spook works out the number. It goes up when a change in Spook can move the number in a home where nothing changed.
failedLens sensors only. The checks of that lens that failed, by the name in the tables above.

Which entity or which automation is behind a finding is not in an attribute: Home Assistant records attributes with every change, and the repairs dashboard already has the details.

How to use it

In Spook's panel

The Overview page of Spook's panel opens with it: the ghost in his mood, the number, and how sure that number is. "Based on 34 of 36 checks" counts the checks that apply to your home, next to the ones you switched off, the ones that could not look, and the findings you ignored. Checks that have nothing to look at in your home, like the Zigbee check without Zigbee, are not in it: they do not make the number any less sure.

Below it are the six lenses, each with its score. Select one to open it in place: what to look at first, what was left out, and, folded away, what passes and what does not apply to your home. The failing checks come in the order of what they would add to the number, so the one on top cheers Spook up most.

When a cap holds the number down, the panel names the check that does it, and what the number would be without it.

The panel is a preview: go to Settings > System > Labs, and enable Spook's panel. It opens from the gear on Spook's card in Settings > Devices & services, for administrators.

On a dashboard

Spook has a card for it: the happiness card, with the ghost in his mood, the number and the six lenses. And a badge with the ghost and the number. Both need Spook on your dashboards switched on.

Without that, a gauge card on the number does the job, with the colors of the moods:

type: gauge
entity: sensor.spook_happiness
min: 0
max: 100
severity:
  green: 85
  yellow: 60
  red: 0

Put the six lens sensors in an entities card next to it, and you see at a glance where the points went. The number has a state class, so its history is kept for the long run: watch it climb while you clean up.

In an automation

Get told when Spook gets spooked:

triggers:
  - trigger: state
    entity_id: sensor.spook_mood
    to: spooked
    not_from:
      - unknown
      - unavailable
actions:
  - action: persistent_notification.create
    data:
      title: Spook is spooked 👻
      message: Something in your home needs attention. Have a look at the repairs dashboard.

The not_from matters: after every start the mood is unknown for a while, and without it the automation would tell you again each time Home Assistant starts.