Appendix B

Scenes, helpers, and groups

These three built-in Home Assistant building blocks require no additional integrations. Once you understand them, helpers can replace much of the state-handling logic that might otherwise require extra automations or custom templates.

Scenes: apply a predefined state with one action

A scene is a snapshot of the desired states of a set of entities. When you activate it, Home Assistant applies all of those stored states together.

Terminology update: In Home Assistant 2024.8, “Service” was renamed Action. Modern YAML changed from service: to action: and from service_data: to data:. Beginning with 2024.10, automations use the plural section keys triggers:, conditions:, and actions:, while each trigger definition changed from platform: to trigger:. Developer Tools moved into Settings in 2026.2 and was shortened to Tools in 2026.8; the path is now Settings → Tools. This page uses the current syntax. Home Assistant still understands supported legacy keys, so you do not need to rewrite every existing automation at once.

Method 1: Capture the current state

  1. First, adjust your home manually

    For example, set the main light to 40%, the accent light to purple, the air conditioner to 26°C, the curtains to 30%, and the speaker to Bluetooth input.

  2. Go to Settings → Automations & scenes → Scenes → + Add scene

    Select “Create from current state,” choose the entities to include, and save. Home Assistant stores their current values as the scene snapshot.

    Creating a scene from the current entity states
    Figure B-1 Creating a scene from the current state is the quickest and most intuitive method.
  3. Name it—for example, “Movie mode”—and save

    Its entity ID will be scene.movie_mode.

Method 2: Enter each entity’s target state manually

This method is useful when you want to prepare a “holiday” scene but cannot put every device into that state right now—for example, when testing it would disturb the neighbors at midnight. Start with a blank scene, add each entity, and enter its target state.

Activate a scene

  • Dashboard: add a Button card, set its action to scene.turn_on, and select scene.movie_mode as the target.
  • Automation: add scene.turn_on to the actions section.
  • Voice assistant: expose the scene, then say “Movie mode.”

Advanced: add a transition

A scene normally applies its stored states immediately. When activating it, you can add transition: 5 so supported light entities fade to their target state over 5 seconds:

action: scene.turn_on
target:
  entity_id: scene.movie_mode
data:
  transition: 5

Scenes versus scripts

Scene: Applies the stored final states of all included entities together. A scene does not provide sequencing, delays, or conditions.
Script: Can include ordered actions, delays, conditions, and loops, but you must define each action step by step. In older Home Assistant terminology, actions were called services.
Common combination: Call a scene from a script. A “Movie mode” script might activate the “Movie lighting” scene, wait 2 seconds, close the curtains, and turn on the TV.

Helpers: give your logic a memory

A helper is a virtual entity built into Home Assistant. It has no corresponding physical device, but it has a state, can appear on a dashboard, and can serve as an automation trigger or condition.

Why use one? Individual automation runs do not provide shared memory. To share a value between automations—such as whether guest mode is enabled—use a helper as a common variable.

Path: Settings → Devices & services → Helpers, then select “+ Create helper.”

Home Assistant Helpers page
Figure B-2 On the Helpers page, select a type, enter a name, and create the helper in moments.

Helper type quick reference

1. input_boolean — on/off toggle

This is the most widely useful helper. Typical examples: Guest mode, Vacation mode, and Sleep mode.

  • Create: select “Toggle,” name it “Guest mode,” and use the entity ID input_boolean.guest_mode.
  • As a condition: in a “Turn on the lights at sunset” automation, require the helper to be off—shown in shorthand as input_boolean.vacation_mode == off—so the lights remain off while you are away.
  • As a trigger: when input_boolean.guest_mode changes to on, notify the homeowner that a guest has arrived.
  • On a dashboard: add it to an Entities card or Tile card so anyone in the household can change it.

2. input_number — adjustable number (slider or input field)

Move a “magic number” out of an automation so household members can adjust it without opening the YAML editor.

  • Example: input_number.motion_light_brightness stores the brightness used when motion turns on a light. Move the slider when you want dimmer light at night.
  • Reference it in an automation: brightness_pct: "{{ states('input_number.motion_light_brightness') | int }}"

