Time/Clock-Widgets

clock.countdown clock.countup clock.digiclock clock.iconclock clock.miniclock


clock.countdown

Displays a countdown

Parameters
{{ clock.countdown(id, item, starttime, duration, interval, stopmode, idletxt, condition) }}
id
unique id for this widget (optional)
item
an item being switched
starttime
an item containing the start time of the countdown as string (e.g. "2023-05-21T23:00:34.566439+02:00") or timestamp
duration
an item containing the duration of the countdown (h,i,s format) or a fixed duration, e.g. '10i 30s'
interval
the countdown interval in seconds, e.g. '60s' (default: '10s')
stopmode
the mode of stopping the timer 'item' (default): countdown runs until item is changed; 'zero' = like 'item' but countdown stops at 00:00:00
idletxt
the text displayed when countdown is inactive (default '--:--:--')
condition
value for the switching item as condition. Countdown starts only if item equals condition (optional, default = '')
Example
{{ clock.countdown('t', 'bath.light.switch', 'bath.light.timestamp', 'bath.light.timer', '5s'}}
{{ clock.countdown('t2', 'bath.light.switch2', 'bath.light.timestamp2', '15s', '1s', 'zero', ' ', 1) }}

Press the "Trigger" button to create a timestamp for the start time. Countdown will start only if a duration is entered. You can change start time and duration during runtime of the countdown. Timer will stop if the item is changed while the timestamp remains unchanged.

Item to switch.      Click to start    =>   Timestamp for "now" is: ---

Enter timer duration in standard duration format e.g. "1h 45i 30s":

Countdown Timer:    --:--:--


This example comes with a fixed countdown duration and starts only if the switching item equals the value of 1.
Item to switch.      Click to start    =>    Timestamp for "now" is: ---

Countdown Timer:   


Author: Wolfram v. Hülsen