Вклад участника Matveevrj
- 20:48, 21 сентября 2022 разн. история +89 Н Translations:Rule Examples/76/en Новая страница: «<syntaxhighlight lang="ecmascript"> defineVirtualDevice("buzzer", { title: "Buzzer", //» текущая
- 20:48, 21 сентября 2022 разн. история −366 Rule Examples/en Новая страница: «defineRule({ whenChanged: "wb-mcm8_20/Input 1 Single Press Counter", then: function (newValue, devName, cellName) { dev["wb-mdm3_58/K1"] = true; } });»
- 20:48, 21 сентября 2022 разн. история +166 Н Translations:Rule Examples/75/en Новая страница: «[https://github.com/contactless/wb-rules-system/blob/master/rules/buzzer.js Rule] creates a virtual buzzer device with volume and frequency sliders and a mute button.» текущая
- 20:48, 21 сентября 2022 разн. история +25 Н Translations:Rule Examples/74/en Новая страница: «=== Rule for tweeters ===» текущая
- 20:48, 21 сентября 2022 разн. история +41 Н Translations:Rule Examples/73/en Новая страница: «A few examples of system rules are below.» текущая
- 20:48, 21 сентября 2022 разн. история −13 Rule Examples/en Новая страница: «→----------------------------: →2. Double Press Counter: Off action: →----------------------------: »
- 20:48, 21 сентября 2022 разн. история −13 Translations:Rule Examples/222/en текущая
- 20:48, 21 сентября 2022 разн. история −184 Rule Examples/en Новая страница: «When the CO2 concentration is over 1001, we flash red once a second. <div class="mw-collapsible mw-collapsed"; style="width:600px; overflow: hidden;"> <syntaxhighlight lang="ecmascript"> defineRule("msw3_co2", { whenChanged: "wb-msw-v3_97/CO2", then: function(newValue, devName, cellName) { var co2_good = newValue < 650; var co2_middle = newValue < 1000 && newValue > 651; var co2_bad = newValue > 1001;»
- 20:48, 21 сентября 2022 разн. история +451 Н Translations:Rule Examples/222/en Новая страница: «Many of the indications that are visible in the web interface of the controller out of the box are also created by rules on the wb-rules engine. Their code is here: [https://github.com/wirenboard/wb-rules-system https://github.com/wirenboard/wb-rules-system]. The system rules are collected in the <code>wb-rules-system</code> package, the script files on the controller are located in the <code>/usr/share/wb-rules-system/</code> folder.<code></code>»
- 20:47, 21 сентября 2022 разн. история −131 Rule Examples/en Новая страница: «=== System rules ===»
- 20:46, 21 сентября 2022 разн. история +20 Н Translations:Rule Examples/70/en Новая страница: «=== System rules ===» текущая
- 20:46, 21 сентября 2022 разн. история +470 Н Translations:Rule Examples/221/en Новая страница: «<div class="NavFrame"> <div class="NavContent"> <syntaxhighlight lang="ecmascript"> defineRule("msw3_Motion", { whenChanged: "wb-msw-v3_97/Max Motion", then: function(newValue, devName, cellName) { if (newValue > 50) { if (dev["wb-msw-v3_97"]["Illuminance"] < 50) { dev["wb-mr3_11"]["K1"] = true; } } else { dev["wb-mr3_11"]["K1"] = false; } } }); </syntaxhighlight> </div...»
- 20:46, 21 сентября 2022 разн. история −256 Rule Examples/en Новая страница: «== Sensor MSW v.3 ==»
- 20:46, 21 сентября 2022 разн. история +893 Н Translations:Rule Examples/220/en Новая страница: «if (co2_good) { dev[devName]["Green LED"] = true; dev[devName]["Red LED"] = false; dev[devName]["LED Period (s)"] = 10; } if (co2_middle) { dev[devName]["Green LED"] = true; dev[devName]["Red LED"] = true; dev[devName]["LED Period (s)"] = 5; } if (co2_bad) { dev[devName]["Green LED"] = false; dev[devName]["Red LED"] = true;...»
- 20:46, 21 сентября 2022 разн. история −95 Rule Examples/en Новая страница: «When the CO2 concentration is over 651, but less than 1000, we flash yellow once every 5 seconds.»
- 20:46, 21 сентября 2022 разн. история +436 Н Translations:Rule Examples/219/en Новая страница: «When the CO2 concentration is over 1001, we flash red once a second. <div class="mw-collapsible mw-collapsed"; style="width:600px; overflow: hidden;"> <syntaxhighlight lang="ecmascript"> defineRule("msw3_co2", { whenChanged: "wb-msw-v3_97/CO2", then: function(newValue, devName, cellName) { var co2_good = newValue < 650; var co2_middle = newValue < 1000 && newValue > 651; var co2_bad = newValue > 1001;» текущая
- 20:46, 21 сентября 2022 разн. история −170 Rule Examples/en Новая страница: «→---------------------------------------: →3. Long Press Counter: Increase brightness: →---------------------------------------: »
- 20:45, 21 сентября 2022 разн. история +97 Н Translations:Rule Examples/218/en Новая страница: «When the CO2 concentration is over 651, but less than 1000, we flash yellow once every 5 seconds.» текущая
- 20:45, 21 сентября 2022 разн. история +94 Н Translations:Rule Examples/217/en Новая страница: «=== CO2 === When the CO2 concentration is less than 650, we flash green once every 10 seconds.» текущая
- 20:45, 21 сентября 2022 разн. история −520 Rule Examples/en Новая страница: «if (i > 0 && dev["wb-mcm8_20/Input 1"]) { i-- dev["wb-mdm3_58/Channel 1"] = i } else { timers["input1_shortlong_press"].stop(); } } });»
- 20:45, 21 сентября 2022 разн. история +556 Н Translations:Rule Examples/216/en Новая страница: «When connecting the WB-MSW v.3 sensor to the Wiren Board controller, it is possible to create interesting scenarios using data from the sensor. For example, turn on the light when moving, signal with LEDs when the CO2 or VOC value is exceeded, turn on the air conditioner if it is hot or the air humidifier if the air is too dry. Rules are created individually for tasks. Here we will give some examples to understand the principle of working with the sensor. Mo...»
- 20:45, 21 сентября 2022 разн. история +20 Н Translations:Rule Examples/215/en Новая страница: «== Sensor MSW v.3 ==» текущая
- 20:45, 21 сентября 2022 разн. история −152 Rule Examples/en Новая страница: «if (i < 100 && dev["wb-mcm8_20/Input 1"]) { i++ dev["wb-mdm3_58/Channel 1"] = i } else { timers["input1_long_press"].stop(); } } });» Метки: правка с мобильного устройства правка из мобильной версии
- 20:45, 21 сентября 2022 разн. история +208 Н Translations:Rule Examples/214/en Новая страница: «=== Generic module for wb-rules === We wrote a module for wb-rules [https://github.com/wirenboard/wb-community/tree/main/wb-press-actions wb-press-actions] that makes it easy to handle clicks in your scripts.» текущая
- 20:44, 21 сентября 2022 разн. история −504 Rule Examples/en Новая страница: «→--------------------------------------------: →4. Shortlong Press Counter: Decrease brightness: →--------------------------------------------: »
- 20:44, 21 сентября 2022 разн. история +18 Н Translations:Rule Examples/213/en Новая страница: «</syntaxhighlight>» текущая
- 20:44, 21 сентября 2022 разн. история +163 Н Translations:Rule Examples/212/en Новая страница: «if (i > 0 && dev["wb-mcm8_20/Input 1"]) { i-- dev["wb-mdm3_58/Channel 1"] = i } else { timers["input1_shortlong_press"].stop(); } } });» текущая
- 20:44, 21 сентября 2022 разн. история +203 Н Translations:Rule Examples/211/en Новая страница: «// A rule that will decrease the brightness on a timer defineRule({ when: function () { return timers["input1_shortlong_press"].firing; }, then: function () { var i = dev["wb-mdm3_58/Channel 1"];» текущая
- 20:44, 21 сентября 2022 разн. история +242 Н Translations:Rule Examples/210/en Новая страница: «defineRule({ whenChanged: "wb-mcm8_20/Input 1 Shortlong Press Counter", then: function (newValue, devName, cellName) { // Start a timer that will decrease the value of the control startTicker("input1_shortlong_press", 75); } });» текущая
- 20:44, 21 сентября 2022 разн. история +155 Н Translations:Rule Examples/209/en Новая страница: «→--------------------------------------------: →4. Shortlong Press Counter: Decrease brightness: →--------------------------------------------: » текущая
- 20:44, 21 сентября 2022 разн. история +160 Н Translations:Rule Examples/208/en Новая страница: «if (i < 100 && dev["wb-mcm8_20/Input 1"]) { i++ dev["wb-mdm3_58/Channel 1"] = i } else { timers["input1_long_press"].stop(); } } });» текущая
- 20:44, 21 сентября 2022 разн. история +198 Н Translations:Rule Examples/207/en Новая страница: «// A rule that will increase the brightness on a timer defineRule({ when: function () { return timers["input1_long_press"].firing; }, then: function () { var i = dev["wb-mdm3_58/Channel 1"];» текущая
- 20:44, 21 сентября 2022 разн. история +232 Н Translations:Rule Examples/206/en Новая страница: «defineRule({ whenChanged: "wb-mcm8_20/Input 1 Long Press Counter", then: function (newValue, devName, cellName) { // Start a timer that will increase the value of the control startTicker("input1_long_press", 75); } });» текущая
- 20:44, 21 сентября 2022 разн. история +140 Н Translations:Rule Examples/205/en Новая страница: «→---------------------------------------: →3. Long Press Counter: Increase brightness: →---------------------------------------: » текущая
- 20:44, 21 сентября 2022 разн. история −435 Rule Examples/en Новая страница: «Since changing the brightness requires a time-consuming action, we use a timer. We also control the state of the input with the button and stop the action when the button is released.»
- 20:44, 21 сентября 2022 разн. история +161 Н Translations:Rule Examples/204/en Новая страница: «defineRule({ whenChanged: "wb-mcm8_20/Input 1 Double Press Counter", then: function (newValue, devName, cellName) { dev["wb-mdm3_58/K1"] = false; } });» текущая
- 20:44, 21 сентября 2022 разн. история +110 Н Translations:Rule Examples/203/en Новая страница: «→----------------------------: →2. Double Press Counter: Off action: →----------------------------: » текущая
- 20:44, 21 сентября 2022 разн. история +160 Н Translations:Rule Examples/202/en Новая страница: «defineRule({ whenChanged: "wb-mcm8_20/Input 1 Single Press Counter", then: function (newValue, devName, cellName) { dev["wb-mdm3_58/K1"] = true; } });» текущая
- 20:44, 21 сентября 2022 разн. история +137 Н Translations:Rule Examples/201/en Новая страница: «<syntaxhighlight lang="js"> →----------------------------: →1. Single Press Counter: On action: →----------------------------: » текущая
- 20:44, 21 сентября 2022 разн. история +183 Н Translations:Rule Examples/200/en Новая страница: «Since changing the brightness requires a time-consuming action, we use a timer. We also control the state of the input with the button and stop the action when the button is released.» текущая
- 20:44, 21 сентября 2022 разн. история −270 Rule Examples/en Новая страница: «=== Examples === {{YouTube |link=https://youtu.be/C60KB7TCeKg |text= Rule example }} In the example, we are using the WB-MCM8 to control the first dimmer channel WB-MDM3: # Short press turns on the channel. # Double - turns off the channel. # Long - increases brightness. # Short, then long - reduces brightness.»
- 20:44, 21 сентября 2022 разн. история +379 Н Translations:Rule Examples/199/en Новая страница: «=== Examples === {{YouTube |link=https://youtu.be/C60KB7TCeKg |text= Rule example }} In the example, we are using the WB-MCM8 to control the first dimmer channel WB-MDM3: # Short press turns on the channel. # Double - turns off the channel. # Long - increases brightness. # Short, then long - reduces brightness.» текущая
- 20:43, 21 сентября 2022 разн. история −230 Rule Examples/en Новая страница: «Handling counters is conveniently done on wb-rules, but you can use any automation tool like Node-RED. To speed up meter polling, configure poll period.»
- 20:43, 21 сентября 2022 разн. история +216 Н Translations:Rule Examples/198/en Новая страница: «Handling counters is conveniently done on wb-rules, but you can use any automation tool like Node-RED. To speed up meter polling, configure poll period.» текущая
- 20:43, 21 сентября 2022 разн. история −399 Rule Examples/en Новая страница: «To process clicks, you need to track the state of the counter of the desired type of click on the controller and, when it changes, perform an action.»
- 20:43, 21 сентября 2022 разн. история +149 Н Translations:Rule Examples/197/en Новая страница: «To process clicks, you need to track the state of the counter of the desired type of click on the controller and, when it changes, perform an action.» текущая
- 20:43, 21 сентября 2022 разн. история +344 Н Translations:Rule Examples/196/en Новая страница: «== Handling click counters == {{Anchors|press-actions}} === Description === The latest firmware versions of Wiren Board devices can recognize the types of button presses connected to the inputs and broadcast them via Modbus to the Wiren Board controller. For information on how the device recognizes types of clicks, read its documentation.» текущая
- 20:43, 21 сентября 2022 разн. история −137 Rule Examples/en Новая страница: «defineRule("water_meter_1", { whenChanged: "wb-mcm8_29/Input 1 counter", then: function(newValue, devName, cellName) { if(newValue){ dev["water_meters"]["water_meter_1"] = ((parseInt(newValue) - counterCorrection) * inpulseValue) + meterCorrection; // We multiply the value of the counter by the number of liters / pulse and add the correction value. } } }); </syntaxhighlight>»
- 20:42, 21 сентября 2022 разн. история +407 Н Translations:Rule Examples/195/en Новая страница: «defineRule("water_meter_1", { whenChanged: "wb-mcm8_29/Input 1 counter", then: function(newValue, devName, cellName) { if(newValue){ dev["water_meters"]["water_meter_1"] = ((parseInt(newValue) - counterCorrection) * inpulseValue) + meterCorrection; // We multiply the value of the counter by the number of liters / pulse and add the correction value. } } }); </syntaxhighlight>»
- 20:42, 21 сентября 2022 разн. история −120 Rule Examples/en Новая страница: «if (relay_down_timer_id) { relay_down_timer_id = clearTimeout(relay_down_timer_id); };»