-
Notifications
You must be signed in to change notification settings - Fork 1
Actions and Interactions
Configure how your buttons respond to user interaction.
Button Builder supports five action trigger points:
| Trigger | Activation | Default |
|---|---|---|
| Tap | Single tap/click | toggle |
| Hold | Long press (~500ms) | more-info |
| Double Tap | Two quick taps | none |
Toggles the entity's state (on/off).
tap_action:
action: toggleWorks with:
- Lights
- Switches
- Fans
- Input booleans
- Covers
- Locks
- Media players
Opens the entity's detailed dialog.
tap_action:
action: more-infoOptions:
| Option | Description |
|---|---|
| entity | Override which entity's info to show |
tap_action:
action: more-info
entity: sensor.temperature # Show different entityCalls any Home Assistant service.
tap_action:
action: call-service
service: light.turn_on
service_data:
entity_id: light.bedroom
brightness_pct: 75
rgb_color: [255, 100, 100]Options:
| Option | Description |
|---|---|
| service | Service to call (e.g., light.turn_on) |
| service_data | Data to pass to the service |
| target | Target entities/areas/devices |
Turn on light with brightness:
tap_action:
action: call-service
service: light.turn_on
service_data:
entity_id: light.living_room
brightness_pct: 100Set light color:
tap_action:
action: call-service
service: light.turn_on
service_data:
entity_id: light.strip
rgb_color: [255, 0, 150]Run a script:
tap_action:
action: call-service
service: script.turn_on
service_data:
entity_id: script.good_morningSend notification:
tap_action:
action: call-service
service: notify.mobile_app
service_data:
title: "Button Pressed"
message: "Living room button was tapped"Control media player:
tap_action:
action: call-service
service: media_player.play_media
service_data:
entity_id: media_player.speaker
media_content_id: "spotify:playlist:xyz"
media_content_type: musicSet climate temperature:
tap_action:
action: call-service
service: climate.set_temperature
service_data:
entity_id: climate.thermostat
temperature: 72Control cover position:
tap_action:
action: call-service
service: cover.set_cover_position
service_data:
entity_id: cover.blinds
position: 50Navigate to another dashboard view.
tap_action:
action: navigate
navigation_path: /lovelace/lightsOptions:
| Option | Description |
|---|---|
| navigation_path | Dashboard path to navigate to |
Path Examples:
| Path | Description |
|---|---|
/lovelace/0 |
First view (index) |
/lovelace/lights |
View with path "lights" |
/config |
HA configuration |
/developer-tools |
Developer tools |
/my-dashboard/rooms |
Custom dashboard view |
Open a URL in a new browser tab.
tap_action:
action: url
url_path: https://example.comOptions:
| Option | Description |
|---|---|
| url_path | URL to open |
Examples:
# External website
tap_action:
action: url
url_path: https://weather.com
# Internal HA page
tap_action:
action: url
url_path: /local/camera_snapshot.jpg
# IP camera stream
tap_action:
action: url
url_path: http://192.168.1.100:8080/streamOpen the Home Assistant Assist dialog.
tap_action:
action: assistOptions:
| Option | Description |
|---|---|
| pipeline_id | Specific Assist pipeline to use |
| start_listening | Start with microphone active |
tap_action:
action: assist
start_listening: trueFire a custom browser event for advanced integrations.
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
content:
type: entities
entities:
- light.bedroom
- light.bathroomCommon Uses:
- Browser Mod popups
- Custom JavaScript handlers
- Integration with other frontend tools
Disable the action entirely.
tap_action:
action: noneUse Cases:
- Display-only buttons
- Prevent accidental toggles
- Child-proof buttons
- Navigate to Actions category
- Select Tap Action
- Choose action type from dropdown
- Configure action-specific options
- Navigate to Actions category
- Select Hold Action
- Configure as above
- Navigate to Actions category
- Select Double Tap Action
- Configure as above
Require user confirmation before executing an action.
tap_action:
action: toggle
confirmation:
text: "Are you sure you want to toggle this light?"Confirmation Options:
| Option | Description |
|---|---|
| text | Custom confirmation message |
| exemptions | Users exempt from confirmation |
With Exemptions:
tap_action:
action: call-service
service: script.arm_alarm
confirmation:
text: "Arm the alarm system?"
exemptions:
- user: admin_user_id- Destructive actions (delete, reset)
- Security actions (lock, arm alarm)
- Expensive operations (garage door, irrigation)
- Public dashboards (prevent accidental triggers)
Provide tactile feedback on mobile devices.
tap_action:
action: toggle
haptic: mediumHaptic Options:
| Value | Description |
|---|---|
success |
Success vibration |
warning |
Warning vibration |
failure |
Error vibration |
light |
Light tap |
medium |
Medium tap |
heavy |
Heavy tap |
selection |
Selection feedback |
tap_action:
action: toggle
hold_action:
action: more-info
double_tap_action:
action: call-service
service: light.turn_on
service_data:
entity_id: light.bedroom
brightness_pct: 100Control multiple entities with one button:
tap_action:
action: call-service
service: light.turn_on
target:
entity_id:
- light.living_room
- light.kitchen
- light.hallway
service_data:
brightness_pct: 100tap_action:
action: call-service
service: scene.turn_on
service_data:
entity_id: scene.movie_timeUsing button-card templates:
tap_action:
action: |
[[[
if (entity.state === 'on') {
return {
action: 'call-service',
service: 'light.turn_off',
service_data: { entity_id: entity.entity_id }
};
}
return {
action: 'call-service',
service: 'light.turn_on',
service_data: {
entity_id: entity.entity_id,
brightness_pct: 50
}
};
]]]Tap for toggle, hold for full brightness:
tap_action:
action: toggle
hold_action:
action: call-service
service: light.turn_on
service_data:
entity_id: light.bedroom
brightness_pct: 100
double_tap_action:
action: call-service
service: light.turn_on
service_data:
entity_id: light.bedroom
brightness_pct: 25Tap for main light, hold for all lights:
entity: light.living_room_main
tap_action:
action: toggle
hold_action:
action: call-service
service: light.turn_on
target:
entity_id:
- light.living_room_main
- light.living_room_lamp
- light.living_room_stripTap for info, hold for toggle:
tap_action:
action: more-info
hold_action:
action: toggletap_action:
action: navigate
navigation_path: /lovelace/living-room
hold_action:
action: navigate
navigation_path: /lovelace/settings
double_tap_action:
action: navigate
navigation_path: /lovelace/overview- Check entity availability - Is entity in "unavailable" state?
- Check service name - Use Developer Tools > Services to verify
- Check permissions - Does user have access to entity?
- Check service data - Validate JSON/YAML format
Some entities don't support toggle:
- Use
homeassistant.togglefor broad compatibility - Or use explicit
turn_on/turn_offservices
- Ensure path starts with
/ - Check dashboard and view names match exactly
- Case-sensitive paths
- Configuration Options - Full settings reference
- Style Presets - Button styling
- Advanced Features - Templates and AI builder
Getting Started
Configuration
Advanced
Help