mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-26 18:57:17 +00:00
I added another example -> input_number being used as a delay in an automation (#5837)
This commit is contained in:
parent
258df7c37f
commit
986f865c0f
@ -194,3 +194,38 @@ automation:
|
|||||||
payload: "{{ states('input_number.target_temp') | int }}"
|
payload: "{{ states('input_number.target_temp') | int }}"
|
||||||
```
|
```
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
||||||
|
Here's an example of `input_number` being used as a delay in an automation.
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
```yaml
|
||||||
|
# Example configuration.yaml entry using 'input_number' as a delay in an automation
|
||||||
|
input_number:
|
||||||
|
minutes:
|
||||||
|
name: minutes
|
||||||
|
icon: mdi:clock-start
|
||||||
|
initial: 3
|
||||||
|
min: 0
|
||||||
|
max: 6
|
||||||
|
step: 1
|
||||||
|
|
||||||
|
seconds:
|
||||||
|
name: seconds
|
||||||
|
icon: mdi:clock-start
|
||||||
|
initial: 30
|
||||||
|
min: 0
|
||||||
|
max: 60
|
||||||
|
step: 10
|
||||||
|
|
||||||
|
automation:
|
||||||
|
- alias: turn something off after x time after turning it on
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: switch.something
|
||||||
|
to: 'on'
|
||||||
|
action:
|
||||||
|
- delay: '00:{{ states.input_number.minutes.state | int }}:{{ states.input_number.seconds.state | int }}'
|
||||||
|
- service: switch.turn_off
|
||||||
|
entity_id: switch.something
|
||||||
|
```
|
||||||
|
{% endraw %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user