Integrations

HTTP

Spook adds actions that list the IP addresses Home Assistant banned after too many failed logins, and lift a ban without a restart.

The HTTP integration is the web server of Home Assistant. It can ban an IP address after too many failed logins: set login_attempts_threshold under http in your configuration, and an address that gets the login wrong that many times is refused from then on. Home Assistant writes every ban to ip_bans.yaml in your configuration folder.

Lifting a ban again takes editing that file and restarting Home Assistant. Often it is your own phone that got banned, after a password change. Spook adds an action that lists the bans, and one that lifts a ban right away, no file editing and no restart.

Both need IP banning on in Home Assistant. It is, unless you set ip_ban_enabled: false under http in your configuration. With it off, Home Assistant keeps no bans, and both actions say so.

Actions

Spook adds two actions to the HTTP integration. You find them wherever you add an action, marked with a 👻. Both are for administrators only: who gets in is not up to everybody in your home.

List IP bans

Lists the IP addresses Home Assistant has banned, with when each was banned. The oldest ban comes first.

How to use it

  1. Open the automation or script that needs the list, and select Add action.
  2. Search for bans, and select HTTP: List IP bans 👻.
  3. Under Response variable, give the list a name, like bans. The steps after this one can use it.
  4. Select Save.

Just want to see who is banned? Try this action opens it in your Home Assistant, ready to run once. The list shows up below the action.

Unban IP address

Lifts the ban on one or more IP addresses. Right away: the next request from that address is let in, without a restart. Spook also takes the ban out of ip_bans.yaml, so it stays lifted after a restart.

The failed logins Home Assistant counted for that address are forgotten too. Otherwise one more typo would ban it again straight away.

An address that is not banned is skipped, not an error. Ask for the response to see which addresses were actually unbanned: an address missing from it was not banned, or has a typo in it.

How to use it

  1. Open the automation or script that should lift the ban, and select Add action.
  2. Search for unban, and select HTTP: Unban IP address 👻.
  3. Under IP address, enter the addresses to unban.
  4. Select Save.

Locked out your own phone? Try this action from a device that is not banned. It opens the action 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.