[SOLVED] Can I define custom text for the state of a contact

Can I define personalized/custom text for the state of a Contact?

I have made some simple interfaces on ‘dumb’ machines (e.g. a printer) that are basically a contact indicating wether a machine is indeed off or still on.

Now if I define those in my items file as a switch, the statement:
"Printer is [MAP(en.map):%s]"
nicely shows it as OFF or ON, but then I am also presented with a ‘switch’ icon that has no meaning
If I define it as a contact, the statement:
"Printer is [MAP(en.map):%s]"
will not show the useless switch icon anymore, but now the state is shown as “OPEN” or “CLOSED” while I want it to show ‘On’ or ‘off’ (or ON or OFF)

I thought that i could change that with the map by defining a new map file ( that I call “ma.map”) and that is defined as:
CLOSED=on
OPEN=off
NULL=unknown

and then use
"Printer is [MAP(ma.map):%s]"
but alas, that seems to make no difference at all.
Am I on the wrong track here, is there anyway I can make the state of a ‘contact’ appear as ‘On’ or ‘Off’?

First of all, if it is just the icon you don’t want you can set the icon yourself. See:

http://docs.openhab.org/configuration/items.html#icons

I’m not sure what is going on with the map. It seems like it should work. Have you installed the MAP Transformation Addon? Depending on which package you chose the first time when you opened the web UI it may not have been installed.

Are you seeing any errors in the logs?

I highly recommend the Beginner’s Tutorial

Thanks for your reply. Will check if I have that add on installed.
I thought I had
I actually just wanted a state to appear and not any icon that suggested that I could switch teh state as it only monitors ON or OFF and cant set it
I went through beginners manual (or at least trying to :slight_smile:
i’ll try some more. Thanks :slight_smile:

Ah yes, it was the add on. is working perfectly now. Thanks a bundle :slight_smile:

EDIT:
I noticed that apparently it is also essential that the map file redifines in lowercase:
So:
CLOSED=on
OPEN=off
NULL=unknow
will work, but
CLOSED=ON
OPEN=OFF
NULL=unknow

apparently not.
I also noticed that eventhough everything may be working fine in my android app, it might not in the various UI’s, but i do not mind