История
3 июня 2019
Новая страница: «[https://github.com/contactless/wb-rules-system/blob/master/rules/power_status.js The rule] creates a virtual device that reports the current power status. Two…»
−208
Новая страница: «==== Power status rule ====»
−34
Новая страница: «[https://github.com/contactless/wb-rules-system/blob/master/rules/buzzer.js Rule] creates a virtual buzzer device with sliders to adjust the volume and frequency,…»
−105
Новая страница: «==== The rule for the buzzer====»
−14
Новая страница: «Some examples:»
−20
Новая страница: «Full list of rules is[https://github.com/contactless/wb-rules-system/tree/master/rules in the repository.].»
−24
Новая страница: «Some rules come with the default rule system in the wb-rules-system package.»
−72
Новая страница: «=== System rules ===»
−21
Новая страница: «An older version of the same script demonstrates the use of aliases: <syntaxhighlight lang="ecmascript">»
−65
Новая страница: «In addition, the rule turns off the engines after a specified time after switching on.»
−61
Новая страница: «One relay includes the engine, raising the curtains, the second relay - includes the engine, lowering the curtains. The rule ensures that both relays are not swit…»
−121
Новая страница: «=== Rolling shutters ===»
+2
Новая страница: «The rule is as in the previous section, but runs only from 9:30 to 17:10 UTC.»
−54
Новая страница: «=== Activate a rule only at a specific time ===»
−46
Новая страница: «If you need several such motion detectors, you can wrap the creation of rules and variables into a function to avoid copying the code:»
−108
Новая страница: «=== Creating similar rules ===»
−28
Новая страница: «Lighting is connected via built-in relay, wb-gpio/Relay_1 channel.»
−43
Новая страница: «The rule turns on the light when motion is detected and turns off the light 30 seconds after the motion sensor signal disappears.»
−102
Новая страница: «The motion detector with the "dry contact" output type is connected to the D2 input, which closes the D2 and GND when motion is detected. At the same time, the st…»
−95
Новая страница: «=== Motion detection with timeout ===»
−25
Новая страница: «The same, but with a virtual device as a source of events. Example of use: scenario button that turns on/off the siren and light bulb.»
−149
Новая страница: «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 newVa…»
−131
Новая страница: «In the example, the motion sensor is connected to the input "dry contact", control type "switch". The siren is connected to the built-in relay Wiren Board, and th…»
−178
Новая страница: «For example, a rule can include a siren and a lamp if the motion sensor has noticed movement.»
−66
Новая страница: «This simple rule monitors the control and sets the other control in the same state.»
−93
Новая страница: «=== Control tracking ===»
−24
Новая страница: «== Examples of rules ==»
−10
Новая страница: «To start writing complex rules, you need to see examples of rules and complete documentation on the rules engine: #Examples of rules: #* on the same page below; #…»
−166
Новая страница: «=== Write on complex rules ===»
−18
Новая страница: «Create a virtual switch, by clicking on which two relays are switched at once.»
−84
Новая страница: «=== The first rule with a virtual device ===»
−40
Новая страница: «</syntaxhighlight> *The first line is the code word ''defineRule'' and the name of the rule *The second line is the code word for determining when the rule is exe…»
−703
Новая страница: «defineRule("heater_control", { //rule name is arbitrary whenChanged: "wb-w1/28-0115a48fcfff", //when the state of 1-Wire sensor with ID 28-0115a48fcfff changes…»
−321
Новая страница: «To begin with, we will analyze a simple rule - when the temperature is exceeded, turn off the heater. The temperature is obtained from the 1-Wire s…»
−146
Новая страница: «=== The first rule ===»
−13
Новая страница: «Any number of different rules can be stored in a single file. Typically, rules responsible for close functions are stored in a single file.»
−98
Новая страница: «There are two types of rules :the rules themselves (start with defineRule) and virtual devices (start with defineVirtualDevice). Virtual devices are new switchers…»
−416
Новая страница: «400px|thumb|The rule for the heater control, written via the web interface»
−66
Новая страница: «== Writing the first rule==»
−17
Новая страница: «*The list of files with rules is on the ''Scripts'' page of the web interface. *Click the file name to open it for editing. **To create a new file, click ''New...…»
−661
Новая страница: «== How to create and edit rules ==»
−42
Новая страница: «The complete description of the rules engine: https://github.com/contactless/wb-ruleshttps://github.com/contactless/wb-rules»
+17
Новая страница: «400px|thumb|right|Editing rules in web interface You can write rules for the controller, for example: "If the sensor temperature is le…»
−192
Новая страница: «Rule engine wb-rules»
+43 000