Delay

Overview

A delay can be set to a Value so that the changes of the Value are delayed instead of being immediately published.

Warning

Errors on a delayed Value are also delayed.

@startuml
skinparam backgroundColor transparent
robust "Delay value" as delay
robust "External value" as value

@0
value is 0
delay is 0

@1
value is 10
value -> delay : Trigger

@delay
@1 <-> @2 : 1s

@2
delay is 10

@3
value is 15
value -> delay : Trigger

@delay
@3 <-> @4 : 1s

@3.5
value is 20
value -> delay : Trigger

@4
delay is 15

@delay
@3.5 <-> @4.5 : 1s

@4.5
delay is 20

@enduml

  • The External value is the source of the delay.

  • The Delay value is the resulting value as published by OnSphere.

  • The blue arrow indicates that the value is read by OnSphere.

  • The red arrow indicates the duration of the delay.

Example

This can be used for example to delay the locking of a door when pushing on a button, so the person has time to leave the room before it closes.