Chapter 12

Domain reference

Home Assistant organizes everything by category, or “domain”: lights belong to light, air conditioners to climate, and curtains to cover. All devices in a domain use the same set of actions (formerly called services). Learn to control one, and you can control them all. This chapter is a quick reference to the most common domains.

What is a domain, and why does it matter?

Every entity ID follows domain.name. The part before the period is its domain:

  • light.livingroom_main → the domain is light
  • climate.bedroom_ac → the domain is climate
  • sensor.outdoor_temperature → the domain is sensor

Why does it matter? Home Assistant’s actions—formerly called service calls—are organized by domain. light.turn_on can turn on any supported light, regardless of brand or protocol: Philips Hue, IKEA TRÅDFRI, Xiaomi Yeelight, generic Zigbee lights, and DIY WLED strips all use the same action. That abstraction is one of Home Assistant’s greatest strengths.

Rule of thumb: Before buying a device, check which domain its integration exposes. If it appears as a light, your existing light automations can usually control it without being rewritten. If it appears as a switch, it will not offer brightness or color-temperature controls.

light · Lights

Lighting devices may support brightness, color temperature, and color. On/off-only devices may also be classified as lights, depending on the integration.

Common actions

  • light.turn_on — Common parameters include brightness_pct: 60, color_temp_kelvin: 3000, rgb_color: [255, 100, 50], transition: 5 (fade time in seconds), and effect: "colorloop"
  • light.turn_off — Also supports transition for a gradual fade-out
  • light.toggle — Switch between on and off

Common dashboard cards

  • Light card: Built in, with a brightness slider and color controls
  • Tile card: A compact tile that works well in a grid
  • Mushroom Light card (HACS): A polished community card that combines sliders and color controls

Common pitfalls

  • Cutting power at the wall: A Zigbee bulb goes offline when a physical switch cuts its power, so an automation cannot turn it back on. Use a smart switch that keeps the bulb powered, or prevent the wall switch from being turned off.
  • Color-temperature units: Current Home Assistant actions use color_temp_kelvin (3000 K for warm white / 6500 K for cool white). Older examples use color_temp in mireds, where a lower number is cooler. Kelvin is generally more intuitive in YAML; use the parameter supported by your integration.
  • Transitions can be interrupted: transition: 30 fades from the current state to the target brightness over 30 seconds. Another turn_on call during that period interrupts the transition. Wrapping the sequence in a script set to restart mode can make the behavior more predictable.

switch · Switches and smart plugs

This domain provides simple power control. Smart plugs, relays, and basic wall switches all commonly appear as switches.

Common actions

  • switch.turn_on / switch.turn_off / switch.toggle — No extra parameters; switch control is that simple.

Common uses

  • Control non-smart appliances such as water dispensers, dehumidifiers, traditional fans, and holiday lights
  • Control solenoid valves for water heaters, irrigation systems, or gas—using appropriately rated, fail-safe equipment
  • Control a curtain motor, although exposing it as a cover is preferable

Common pitfalls

  • Power-loss recovery: Many plugs remain off after an outage unless “Power-on state” is set to “Last” or “On” in the manufacturer’s app or Home Assistant. Choose this setting carefully; restoring power automatically may be unsafe for some appliances.
  • Energy entities: Many smart plugs also expose sensor.*_power and sensor.*_energy. You can use them in the Energy dashboard or as a signal that a washing machine has finished its cycle.
Useful example: detect when a washer or dryer finishes. Measure power with an appropriately rated smart plug, then create an automation that sends a push notification when sensor.washer_power drops from more than 10 W to less than 5 W and stays there for 3 minutes. It can be more useful than the manufacturer’s app.

climate · Heating, cooling, and thermostats

