Integrations

Logger

Spook adds an action that turns debug logging on or off for an integration, like the Enable debug logging button on its integration page, but from an automation.

The logger integration decides how much Home Assistant writes to its log. When an integration misbehaves, its integration page has an Enable debug logging button: from then on, it writes down everything it does, until you select Disable debug logging.

That button only helps when you are there to press it. The problem that shows up at three in the morning, once a week, is over by the time you get up. Spook adds an action that does what the button does, so an automation can press it: when the integration fails, for example, with the Integration failed to set up trigger.

Actions

Spook adds one action to the logger integration. You find it wherever you add an action, marked with a 👻.

Set integration log level

Sets how much an integration logs. Debug, unless you pick another level. The same as Enable debug logging on the integration page, so that page shows debug logging is on, and its Disable debug logging button works as always.

The level is set on everything the integration logs through: the integration itself, and the libraries it names as its own. That is what the button does too.

Set the level to Default to stop. The integration then follows the level above it: the default in your logger configuration, or the one of Home Assistant. A level your logger configuration sets for exactly that integration comes back with the next restart.

How long the level stays is up to you:

  • Until Home Assistant restarts: gone with the next restart.
  • Also through the next restart: kept for one restart, then gone with the one after. This is what the button does: whatever goes wrong while Home Assistant starts is in the log too.
  • Until you change it: kept for every restart to come.

This action is for administrators only, like the button. Your automations can always run it. So can your scripts, unless a user who is not an administrator starts one.

How to use it

  1. Open the automation or script that should turn on debug logging, and select Add action.
  2. Search for log level, and select Logger: Set integration log level 👻.
  3. Under Integration, type the domain of the integration, like hue.
  4. Optionally, pick another Log level, or change how long to Keep it.
  5. Select Save.

Just want to see it work? Try this action opens it in your Home Assistant, ready to run once.

Missing something here?

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