Input number
The Input number integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] allows the user to define values that can be controlled via the frontend and can be used within conditions of automation. The frontend can display a slider, or a numeric input box. Changes to the slider or numeric input box generate state events. These state events can be utilized as automation
triggers as well.
The preferred way to configure an input number is via the user interface at Settings > Devices & services > Helpers. Click the add button and then choose the Number option.
To be able to add Helpers via the user interface you should have default_config:
in your configuration.yaml
The 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], it should already be there by default unless you removed it.
If you removed default_config:
from you configuration, you must add input_number:
to your configuration.yaml
first, then you can use the UI.
Input numbers can also be configured via configuration.yaml
The 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]:
Configuration Variables
Alias for the input. Multiple entries are allowed.
Unit of measurement in which the value of the slider is expressed in.
Icon to display in front of the input element in the frontend.
Actions
This integration provides the following actions to modify the state of the input_number
and an action to reload the
configuration without restarting Home Assistant itself.
Service | Data | Description |
---|---|---|
decrement |
entity_id(s) area_id(s)
|
Decrement the value of specific input_number entities by step
|
increment |
entity_id(s) area_id(s)
|
Increment the value of specific input_number entities by step
|
reload |
Reload input_number configuration |
|
set_value |
value entity_id(s) area_id(s)
|
Set the value of specific input_number entities |
Restore state
If you set a valid value for initial
this integration will start with the state set to that value. Otherwise, it will restore the state it had prior to Home Assistant stopping. Please note that initial
is only available in a YAML configuration and not via the Home Assistant user interface.
Scenes
To set the value of an input_number in a Scene:
Automation examples
Here’s an example of input_number
being used as a trigger in an automation.
Another code example using input_number
, this time being used in an action in an automation.
Example of input_number
being used in a bidirectional manner, both being set by and controlled by an MQTT action in an automation.
Here’s an example of input_number
being used as a delay in an automation.