3. input_select — drop-down list (choose one option)

Classic use: a household state machine. Create input_select.home_mode with the options [Home, Away, Sleep, Guest, Vacation], then use its current value as a condition throughout your automations.

Benefit: A single, centrally managed mode avoids contradictory combinations of 5 separate Boolean helpers.

4. input_text — text string

Typical uses include notes, labels, and dynamic string references. For example, input_text.tv_url can store a livestream URL that a media button passes to play_media.

5. input_datetime — date, time, or both

Let household members set values such as a wake-up time or water-heater start time. Select this entity in an automation’s time trigger so the automation runs at the chosen time.

triggers:
  - trigger: time
    at: input_datetime.wake_up_time

6. timer — countdown timer

A timer is more flexible than a delay: you can inspect its remaining time, cancel it, and trigger an event when it finishes.

  • Create: select “Timer” and, if needed, set a default duration such as duration: "00:05:00".
  • Start: call timer.start; you can pass duration to override the default.
  • Cancel: call timer.cancel.
  • Trigger on completion: use an event trigger with event_type: timer.finished.
  • Classic pattern: Keep a motion-activated light on for 5 minutes. Motion turns on the light and starts the timer; when the timer finishes, another automation turns off the light. Calling timer.start again restarts an active timer.

7. counter — integer counter

Increment, decrement, or reset it. Use a counter to track values such as how many times a door opened today or how many times you watered plants this week, then display the total on a dashboard.

8. input_button — momentary button

Unlike an input_boolean, it does not remain on after it is pressed; each press simply updates the button event. It is useful for one-off dashboard actions such as “Refresh data” or “Send a test notification.”

9. schedule — weekly schedule

Define time blocks on a weekly grid. For example, “Working hours” might run from 09:00 to 18:00, Monday through Friday. The entity’s state changes automatically between on and off according to the current time.

A schedule is easier to maintain than several handwritten time conditions, and household members can adjust its time blocks from the dashboard.

10. Template, Threshold, Derivative, Statistics, and more

The same page also provides advanced helpers, including Template sensors, Threshold binary sensors, Derivative sensors, and Statistics sensors. For example:

  • Threshold: Convert the numeric value of sensor.pm25 into binary_sensor.air_bad, which turns on above 35. This makes automation conditions easier to read.
  • Statistics: Calculate a value such as the average temperature over the past 24 hours. For a daily meter total, use the Utility Meter helper instead.
  • Derivative: Calculate a rate of change, such as the rate of power-consumption change or temperature rise.
Try a helper before writing a template: Beginners often reach for a Jinja template sensor whenever they need a conversion. For roughly 80% of common cases, a purpose-built helper is simpler, more robust, and easier for the household to understand. Write a template only when no suitable helper exists.

Groups: combine multiple entities into one

A Group helper combines multiple entities of a supported type into one new entity. The new entity’s state is derived from the states of its members.

Common uses

  • Light group: light.livingroom_all = main light + accent light + floor lamp, so you can turn them all on at once.
  • Switch group: switch.holiday_lights = 5 smart plugs for holiday lights.
  • Binary sensor group: binary_sensor.any_window_open = 5 window contact sensors; it is on when any window is open, which is useful for a pre-departure check.
  • Person group: group.family = 4 people; its state is home when anyone is home.

Create a group

Go to Settings → Devices & services → Helpers → “+ Create helper” → “Group.” Select a type—Light, Switch, Cover, Binary sensor, Media player, Fan, Lock, or Sensor—then select its members.

Creating a group and selecting its members
Figure B-3 Select the group type, then select multiple members—usually faster than writing YAML.

Aggregation behavior

Type Default state logic Configurable option
Light / SwitchAny member on → group onRequire all members to be on
Binary sensorAny member on → group onRequire all members to be on
SensorNumeric aggregation (min / max / mean / median / sum / last / range)Select the aggregation method when creating the group

Control every member through the group

In shorthand, light.turn_on target: light.livingroom_all applies the action to every member. This is cleaner than selecting 5 entities in every automation, and adding another light later requires changing only the group membership.

