MAP file for multiple devices

I am in the process of migrating my setup to OpenHAB. I have a lot of devices I talk to via TCP and I finally got the TCP binding working with 1.8.1. I have a lot of binary devices that require ON/OFF transitions. How do I include all of these in a single map file? For example, say I have a TCP device that requires me to send “bedroom_stereo_on/bedroom_stereo_off” to toggle the switch, and another device that requires “living_room_stereo_on/living_room_stereo_off” to toggle another. Could I include these devices in a single map file? If so, how?

It would be nice if the TCP/UDP binding allowed outgoing messages to have replaceable strings like ${itemName} like the MQTT binding does, so you could have a map file

ON=${itemName}_on
OFF=${itemName}_off

making your item name become part of the outgoing message, but such is not present in the TCP/UDP binding. So until such an enhancement exists, you will need separate map files.

1 Like