### Example addons.cfg configuration Source: https://github.com/openhab/openhab-docs/blob/main/configuration/addons.md This is an example of the `addons.cfg` file, which is used to configure add-ons for installation. Specify add-on types and their IDs. ```text ui = basic,habpanel action = pushover binding = astro transformation = jsonpath persistence = influxdb ``` -------------------------------- ### Install and Start openHAB Windows Service Source: https://github.com/openhab/openhab-docs/blob/main/installation/windows.md Commands to install the openHAB service and start it. Run these in an elevated command prompt after configuring the wrapper properties. ```text C:\openHAB\userdata\bin\openHAB-service.bat install net start "openHAB" ``` -------------------------------- ### Launch openHAB Source: https://github.com/openhab/openhab-docs/blob/main/installation/macos.md Start openHAB by typing its installed package name in the terminal. ```shell openhab # OR # openhab-milestone ``` -------------------------------- ### Install Bundle from URI Source: https://github.com/openhab/openhab-docs/blob/main/administration/bundles.md Use `bundle:install` to install a bundle directly from a web URI. This is the recommended method for installing bundles. ```text openhab> bundle:install https://github.com/myrepy/my-binding/raw/main/org.openhab.binding.my-5.0.0-SNAPSHOT.jar openhab> bundle:list | grep My 303 | Active | 80 | 5.0.0.202505050505 | openHAB Add-ons :: Bundles :: My Binding ``` -------------------------------- ### Start a Bundle Source: https://github.com/openhab/openhab-docs/blob/main/administration/bundles.md Use the `bundle:start` command followed by the bundle ID to start a specific bundle. Check the status with `bundle:list`. ```text openhab> bundle:start 209 openhab> bundle:list ... 209 | Active | 80 | 5.0.0 | openHAB Add-ons :: Bundles :: Network Binding ``` -------------------------------- ### Install openHAB Service Wrapper Source: https://github.com/openhab/openhab-docs/blob/main/installation/windows.md Installs the necessary service wrapper feature and then installs the openHAB service itself. This is a prerequisite for running openHAB as a Windows service. ```shell feature:install service-wrapper wrapper:install --name "openHAB" --display "openHAB" --description "openHAB Service" ``` -------------------------------- ### openHAB Runtime Launch Example Source: https://github.com/openhab/openhab-docs/blob/main/installation/macos.md Example output showing the openHAB runtime launching and the prompt appearing after execution. ```shell $ ./start.sh Launching the openHAB runtime... _ _ _ ____ ___ ___ ___ ___ | | | | / \ | __ ) / _ \ / _ \ / _ \ / _ \ | |_| | / _ \ | _ \ | (_) | (_) | __/| | | || _ | / ___ \ | |_) ) \___/| __/ \___/|_| |_||_| |_|/_/ \_\|____/ |_| 5.0.0 - Release Build Use '' for a list of available commands and '[cmd] --help' for help on a specific command. To exit, use '' or 'logout'. openhab> ``` -------------------------------- ### Example: Start Wake Up Light on Sunrise Source: https://github.com/openhab/openhab-docs/blob/main/configuration/rules-dsl.md An example rule that triggers an action when the sun rises, using a specific channel event. ```java rule "Start wake up light on sunrise" when Channel "astro:sun:home:rise#event" triggered START then ... end ``` -------------------------------- ### Basic Sitemap Definition Example Source: https://github.com/openhab/openhab-docs/blob/main/ui/sitemaps.md Illustrates a typical Sitemap definition, including frames, text elements, switches, groups, and selections with mappings. This example can be used as a starting point for personal home setups. ```java sitemap demo label="My home automation" { Frame label="Date" { Text item=Date } Frame label="Demo" { Switch item=Lights icon="light" Text item=LR_Temperature label="Livingroom [%.1f °C]" Group item=Heating Text item=LR_Multimedia_Summary label="Multimedia [%s]" staticIcon="video" { Selection item=LR_TV_Channel mappings=[0="off", 1="DasErste", 2="BBC One", 3="Cartoon Network"] Slider item=LR_TV_Volume } } } ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/openhab/openhab-docs/blob/main/README.md Run this command once to install all the necessary Node.js dependencies for building the documentation. ```shell npm install ``` -------------------------------- ### Example of available add-ons list Source: https://github.com/openhab/openhab-docs/blob/main/configuration/addons.md This is an example output from the `feature:list | grep ^openhab` command, showing available add-ons with their versions and status. ```text ... openhab-binding-mqtt | 5.0.0 | | Started | openhab-addons-5.0.0 | MQTT Binding openhab-binding-netatmo | 5.0.0 | | Started | openhab-addons-5.0.0 | Netatmo Binding openhab-binding-onewire | 5.0.0 | | Uninstalled | openhab-addons-5.0.0 | OneWire Binding ... openhab-binding-network | 5.0.0 | | Uninstalled | openhab-addons-5.0.0 | Network Binding ... ``` -------------------------------- ### Install apache2-utils Source: https://github.com/openhab/openhab-docs/blob/main/installation/reverse-proxy.md Installs the necessary utility for creating password files. ```shell sudo apt-get install apache2-utils ``` -------------------------------- ### Install openHAB Package Source: https://github.com/openhab/openhab-docs/blob/main/installation/openbsd.md Installs the main openHAB package using the pkg_add command. ```shell # pkg_add openhab ``` -------------------------------- ### Fresh Install openHAB via APT Source: https://github.com/openhab/openhab-docs/blob/main/configuration/migration/index.md Performs a fresh installation of openHAB using APT, first purging the existing openHAB2 installation. ```shell sudo apt purge openhab2 sudo apt update sudo apt install openhab ``` -------------------------------- ### Get OpenHAB Installation Information Source: https://github.com/openhab/openhab-docs/blob/main/installation/index.md Use the `openhab-cli info` command in the console to retrieve details about your OpenHAB installation, including version, user, directories, and URLs. This is useful for understanding file paths and configuration locations. ```shell openhab-cli info ``` -------------------------------- ### Complete Persistence Configuration Example Source: https://github.com/openhab/openhab-docs/blob/main/configuration/persistence.md A comprehensive example of a persistence configuration file, demonstrating strategies, filters, and item-specific persistence rules. ```java // persistence strategies have a name and definition and are referred to in the "Items" section Strategies { everyHour : "0 0 * * * ?" everyDay : "0 0 0 * * ?" } Filters { fivepercent : > % 5 atMostOnceAMinute : T 1 m } /* * Each line in this section defines for which Item(s) which strategy(ies) should be applied. * You can list single items, use "*" for all items or "groupitem*" for all members of a group * Item (excl. the group Item itself). */ Items { // persist the Item state of Heating_Mode and Notifications_Active on every change and restore them from the db at startup Heating_Mode, Notifications_Active: strategy = everyChange, restoreOnStartup // additionally, persist all temperature and weather values every hour Temperature*, Weather* : strategy = everyHour // persist all items every day, except items in the weather group and the cellar temperature *, !Weather*, !CellarTemperature: strategy = everyDay } ``` -------------------------------- ### Start and Enable openHAB Service Source: https://github.com/openhab/openhab-docs/blob/main/installation/openbsd.md Starts the openHAB service, checks its status, and enables it to run automatically at system startup. ```shell # rcctl start openhab # rcctl check openhab # rcctl enable openhab ``` -------------------------------- ### Basic Color Examples Source: https://github.com/openhab/openhab-docs/blob/main/ui/sitemaps.md Examples showing equivalent ways to set label, value, and icon colors based on item states. ```java Text item=Temperature labelcolor=[>0="blue"] valuecolor=[22="green"] iconcolor=[22="green"] ``` ```java Text item=Temperature labelcolor=[>0="blue"] valuecolor=[==22="green"] iconcolor=[==22="green"] ``` ```java Text item=Temperature labelcolor=[Temperature>0="blue"] valuecolor=[Temperature==22="green"] iconcolor=[Temperature==22="green"] ``` -------------------------------- ### Start openHAB as a Homebrew Service Source: https://github.com/openhab/openhab-docs/blob/main/installation/macos.md Automatically start openHAB on user login by running it as a Homebrew service. ```shell brew services start openhab # OR # brew services start openhab-milestone ``` -------------------------------- ### Conditional Visibility Examples Source: https://github.com/openhab/openhab-docs/blob/main/ui/sitemaps.md Examples demonstrating how to set visibility based on item states. The item will be visible if any condition is true. ```java Text item=BatteryWarning visibility=[Battery_Level<30] ``` ```java Switch item=CinemaLight label="Cinema light" visibility=[TV_Power==ON] ``` ```java Switch item=LawnSprinkler visibility=[Day_Time=="Morning", Day_Time=="Afternoon", Temperature>19] ``` ```java Switch item=LawnSprinkler visibility=[Day_Time=="Morning" AND Temperature>19] ``` -------------------------------- ### Install NGINX Source: https://github.com/openhab/openhab-docs/blob/main/installation/reverse-proxy.md Installs the NGINX web server on Debian-based systems. This is the first step to setting up a reverse proxy. ```shell sudo apt-get update && sudo apt-get install nginx ``` -------------------------------- ### Image Element Examples Source: https://github.com/openhab/openhab-docs/blob/main/ui/sitemaps.md Examples of Image elements, showing how to display an image from a URL and a snapshot from an IP camera with a refresh interval. ```java Image url="https://raw.githubusercontent.com/wiki/openhab/openhab/images/features.png" // display a snapshot image from an IP camera, using refresh parameter to get updated images Image url="https://192.168.1.203:8080/?action=snapshot" refresh=10000 ``` -------------------------------- ### Start and Check Status on SysVinit Systems Source: https://github.com/openhab/openhab-docs/blob/main/installation/linux.md Start the openHAB service and check its status on systems using SysVinit. This also includes registering the service for automatic startup. ```shell sudo /etc/init.d/openhab start sudo /etc/init.d/openhab status sudo update-rc.d openhab defaults ``` -------------------------------- ### List Installation Contents Source: https://github.com/openhab/openhab-docs/blob/main/installation/macos.md Verifies the successful extraction of the openHAB archive by listing the contents of the installation directory. ```shell user:openhab $ ls LICENSE.TXT conf start.bat start_debug.bat userdata addons runtime start.sh start_debug.sh ``` -------------------------------- ### Install an add-on via openHAB console Source: https://github.com/openhab/openhab-docs/blob/main/configuration/addons.md This command installs a specified add-on in the background using its `id`. Replace `` with the actual add-on identifier. ```sh openhab:addons install ``` -------------------------------- ### View openHAB Logs (Manual Install) Source: https://github.com/openhab/openhab-docs/blob/main/installation/linux.md Continuously monitor the openHAB log and events files for manual installations. This is useful for real-time debugging. ```shell tail -f /opt/openhab/userdata/logs/openhab.log -f /opt/openhab/userdata/logs/events.log ``` -------------------------------- ### Serve Documentation Preview Locally Source: https://github.com/openhab/openhab-docs/blob/main/README.md Build and serve a local preview of the documentation. This command starts a development server, typically accessible at http://localhost:8080/docs. ```shell npm run serve-preview ``` -------------------------------- ### Install openHAB Add-ons Package Source: https://github.com/openhab/openhab-docs/blob/main/installation/linux.md Installs the package containing all available openHAB add-ons. This is useful if you plan to use openHAB offline or want all add-ons readily available. ```shell sudo apt-get install openhab-addons ``` -------------------------------- ### Initialize values on System Startup Source: https://github.com/openhab/openhab-docs/blob/main/configuration/rules-dsl.md Use the 'System started' trigger to initialize item states when openHAB starts. This is useful for setting default values if they are not already present. ```java rule "Speedtest init" when System started then if (Speedtest_Summary.state == NULL || Speedtest_Summary.state == "") Speedtest_Summary.postUpdate("unknown") end ``` -------------------------------- ### Trigger rule on start level reload Source: https://github.com/openhab/openhab-docs/blob/main/configuration/rules-dsl.md This example demonstrates a rule triggered by 'System reached start level 70'. It includes logging to show behavior during rule editing and saving, noting that start levels are typically reached only once. ```java rule "Start level reload" when System reached start level 70 then logInfo("StartLevelTest", "triggered a second time, if active rule being edited and saved another time.") logInfo("StartLevelTest", "You won´t realize this behaviour under regular run conditions, each start level is reached exactly once.") end ``` -------------------------------- ### Initialize Light Model with Capabilities and Configuration Source: https://github.com/openhab/openhab-docs/blob/main/developers/utils/tools.md Sets up the light state machine with default capabilities and configuration parameters. Use this to define the lighting model's behavior, such as RGB data type, minimum brightness, step size, and color temperature range. ```java public class LightModelHandler extends BaseThingHandler { // initialize the light model with default capabilities and parameters private final LightModel model = new LightModel(); @Override public void initialize() { // Set up the light state machine capabilities. model.configSetLightCapabilities(LightCapabilities.COLOR_WITH_COLOR_TEMPERATURE); // Optionally: set up the light state machine configuration parameters. // These would typically be read from the thing configuration or read from the remote device. model.configSetRgbDataType(RgbDataType.RGB_NO_BRIGHTNESS); // RGB data type model.configSetMinimumOnBrightness(2); // minimum brightness level when on 2% model.configSetIncreaseDecreaseStep(10); // step size for increase/decrease commands model.configSetMirekControlCoolest(153); // color temperature control range model.configSetMirekControlWarmest(500); // color temperature control range // Optionally: if the light has warm and cool white LEDS then set up their LED color temperatures. // These would typically be read from the thing configuration or read from the remote device. model.configSetMirekCoolWhiteLED(153); model.configSetMirekWarmWhiteLED(500); // now set the status to UNKNOWN to indicate that we are initialized updateStatus(ThingStatus.UNKNOWN); } @Override public void handleCommand(ChannelUID channelUID, Command command) { // update the model state based on a command from OpenHAB model.handleCommand(command); // or if it is a color temperature command model.handleColorTemperatureCommand(command); sendBindingSpecificCommandToUpdateRemoteLight( .. model.getOnOff() or .. model.getBrightness() or .. model.getColor() or .. model.getColorTemperature() or .. model.getColorTemperaturePercent() or .. model.getRGBx() or .. model.getXY() or ); } // method that sends the updated state data to the remote light private void sendBindingSpecificCommandToUpdateRemoteLight(..) { // binding specific code } // method that receives data from remote light, and updates the model, and then OH private void receiveBindingSpecificDataFromRemoteLight(double... receivedData) { // update the model state based on the data received from the remote model.setBrightness(receivedData[0]); model.setRGBx(receivedData[1], receivedData[2], receivedData[3]); model.setMirek(receivedData[4]); // update the OH channels with the new state values updateState(onOffChannelUID, model.getOnOff()); updateState(brightnessChannelUID, model.getBrightness()); updateState(colorChannelUID, model.getColor()); updateState(colorTemperatureChannelUID, model.getColorTemperature()); } } ``` -------------------------------- ### HTTP GET Request with Special Characters in Query Parameters Source: https://github.com/openhab/openhab-docs/blob/main/configuration/blockly/rules-blockly-http.md Example of constructing a GET request with query parameters where one parameter's value contains special characters that require URI encoding. The block handles the encoding automatically. ```Blockly GET http://example.com/api Query: { param1: "EncodedValueWithSpecialCharacters->!" param2: "value2" } ``` -------------------------------- ### JSR223 Script Directory Structure Example Source: https://github.com/openhab/openhab-docs/blob/main/configuration/jsr223.md Illustrates a typical directory structure for JSR223 scripts, including subdirectories and files with specific start levels. ```text ├── automation/jsr223 │ ├── dir1 │ │ ├── script_a.py │ │ └── script_b.py │ ├── script.sl38.py │ ├── sl30 │ │ ├── script_x.py │ │ └── script_y.py │ └── script.py ``` -------------------------------- ### Java Security Error Example Source: https://github.com/openhab/openhab-docs/blob/main/installation/synology.md This error indicates that an unsupported Java version (like OpenJDK) is being used, which lacks necessary cryptographic algorithms. Ensure Oracle Java is installed. ```text java.security.NoSuchAlgorithmException: EC KeyPairGenerator not available ``` -------------------------------- ### Example Group Item Hierarchy Source: https://github.com/openhab/openhab-docs/blob/main/configuration/items.md Illustrates the creation of a hierarchical structure for Group Items, demonstrating both location and functional perspectives. This setup helps in organizing and managing related items. ```java // Overarching group Group House // Location perspective Group GroundFloor (House) Group Livingroom (GroundFloor) // Functional perspective Group Sensors (House) Group Temperatures (Sensors) // Example Item Number:Temperature Livingroom_Temperature "Temperature [%.1f °C]" (Livingroom, Temperatures) ``` -------------------------------- ### Install Ruby Version with RVM Source: https://github.com/openhab/openhab-docs/blob/main/README.md Install a specific Ruby version using Ruby Version Manager (RVM) if it is not already installed. ```shell rvm install ruby-3.3.2 ``` -------------------------------- ### Install NodeJS Version with NVM Source: https://github.com/openhab/openhab-docs/blob/main/README.md Install a specific NodeJS version using Node Version Manager (nvm) if it is not already installed. ```shell nvm install 16.20.1 ``` -------------------------------- ### Item Configuration with Profile Source: https://github.com/openhab/openhab-docs/blob/main/configuration/items.md This is a general syntax example showing how to configure an item with a specific profile and its parameters. The profile and its parameters are defined within square brackets after the channel definition. ```java MyItem { channel="::MyThing:myChannel"[profile="system:", ="MyValue", ...]}} ``` -------------------------------- ### Basic YAML Configuration Example Source: https://github.com/openhab/openhab-docs/blob/main/configuration/yaml/index.md This example demonstrates the general structure of an openHAB YAML configuration file, including version, tags, things, items, widgets, and pages. ```yaml version: 1 # All the sections below are optional and may appear in any order tags: Equipment_Curtain: label: Curtain Location_Indoor_Room_HomeCinemaRoom: label: Home Cinema Room description: The room containing my home cinema system synonyms: - Home theater room - TV room - Movie room things: lgwebos:WebOSTV:3aab9eea-953b-4272-bdbd-f0cd0ecf4a46: config: host: 192.168.2.119 key: 6ef1dff6c7c936c8dc5056fc85ea3aef macAddress: 3c:cd:93:c2:20:e0 items: TV_Power: type: Switch label: TV Power icon: television autoupdate: false channel: lgwebos:WebOSTV:3aab9eea-953b-4272-bdbd-f0cd0ecf4a46:power TV_Volume: type: Dimmer label: Volume # Label must not contain a format pattern format: "%d" # Values starting with a percent sign must be quoted channel: lgwebos:WebOSTV:3aab9eea-953b-4272-bdbd-f0cd0ecf4a46:volume widgets: custom-clock-card: component: oh-clock-card pages: livingroom-overview: component: oh-layout-page config: label: Living Room slots: default: - component: widget:custom-clock-card ``` -------------------------------- ### Create openHAB System User (Fedora Example) Source: https://github.com/openhab/openhab-docs/blob/main/installation/linux.md An alternative command for creating the openHAB system user, specifically for Fedora-based distributions. Always check your distribution's documentation for exact syntax. ```shell sudo adduser --system --no-create-home --user-group --disabled-login openhab ``` -------------------------------- ### Launch Demo App with Maven Source: https://github.com/openhab/openhab-docs/blob/main/developers/ide/generic.md Launch the openHAB demo application using the configuration in app.bndrun. Access the running instance at http://localhost:8080/. ```bash mvn bnd-run:run ``` -------------------------------- ### Install Arch Linux Build Tools Source: https://github.com/openhab/openhab-docs/blob/main/installation/linux.md Install necessary tools for building packages from source on Arch Linux. The '--needed' flag ensures only missing packages are installed. ```shell sudo pacman -Sy --needed base-devel ``` -------------------------------- ### Using the help command in OpenHAB Console Source: https://github.com/openhab/openhab-docs/blob/main/administration/console.md The 'help' command lists all available commands or provides details on a specific command or subsystem. ```text openhab> help ... openhab> help bundle ... openhab> help bundle:stop ... ``` -------------------------------- ### Execute rule after specific start level Source: https://github.com/openhab/openhab-docs/blob/main/configuration/rules-dsl.md Trigger a rule when openHAB reaches a specific start level. This is useful for executing tasks that depend on services initialized at earlier start levels. ```java rule "Speedtest update" when System reached start level 50 then logInfo("Speedtest", "We now have the following state right after startup: " + Speedtest_Summary.state) end ``` -------------------------------- ### Build Add-on with Maven Source: https://github.com/openhab/openhab-docs/blob/main/developers/addons/index.md Run this command from the repository root to build your add-on and ensure the build works smoothly. This step can take approximately 30 minutes. ```bash mvn clean install ``` -------------------------------- ### Mapview Element Example Source: https://github.com/openhab/openhab-docs/blob/main/ui/sitemaps.md A concrete example of a Mapview element, specifying the item and height. ```java Mapview item=Demo_Location height=5 ``` -------------------------------- ### Install Latest openHAB Version Source: https://github.com/openhab/openhab-docs/blob/main/installation/linux.md Installs the latest available version of openHAB from the configured repositories. ```shell sudo apt-get install openhab ``` -------------------------------- ### Component Configuration Example Source: https://github.com/openhab/openhab-docs/blob/main/ui/personal-widgets.md Demonstrates how to configure a component by adding a 'config' section to its YAML definition. This is used to specify or modify aspects of a component to suit specific needs. ```yaml - component: oh-toggle config: item: mySwitchItem ``` -------------------------------- ### Launch openHAB Source: https://github.com/openhab/openhab-docs/blob/main/installation/macos.md Starts the openHAB application from its root directory using the provided startup script. The first launch may take some time. ```shell ./start.sh ``` -------------------------------- ### Video Element Example Source: https://github.com/openhab/openhab-docs/blob/main/ui/sitemaps.md A concrete example of a Video element, specifying the URL of the video to embed. ```java Video url="https://demo.openhab.org/Hue.m4v" ``` -------------------------------- ### Install OpenSSL Source: https://github.com/openhab/openhab-docs/blob/main/installation/reverse-proxy.md Install the OpenSSL package on Debian-based Linux distributions. This is a prerequisite for generating self-signed certificates. ```shell sudo apt-get install openssl ``` -------------------------------- ### Create openHAB Backup (Default Path) Source: https://github.com/openhab/openhab-docs/blob/main/installation/macos.md Creates a backup of the openHAB system, saving the configuration to a zip file in the default '~/openhab/backups' directory. ```shell sudo $OPENHAB_RUNTIME/bin/backup ``` -------------------------------- ### Install Samba Source: https://github.com/openhab/openhab-docs/blob/main/installation/linux.md Installs the Samba server and common utilities required for network file sharing on Debian-based systems. ```shell sudo apt-get install samba samba-common-bin ``` -------------------------------- ### Example Configuration Description XML Source: https://github.com/openhab/openhab-docs/blob/main/developers/addons/config-xml.md This XML file defines configuration parameters and groups for an openHAB binding. It includes settings for connection and authentication. ```xml Connection settings. Authentication settings. network-address Network address of the device. 80,443,8080 password ``` -------------------------------- ### Install openHAB Add-ons Package Source: https://github.com/openhab/openhab-docs/blob/main/installation/openbsd.md Installs the openHAB add-ons package, which includes additional components that can be downloaded on demand. ```shell # pkg_add openhab-addons ``` -------------------------------- ### OSGi Bundle Manifest Example Source: https://github.com/openhab/openhab-docs/blob/main/developers/osgi/osgi.md A basic OSGi bundle manifest file demonstrating essential headers for identification, versioning, and package management. ```xml Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Example Plug-in Bundle-SymbolicName: com.example.myosgi; singleton:=true Bundle-Version: 1.0.0 Bundle-RequiredExecutionEnvironment: JavaSE-11 Import-Package: org.example.required Export-Package: org.example.provided ``` -------------------------------- ### Restore openHAB 2 Installation Source: https://github.com/openhab/openhab-docs/blob/main/configuration/migration/index.md Use this command to restore a previously created backup of your openHAB 2 installation. ```bash openhab-cli restore [filepath]/[filename].zip ``` -------------------------------- ### Equinox Configuration for Command Line Startup Source: https://github.com/openhab/openhab-docs/blob/main/developers/osgi/equinox.md This configuration file specifies the bundles to be loaded and runtime options for the Equinox OSGi framework when launched from the command line. Ensure all listed bundles are present in your Maven cache or local repository. ```ini osgi.bundles=\ org.eclipse.core.runtime,\ org.eclipse.equinox.common,\ org.eclipse.core.jobs,\ org.eclipse.equinox.registry,\ org.eclipse.equinox.preferences,\ org.eclipse.core.contenttype,\ org.eclipse.equinox.app,\ org.eclipse.equinox.console,\ org.apache.felix.gogo.runtime,\ org.apache.felix.gogo.shell,\ org.apache.felix.gogo.command eclipse.ignoreApp=true eclipse.consoleLog=true ``` -------------------------------- ### List All Bundles Source: https://github.com/openhab/openhab-docs/blob/main/administration/bundles.md Displays all installed bundles with their state, level, version, and name. Useful for an overview of the running system. ```text openhab> bundle:list START LEVEL 100 , List Threshold: 50 ID │ State │ Lvl │ Version │ Name ────┼────────┼─────┼───────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────── 30 │ Active │ 80 │ 2.20.0 │ Jackson-annotations 31 │ Active │ 80 │ 2.20.1 │ Jackson-core 32 │ Active │ 80 │ 2.20.1 │ jackson-databind ... 161 │ Active │ 80 │ 5.2.0.202601040252 │ openHAB Core :: Bundles :: JAAS Authentication 162 │ Active │ 80 │ 5.2.0.202601040254 │ openHAB Core :: Bundles :: OAuth2Client 163 │ Active │ 80 │ 5.2.0.202601040258 │ openHAB Core :: Bundles :: Automation 164 │ Active │ 80 │ 5.2.0.202601040300 │ openHAB Core :: Bundles :: Automation Media Modules ... 285 │ Active │ 80 │ 5.2.0.202601040327 │ openHAB Add-ons :: Bundles :: Automation :: JavaScript Scripting 286 │ Active │ 80 │ 5.2.0.202601040331 │ openHAB Add-ons :: Bundles :: Astro Binding 287 │ Active │ 80 │ 5.2.0.202601040339 │ openHAB Add-ons :: Bundles :: Energi Data Service Binding 288 │ Active │ 80 │ 5.2.0.202601040345 │ openHAB Add-ons :: Bundles :: MQTT Broker Binding ``` -------------------------------- ### Example YAML Widget Definitions Source: https://github.com/openhab/openhab-docs/blob/main/configuration/yaml/widgets.md This example demonstrates how to define custom clock and switch widgets using YAML. It shows the basic structure for specifying the widget component and configuration. ```yaml version: 1 widgets: custom-clock-card: component: oh-clock-card custom-switch-card: component: oh-toggle-card config: title: Light Switch item: LivingRoom_Light ``` -------------------------------- ### Basic Filters Syntax Example Source: https://github.com/openhab/openhab-docs/blob/main/configuration/persistence.md This example shows the general syntax for defining filters within the Filters block. ```java Filters { : : ... } ``` -------------------------------- ### Example Item Definitions Source: https://github.com/openhab/openhab-docs/blob/main/configuration/items.md These examples demonstrate defining different types of items, including Switches, Strings, and Numbers with specific formatting, icons, groups, tags, and binding configurations. ```java Switch Kitchen_Light "Kitchen Light" {channel="mqtt:topic:..." } ``` ```java String Bedroom_Sonos_CurrentTitle "Title [%s]" (gBedRoom) {channel="sonos:..."} ``` ```java Number:Power Bathroom_WashingMachine_Power "Power [%.0f W]" (gPower) {channel="homematic:..."} ``` ```java Number:Temperature Livingroom_Temperature "Temperature [%.1f °C]" (gTemperature, gLivingroom) ["Setpoint", "Temperature"] {knx="1/0/15+0/0/15"} ``` -------------------------------- ### Install Specific openHAB Version Source: https://github.com/openhab/openhab-docs/blob/main/installation/linux.md Installs a specific version of openHAB and its add-ons package by explicitly naming the version number. ```shell sudo apt install openhab=5.0.0 sudo apt install openhab-addons=5.0.0 ``` -------------------------------- ### Create and Navigate to openHAB Directory Source: https://github.com/openhab/openhab-docs/blob/main/installation/macos.md Creates a directory named 'openhab' in the user's home directory and changes the current directory to it. Ensure the path does not contain spaces. ```shell mkdir ~/openhab cd ~/openhab ``` -------------------------------- ### Install Latest Stable openHAB Source: https://github.com/openhab/openhab-docs/blob/main/installation/macos.md Installs the latest official and thoroughly tested stable release of openHAB using Homebrew. ```shell brew install openhab ``` -------------------------------- ### Group Element Usage Example Source: https://github.com/openhab/openhab-docs/blob/main/ui/sitemaps.md An example of a Group element in an OpenHAB sitemap, displaying room temperatures with specific formatting. ```java Group item=gTemperature label="Room Temperatures [%.1f °C]" ``` -------------------------------- ### Multi Binding / Channel Linkage Example Source: https://github.com/openhab/openhab-docs/blob/main/configuration/items.md Demonstrates linking a single Item to multiple Channels from different Bindings. Commands and updates are combined. ```java Switch Office_PC { channel="lgwebos:WebOSTV:01dd3ac4-62f4-7505-208b-12345679", channel="network:servicedevice:6d5de4e65d" } ``` -------------------------------- ### Send HTTP GET Request Source: https://github.com/openhab/openhab-docs/blob/main/configuration/actions.md Sends a GET request to a specified URL. Can include custom headers and a timeout in milliseconds. ```javascript val headers = newHashMap("Cache-control" -> "no-cache") val output = sendHttpGetRequest("https://example.com/?id=1", headers, 1000) ``` -------------------------------- ### OpenHAB Console Auto-completion Example Source: https://github.com/openhab/openhab-docs/blob/main/administration/console.md Demonstrates auto-completion in the OpenHAB console. Typing a partial command and pressing TAB suggests and completes commands. ```text openhab> bundle bundle bundle:capabilities bundle:classes bundle:diag bundle:dynamic-import bundle:find-class bundle:headers bundle:id bundle:info bundle:install bundle:list bundle:load-test bundle:refresh bundle:requirements bundle:resolve bundle:restart bundle:services bundle:start bundle:start-level bundle:stop bundle:tree-show bundle:uninstall bundle:update bundle:watch ``` -------------------------------- ### Install Specific openHAB Version Source: https://github.com/openhab/openhab-docs/blob/main/installation/macos.md Install a specific stable version of openHAB using Git to checkout a tagged formula version. ```shell git -C $(brew --prefix)/Library/Taps/openhab/homebrew-openhab checkout v5.0 Formula/openhab.rb ``` -------------------------------- ### List Available openHAB Versions Source: https://github.com/openhab/openhab-docs/blob/main/installation/linux.md Lists all available versions of the openHAB package that can be installed via apt. ```shell apt list -a openhab ``` -------------------------------- ### View openHAB Homebrew Info Source: https://github.com/openhab/openhab-docs/blob/main/installation/macos.md Displays detailed information about the installed openHAB or openHAB-milestone package, including add-on installation instructions. ```shell brew info openhab ``` ```shell brew info openhab-milestone ```