Вклад участника Matveevrj
- 20:59, 21 сентября 2022 разн. история +168 Н Translations:Rule Examples/238/en Новая страница: «"properties": { "temperature_setpoint": { "type":"number", "title":"Temperature Setpoint (Degrees C)", "default": 25, "propertyOrder": 1, "minimum": 5, "maximum": 40 },» текущая
- 20:59, 21 сентября 2022 разн. история −565 Rule Examples/en Новая страница: «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"] ; } } });»
- 20:59, 21 сентября 2022 разн. история +71 Н Translations:Rule Examples/237/en Новая страница: «"configFile": { "path":"/etc/test-config.conf", "service":"wb-rules" },» текущая
- 20:58, 21 сентября 2022 разн. история +248 Н Translations:Rule Examples/236/en Новая страница: «1. The output scheme of the html page in the Configs section: /usr/share/wb-mqtt-confed/schemas/test-config.schema.json <syntaxhighlight lang="bash"> { "type":"object", "title":"Test configuration", "description":"Long description configuration",» текущая
- 20:58, 21 сентября 2022 разн. история +25 Н Translations:Rule Examples/235/en Новая страница: «Three files are required:» текущая
- 20:58, 21 сентября 2022 разн. история +111 Н Translations:Rule Examples/234/en Новая страница: «The correct but tricky way is to create a new tab in the Configs section with editable settings options fields.» текущая
- 20:58, 21 сентября 2022 разн. история +262 Н Translations:Rule Examples/3/en Новая страница: «An easy way is to do in the defineVirtualDevice() field, make it readonly: false. And it will appear in the web interface in Devices as editable, and the value will be saved in the rules engine. But a complex setup with menus and options cannot be done this way.» текущая
- 20:58, 21 сентября 2022 разн. история −238 Rule Examples/en Новая страница: «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"); } });»
- 20:58, 21 сентября 2022 разн. история +256 Н Translations:Rule Examples/233/en Новая страница: «300px|thumb|right|Example configuration 300px|thumb|right|Example script If you need to manually enter temperature and humidity settings in the interface of the Wiren Board controller.» текущая
- 20:58, 21 сентября 2022 разн. история +36 Н Translations:Rule Examples/135/en Новая страница: «== Custom fields in web interface ==» текущая
- 20:58, 21 сентября 2022 разн. история −237 Rule Examples/en Новая страница: «2. Sending a command»
- 20:58, 21 сентября 2022 разн. история +291 Н Translations:Rule Examples/232/en Новая страница: «trackMqtt("/devices/+/controls/+/meta/error", function(message){ log.info("name: {}, value: {}".format(message.topic, message.value)) if (message.value=="r"){ dev["meta_error_test/topic"] = message.topic; dev["meta_error_test/value"] = message.value; } }); </syntaxhighlight>» текущая
- 20:58, 21 сентября 2022 разн. история +281 Н Translations:Rule Examples/231/en Новая страница: «<syntaxhighlight lang="ecmascript"> defineVirtualDevice("meta_error_test", { title: "Metaerordisplay", cells: { topic: { type: "text", value: "", readonly: true }, value: { type: "text", value: "", readonly: true }, } });» текущая
- 20:58, 21 сентября 2022 разн. история +113 Н Translations:Rule Examples/230/en Новая страница: «== Handling errors when working with serial devices == Implemented by subscribing to all '''meta/error''' topics.» текущая
- 20:57, 21 сентября 2022 разн. история −177 Rule Examples/en Новая страница: «<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"); } });»
- 20:57, 21 сентября 2022 разн. история +44 Н Translations:Rule Examples/229/en Новая страница: «runShellCommand(command); </syntaxhighlight>» текущая
- 20:57, 21 сентября 2022 разн. история +316 Н Translations:Rule Examples/228/en Новая страница: «<syntaxhighlight lang="ecmascript"> varmessage = "Text"; // write your message text var token = "TOKEN"; // replace with bot token var chat_id = CHATID; // replace with your chat_id var command = 'curl -s -X POST https://api.telegram.org/bot{}/sendMessage -d chat_id={} -d text="{}"'.format(token, chat_id, message);» текущая
- 20:57, 21 сентября 2022 разн. история −705 Rule Examples/en Новая страница: «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"); } });»
- 20:57, 21 сентября 2022 разн. история +165 Н Translations:Rule Examples/227/en Новая страница: «== Sending a message via Telegram bot == {{Anchor|telegram}} Messages are sent using [https://core.telegram.org/api#telegram-api Telegram API] via <code>curl</code>.» текущая
- 20:57, 21 сентября 2022 разн. история +18 Н Translations:Rule Examples/134/en Новая страница: «</syntaxhighlight>» текущая
- 20:57, 21 сентября 2022 разн. история +82 Н Translations:Rule Examples/133/en Новая страница: «setTimeout(setup_port, 1000); // set setup_port() running 1 second after starting.» текущая
- 20:57, 21 сентября 2022 разн. история +225 Н Translations:Rule Examples/132/en Новая страница: «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"); } });» текущая
- 20:57, 21 сентября 2022 разн. история +224 Н Translations:Rule Examples/131/en Новая страница: «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"); } });» текущая
- 20:56, 21 сентября 2022 разн. история +132 Н Translations:Rule Examples/130/en Новая страница: «function setup_port() { runShellCommand("stty -F /dev/ttyNSC0 ospeed 9600 ispeed 9600 raw clocal -crtscts -parenb -echo cs8"); }» текущая
- 20:56, 21 сентября 2022 разн. история +197 Н Translations:Rule Examples/129/en Новая страница: «<syntaxhighlight lang="ecmascript"> defineVirtualDevice("rs485_cmd", { title: "Send custom command to RS-485 port", cells: { enabled: { type: "switch", value: false }, } });» текущая
- 20:56, 21 сентября 2022 разн. история +45 Н Translations:Rule Examples/128/en Новая страница: «The full contents of the file with the rules:» текущая
- 20:56, 21 сентября 2022 разн. история +26 Н Translations:Rule Examples/127/en Новая страница: «7. Putting it all together» текущая
- 20:56, 21 сентября 2022 разн. история −279 Rule Examples/en Новая страница: «cells: { 'working on battery' : { type : "switch", value : false, readonly : true }, 'Vin' : { type : "voltage", value : 0 }»
- 20:56, 21 сентября 2022 разн. история +26 Н Translations:Rule Examples/126/en Новая страница: «Note the double shielding.» текущая
- 20:56, 21 сентября 2022 разн. история +18 Н Translations:Rule Examples/125/en Новая страница: «</syntaxhighlight>» текущая
- 20:56, 21 сентября 2022 разн. история +225 Н Translations:Rule Examples/124/en Новая страница: «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"); } });» текущая
- 20:56, 21 сентября 2022 разн. история +260 Н Translations:Rule Examples/123/en Новая страница: «<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"); } });» текущая
- 20:56, 21 сентября 2022 разн. история −100 Rule Examples/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:56, 21 сентября 2022 разн. история +61 Н Translations:Rule Examples/122/en Новая страница: «7. Let's describe the rules for turning the switch on and off» текущая
- 20:55, 21 сентября 2022 разн. история −318 Rule Examples/en Новая страница: «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"); } } });»
- 20:55, 21 сентября 2022 разн. история +18 Н Translations:Rule Examples/121/en Новая страница: «</syntaxhighlight>» текущая
- 20:55, 21 сентября 2022 разн. история +168 Н Translations:Rule Examples/120/en Новая страница: «<syntaxhighlight lang="ecmascript"> function setup_port() { runShellCommand("stty -F /dev/ttyNSC0 ospeed 9600 ispeed 9600 raw clocal -crtscts -parenb -echo cs8"); }» текущая
- 20:55, 21 сентября 2022 разн. история +40 Н Translations:Rule Examples/119/en Новая страница: «6. Add a function to configure the port.» текущая
- 20:55, 21 сентября 2022 разн. история +108 Н Translations:Rule Examples/118/en Новая страница: «A new device "Send custom command to RS-485 port" should appear in the Devices section of the web interface.» текущая
- 20:55, 21 сентября 2022 разн. история −383 Rule Examples/en Новая страница: «<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.» Метки: правка с мобильного устройства правка из мобильной версии
- 20:55, 21 сентября 2022 разн. история +65 Н Translations:Rule Examples/117/en Новая страница: «There should be no error messages in the log (exit via control-c)» текущая
- 20:55, 21 сентября 2022 разн. история +105 Н Translations:Rule Examples/116/en Новая страница: «<pre> root@wirenboard:~# /etc/init.d/wb-rules restart root@wirenboard:~# tail -f /var/log/messages </pre>» текущая
- 20:55, 21 сентября 2022 разн. история +43 Н Translations:Rule Examples/115/en Новая страница: «5. Restart wb-rules and check the operation» текущая
- 20:55, 21 сентября 2022 разн. история +216 Н Translations:Rule Examples/114/en Новая страница: «<syntaxhighlight lang="ecmascript"> defineVirtualDevice("rs485_cmd", { title: "Send custom command to RS-485 port", cells: { enabled: { type: "switch", value: false }, } }); </syntaxhighlight>» текущая
- 20:55, 21 сентября 2022 разн. история +42 Н Translations:Rule Examples/113/en Новая страница: «4. Describe the virtual device in the file» текущая
- 20:54, 21 сентября 2022 разн. история −686 Rule Examples/en Новая страница: «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>»
- 20:54, 21 сентября 2022 разн. история +66 Н Translations:Rule Examples/112/en Новая страница: «<pre> root@wirenboard:~# mcedit /etc/wb-rules/rs485_cmd.js </pre>» текущая
- 20:54, 21 сентября 2022 разн. история +115 Н Translations:Rule Examples/111/en Новая страница: «The file can be edited with vim, nano, or mcedit in an ssh session on the device, or it can be downloaded with SCP.» текущая
- 20:54, 21 сентября 2022 разн. история +88 Н Translations:Rule Examples/110/en Новая страница: «3. Create the new rules file <code>/etc/wb-rules/rs485_cmd.js</code> in the rules engine» текущая
- 20:54, 21 сентября 2022 разн. история +173 Н Translations:Rule Examples/109/en Новая страница: «<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.» текущая