[SOLVED] Newbee: My mapping does not work


(MrBurns) #1

Hi,

today I wanted to use mapping for the first time, but could not succeed :-(.

What I did:

  1. Created a TestSwitch item in file “test.items”:
Switch TestSwitch "Test"
  1. Created a mapping file “test.map” in transform folder:
TestSwitch=MySwitchMapped
  1. Added a rule in “test.rules”:
rule Test
when Item TestSwitch changed
then
  logInfo("test.rules", transform("MAP", "test.map", item.name.toString))
end

But if I activate the switch in Basic UI the log always shows

2019-01-12 14:31:50.110 [INFO ] [se.smarthome.model.script.test.rules] - TestSwitch

The text ‘TestSwitch’ never gets mapped to ‘MySwitchMapped

Even if I use:

logInfo("test.rules", transform("MAP", "test.map", "TestSwitch"))

I don’t get the mapped text.

Do I have to activate the mapping anywhere in OpenHAB Paper UI?
What I am missing please?

Thanks…


(Rolf Vermeer) #2

You have to install the Map transformation in Paper UI via Add-ons :arrow_forward: Transformations :arrow_forward: Map Transformation


(Vincent Regaud) #3

Please use code fences in the forum, thanks


(MrBurns) #4

Hi RolfV,

thanks that is the solution :slight_smile:

I wonder why this is not mentioned here:

https://www.openhab.org/docs/configuration/transformations.html


(MrBurns) #5

@vzorglub: sorry - I did now :slight_smile:


(Vincent Regaud) #6

Added to docs.
Thanks


(MrBurns) #7

@vzorglub: Great! :+1: