<commit_before># Serial Binding

The Serial binding allows openHAB to communicate over serial ports attached to the openHAB server.

| Item Type | Function |
|-----------|----------|
| Switch    | the item will update its state to `ON` or `OFF` whenever data becomes available on the serial interface (or simply by short-cutting pins 2 and 7 on the RS-232 interface) |
| String    | the item will update its state to a string that is the data received from the serial interface.  Sending a command to the String item will be sent out as data through the serial interface. |
| Number    | the item will receive the RegEx result and attempt to convert the string to a number. |

## Port Configuration Notes

In most cases it will not be needed to perform special steps to access serial ports, but these notes might be helpful.

### Linux Users

* When using **non standard serial ports**, adapt start.sh to have the serial port included. The `java` command line should then include the following parameters:

```
-Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0
```

where `/dev/ttyAMA0` is the path to the serial port. Remember to change all scripts used for startup (debug, automatic start in Linux, etc.).

* A Linux distro might require adding the `openhab` user to the `dialout` group to grant permission to read/write to the serial port.<commit_msg>added systemd permission info (#5853)<commit_after># Serial Binding

The Serial binding allows openHAB to communicate over serial ports attached to the openHAB server.

| Item Type | Function |
|-----------|----------|
| Switch    | the item will update its state to `ON` or `OFF` whenever data becomes available on the serial interface (or simply by short-cutting pins 2 and 7 on the RS-232 interface) |
| String    | the item will update its state to a string that is the data received from the serial interface.  Sending a command to the String item will be sent out as data through the serial interface. |
| Number    | the item will receive the RegEx result and attempt to convert the string to a number. |

## Port Configuration Notes

In most cases it will not be needed to perform special steps to access serial ports, but these notes might be helpful.

### Linux Users

* When using **non standard serial ports**, adapt start.sh to have the serial port included. The `java` command line should then include the following parameters:

```
-Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0
```

where `/dev/ttyAMA0` is the path to the serial port. Remember to change all scripts used for startup (debug, automatic start in Linux, etc.).

* If using a systemd based distribution, then add the Serial Ports parameters to the configuration file at /etc/default/openhab2

* A Linux distro might require adding the `openhab` user to the `dialout` group to grant permission to read/write to the serial port.
{'fraction_non_alphanumeric': 0.07394366197183098, 'fraction_numerical': 0.006690140845070422, 'mean_word_length': 3.7989864864864864, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '821583', 'n_tokens_mistral': 732, 'n_tokens_neox': 695, 'n_words': 425}