[SOLVED] MAP file ... how to map "any other value"

(Andrea Riela) #1

Hi folks,

is there a way to match in a .map file “any other value”?


1= string A
2= string B
*= “”


(Rich Koshak) #2

Unfortunately not that I’m aware of.

(Gaël L'hopital) #3

But this is and excellent candidate to open an issue in eclipse / smart home github repo !

(Andrea Riela) #4

any suggestion how to do that?

Sorry, first time for me :slight_smile:

(Vincent Regaud) #5

Go to: (I believe it’s the correct repository)

open an issue can the tile should be:

[FEATURE REQUEST] [MAP] Map transformation “Any tother value”

Is the body, describe what you would like to be implemented

(Andrea Riela) #6

Here you are:

I hope this is clear enough :slight_smile:

thanks for your help


(Gaël L'hopital) #7

Aargh, too late. It’s not the good repository. The right one should be this one :
Eclipse smarthome

(Gaël L'hopital) #8

At least you’ve got an option that is to use Scale transform if your input data are numbers. Scale transformation has a catchall option :

[1..2[=String A
[2..3[=String B
[..]=any other

(Gaël L'hopital) #9

Good news, the PR for a default value in MAP transformation has been approved and merged.
PR 6834

(Andrea Riela) #10

thank you for good news :slight_smile:


(Andrea Riela) #11

Sorry @glhopital,

where can I find when the PR will be implemented (OH build)?


(Vincent Regaud) #12

Should be on the latest snapshot
Let me test
5 minutes

(Vincent Regaud) #13

Yep, it works:

New MAP transform docs:

(Andrea Riela) #14

WOW :slight_smile:
so in my example above I can add at the end


that’s it :slight_smile:

(Vincent Regaud) #15

Yep, should work
Great contribution, thanks

(Andrea Riela) #16

stupid question, but …

if also my item has a value NULL, but in my map file I don’t have specific map NULL="", that means the last “default” rule will cover also this piece?

item = 3

map file:

1= value
2= value
= default_value

being 3, I will see the default_value, correct?


(Vincent Regaud) #17

It should do
I haven’t tested that…
… … … … … … …
Yes it works

(Andrea Riela) #18

that will simplify a lot my map files :slight_smile:

Thanks guys for your help