Integrations

Energy

Spook adds actions to put individual devices on the energy dashboard of Home Assistant and take them off again, from your automations and scripts, and tells you in your repairs when the energy dashboard is set up to use an entity that no longer exists.

The energy dashboard in Home Assistant is where your consumption, production, gas, water, and battery numbers come together. It is configured once, in Settings > Dashboards > Energy, by pointing it at the entities that carry those numbers.

That configuration is a list of entity IDs, kept separately from the entities themselves. Home Assistant does validate it, but only shows the result inside that configuration panel. You visit that page when you change something, not to check on it.

Spook takes Home Assistant's own check and puts what it finds in your repairs dashboard.

The individual devices on the energy dashboard are added and deleted in that same configuration, one at a time, by hand. Spook adds actions for it, so an automation or a script can do the same: put the energy sensor of a new smart plug on the dashboard the moment it is set up, and take the device you replaced off again. An AI agent with Spook's tools can do both too.

Actions

Spook adds two actions for the energy dashboard. You find them wherever you add an action, marked with a 👻. Both are for administrators only, the same as the energy configuration.

They do what Settings > Dashboards > Energy does under Individual electrical devices, and leave everything else on the energy dashboard as it is: the grid, solar, batteries, gas, water, and the other devices. A call that changes nothing writes nothing.

Add an individual device

Puts one or more devices on the energy dashboard, the same as Add device in the energy configuration.

You plugged in a new smart plug for the dishwasher. Home Assistant has its energy sensor the moment it is set up, but the energy dashboard does not know about it until you add it there by hand. With this action, an automation does that for you.

Every device is checked first, the way the energy dashboard checks it: an energy sensor in a unit of energy, one that totals up, and one the recorder keeps. A sensor that measures power is refused. So is a sensor that is on the energy dashboard already, as something other than an individual device, and an energy sensor made with an Integral helper from a power sensor whose energy is counted there already. Two sensors that count the same energy in another way, like the total and today's consumption of one smart plug, look like two devices: pick one of them. If one of them does not fit, none of them go on.

A device that is on the energy dashboard already stays where it is, and gets what you give for it, like a new name. Asked again, nothing changes, so it is safe to run as often as you like.

How to use it

  1. Open the automation or script that should add the device, and select Add action.
  2. Search for add an individual device, and select Energy: Add an individual device 👻.
  3. Under Device energy consumption, choose the energy sensor of the device.
  4. Fill in a Display name, a Device power consumption sensor and an Upstream device if you like.
  5. Select Save.

Just want to see it work? Try this action opens it in your Home Assistant, ready to run once. Mind you: running it changes the energy dashboard for real.

Remove an individual device

Takes one or more devices off the energy dashboard, the same as deleting one in the energy configuration.

The other half of Add an individual device: the old fridge went out, the new one has a new plug, and the old one only adds a flat line to the energy dashboard. The statistics of the device stay, with all their history, so adding it again brings it all back.

Devices that were part of a device you remove stay on the energy dashboard, and stop saying so, the same as in the energy configuration. A device that is not on the energy dashboard is no change, and no error.

How to use it

  1. Open the automation or script that should remove the device, and select Add action.
  2. Search for remove an individual device, and select Energy: Remove an individual device 👻.
  3. Under Device energy consumption, choose the energy sensor of the device.
  4. Select Save.

Just want to see it work? Try this action opens it in your Home Assistant, ready to run once. Mind you: running it changes the energy dashboard for real.

Repairs

Spook checks your energy configuration for entities and solar forecasts that no longer exist, and tells you in the repairs dashboard. New to repairs? Follow Fix your first repair.

Unknown referenced entities

The energy dashboard uses an entity that no longer exists, usually because it was removed or replaced, or did not load. The dashboard does not complain: it leaves that source out, so a missing gas sensor looks like a month where you used no gas.

The repair for an energy dashboard that uses an entity that is gone, with the choice to take it out.
Spook can take what is gone out of the energy configuration for you.

How to fix it: Select the repair. It gives you three choices:

  • Take the deleted ones out of the energy configuration, which removes those the repair marks as deleted, ones Home Assistant removed, the way each setting allows. A missing meter takes its source or device along: a solar panel, a battery, a gas or water meter, or one way of a grid connection or of a battery measured per direction. A missing price or cost is only cleared, so the meter it belonged to keeps counting. A device that was part of a device that goes stops saying so.
  • Let me do it myself, which points you at Settings > Dashboards > Energy.
  • Keep them, stop telling me, which leaves them alone and stops the repair coming back.

Was the entity renamed and not removed, like a device that was paired again? Then pick the new one in the energy configuration yourself. Taking it out means the dashboard stops showing the history of that source; the statistics themselves stay. The repair disappears by itself once it is fixed.

Unknown solar forecasts

Your solar panels take their forecast from an integration like Forecast.Solar. Remove that integration, and Home Assistant keeps its ID in the energy configuration anyway. The energy dashboard then shows no forecast, and does not say why. The energy configuration does not help either: it only lists the forecasts that still exist, so there is nothing to untick.

How to fix it: Select the repair. It gives you three choices:

  • Take them out of the energy configuration, which removes the forecasts that are gone from every solar source that uses them. Your solar panels stay, and so does their history. A forecast that still exists is left where it is.
  • Let me do it myself, which points you at Settings > Dashboards > Energy. Handy when you added the integration again: it got a new ID, and you pick it under your solar panels. The old one stays behind, though, so this repair stays up until Spook takes it out.
  • Keep them, stop telling me, which leaves them alone and stops the repair coming back.

The repair disappears by itself once it is fixed.

Use cases

What people use this for:

  • Replacing an energy meter. The new integration gives you new entity IDs, the energy dashboard keeps the old ones, and the totals stop adding up.
  • Renaming a sensor that feeds the dashboard. Renaming is quick, and it is easy to forget that the energy configuration still points at the old name.
  • Putting every new smart plug on the energy dashboard the moment it is set up.
  • Swapping a replaced appliance on the energy dashboard in one script: the old one off, the new one on.

Missing something here?

An action, an entity or a repair this integration should have? Say so. Stuck, or found a bug? There is help.