Common actions

  • climate.turn_on / climate.turn_off
  • climate.set_temperature — Use temperature: 26 for a single target temperature, or target_temp_high / target_temp_low for a thermostat range
  • climate.set_hvac_mode — Set hvac_mode: cool / heat / auto / dry / fan_only / off
  • climate.set_fan_modefan_mode: auto / low / medium / high / on / off (values depend on the device)
  • climate.set_preset_mode — Select a manufacturer-defined preset such as energy-saving, sleep, or away
  • climate.set_swing_mode — Set the louver swing mode

Dashboard cards

  • Thermostat card: A built-in circular temperature control
  • Tile card: A compact option for displaying several climate devices side by side
  • simple-thermostat (HACS): A community card with additional controls

Common pitfalls

  • Infrared air-conditioner state may be inaccurate: With an IR blaster such as BroadLink or SwitchBot Hub, Home Assistant knows only which command it sent—not whether the air conditioner received it. Add a separate temperature sensor to confirm that the room temperature is actually changing.
  • Presets can override the temperature: A manufacturer’s “eco” preset will often force its own target temperature. Return the preset to none before setting the temperature manually.
  • Units: Confirm that the unit system described in Chapter 2 is set to Celsius. Otherwise, temperature: 26 may be interpreted as Fahrenheit—which would be extremely cold.

cover · Curtains, garage doors, and blinds

Common actions

  • cover.open_cover / cover.close_cover / cover.stop_cover / cover.toggle
  • cover.set_cover_position — Use position: 50 (0 is fully closed; 100 is fully open)
  • cover.set_cover_tilt_position — Set the angle of blind slats
  • cover.open_cover_tilt / cover.close_cover_tilt

Common pitfalls

  • Direction is reversed: Some motors interpret “open” in the opposite direction from what you expect. Use “Reconfigure” on the device page or calibrate the motor in its manufacturer’s app. Do not work around it in Home Assistant by writing position: 100 - x.
  • No position support: Inexpensive curtain motors may support only open, close, and stop. Calling set_cover_position will fail. Check supported_features on the device’s entity page first.
  • Add lock safeguards for garage doors: cover.open_cover has no built-in confirmation, so a faulty automation could open the garage in the middle of the night. Use an input_boolean as an enable switch and add explicit conditions.

media_player · TVs, speakers, and streamers

Common actions

  • media_player.turn_on / turn_off / toggle
  • media_player.volume_set (volume_level: 0.3, 0-1), volume_up / volume_down / volume_mute
  • media_player.media_play / media_pause / media_stop / media_next_track / media_previous_track
  • media_player.play_media — Play specific content using media_content_id and media_content_type
  • media_player.select_source — Select an input or source such as HDMI1, Netflix, or Spotify
  • media_player.select_sound_mode — Select a supported sound mode

Capabilities vary by integration

  • Google Cast: Can cast a URL to a Nest Hub or Chromecast, making it useful for text-to-speech announcements such as “The washing machine has finished.”
  • Apple TV / Sonos / HEOS: Offer extensive support, including playlists and speaker groups
  • Samsung / LG TVs: Usually turn off reliably, but turning them on may require additional Wake-on-LAN configuration
  • Spotify / Plex: Can use play_media to start a specific playlist or video

Common pitfalls

  • A TV may need 3–5 seconds after turning on before it accepts another command. Add a delay between “turn on” and “select source.”
  • A Cast speaker group is a separate media-player entity, not an attribute of one of its speakers.

lock · Smart locks

Common actions

  • lock.lock / lock.unlock
  • lock.open — Physically unlatch or open the door when the hardware supports it

Common pitfalls

  • Safety first: Always give lock automations two safeguards. For example, an “auto-lock when leaving” automation should verify both that nobody is home and that the door has not opened in the past 5 minutes. Do not rely on a time trigger alone.
  • Cloud latency: Cloud integrations for brands such as Yale, August, and Aqara often have a 5–15-second delay. For lower latency, use a supported local protocol such as Matter over Thread or Z-Wave.
  • You cannot control an unavailable lock: If the lock loses its connection to Home Assistant, remote control will not work. Local protocols such as Matter, Zigbee, and Z-Wave are generally more resilient than cloud-only connections.
