Input button
The Input button integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] lets you create a button helperA helper is a virtual entity you create inside Home Assistant. It is not backed by a physical device. Helpers store values, track state, or do calculations that your automations and dashboards need. [Learn more]: an entity you can press, but that does not store an on or off stateThe state holds the information of interest of an entity, for example, if a light is on or off. Each entity has exactly one state and the state only holds one value at a time. However, entities can store attributes related to that state such as brightness, color, or a unit of measurement. [Learn more]. Because the button is not tied to a physical device, you can use it to start something from the user interface, such as running a script or triggering an automationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more]. For example, you can create a button helper to ring a doorbell chime, restart a routine, or send yourself a notification.
When you press a button helper, Home Assistant records the timestamp of the press. Your automations can use that press as a trigger, which makes a button helper a convenient way to start an action from a dashboard.
Configuration
- Go to Settings > Devices & services > Helpers and select Create helper.
- Select Button.
Input buttons can also be configured via configuration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more]:
# Example configuration.yaml entry
input_button:
ring_bell:
name: Ring bell
icon: mdi:bell
Configuration Variables
Alias for the input. Multiple entries are allowed.
Icon to display in front of the input element in the frontend.
Automation examples
The input_button entity is stateless, as in, it cannot have a state like the
on or off state that, for example, a normal switch entity has.
Every input button entity does keep track of the timestamp of when the last time the input button entity has been pressed in the Home Assistant UI or pressed via an action.
Because the state of a input button entity in Home Assistant is a timestamp, it means we can use it in our automations. For example:
triggers:
- trigger: state
entity_id: input_button.my_button
actions:
- action: notify.frenck
data:
message: "My button has been pressed!"
List of actions
The Input button integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides the following actions. Each link below opens a dedicated page with examples, parameters, and a step-by-step UI walkthrough.
-
Press input button (
input_button.press) Presses an input button. -
Reload input buttons (
input_button.reload) Reloads the input button helpers from the YAML configuration.
For an overview of every action across all integrations, see the actions reference.
Troubleshooting
The Button helper option is missing from the user interface
Symptom
When you go to Settings > Devices & services > Helpers to add a helper, the Button option is not listed.
Description
Button helpers are provided through default_config:, which is part of your configuration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] by default. If you removed default_config:, the option is no longer available.
Resolution
- Add
input_button:to yourconfiguration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more]. - Restart Home Assistant.
- After the restart, create your button helpers from the user interface.