2016-07-16 19:50:38 +00:00
---
layout: documentation
2016-08-05 10:10:20 +00:00
title: Runtime Commands
2016-07-16 19:50:38 +00:00
---
{% include base.html %}
# Runtime Commands
2016-11-12 19:11:54 +00:00
It is possible to query and even change the state of entities like items or things. Therefore the console offers commands in various areas:
2016-07-16 19:50:38 +00:00
2016-11-12 19:11:54 +00:00
{::options toc_levels="3..4"/}
2016-07-16 19:50:38 +00:00
2016-11-12 19:11:54 +00:00
* TOC
{:toc}
2019-12-27 15:18:48 +00:00
::: tip Note
Some of the described commands are executed on the internal database and could break your installation. Please use this functionality only if you know what you are doing!
:::
2016-07-16 19:50:38 +00:00
## Examples
Query an item's state:
```
2020-11-06 18:13:32 +00:00
openhab> openhab:status Heating_GF_Corridor
2016-08-02 09:35:18 +00:00
OFF
2016-07-16 19:50:38 +00:00
```
Changing an item's state:
```
2020-11-06 18:13:32 +00:00
openhab> openhab:send Heating_GF_Corridor ON
2016-07-16 19:50:38 +00:00
Command has been sent successfully.
```
Get help for a command:
```
2020-11-06 18:13:32 +00:00
openhab> help openhab:send
Usage: openhab:send < item > < command > - sends a command for an item
2016-07-16 19:50:38 +00:00
```
2016-11-10 21:18:51 +00:00
### Items
2016-07-16 19:50:38 +00:00
2020-11-06 18:13:32 +00:00
| Command | Description |
|-----------------------------------|---------------------------------------------------------------------|
| `openhab:status <item>` | shows the current status of an item |
| `openhab:update <item> <state>` | sends a status update for an item |
| `openhab:send <item> <command>` | sends a command for an item |
| `openhab:items list [<pattern>]` | lists names and types of all items (matching the pattern, if given) |
| `openhab:items clear` | removes all items |
| `openhab:items remove <itemName>` | removes the given item |
2016-07-16 19:50:38 +00:00
2016-11-10 21:18:51 +00:00
### Discovery
2016-07-16 19:50:38 +00:00
2020-11-06 18:13:32 +00:00
| Command | Description |
|------------------------------------------------------|----------------------------------------------------------------------------|
| `openhab:discovery start <thingTypeUID!bindingID>` | runs a discovery on a given thing type or binding |
| `openhab:discovery enableBackgroundDiscovery <PID>` | enables background discovery for the discovery service with the given PID |
| `openhab:discovery disableBackgroundDiscovery <PID>` | disables background discovery for the discovery service with the given PID |
2016-07-16 19:50:38 +00:00
### Inbox
2020-11-06 18:13:32 +00:00
| Command | Description |
|--------------------------------------------|------------------------------------|
| `openhab:inbox` | lists all current inbox entries |
| `openhab:inbox listignored` | lists all ignored inbox entries |
| `openhab:inbox approve <thingUID> <label>` | creates a thing for an inbox entry |
| `openhab:inbox clear` | clears all current inbox entries |
| `openhab:inbox ignore <thingUID>` | ignores an inbox entry permanently |
2016-07-16 19:50:38 +00:00
### Things
2020-11-06 18:13:32 +00:00
| Command | Description |
|------------------------|----------------------------|
| `openhab:things list` | lists all things |
| `openhab:things clear` | removes all managed things |
2016-07-16 19:50:38 +00:00
2016-11-10 21:18:51 +00:00
### Links
2016-07-16 19:50:38 +00:00
2020-12-11 14:55:25 +00:00
| Command | Description |
|---------------------------------------------------------|----------------------------------------------------------------------------------|
| `openhab:links list` | lists all links |
| `openhab:links link <itemName> <channelUID>` | links an item with to channel |
| `openhab:links unlink <itemName> <thingUID>` | unlinks an item with to channel |
| `openhab:links clear` | removes all managed links |
| `openhab:links orphan <list|purge>` | lists/purges all orphaned - one missing element (either item or channel) - links |
2016-07-16 19:50:38 +00:00
2016-11-10 21:18:51 +00:00
### Audio
2016-07-16 19:50:38 +00:00
2020-11-06 18:13:32 +00:00
| Command | Description |
|-------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|
| `openhab:audio play [<sink>] <filename>` | plays a sound file from the `$OPENHAB_CONF/sounds` folder through the optionally specified audio sink(s) |
| `openhab:audio play <sink> <filename> <volume>` | plays a sound file from the `$OPENHAB_CONF/sounds` folder through the specified audio sink(s) with the specified volume |
| `openhab:audio stream [<sink>] <url>` | streams the sound from the url through the optionally specified audio sink(s) |
| `openhab:audio sources` | lists the audio sources |
| `openhab:audio sinks` | lists the audio sinks |
2016-07-16 19:50:38 +00:00
2016-11-10 21:18:51 +00:00
### Voice
2020-11-06 18:13:32 +00:00
| Command | Description |
|-------------------------------------|------------------------------------------------------------------------|
| `openhab:voice say <text>` | speaks a text on the default audio sink with the default TTS and voice |
| `openhab:voice voices` | lists available voices of the active TTS services |
| `openhab:voice interpret <command>` | interprets a human language command |
2016-11-10 21:18:51 +00:00
### Automation
2020-11-06 18:13:32 +00:00
| Command | Description |
|--------------------------------------|-----------------------------------------------------------|
| `openhab:script <script to execute>` | Executes a script from the `$OPENHAB_CONF/scripts` folder |
2016-11-10 21:18:51 +00:00
### Firmware
2020-11-06 18:13:32 +00:00
| Command | Description |
|---------------------------------------------------------|-------------------------------------------------|
| `openhab:firmware list <thingTypeUID>` | Lists the available firmwares for a thing type. |
| `openhab:firmware status <thingUID>` | lists the firmware status for a thing |
| `openhab:firmware update <thingUID> <firmware version>` | updates the firmware for a thing |