Home Assistant Actions You Should Be Using
In this article
Home Assistant actions (formerly called services) let you trigger any device or automation from a button, voice command, or script. The ones you should be using are the ones that match your daily routines: turning off all lights at bedtime, locking doors when you leave, and adjusting climate when you arrive. Below is a practical guide to the most useful actions, how to find them, and how to avoid common mistakes.
What Are Home Assistant Actions?
In Home Assistant, an action is a command that tells a device or integration to do something. For example, light.turn_on turns on a light, climate.set_temperature changes your thermostat, and media_player.play_media starts music. Actions are the building blocks of automations and scripts. You can call them from the Developer Tools, from a dashboard button, or from a voice assistant like Alexa or Google Home.
Every action has a domain (like light or switch) and a service name (like turn_on). You often need to specify a target (which device or entity) and sometimes additional data, like brightness or temperature. The Home Assistant documentation lists all available actions for each integration, and the Developer Tools panel lets you test them before using them in an automation.
Essential Actions for Daily Use
These actions cover the most common needs in a smart home. They are safe to experiment with and work with most devices.
- Light control:
light.turn_on,light.turn_off,light.toggle. You can set brightness, color, and transition time. - Climate control:
climate.set_temperature,climate.set_hvac_mode. Use this to switch between heat, cool, and auto, or to set a target temperature. - Lock and unlock:
lock.lock,lock.unlock. Always require a PIN or a confirmation when unlocking remotely. - Media playback:
media_player.play_media,media_player.volume_set. Start a playlist or set volume on a speaker. - Scene activation:
scene.turn_on. Scenes restore a predefined set of states, like “movie night” or “good morning.” - Switch and fan control:
switch.turn_on,fan.set_percentage. For plugs, fans, and other binary devices.
These actions are universal across most integrations. For example, light.turn_on works with Philips Hue, LIFX, and almost any Zigbee or Z-Wave bulb, because Home Assistant normalizes the interface.
How to Use Actions in Automations
You can call actions in three main places: automations, scripts, and dashboard buttons.
- Automations: Create a new automation in Settings → Automations & Scenes. Choose a trigger (like time, motion, or a button press), then add an action block. Pick the action from the dropdown, select the target entity, and fill in any data.
- Scripts: Scripts are sequences of actions that you can run manually or from an automation. They are useful for complex routines, like “good night” that turns off lights, locks doors, and lowers the thermostat.
- Dashboard buttons: Add a “Call Service” button to your dashboard. You can set the action, target, and data in the button’s configuration.
For example, a “good night” script might look like this in YAML:
script:
good_night:
sequence:
- action: light.turn_off
target:
entity_id: light.living_room
- action: lock.lock
target:
entity_id: lock.front_door
- action: climate.set_temperature
target:
entity_id: climate.bedroom
data:
temperature: 18You can also use the choose action to run different actions based on conditions, like whether someone is home.
Choosing the Right Action for Your Device
Not every action works with every device. The action you use depends on the integration and the device’s capabilities. For example, a smart plug might only support switch.turn_on and switch.turn_off, while a smart bulb supports light.turn_on with brightness and color. To find the right action, check the device’s integration page in the Home Assistant documentation, or use the Developer Tools → Actions tab to see the available services for a given entity.
If you have a device that doesn’t appear in the action list, it may not be supported or may require a custom integration. Stick to officially supported integrations to avoid instability.
Common Mistakes and How to Avoid Them
New users often make these errors when using actions:
- Wrong entity ID: Typing the entity ID incorrectly. Always copy the entity ID from the device’s info page.
- Missing data fields: For example,
climate.set_temperaturerequires a temperature value. If you omit it, the action fails. - Targeting multiple entities unintentionally: When you use
light.turn_onwithout a target, it affects all lights. Always specify a target. - Using actions in the wrong order: For example, turning on a media player before setting the source might not work. Test the sequence manually.
- Forgetting to check the state: Use a condition, like
condition: state, to ensure an action only runs when the device is in a certain state.
If an action doesn’t work, check the logbook and the device’s integration page for error messages. Often, the issue is a missing permission or a device that is offline.
Comparing Actions, Scripts, and Automations
Actions are single commands. Scripts are sequences of actions. Automations are rules that trigger actions based on events. You can think of actions as verbs, scripts as sentences, and automations as the conditions under which you speak those sentences.
For example, an action is “turn off the kitchen light.” A script is “turn off the kitchen light, then lock the back door.” An automation is “every night at 10 PM, run the good night script.” Using scripts and automations together keeps your configuration organized and avoids repeating the same actions in multiple places.
Costs and Safety Considerations
Home Assistant actions themselves are free; the cost is in the hardware and the time to set it up. There are no subscription fees for the core software. However, some cloud integrations (like Google Assistant or Alexa) may require a paid subscription for advanced features. Always check the integration’s documentation for any costs.
Safety is important when automating actions that involve locks, garage doors, or heating. Never unlock a door or open a garage without a confirmation. Use a PIN or a “person home” condition. For heating, set reasonable temperature limits to avoid freezing pipes or overheating. Always test actions in a controlled environment before relying on them.
Frequently Asked Questions
How do I find the action I need?
Go to Developer Tools → Actions in Home Assistant. Select the domain (like light) and you’ll see a list of available services. You can also search the documentation for your specific integration.
Can I use actions with voice assistants?
Yes, if you have the Home Assistant Cloud or a local voice assistant like Assist, you can create custom sentences that trigger scripts or actions. For example, “turn off the living room lights” can call light.turn_off.
What is the difference between an action and a service?
They are the same thing. In older versions of Home Assistant, they were called services. The term “action” was introduced in 2023 to avoid confusion with the Services page. You may still see “service” in older documentation.
Why is my action not working?
Check the entity ID, ensure the device is online, and look at the logbook for errors. Also verify that you have the correct data fields. For example, climate.set_temperature needs a temperature value.
Can I target multiple devices with one action?
Yes, you can specify multiple entity IDs in the target field, or use a group. For example, light.turn_on can target light.kitchen, light.living_room.
Are there any actions I should avoid?
Avoid actions that could cause harm, like unlocking doors or turning off a freezer without a good reason. Also avoid actions that are not idempotent, meaning they have a different effect each time, like toggling a light when you really want to set it to a specific state.