Warning: If you enable automatic locking without a phone or spare key, you may lock yourself out. Always keep a mechanical key or backup PIN available.

vacuum · Robot vacuums

Common actions

  • vacuum.start / vacuum.pause / vacuum.stop
  • vacuum.return_to_base — Return to the charging dock
  • vacuum.locate — Play a sound so you can find the vacuum
  • vacuum.set_fan_speed — Set the suction level
  • vacuum.send_command — Send a vendor-specific command, such as cleaning a particular Roborock room

Common uses

  • Everyone has been away for 30 minutes → start cleaning
  • All Zigbee motion sensors have reported no motion for 15 minutes on a weekday afternoon → start cleaning
  • A Google Calendar event says guests are coming → clean the living room 30 minutes beforehand

Common pitfalls

  • Cloud API rate limits: Some brands limit the number of daily API calls. Do not write an automation that polls the vacuum’s state every minute.
  • Room IDs are hidden: To clean only the living room, first divide the map into rooms in the manufacturer’s app, then pass the room ID through send_command. The ID is usually available in the device attributes or integration logs.

fan · Fans and air purifiers

Common actions

  • fan.turn_on / fan.turn_off / fan.toggle
  • fan.set_percentage — Set the speed from 0–100%
  • fan.set_preset_mode — Select auto / sleep / turbo, depending on the device
  • fan.oscillate — Enable or disable side-to-side oscillation
  • fan.set_direction — Set a ceiling fan to rotate clockwise or counterclockwise

Common pitfalls

  • An air purifier may expose separate entities in three domains: fan for fan speed, sensor for PM2.5, and switch for features such as ionization.
  • set_percentage: 0 usually turns the fan off. Call turn_on before restoring its speed.

camera · Cameras

Common actions

  • camera.snapshot — Save a still image using filename: /media/snap_{{ now().timestamp() }}.jpg
  • camera.turn_on / turn_off — Supported by some cameras
  • camera.enable_motion_detection / disable_motion_detection
  • camera.record — Record a video clip

Dashboard cards

  • Picture entity: The simplest built-in option
  • Picture glance: Shows a camera image with small icons for related entities such as locks and lights
  • WebRTC card (HACS): Provides low-latency streaming suitable for doorbells

Common pitfalls

  • Cloud cameras such as Ring, Wyze, and TP-Link Kasa: A 5–30-second video delay is common. For real-time video, use a local ONVIF or RTSP stream.
  • Snapshot file location: Files in /config/www/ can be served to a dashboard by default. Files saved under /media/ require additional media_source configuration.

sensor / binary_sensor · Sensors

A sensor reports a numeric or textual value, such as a temperature of 25.3 or a battery level of 87%. A binary_sensor reports one of two states, such as open/closed, occupied/clear, or raining/not raining.

They do not accept control actions

Sensors are read-only: you cannot “turn on” a temperature sensor. Their value lies in serving as triggers and conditions:

  • Trigger: when binary_sensor.motion_livingroom changes to on → turn on the light
  • Condition: at sunset, proceed only if binary_sensor.someone_home is on
  • Numeric trigger: when sensor.pm25 exceeds 35 → turn on the air purifier

Common device classes, which determine icons and behavior

  • sensor: temperature / humidity / pressure / illuminance / power / energy / battery / co2 / pm25
  • binary_sensor: motion / occupancy / door / window / smoke / moisture / opening / battery / connectivity
Tip: If Home Assistant assigns the wrong device_class—for example, treating an opening sensor as a door sensor—you can override it from the entity’s settings page. Its dashboard icon will update accordingly.

Common pitfalls

  • Binary-sensor chatter: A motion sensor may rapidly switch “on → off → on.” If your automations turn lights on for on and off for off, the lights will flicker. Require the state to remain stable with a “for: 5 minutes” condition before acting.
  • Battery level is a sensor, not a binary sensor: To send a warning below 20%, use sensor.*_battery with a numeric-state trigger.

