TCP Binding and Transformation (looking for best practice)

I use the TCP binding to speak with my Vantage lighting system. I probably have 50+ Vantage switches located throughout my home. Of those 50, probably 15 or so are tied into items within OH.

The Vantage lighting switches are addressed using a toggle. So for the example item below, VSW!1 98 2 6 toggles the switch both on and off.

A typical Vantage item looks like this…

KITCHEN

Switch Kitchen "Kitchen" [ "Switchable" ] {tcp=">[ON:10.X.X.X:3040:'MAP(kitchen.map)'],>[OFF:10.X.X.X:3040:'MAP(kitchen.map)']"}

Kitchen.map looks like this…

ON=VSW!1 98 2 6\r
OFF=VSW!1 98 2 6\r

Now that I’ve given you the background information, here’s my challenge. For every button press of the physical vantage wall switches the TCP binding hears the button press and attempts to match it via a transform file (see log below). Now remember I only have 15 switches defined as items so as you can imagine there are quite a few button pushes that go on throughout each and every day which makes for large log files.

2018-10-02 23:10:55.071 [WARN ] [rm.AbstractFileTransformationService] - Could not transform 'SW 1 121 255 1
' with the file 'bar.map' : Target value not found in map for 'SW 1 121 255 1
'
2018-10-02 23:10:55.072 [WARN ] [rm.AbstractFileTransformationService] - Could not transform 'SW 1 121 255 1
' with the file 'bar.map' : Target value not found in map for 'SW 1 121 255 1
'
2018-10-02 23:10:55.072 [WARN ] [rm.AbstractFileTransformationService] - Could not transform 'SW 1 121 255 1
' with the file 'kitchen.map' : Target value not found in map for 'SW 1 121 255 1
'
2018-10-02 23:10:55.073 [WARN ] [rm.AbstractFileTransformationService] - Could not transform 'SW 1 121 255 1
' with the file 'kitchen.map' : Target value not found in map for 'SW 1 121 255 1
'
2018-10-02 23:10:55.073 [WARN ] [rm.AbstractFileTransformationService] - Could not transform 'SW 1 121 255 1
' with the file 'dn_room.map' : Target value not found in map for 'SW 1 121 255 1
'
2018-10-02 23:10:55.074 [WARN ] [rm.AbstractFileTransformationService] - Could not transform 'SW 1 121 255 1
' with the file 'dn_room.map' : Target value not found in map for 'SW 1 121 255 1
'
2018-10-02 23:10:55.074 [WARN ] [rm.AbstractFileTransformationService] - Could not transform 'SW 1 121 255 1
' with the file 'stairs.map' : Target value not found in map for 'SW 1 121 255 1
'
2018-10-02 23:10:55.075 [WARN ] [rm.AbstractFileTransformationService] - Could not transform 'SW 1 121 255 1
' with the file 'stairs.map' : Target value not found in map for 'SW 1 121 255 1
'
2018-10-02 23:10:55.075 [WARN ] [rm.AbstractFileTransformationService] - Could not transform 'SW 1 121 255 1
' with the file 'k_bar.map' : Target value not found in map for 'SW 1 121 255 1
'
2018-10-02 23:10:55.075 [WARN ] [rm.AbstractFileTransformationService] - Could not transform 'SW 1 121 255 1
' with the file 'k_bar.map' : Target value not found in map for 'SW 1 121 255 1
'
2018-10-02 23:10:55.076 [WARN ] [rm.AbstractFileTransformationService] - Could not transform 'SW 1 121 255 1
' with the file 'lv_room.map' : Target value not found in map for 'SW 1 121 255 1
'
2018-10-02 23:10:55.076 [WARN ] [rm.AbstractFileTransformationService] - Could not transform 'SW 1 121 255 1
' with the file 'lv_room.map' : Target value not found in map for 'SW 1 121 255 1
'
2018-10-02 23:10:55.077 [WARN ] [rm.AbstractFileTransformationService] - Could not transform 'SW 1 121 255 1
' with the file '90.map' : Target value not found in map for 'SW 1 121 255 1
'
2018-10-02 23:10:55.077 [WARN ] [rm.AbstractFileTransformationService] - Could not transform 'SW 1 121 255 1
' with the file '90.map' : Target value not found in map for 'SW 1 121 255 1
'
2018-10-02 23:10:55.078 [WARN ] [rm.AbstractFileTransformationService] - Could not transform 'SW 1 121 255 1
' with the file 'cfan.map' : Target value not found in map for 'SW 1 121 255 1
'
2018-10-02 23:10:55.078 [WARN ] [rm.AbstractFileTransformationService] - Could not transform 'SW 1 121 255 1
' with the file 'cfan.map' : Target value not found in map for 'SW 1 121 255 1
'
2018-10-02 23:10:55.079 [WARN ] [rm.AbstractFileTransformationService] - Could not transform 'SW 1 121 255 1
' with the file 'off.map' : Target value not found in map for 'SW 1 121 255 1
'
2018-10-02 23:10:55.079 [WARN ] [rm.AbstractFileTransformationService] - Could not transform 'SW 1 121 255 1
' with the file 'off.map' : Target value not found in map for 'SW 1 121 255 1
'

The desired outcome is to prevent all of this extra detail in the logs…so what is the best practice in this situation. Should I write up a transform file for every switch in the house so I’m covered or is there a better way to address this??

First let’s try to get rid on the error
What is the inbound TCP item?
Can you post the map file?
What is SW 1 121 255 1?

It’s not really an error…this is the crux of the issue I outlined above.

That’s a physical button press from one of the 35 or so other Vantage switches that’s not currently included with OH.

From what I can tell, the TCP binding listens to and processes everything once the connection has been made at startup.

So the question is, do I create a map file that has all of the remaining switch id’s in it to prevent this from happening or is there a better way to prevent this?

Thanks,

Squid

I would go with the map file
You can also filter the log

Vincent has the same things I would suggest. But I do have a question.

At least for the Item you show, why do you need a MAP at all?

Couldn’t you just use

{tcp=">[*:10.x.x.x:3040:VSW!1 98 2 6\r"]}

I don’t know if you can use * in the command field like you can for most of the other similar bindings. But since the String you send is the same no matter what the command you don’t really even need the map.

But your example Item only has outgoing configs. What do you have for incoming that is trying to match these messages with a map? How does that work? Is the MAP needed at all?

Well I took a look at all of the items I have that use the TCP binding and i have nothing “listening” for incoming information. I think the lighting controller that I connect to via TCP broadcasts out every time a physical button is pressed. I would assume this is so you could update the state of a home automation system. I know at one time I had looked at implementing dummy items that could be updated so I could match state no matter how the light/item was turned on or off. It would be nice if OH matched the state of the lights in the house all of the time.

I never knew I could include the command like that…I thought I had to use the map file. I will have to try that out.

Well it doesn’t seem to like the TCP items without the transformation file…I get a NPE whether I use the asterisk or seperate on and off statements.

2018-10-04 23:49:30.817 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'lights.items'
2018-10-04 23:49:30.821 [ERROR] [el.item.internal.GenericItemProvider] - Binding configuration of type 'tcp' of item 'Hallway2' could not be parsed correctly.
org.eclipse.smarthome.model.item.BindingConfigParseException: bindingConfig '>[ON:10.5.1.6:3040:VSW!1 90 1 6],>[OFF:10.5.1.6:3040:VSW!1 90 1 6]' doesn't contain a valid binding configuration

You might need to escape the spaces and possibly the ! as well using a .

The docs clearly state this should be possible. But the spaces might be giving the parser some problems.