openhab / openhab1-addons

Add-ons for openHAB 1.x
Eclipse Public License 2.0
3.43k stars 1.71k forks source link

[serial] Serial port alias #5869

Open marekhalmo opened 5 years ago

marekhalmo commented 5 years ago

I run openhab on 2 systems, one on windows as a development environment, and one on OpenHabian as production environment.

Current Behavior

My inputs and outputs are on a serial gateway (Arduino as serial device). The data is the same but the port changes depending on the environment i use (e.g. COM5 on widnows and /dev/ttyUSB0 on OpenHabian) This means that i have to keep 2 items configuration files where everything is the same except the port. One will fail due to invalid port number, the other configuration file will run fine

Expected Behavior/Possible Solution

I would like to use an alias as a variable for the serial port name. The alias could be defined in some external file or an item. It would also allow easy configuration change in case your port number changes (e.g. you plug your device to a different serial/usb port)

Is this possible? There are quite few things bound here and i don't want to run duplicates

Your Environment

Development: Windows 10 Production: OpenHabian@RPI