История
23 сентября 2022
21 сентября 2022
Нет описания правки
−38
Нет описания правки
−49
Нет описания правки
−49
Нет описания правки
−55
Нет описания правки
−49
Нет описания правки
−49
Нет описания правки
−43
Нет описания правки
−39
Нет описания правки
−156
Нет описания правки
−46
Нет описания правки
−82
Нет описания правки
−82
Нет описания правки
−82
Нет описания правки
−46
Нет описания правки
+14
Нет описания правки
−80
Обновление для соответствия новой версии исходной страницы.
+880
Нет описания правки
+24
Нет описания правки
+14
Новая страница: «When you click Save in the web interface, the wb-rules service will be restarted, and the values of the settings will be written to the rules.»
−91
Новая страница: «7. Let's describe the rules for turning the switch on and off»
−173
Новая страница: «The file can be edited with vim, nano, or mcedit in an ssh session on the device, or it can be downloaded with SCP.»
−319
Новая страница: «setTimeout(setup_port, 1000); // set setup_port() running 1 second after starting.»
−179
Новая страница: «<syntaxhighlight lang="js"> defineVirtualDevice("Termostat", { title: "Termostat", cells: { // =============== hallway underfloor heating "R01-TS16-1-mode": {//mode 0-manual 1-scheduled type: "switch", value: false, }, "R01-TS16-1-setpoint": {//setting type: "range", value: 25, max: 30, readonly: false }, "R01-TS16-1-lock": {//blockage in visualization 0-unlocked 1-blocked typ...»
−109
Новая страница: «function checkSchedule(schedule, now) { if (now == undefined) { now = new Date(); }»
−294
Новая страница: «// signboard and facade illumination defineRule("signboardOnOff", { when: function() { return dev._schedules.signboard || true; }, then: function (newValue, devName, cellName) { log("signboardOnOff newValue={}, devName={}, cellName={}", newValue, devName, cellName); var on = dev._schedules.signboard; // dev["wb-mr6c_80/K2"] = !on; dev["wb-mr6c_80/K1"] = !on; dev["wb-mr6c_80/K3"] = !on; } });»
−742
Новая страница: «defineAlias("heater1EnableInverted", "wb-mrm2-old_70/Relay 1"); defineAlias("frontshopVentInverted", "wb-gpio/EXT1_R3A3");»
−56
Новая страница: «// setup pwm2 runShellCommand("echo 2 > /sys/class/pwm/pwmchip0/export");»
−547
Новая страница: «for (var schedule_name in _schedules) { if (_schedules.hasOwnProperty(schedule_name)) { var schedule = _schedules[schedule_name]; params.cells[schedule_name] = {type: "switch", value: false, readonly: true}; } };»
−504
Новая страница: «4. Describe the virtual device in the file»
−336
Новая страница: «There should be no error messages in the log (exit via control-c)»
−179
Новая страница: «[https://github.com/contactless/wb-rules-system/blob/master/rules/power_status.js Rule] creates a virtual device that reports the current power status. Two ADC channels are used as input data: battery voltage measurement and input voltage measurement.»
−193
Новая страница: «A few examples of system rules are below.»
−568
Новая страница: «The full contents of the file with the rules:»
−85
Новая страница: «To configure the / dev/ttyNSC0 port to 9600 speed, run the following command»
−348
Новая страница: «A new device "Send custom command to RS-485 port" should appear in the Devices section of the web interface.»
−677
Новая страница: «defineRule("_system_track_vin", { whenChanged: "wb-adc/Vin", then: function() { if (dev["wb-adc"]["Vin"] < dev["wb-adc"]["BAT"] ) { dev["power_status"]["Vin"] = 0; } else { dev["power_status"]["Vin"] = dev["wb-adc"]["Vin"] ; } } });»
−565
Новая страница: «defineRule("_rs485_switch_on", { asSoonAs: function () { return dev.rs485_cmd.enabled; }, then: function() { runShellCommand("/usr/bin/printf '\\xff\\xff\\x0a\\x01\\xff\\x00\\x00\\x0a' > /dev/ttyNSC0"); } });»
−238
Новая страница: «2. Sending a command»
−237
Новая страница: «<syntaxhighlight lang="ecmascript"> defineRule("_rs485_switch_on", { asSoonAs: function () { return dev.rs485_cmd.enabled; }, then: function() { runShellCommand("/usr/bin/printf '\\xff\\xff\\x0a\\x01\\xff\\x00\\x00\\x0a' > /dev/ttyNSC0"); } });»
−177
Новая страница: «defineRule("_rs485_switch_off", { asSoonAs: function () { return !dev.rs485_cmd.enabled; }, then: function() { runShellCommand("/usr/bin/printf '\\xff\\xff\\x0a\\x01\\x00\\x00\\x00\\x0b' >/dev/ttyNSC0"); } });»
−705
Новая страница: «cells: { 'working on battery' : { type : "switch", value : false, readonly : true }, 'Vin' : { type : "voltage", value : 0 }»
−279
Новая страница: «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>»
−100
Новая страница: «defineRule("_system_buzzer_onof", { whenChanged: "buzzer/enabled", then: function (newValue, devName, cellName) { if ( dev.buzzer.enabled) { _buzzer_set_params(); runShellCommand("echo 1 > /sys/class/pwm/pwmchip0/pwm2/enable"); } else { runShellCommand("echo 0 > /sys/class/pwm/pwmchip0/pwm2/enable"); } } });»
−318
Новая страница: «<pre> /usr/bin/printf '\xFF\xFF\x0A\x01\xD1\x06\x00\xE2' >/dev/ttyNSC0 </pre> where "\xFF\xFF\x0A\x01\xD1\x06\x00\xE2" - is the entry of a "FF FF 0A 01 D1 06 00 E2" command.»
−383
Новая страница: «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>»
−686
Новая страница: «1. Port setting»
−73
Новая страница: «</syntaxhighlight> == Sending commands via RS-485 ==»
−396
Новая страница: «Termostat("R01-TS16-1", "A60-M1W3/External Sensor 1", "Termostat/R01-TS16-1-setpoint", "wb-gpio/EXT4_R3A1", "Termostat/R01-TS16-1-onoff"); // Hallway underfloor heating»
−565