Schedule Element
The ScheduleElement creates on and off events based on the current local time.
When using this element a real time retrieving element must be configured as well like the NTPTime or DCFTime.
One Schedule Element can be used to create a timespan during a day that creates 2 possible events.
The first one when the on
-time has passed and a second one when the off
-time has passed.
When starting the device the following events are emitted:
- When starting before the defined time span the
off
-event will be emitted. - When starting the device in the middle of this time span the
on
-event will be emitted. - When starting after the defined time span the
off
-event will be emitted.
The onvalue
event is always emitted together with the on
and off
event situations.
Element Configuration
The following properties are available for configuration of the element:
mode – The element supports 3 modes:
- “on” for always on,
- “off” for always off and
- "timer" for switching the value using the timer settings.
ontime – Specifies the start of the time span.
offtime – Specifies the end of the time span.
onon – These actions are emitted when the on time has passed.
onoff – These actions are emitted when the off time has passed.
onvalue – These actions are emitted when the value is changing.
From the base element implementation the following properties are available for configuration:
title – Caption text for the element. Used by the element specific cards on the dash boards.
description – A line of text that gives a short description of the device used in the web UI.
room – The location of the device.
loglevel – This property holds the element specific log level. The default value is LOGGER_LEVEL_ERR == 1.
startup – This property can be used to start the element using a different initialization phase. Possible values are “sys”, “net”, “time”. See The Startup sequence.
Element State
The following properties are available with the current values at runtime
active – Is set to true when the element is active.
value – Current output value of the element.
Example Configuration
{
"schedule": {
"lights": {
"ontime": "04:00:00",
"offtime": "18:00:00",
"onon": "device/main?log=now on.",
"onoff": " device/main?log=now off."
}
}
}
Example State
{
"button/start": {
"active": "true",
"value": ???
}
}