openhab-addons/bundles/org.openhab.binding.serialbutton
Holger Friedrich 533cc666ab
Apply spotless after release (#16097)
* Apply spotless after release
* itests: resolve bundles

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
2023-12-22 23:30:38 +01:00
..
src/main Java 17 features (N-S) (#15565) 2023-09-13 08:03:31 +02:00
NOTICE
pom.xml Apply spotless after release (#16097) 2023-12-22 23:30:38 +01:00
README.md [Documentation] Markdown improvements n to s (#13948) 2022-12-14 16:52:43 +01:00

Serial Button Binding

This is a binding for probably one of the simplest devices possible: A simple push button which short-cuts two pins on a serial port.

Supported Things

The binding defines a single thing type called button.

A button requires the single configuration parameter port, which specifies the serial port that should be used.

The only available channel is a SYSTEM_RAWBUTTON channel called button, which emits PRESSED events (no RELEASED events though) whenever data is available on the serial port (which will be read and discarded).

The use case is simple: Connect any push button to pins 2 and 7 of an RS-232 interface as short-cutting those will signal that data is available. Using the default toggle profile, this means that you can use this channel to toggle any Switch item through the button.

Full Example

demo.things:

serialbutton:button:mybutton "My Button" [ port="/dev/ttyS0" ]

demo.items:

Switch MyLight { channel="serialbutton:button:mybutton:button" }

Note: This is a trigger channel, so you will most likely bind a second (state) channel to your item, which will control your physical light, so you might end up with the following, if you want to use your button with a Hue bulb:

Switch MyLight { channel="hue:0210:1:bulb1:color,serialbutton:button:mybutton:button" }

demo.sitemap:

sitemap demo label="Main Menu"
{
    Frame {
        Switch item=MyLight label="My Light"
    }
}