UNPKG

@openhab-ui/setup-and-maintenance

Version:

Configuration and maintenance interface for openHAB

33 lines 11.8 kB
<html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,user-scalable=yes"><link rel="icon" href="img/favicon.ico"><link rel="manifest" href="/manifest.json"><link rel="preload" href="fonts/fa-regular-400.woff2" as="font" type="font/woff2" crossorigin="anonymous"><link rel="preload" href="fonts/fa-solid-900.woff2" as="font" type="font/woff2" crossorigin="anonymous"><link rel="preload" href="fonts/roboto-v18-latin-ext_greek_cyrillic_cyrillic-ext_greek-ext_latin_vietnamese-regular.woff2" as="font" type="font/woff2" crossorigin="anonymous"><link rel="preload" href="fonts/roboto-v18-latin-ext_greek_cyrillic_cyrillic-ext_greek-ext_latin_vietnamese-500.woff2" as="font" type="font/woff2" crossorigin="anonymous"><link rel="preload" href="fonts/roboto-v18-latin-ext_greek_cyrillic_cyrillic-ext_greek-ext_latin_vietnamese-700.woff2" as="font" type="font/woff2" crossorigin="anonymous"><link rel="preload" href="img/pattern_opacity.png" as="image"><link rel="preload" href="img/openhab-logo.svg" as="image"><link rel="stylesheet" href="css/main.css" type="text/css"><link rel="stylesheet" href="css/main_deferred.css" type="text/css"><script type="module" src="js/app.js" async></script><script type="module" src="js/vue.js" async></script><script type="module" src="js/ohcomponents.js" async></script><script type="module" src="js/uicomponents.js" async></script><script type="module">async function applyTheme() { if (localStorage.getItem("darktheme") === "true") { let darkthemecss = document.getElementById("darkthemecss"); if (!darkthemecss) { let head = document.getElementsByTagName('head')[0]; let link = document.createElement('style'); link.id = "darkthemecss"; link.innerHTML = await fetch('css/dark.css').then(d => d.text()); head.appendChild(link); document.dispatchEvent(new Event("themechanged")); } } else { let darkthemecss = document.getElementById("darkthemecss"); if (darkthemecss) darkthemecss.remove(); } if (localStorage.getItem("widetheme") === "true") { document.querySelector("body").classList.add("wide"); } else { document.querySelector("body").classList.remove("wide"); } window.requestAnimationFrame(() => { window.dispatchEvent(new Event("resize")); }); } window.toggleWideTheme = function (event) { event.preventDefault(); let isEnabled = localStorage.getItem("widetheme") === "true"; localStorage.setItem("widetheme", !isEnabled); applyTheme(); } applyTheme(); window.addEventListener('storage', e => { if (e.key == "darktheme") applyTheme(); }); document.addEventListener('themechange', e => applyTheme());</script><title>openHAB - Empowering the smart home</title><title>openHAB - Empowering the smart home</title><link rel="prev" href="tutorial-scenes.html"><link rel="next" href="tutorial-control-ui.html"><link rel="parent" href="index.html"></head><body><link rel="stylesheet" href="css/tutorial.css" type="text/css"><nav><div class="sidebar leftright fixedwrapper"><h4 class="ml-2">Table of content</h4><ol style="text-align: left"><oh-nav-auto-link></oh-nav-auto-link><li><a data-no-reload="nav" href="tutorial.html">Introduction</a></li><li><a data-no-reload="nav" href="tutorial-addons.html">Extend openHAB</a></li><li><a data-no-reload="nav" href="tutorial-conceptional.html">Conceptional overview</a></li><li><a data-no-reload="nav" href="tutorial-things.html">Things &amp; Channels</a></li><li><a data-no-reload="nav" href="tutorial-items.html">Items &amp; Links</a></li><li><a data-no-reload="nav" href="tutorial-scheduler.html">Scheduler</a></li><li><a data-no-reload="nav" href="tutorial-scenes.html">Scenes</a></li><li><a data-no-reload="nav" href="tutorial-rules.html">Rules</a></li><li><a data-no-reload="nav" href="tutorial-control-ui.html">Control interfaces</a></li><li><a data-no-reload="nav" href="tutorial-exercises.html">Excercises</a></li></ol></div></nav><header class="navbarui"><a class="sidebar-button" href="#" onclick="toggleSidebar(event)"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon" style="max-width: 20px;"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg> </a><a class="home" id="home" href="index.html"><div alt="openHAB" class="logo"></div></a><nav><oh-nav-auto-link></oh-nav-auto-link><div><a id="navmaintenance" href="maintenance.html">Maintenance</a></div><div><a id="navbindings" href="bindings.html">Add-ons</a></div><div><a id="navinbox" href="inbox.html" style="display: inline-flex;align-items: center;">Inbox<oh-form-bind adapter="modeladapter_forms/inboxcounter" objectid=""></oh-form-bind><oh-vue-form></oh-vue-form><template><span class="ml-2 badge badge-pill badge-orange">{{inboxcounter}}</span></template></a></div><div><a id="navthings" href="things.html">Things</a></div><div><a id="navitems" href="items.html">Items</a></div><div><a id="navscheduler" href="schedules.html">Scheduler</a></div><div><a id="navscenes" href="scenes.html">Scenes</a></div><div><a id="navrules" href="rules.html">Automation</a></div></nav></header><nav-ajax-page-load></nav-ajax-page-load><div id="alert-area" class="alert-area"></div><template id="alert-template"><div class="alert-box"><div class="alert-content"><slot></slot></div><a class="alert-close no-loader" data-close href="#"></a></div></template><section class="header"><div><oh-prop-bind attribute="label" queryparameter="title"></oh-prop-bind><nav-breadcrumb label="Rules"></nav-breadcrumb></div><span class="link roundbtn" onclick="toggleWideTheme(event)"><i class="fas fa-arrows-alt-h"></i></span><oh-doc-link toggle class="link helpbtn roundbtn" title="Open/Close context help"><i class="fas fa-times"></i><i class="fas fa-question"></i></oh-doc-link></section><main class="tutorial"><h4>Rules</h4><p>A Rule consists of a <b>Name</b>, a unique <b>ID</b> and optional <b>Triggers</b>, <b>Conditions</b> and <b>Actions</b>. Rules are the fundament for <i>Scenes</i> and <i>Time based actions</i>.</p><img class="tutimage" src="img/tutorial/rules.png"><p>A binding or service, installed via the <i>Add-ons</i> screen, might add more Triggers, Conditions or Actions to the table.</p><section class="card border-success p-3 mb-2"><h5>Triggers</h5><p>Defines the events when the Rule will trigger. Triggers may have Outputs. You can connect those to Inputs of Conditions and Actions.</p></section><details class="mb-4"><summary>Some triggers are part of the core installation</summary><table class="table table-striped table-bordered" style="width: initial"><thead><tr><th>Trigger Type</th><th>What it does</th></tr></thead><tbody><tr><td>A trigger channel fires</td><td>Triggers a Rule when a Channel trigger fires such as is used in the Dash Button binding or Astro binding for astronomical events. Both the Channel and the event can be defined.</td></tr><tr><td>An item state changes</td><td>Triggers the Rule when the selected Item changes state. One can optionally define the previous state and new state.</td></tr><tr><td>An item receives a command</td><td>Triggers the Rule when the selected Item receives a command. One can optionally define the command received.</td></tr><tr><td>An item state is updated</td><td>Triggers the Rule when the selected Item receives an update. One can optionally define the update received.</td></tr><tr><td>It is a fixed time of day</td><td>Sets the Rule to trigger at a specific time of day every day.</td></tr><tr><td>The rule is activated</td><td>Triggers when a rule is activated the first time. This causes the Rule to trigger when it is first loaded by OH.</td></tr></tbody></table></details><section class="card border-info p-3 mb-2"><h5>Conditions</h5><p>Defines the conditions under which the Rule will run when triggered. If you define more than one condition, all conditions have to pass.</p></section><details class="mb-4"><summary>Some conditions are part of the core installation</summary><table class="table table-striped table-bordered" style="width: initial"><thead><tr><th>Condition Type</th><th>What it does</th></tr></thead><tbody><tr><td>An item has a given state</td><td>Select the Item, comparison operator, and the value to compare against. For example, MyTemperature Item &gt;= (is greater or equal to) 20.</td></tr><tr><td>A given script* evaluates to true</td><td>A script to execute whose last line evaluates true or false. If the that line is true, the rule will be allowed to run (assuming all the other defined conditions are also true). Currently only JavaScript is supported. Everything available to the Action Script is available here as well. The Script just needs to return true or false.</td></tr><tr><td>It is a certain day of the week</td><td>Allows one to select the day of the week that it must be for the Rule to run. This combined with “it is a fixed time of day” allows one to write Rules that trigger at a certain time on certain days.</td></tr></tbody></table></details><section class="card border-danger p-3 mb-2"><h5>Actions</h5><p>Defines what actions the Rule takes when it runs. Actions are performed in the order they are listed in the <i>Rule</i>. Actions may have Outputs. You can connect those to Inputs of other Actions, that are executed later in the execution order.</p></section><details class="mb-4"><summary>Some actions are part of the core installation</summary><table class="table table-striped table-bordered" style="width: initial"><thead><tr><th>Action Type</th><th>What it does</th></tr></thead><tbody><tr><td>Send a command</td><td>Allows one to send a command to an Item when the Rule runs. This can be very useful for creating links between proxy Items and device Items.</td></tr><tr><td>Run rules</td><td>Allows the triggering of other Rule(s) to run when this Rule triggers.</td></tr><tr><td>Enables or disable rules</td><td>Enable or disable Rule(s). This is useful to create “away mode” type Rule sets as they can be enabled/disabled based on events.</td></tr><tr><td>Execute a given script*</td><td>Define a <i>Script</i> to execute when the Rule runs.</td></tr><tr><td>Play a sound</td><td>Send a sound to the selected audio sink.</td></tr><tr><td>Say something</td><td>Send Text-to-speech to the selected audio sink. The text is statically defined but you can generate dynamic text in a script.</td></tr></tbody></table></details><p>You can list, create and modify Rules on the <a href="rules.html" class="demolink">Rules</a> page.</p><h4>Scripts in Rules</h4><p>With <i>Rules</i>, <i>Profiles</i> and <i>Transformations</i> you can handle about 98% of your automation needs. Very advanced, unusual or complex scenarios might require a scripted solution though.</p><p>A <i>Script</i> is more powerful, but also harder to edit, maintain and process for openHAB. Multiple programming languages are supported: Jython (Python 2.6 dialect), JavaScript, or Groovy (Java dialect).</p></main><footer><nav-buttons class="m-4"></nav-buttons></footer><aside></aside></body></html>