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

Hi folks,

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

eg:

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

thanks
Andrea

Unfortunately not that I’m aware of.

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

1 Like

any suggestion how to do that?

Sorry, first time for me :slight_smile:

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

Here you are:

I hope this is clear enough :slight_smile:

thanks for your help

Andrea

1 Like

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

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
2 Likes

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

3 Likes

thank you for good news :slight_smile:

Andrea

Sorry @glhopital,

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

thanks
Andrea

Should be on the latest snapshot
Let me test
5 minutes

Yep, it works:

New MAP transform docs:

3 Likes

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

=""

that’s it :slight_smile:
Andrea

Yep, should work
Great contribution, thanks

1 Like

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?
eg.

item = 3

map file:

1= value
2= value
= default_value

being 3, I will see the default_value, correct?

Andrea

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

1 Like

that will simplify a lot my map files :slight_smile:

Thanks guys for your help

Andrea

1 Like

How would this Work in OH3 with the State-description? Or would I need a map as this does not work with State-description?

Well, everything in the above thread is about the Map transform. So if you want to do this you would use the Map transform in your State Description Pattern field.