notify · Notifications

Chapter 7 covers the basics; this section provides more detail about notification parameters.

Full Companion App push-notification payload

action: notify.mobile_app_iphone
data:
  title: Washing cycle complete
  message: Remember to collect the laundry
  data:
    push:
      sound: US-EN-Alexa-Laundry-Ready.wav  # iOS sound
      badge: 1
    actions:                                # Tappable actions
      - action: LAUNDRY_DONE
        title: OK, I will get it
      - action: LAUNDRY_SNOOZE
        title: Remind me in 10 minutes
    image: /api/camera_proxy/camera.laundry # Show a camera snapshot
    tag: laundry                            # Replaces the previous notification with the same tag
    channel: laundry                        # Android notification channel
    ttl: 0                                  # Android high priority

Other commonly used notify.* actions

  • notify.persistent_notification — Create an internal Home Assistant notification, shown under the bell icon; this does not send a phone notification
  • notify.notify — Send to the default notification group across all configured channels
  • tts.* — Read text aloud through a media_player; see the voice appendix to this chapter

input_* · Helper entities

Helpers are built-in Home Assistant “virtual entities” that give automations a value you can change or “flip.” See Appendix B for details. The table below maps each helper to its domain:

Domain What it stores Common use
input_booleanOn/off stateA “Guest mode” or “Vacation mode” switch
input_numberAdjustable numberA slider for the illuminance threshold that turns lights on automatically
input_selectDrop-down selectionA “Household mode” with Home, Away, and Sleep options
input_textText stringRecord an event or store a label
input_datetimeDate and timeLet family members change the wake-up time from a dashboard
timerCountdown timerTurn off a light after 5 minutes
counterInteger counterCount how many times a door opened today
scheduleWeekly scheduleDraw a weekly timetable for working hours

Each domain has corresponding actions, including input_boolean.turn_on, input_number.set_value, and timer.start. Appendix B provides a complete tutorial.

Tools and best practices

Terminology: This feature has been renamed twice. It was previously the standalone Developer Tools sidebar item, moved under Settings in Home Assistant 2026.2, and was shortened to Tools in 2026.8. The current path is Settings → Tools. Its “Services” tab was renamed Actions in 2024.8. If you use an older Home Assistant release, go to Developer Tools → Services; the functionality is the same.

Use Tools to test actions

Open the sidebar and select Settings → Tools → Actions. Choose any action, enter its parameters, and select Perform action. This is the fastest way to learn a new domain because you can test it directly without creating an automation.

Home Assistant Developer Tools Services interface
Figure 12-1 Settings → Tools → Actions is the place to experiment with a new domain. This screenshot shows the former Developer Tools → Services interface; the location and labels have since changed as described above.

Use States to inspect entity attributes

Go to Settings → Tools → States, enter an entity ID, and inspect its attributes. For example, light.livingroom may report supported_color_modes, min_color_temp_kelvin, and max_color_temp_kelvin. These attributes determine which parameters you can set.

Key takeaway

Check the domain before buying: Devices exposed under a purpose-built domain such as light / switch / cover / climate usually provide the best experience. A device exposed only as several sensor + switch entities—some generic Tuya curtain motors, for example—may require awkward custom logic. Before buying, search for the brand and model together with “Home Assistant integration.”

FAQ

Why does Home Assistant expose my lamp as a switch? Can I change it to a light?

The device reports only the ability to turn power on and off. This is common when a lamp is plugged into a smart plug, connected to a relay-based wall switch, or controlled by a single-channel Tuya module. The integration cannot know whether the load is a lamp or a water dispenser, so it exposes the device as a switch.

Home Assistant includes a helper that can present it differently. Go to Settings → Devices & services → Helpers → Create helper and select “Change device type of a switch” (formerly “Switch as X”). Select a switch entity and expose it as a light, cover, fan, lock, siren, or valve. Home Assistant creates a new entity such as light.desk_lamp and automatically hides the original switch, preventing duplicate dashboard controls.

