[SOLVED] Transform map issue

Hi everyone,
i run into a problem and do not know how to solve it.
What i have:

item
String BoilerStatus_str "Test [MAP(Boiler_Status.map):%s]" <fire>

sitemap
Text item=BoilerStatus_str

Transform file
500_9=Temp not Rising
500_80=Stand By
500_2=Working

ui
ui

What am i doing wrong? i Have other map and scale files that are working.

For me it seems, as if the transform-file is not identified. I’m wondering why all the letters within the description are uppercase.

Are your map.file in the right folder (transform) and in the correct format (utf8) ?

I don’t know if it is correct or important, but my map-file-names are all stored in lower-case-names.

1 Like

Hi thanks for the reply. It is in utf8 and in the transform folder as i have a lot of other files in there.
I tried also lowercase and no underscore but with the same results.

John,
just made a test with your setup. On my machine everythings works as you can see here:

So I think it’s the folder and/or the format of your .map-file.

Cheers,
Peter

Edit: Have you installed the “MAP-Transformation Service” ?

@johnym30 have you tried restarting OH since creating the new MAP file? Maybe even clean the cache and reboot if a simple restart doesn’t fix it.

Now all of a sudden after a restart i get
' with the file 'boiler.map' : Target value not found in map for '500_80 transform '500_80

This may be due to how OH and all files are loaded after a restart. Does this continue to appear in the log or eventually go away?

I haven’t seen it since


:+1:

As mentioned, when OH restarts there is no set way everything gets loaded and you will usually see a few errors until everything gets settled in.

If the transformation is working you can call this one solved by clicking the square box on the post that provided the solution


I get this error now every time i try to refresh my ui
16:05:41.404 [WARN ] [orm.AbstractFileTransformationService] - Could not transform ‘-’ with the file ‘boiler.map’ : Target value not found in map for ‘-’

Do you have a typo - instead of _ in the file? If not then I recommend cleaning the cache there may be some other error floating around in the cache.

sudo systemctl stop openhab2

sudo openhab-cli clean-cache

sudo systemctl start openhab2 or sudo reboot

That’s normal if your string Item has a state like NULL. Add a line to your map for -=Uninitialized or similar.

I give up!!! I have so many tranform files that are workin (map and scale). i dont know what to do.
Is there any other way to do that? I mean i have the info from my boiler and know what each code mean (500_80, 500_9 etc) how can i make those codes appear in openhab as descriptonns???

Don’t give up. Just do what Rossko said and insert a line in your map, like this:

500_9=Temp not Rising
500_80=Stand By
500_2=Working
-=undefined
NULL=NULL

or expand one of your working maps and include your lines there (you have to look that they are unique)

I included the lines you provide to an already working map (for in the one i created i get the same error) and now it always show “undefined” but when
Item ‘BoilerStatus_str’ received command 500_80
nothing changes
Maybe something to do with the underscore???

Did you wrote that in one line ?

If yes; it’s not correct. Just one line for every translation.

Underscore in the Items-Definition is ok.

I wrote them in different lines as all of my other map files. I understand that the underscore it’s ok in the items name but what about in the map file?

I suspect your Item state is not what you expect. What do you see in events.log when you send your Item this command 500_80 ? Commands are not states.

You are right. It says item received command 500_80. So how can interpet the codes and appear them as text in openhab?

As Rossko said there seems to be some irritations.
The item String BoilerStatus_str which you described above has no channel to receive a state, as far as I can see.

Is there a Rule which updates the state ? Or are you talking about two different Items ?

So what you can do to test your item and the corresponding map is:

Login to the shell (via Putty) and then go to the karaf-console. Then enter the following command:

smarthome:send  BoilerStatus_str 500_9

This will change the items state and the result will look like in my screenshot (basic ui) above.

[17:30:38] openhabian@openHABPi:~$ openhab-cli console

Logging in as openhab
Password:

                          __  _____    ____
  ____  ____  ___  ____  / / / /   |  / __ )
 / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __  |
/ /_/ / /_/ /  __/ / / / __  / ___ |/ /_/ /
\____/ .___/\___/_/ /_/_/ /_/_/  |_/_____/
    /_/                        2.5.0.M5
                               Milestone Build

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown openHAB.

openhab> smarthome:send BoilerStatus_str 500_9
Command has been sent successfully.
openhab>