Skip to main content Link Search Menu Expand Document (external link)

Otherwise

The otherwise property is the automation code that is executed when a rule is triggered and guards are not satisfied. This property accepts a block of code and executes it. The block is automatically passed an event object which can be used to access multiple properties about the triggering event.

Event Properties

PropertyDescription
itemTriggering item
stateChanged state of triggering item
lastLast state of triggering item
rule 'Turn switch ON or OFF based on value of another switch' do
  on_start
  run { TestSwitch << ON }
  otherwise { TestSwitch << OFF }
  only_if { OtherSwitch == ON }
end