From 986f865c0f37416eabcca1997358c4c96a87814a Mon Sep 17 00:00:00 2001 From: bvansambeek <35294853+bvansambeek@users.noreply.github.com> Date: Sat, 21 Jul 2018 18:37:38 +0200 Subject: [PATCH] I added another example -> input_number being used as a delay in an automation (#5837) --- source/_components/input_number.markdown | 35 ++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/source/_components/input_number.markdown b/source/_components/input_number.markdown index aadbd391509..9f7f65ed956 100644 --- a/source/_components/input_number.markdown +++ b/source/_components/input_number.markdown @@ -194,3 +194,38 @@ automation: payload: "{{ states('input_number.target_temp') | int }}" ``` {% 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 %}