Integrations

Times of the Day

Spook adds an action to the Times of the Day helper that changes when it turns on and off, so an automation can move the times without a trip to the helper's options.

The Times of the Day helper is on between two times, and off the rest of the day. Quiet hours from 22:00 to 07:00, the cheap night tariff, school hours. Automations ask it whether it is that time, instead of each carrying their own times.

The times are set in the helper's options, and only there. An automation cannot move them: not quiet hours that start later on the weekend, not an end time you pick on your dashboard.

Spook adds an action for that: set times.

Actions

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

Set times

Changes when one or more Times of the Day helpers turn on, when they turn off, or both, like the options of the helper do. What you leave out stays as it is.

The change goes through the helper's own options, so Home Assistant checks it the same way it checks what you fill in there. Then Home Assistant reloads the helper, as it does after you save its options. The helper works out at once whether it is on or off with its new times, and the action returns once it has, so the next step of your automation already sees it. A helper that already has the times you give is left alone, without a reload.

An off time earlier than the on time spans midnight, the same as in the options: on after 22:00 and off before 07:00 is on from 22:00 until 07:00 the next morning.

Every entity is checked before the first helper changes. An entity that is not a Times of the Day helper, or one set up in YAML, is refused with an error, and nothing changes. The helpers change one at a time, in the order you give them.

Run by hand, the action takes an administrator, like the options of a helper do. 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 change the times, and select Add action.
  2. Search for set times, and select Times of the Day: Set times 👻.
  3. Choose the Times of the Day helpers.
  4. Turn on the times you want to change, and pick the new times.
  5. Select Save.

Missing something here?

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