История
3 июня 2019
Новая страница: «There should be no error messages in the log (exit via control-c)»
−44
Новая страница: «5. Restart wb-rules and check the operation»
−30
Новая страница: «4. Describe the virtual device in the file»
−29
Новая страница: «The file can be edited with vim, nano, or mcedit in an ssh session on the device, or it can be downloaded with SCP.»
−72
Новая страница: «3. Create the new rules file <code>/etc/wb-rules/rs485_cmd.js</code> in the rules engine»
−42
Нет описания правки
−10
Новая страница: «You can send data by the following shell command:»
−42
Новая страница: «2. Sending a command»
−14
Новая страница: «To configure the / dev/ttyNSC0 port to 9600 speed, run the following command»
−62
Новая страница: «1. Port setting»
−17
Новая страница: «When you turn off the switch a command will be sent: (set channel brightness 00=0x00) for Uniel UCH-M141: <pre> FF FF 0A 01 00 00 00 0B </pre>»
−59
Новая страница: «When you turn on the switch a command will be sent: (Set Brightness ch. 00=0xff) for Uniel UCH-M141: <pre> FF FF 0A 01 FF 00 00 0A </pre>»
−63
Новая страница: «Create a virtual device with switch type control via rules engine.»
−106
Новая страница: «For example, send a command to the device on the port /dev/ttys0 (corresponds to the hardware port RS-485-ISO on the Special:MyLanguage/Wiren Board 4|Wiren Boar…»
−168
Новая страница: «=== Sending commands viaRS-485 ===»
−15
Новая страница: «To illustrate, the rules use two different ways of triggering: by changing the value of the control (rule _system_track_vin) and by changing the value of the expr…»
−120
Новая страница: «2. If the input voltage is greater than the battery voltage, the Board is powered by an external power supply. The measurement from the Vin channel is displayed a…»
−144
Новая страница: «1. If the input voltage is less than the voltage on the battery, then the Board is powered by the battery. In this case, 0V is also displayed as the input voltage.»
−150
Новая страница: «The following logic is implemented:»
−20
Новая страница: «[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