Перейти к содержанию

Навигация

Rule Examples/en: различия между версиями

Нет описания правки
(Обновление для соответствия новой версии исходной страницы.)
Метки: правка с мобильного устройства правка из мобильной версии
Строка 7: Строка 7:
For example, a rule can turn on a siren and a lamp if a motion sensor detects movement.  
For example, a rule can turn on a siren and a lamp if a motion sensor detects movement.  


<div class="mw-translate-fuzzy">
In the example, the motion sensor is connected to the "dry contact" input, control type "switch". The siren is connected to the built-in Wiren Board relay, and the lamp is connected to the relay box via Modbus. When the "dry contact" input (motion sensor output) is closed, "1" is supplied to the lamp and the relay, and "0" when it is off.
In the example, the motion sensor is connected to the "dry contact" input, control type "switch". The siren is connected to the built-in Wiren Board relay, and the lamp is connected to the relay box via Modbus. When the "dry contact" input (motion sensor output) is closed, "1" is supplied to the lamp and the relay, and "0" when it is off.
</div>


<div class="mw-translate-fuzzy">
The rule is triggered every time the control value "D1_IN" of the device "wb-gpio" is changed. The new value of this control is passed to the rule code as a variable newValue.
The rule is triggered every time the control value "D1_IN" of the device "wb-gpio" is changed. The new value of this control is passed to the rule code as a variable newValue.
</div>


<syntaxhighlight lang="ecmascript">
<syntaxhighlight lang="ecmascript">
translator, wb_editors
4265

правок