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:172.28.85.50:8000:‘MAP(AMX_Relay_1.map)’], >[OFF:172.28.85.50:8000:‘MAP(AMX_Relay_1.map)’]"}
Non-working input binding:
Switch AMX_Input_1 “” {udp="<[ON:172.28.85.50::‘MAP(AMX_Input_1.map)’], [OFF:172.28.85.50::‘MAP(AMX_Input_1.map)’]"}
AMX_Input_1.map file
contents:
ON=BDEV01SLT04PT01V1
OFF=BDEV01SLT04PT01V0
undefined=ON
-=ON
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 ‘AMX_Input_1.map’.
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 ‘AMX_Input_1.map’.
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:172.28.85.50::‘MAP(AMX_Input_1.map)’], [OPEN:172.28.85.50::‘MAP(AMX_Input_1.map)’]"}
map file:
BDEV01SLT04PT01V1=CLOSED
BDEV01SLT04PT01V0=OPEN
undefined=OPEN
-=OPEN
`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(UDPBinding.java:148) ~[na:na]
at org.openhab.binding.tcp.AbstractDatagramChannelBinding.parseChanneledBuffer(AbstractDatagramChannelBinding.java:998) ~[na:na]
at org.openhab.binding.tcp.AbstractDatagramChannelBinding.execute(AbstractDatagramChannelBinding.java:1505) ~[na:na]
at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:156) ~[na:na]
at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:173) ~[na:na]
`
changed map file to:
CLOSED=BDEV01SLT04PT01V1
OPEN=BDEV01SLT04PT01V0
undefined=OPEN
-=OPEN
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.