Group vs. Area vs. Label: All three can help you control multiple entities at once, but they serve different purposes:
  • Group: An explicit member list aggregated into a new entity with its own meaningful state.
  • Area: A physical location whose assigned entities can be targeted together; ideal for commands such as “Turn off everything in the living room.”
  • Label: A tag that can span areas and domains; ideal for conceptual collections such as “All main lights” or “Outdoor devices.”
In practice, use a Group when a fixed set of lights should behave as one entity, an Area for location-based control, and a Label for a category that spans areas.

Combined example: a bathroom night-light system

Combine a scene, helpers, and a group to build a bathroom night-light system triggered by motion. The design goals are:

  • When someone enters the bathroom late at night, turn on only a soft night-light—not the glaring main light.
  • After 5 minutes without a new motion event, fade out the lights.
  • Do nothing during the day, based on daylight or a schedule.
  • Let household members adjust the brightness.

Build it

  1. Create a group: light.bathroom_all = main light + mirror light + night-light.
  2. Create a scene: scene.bathroom_night_soft = only the night-light on, at a fixed soft brightness. A scene stores literal target states; it cannot read the current value of input_number.bathroom_night_brightness dynamically.
  3. Create helpers:
    • input_number.bathroom_night_brightness (1–100, default 20) for a helper-driven variant of the light action.
    • timer.bathroom_light (default 5 minutes).
    • schedule.night_time (22:00–06:00).
  4. Create the motion automation:
    alias: Bathroom night-light motion
    triggers:
      - trigger: state
        entity_id: binary_sensor.bathroom_motion
        to: "on"
    conditions:
      - condition: state
        entity_id: schedule.night_time
        state: "on"
    actions:
      - action: scene.turn_on
        target: { entity_id: scene.bathroom_night_soft }
      - action: timer.start
        target: { entity_id: timer.bathroom_light }
  5. Create another automation for “timer finished → turn off the lights”:
    alias: Turn off bathroom motion light
    triggers:
      - trigger: event
        event_type: timer.finished
        event_data: { entity_id: timer.bathroom_light }
    actions:
      - action: light.turn_off
        target: { entity_id: light.bathroom_all }
        data: { transition: 3 }
  6. Add a “Brightness” slider to the dashboard with an Entities card for input_number.bathroom_night_brightness. The scene-based YAML above uses a fixed brightness, so the slider becomes functional only if a script or automation uses the helper value in a templated light.turn_on action.
Review the design: In the UI, this creates 4 helpers—3 standalone helpers plus 1 Group helper—along with 1 scene and 2 automations. The YAML shown implements the fixed-brightness scene path. To make brightness adjustable, use the input_number in a script or templated light action instead of expecting the scene to evaluate it. Also confirm how often your motion sensor returns to off: timer.start restarts the timer on each new on transition, but a sensor that remains continuously on will not create another trigger. Once the design matches your sensor, changing the timer default from 5 to 10 minutes requires no automation edit.

Frequently asked questions

Can a scene change dynamically—for example, can its brightness depend on the time of day?
A scene stores fixed values. For dynamic behavior, use a script with an input_number, or create separate morning, daytime, and evening scenes and let an automation choose among them.
Is helper data included in backups?
Yes. Helpers are part of the Home Assistant configuration and are included in the full backups described in Chapter 9. Restoring the backup restores them.
Does one unavailable group member make the entire group unavailable?
Usually not. Home Assistant ignores members whose state is unknown or unavailable when it can still derive the group state from another member. If every member lacks a usable state, the group becomes unavailable. Exact behavior also depends on the group type and its aggregation options.
Will deleting a helper break automations that use it?
Yes. Those references will point to an entity that no longer exists. Before deleting a helper, review its related automations and replace their references. You can inspect the entity under Settings → Tools → States; in older releases, the path was Developer Tools → States in the sidebar.
Is a Timer accurate enough for a 30-second cooking timer?
Home Assistant’s built-in Timer works at one-second resolution and is generally sufficient for ordinary household timing, though system load can affect exact execution time. A restart can pause or reset a timer depending on its restore setting. For a YAML-defined timer, add restore: true to retain its state and remaining time across restarts.