Warning: Changing the domain does not add capabilities the hardware lacks. After converting it to a light, you can call light.turn_on, but you still cannot adjust brightness or color temperature. Dimming requires a genuinely dimmable lamp or module.
My light has brightness controls but no color-temperature or color options. Is Home Assistant at fault?

Probably not; the light itself most likely lacks those features. Go to Settings → Tools → States, enter the entity ID, and inspect supported_color_modes. This attribute reports exactly which color modes the light supports:

Color modeWhat appears in the interface
onoffOn/off only, without even a brightness slider
brightnessA brightness slider only (single-color dimmable light)
color_tempBrightness and color temperature, from warm white to cool white
hs / rgb / rgbw / rgbwwBrightness and a color wheel; modes such as rgbww also provide dedicated white-light channels

A light that lists color_temp will also report min_color_temp_kelvin and max_color_temp_kelvin. These attributes define the warmest and coolest color temperatures the light supports. If the hardware lacks color-temperature support, no helper or HACS card can add it.

If supported_color_modes reports substantially fewer capabilities than the product specification—for example, a color bulb reports only brightness—the integration may be at fault. Update the bulb’s firmware, pair it again, or check the integration’s GitHub repository for reports about the same model.

My curtain moves in the wrong direction: “Open” closes it, and positions 0 and 100 are reversed. How do I fix it?

Home Assistant’s definitions are fixed: position: 0 means fully closed, and position: 100 means fully open. They do not change because a motor was installed in the opposite orientation.

Correct the direction at the device rather than writing 100 - x in your Home Assistant automations. That calculation is easy to forget, and it does not correct the reversed dashboard slider. Use the method that matches your installation:

  1. Zigbee2MQTT motor

    On the device page, look for motor_reversal, which reverses the motor direction, or invert_cover, which reverses the reported position. With invert_cover set to false, open=100 and close=0. Common curtain modules such as the Tuya TS130F expose both options in their device settings.

  2. Motor paired through the manufacturer’s app

    Most motorized-curtain apps offer “Motor direction” or “Travel calibration.” Running the upper- and lower-limit calibration again usually corrects the direction. You should not need to change anything in Home Assistant afterward.

  3. Reconfigure from the device page

    Some integrations provide a “Reconfigure” option on the device page that reruns the calibration process.

  4. Last resort

    If none of those options is available, wrap the entity in a template cover that reverses the values. This is the hardest approach to maintain, so avoid it whenever possible.

I call climate.set_temperature with 26°C, but the climate device does not respond. Why?

Check these causes in order; one of the first two is usually responsible:

  • The air conditioner is off. Setting a target temperature does not necessarily turn the unit on. climate.set_temperature also accepts hvac_mode, so the safest approach is to set hvac_mode: cool and temperature: 26 together.
  • A preset controls the setpoint. In manufacturer presets such as “eco” and “sleep,” the manufacturer often controls the target temperature. First use climate.set_preset_mode to return to none, then set the temperature.
  • The value is outside the supported range. Every device has its own min_temp / max_temp—Home Assistant defaults to 7–35 degrees—and target_temp_step. Some units accept only whole degrees and ignore 25.5. Inspect these attributes under Settings → Tools → States.
  • It is a range-based thermostat. Use target_temp_high and target_temp_low; the integration may ignore a single temperature value.
  • It uses infrared control. As explained above, Home Assistant only knows that it sent the command. Make sure the IR blaster faces the air conditioner and that nothing blocks the signal.

For the quickest diagnosis, run the action directly under Settings → Tools → Actions and check whether it succeeds or returns an error.

Why does select_source not list or select the source I want?

media_player.select_source accepts only strings reported by the device, and capitalization and spaces must match exactly. Under Settings → Tools → States, inspect the media player’s source_list attribute. Entering HDMI 1 will fail if the list contains HDMI1.

