How to get udp binding to work for incoming?

Background: openhab 1.83 running in Ubuntu 16.04 LTS installed from package, talking/listening UDP to an AMX NI-700 running a test program that receives the BDEVxxSLTyyPTzzVw where xx=device, yy=slot, zz=point and w=relay command state, also sends the same format to openhab when a digital input changes state.

Netcat and wireshark show the protocol as working. Sending relay commands works from openhab. the relays change state as expected. however, getting status back from the input points does not. When openhab receives BDEV01SLT04PT01V1 it indicates the input switched on, BDEV01SLT04PT01V0 indicating the input has switched off.

Working relay binding:

Switch AMX_Relay_1 “” {udp=">[ON:‘MAP(’], >[OFF:‘MAP(’]"}

Non-working input binding:

Switch AMX_Input_1 “” {udp="<[ON:‘MAP(’], [OFF:‘MAP(’]"} file


log file from switching states of the input:

2016-08-26 19:39:34.734 [WARN ] [t.i.s.MapTransformationService] - Could not find a mapping for ‘BDEV01SLT04PT01V1’ in the file ‘’.
2016-08-26 19:39:34.735 [WARN ] [t.protocol.internal.UDPBinding] - Can not parse input BDEV01SLT04PT01V1 to match command ON on item AMX_Input_1

2016-08-26 19:39:34.735 [WARN ] [t.i.s.MapTransformationService] - Could not find a mapping for ‘BDEV01SLT04PT01V1’ in the file ‘’.

2016-08-26 19:39:34.736 [WARN ] [t.protocol.internal.UDPBinding] - Can not parse input BDEV01SLT04PT01V1 to match command OFF on item AMX_Input_1

I have tried reversing the key/value pairs in the map file. no change.

Changing the binding from Switch to Contact gives additional errors.

Contact AMX_Input_1 “AMX Input 1” {udp="<[CLOSED:‘MAP(’], [OPEN:‘MAP(’]"}

map file:

`2016-08-26 20:09:14.644 [ERROR] [.service.AbstractActiveService] - Error while executing background thread UDP Refresh Service java.lang.NullPointerException: null
at org.openhab.binding.tcp.protocol.internal.UDPBinding.parseBuffer( ~[na:na]
at org.openhab.binding.tcp.AbstractDatagramChannelBinding.parseChanneledBuffer( ~[na:na]
at org.openhab.binding.tcp.AbstractDatagramChannelBinding.execute( ~[na:na]
at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute( ~[na:na]
at org.openhab.core.service.AbstractActiveService$ ~[na:na]


changed map file to:


gives same error

At this point I am at a loss since I have not seen any similar examples that work to extrapolate from.

What am I missing? the documentation could be better showing how the map file interacts with the binding and which parts of the binding data are passed to the map file and how the return gets used.

Thanks for any help.

For inbound, you don’t have to define a command at all, so please try

Switch AMX_Input_1 "" {udp="<['MAP(']"}

In question of the map-file: left side is input, right side is output, so for inbound item it should be like


If this does not work as expected, try out a string item instead to get the real input (with/without mapping).

Thanks for the quick response.

I changed it to

Switch AMX_Input_1 "" {udp="<['MAP(']"}

and still got similar errors about the map file. fixed the map file to match your post, still not working.

I switched to a string and can successfully receive the string. So I guess I need to write something to parse the string and update the appropriate items. Seems like more steps than should be necessary, but if that is what it takes, then that is what will be done. Now on to figuring that out.

For others that may be interested, the string item that works is:
String AMX_Input_1 "AMX Input 1" { udp="<[*:'REGEX((.*))']" }

the sitemap entry to display this is:
Text item=AMX_Input_1 label="In1 [%s]"

Hi @Grumpy_Oldman,

Can you please tell me what’s in the udp config file? What did you configure there?


Here’s my entire udp.cfg file:

# Port to listen for incoming connections

# Cron-like string to reconnect remote ends, e.g for unstable connection or remote ends
#reconnectcron=0 0 0 * * ?

# Interval between reconnection attempts when recovering from a communication error,
# in seconds

# Queue data whilst recovering from a connection problem (TCP only)

# Maximum buffer size whilst reading incoming data

# Share connections within the Item binding configurations

# Share connections between Item binding configurations

# Share connections between inbound and outbound connections

# Allow masks in ip:port addressing, e.g.* etc

# Pre-amble that will be put in front of data being sent

# Post-amble that will be appended to data being sent

# Perform all write/read (send/receive) operations in a blocking mode, e.g. the binding
# will wait for a reply from the remote end after data has been sent

# timeout, in milliseconds, to wait for a reply when initiating a blocking write/read
#  operation

# Update the status of Items using the response received from the remote end (if the
# remote end sends replies to commands)

# Timeout - or 'refresh interval', in milliseconds, of the worker thread

# Timeout, in milliseconds, to wait when "Selecting" IO channels ready for communication

# Used character set
1 Like