Two situations are common:

  • The list is empty or contains only one or two items. Many TVs report their complete source list only after they have turned on and connected to the network. In an automation that turns on the TV and then changes its source, add a few seconds of delay; otherwise, the command may run before the list is available.
  • The integration does not support source selection. Not every media_player has this capability; speakers and some streaming boxes do not. If the device page has no source selector and its state has no source_list, use the manufacturer’s app automation, infrared control, or HDMI-CEC instead.
Why is the camera slow on my dashboard?

First determine which part of the chain is causing the delay:

  1. Rule out unavoidable cloud latency

    Cameras accessed through a manufacturer’s cloud service can have several seconds of inherent delay. Settings cannot eliminate it; use a supported local ONVIF or RTSP stream when low latency matters.

  2. Make sure you are using WebRTC

    Since 2024.11, Home Assistant has included go2rtc to provide WebRTC camera streams, with substantially less delay than the older HLS approach. On Home Assistant OS or Home Assistant Container, it is enabled by default after updating. Cameras that cannot use WebRTC fall back automatically to the older method.

  3. Use a substream

    Most IP cameras provide both a high-resolution main stream and a lower-resolution substream. Use the substream for small dashboard tiles and the main stream only when opening a full-size view. This substantially reduces the host’s workload.

  4. Do not place eight cameras on one view

    Every live stream consumes CPU and bandwidth. Put cameras on a dedicated dashboard view and leave that view closed when it is not needed, so the streams do not slow down the rest of the dashboard.

  5. Use “Preload stream” selectively

    The camera entity’s “Preload stream” setting keeps the connection open, making the video appear faster when selected, but it consumes resources continuously. Avoid enabling it for every camera on low-powered hardware such as an older Raspberry Pi.

What is the difference between a sensor showing unknown and one showing unavailable?

Home Assistant’s developer documentation draws a clear distinction between the two states:

StateMeaningTypical situation
unavailableThe integration cannot retrieve data because the connection is down, the device has no power, or a cloud service is offlineA Zigbee sensor has a flat battery, a Wi-Fi plug is disconnected, or the host has restarted and not yet reconnected
unknownThe entity is reachable, but its current value is empty or not yet knownThe system has not received its first update, a field was omitted from the latest response, or a new helper has never been assigned a value

In plain English, unavailable means “nobody is home”; unknown means “someone is home, but cannot answer.”

Protect automations against both states. Numeric-state triggers do not fire for either one, but using one of them in a calculation inside a condition or template can raise an error and stop the automation. Check that the state is neither unknown nor unavailable before performing the calculation.

Tip: If a sensor frequently becomes unavailable, the problem is its signal or battery—not something code can fix. Troubleshoot it from the device page described in Chapter 11, or add a mains-powered Zigbee router to extend the mesh.
To control five living-room lights at once, should I create a group or list each one in the automation?

All four approaches work. Choose according to whether the same collection will be useful again:

ApproachHow it worksWhen to use it
Target an areaSelect “Area” as the action target; every light assigned to the living room receives the actionThe recommended default. A new light added to the living-room area is included automatically, so the automation does not need to change at all
Group helperGo to Settings → Devices & services → Helpers → Create helper → Group; you can create groups of lights, switches, covers, fans, sensors, and moreUse this when the lights should appear and behave as one entity on the dashboard. The resulting entity can be placed on a card and used in conditions
LabelAssign a label such as “Night lights” to each entity, then select that label as the action targetUse this for a collection that spans several areas, such as every night-light or curtain in the home
List each entitySelect each target individuallyUse this for a one-off combination or to exclude particular items—for example, “turn off every living-room light except the aquarium light”

A group helper offers another advantage: a light group is on whenever any member is on. This makes conditions such as “Are any living-room lights still on?” especially intuitive. You can also hide the member entities when creating the group to avoid duplicate dashboard controls.

Avoid this mistake: Do not create many groups solely to control several devices once. Groups are for members that need to be treated as one entity. For simple joint control, an area or label is easier and avoids filling the entity registry with inscrutable light.group_xxx entities.