Problems with Map Translation

Hi there,

my logs show following warning, and what ever I insert in my map files OH4 ignores it.

==> /var/log/openhab/openhab.log <==
2023-12-31 19:14:01.785 [WARN ] [rest.core.item.EnrichedItemDTOMapper] - Failed transforming the state 'CAPRICORN' on item 'Astro_Sternzeichen' with pattern 'MAP(zodiac.map):%s': Couldn't transform value because transformation service of type 'MAP' is not available.
2023-12-31 19:14:01.830 [WARN ] [rest.core.item.EnrichedItemDTOMapper] - Failed transforming the state 'NIGHT' on item 'Astro_Sonnenphase_Name' with pattern 'MAP(astro.map):%s': Couldn't transform value because transformation service of type 'MAP' is not available.
2023-12-31 19:14:01.860 [WARN ] [rest.core.item.EnrichedItemDTOMapper] - Failed transforming the state 'WINTER' on item 'Astro_Jahreszeit_Name' with pattern 'MAP(season.map):%s': Couldn't transform value because transformation service of type 'MAP' is not available.
2023-12-31 19:14:01.929 [WARN ] [rest.core.item.EnrichedItemDTOMapper] - Failed transforming the state 'SPRING' on item 'Astro_Jahreszeit_Next' with pattern 'MAP(season.map):%s': Couldn't transform value because transformation service of type 'MAP' is not available.
2023-12-31 19:14:01.995 [WARN ] [rest.core.item.EnrichedItemDTOMapper] - Failed transforming the state 'WANING_GIBBOUS' on item 'Astro_Mondphase_Name' with pattern 'MAP(astro.map):%s': Couldn't transform value because transformation service of type 'MAP' is not available.

What does it mean

service of type 'MAP' is not available.

Where is the error??

thx, in advance
Bernd

Seems you did not install MAP Transformation Service.

1 Like

And where have I to do this?

How about typing map transformation into the search tab of Add-on Store (where you are normally searching for bindings and installing from).

1 Like

Someone should have told me that the menu is at the bottom. There is also the search, which I don’t need anymore, because I also find add-ons apart from “bindings” here… oh man…

Thx anyway!

Is there something else, i need to do?
I installed the “Map Transformation” Add-On… and now?

still no effect!?

Please post your item config which makes use of this map transformation service

// * ---------- ASTRO ---------- *//
//
Group 		gSENSORS									"GRP SENSOREN"


Group 		gASTRO										"GRP ASTRO"
Group		gSUN										"GRP SONNE"													(gASTRO)
Group		gMOON										"GRP MOND"														(gASTRO)

String		Astro_Sternzeichen					"Astro Sternzeichen [MAP(zodiac.map):%s]"								(gASTRO)	{channel="astro:sun:K28:zodiac#sign"}

String		Astro_Jahreszeit_Name				"Astro Jahreszeit-aktuell [MAP(season.map):%s]"							(gASTRO)	{channel="astro:sun:K28:season#name"}
String		Astro_Jahreszeit_Next				"Astro Jahreszeit-nächste [MAP(season.map):%s]"							(gASTRO)	{channel="astro:sun:K28:season#nextName"}

DateTime	Astro_Jahreszeit_Fruehjahr			"Astro Jahreszeit Beginn FrĂĽhling [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"		(gASTRO)	{channel="astro:sun:K28:season#spring"}
DateTime	Astro_Jahreszeit_Sommer				"Astro Jahreszeit Beginn Sommer [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"		(gASTRO)	{channel="astro:sun:K28:season#summer"}
DateTime	Astro_Jahreszeit_Herbst				"Astro Jahreszeit Beginn Herbst [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"		(gASTRO)	{channel="astro:sun:K28:season#autumn"}
DateTime	Astro_Jahreszeit_Winter				"Astro Jahreszeit Beginn Winter [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"		(gASTRO)	{channel="astro:sun:K28:season#winter"}

String		Astro_Mondphase_Name				"Astro Mondphase [MAP(astro.map):%s]"									(gMOON)		{channel="astro:moon:K28:phase#name"}
DateTime	Astro_Mondfinsternis_Total			"Astro Mondfinsternis total [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"			(gMOON)		{channel="astro:moon:K28:eclipse#total"}
DateTime	Astro_Mondfinsternis_Part			"Astro Mondfinsternis partiell[%1$td.%1$tm.%1$tY %1$tH:%1$tM]" 			(gMOON)		{channel="astro:moon:K28:eclipse#partial"}

String		Astro_Sonnenphase_Name				"Astro Sonnenphase [MAP(astro.map):%s]"									(gSUN)		{channel="astro:sun:K28:phase#name"}
DateTime	Astro_Sonnenfinsternis_Total		"Astro Sonnenfinsternis total[%1$td.%1$tm.%1$tY %1$tH:%1$tM]"			(gSUN)		{channel="astro:sun:K28:eclipse#total"}
DateTime	Astro_Sonnenfinsternis_Part			"Astro Sonnenfinsternis partiell[%1$td.%1$tm.%1$tY %1$tH:%1$tM]"		(gSUN)		{channel="astro:sun:K28:eclipse#partial"}

Did you restart openHAB ?
Still seeing the error in the logs ?

Not sure about textual, but using the UI it is MAP:xxxxxx.map?

This syntax works for sitemaps and does not work for MainUI (I might be mistaken though).
For MainUI pages/widgets you need to add a map profile

String Astro_Sternzeichen { channel="astro:sun:K28:zodiac#sign"[profile="transform:MAP", function="zodiac.map"]}

Also make sure that permissions of .map files are properly set. There is a „fix permission“ menu in openhabian-config.

1 Like

There are at least three (four) different options to use a transformation:

  1. Channel. This will affect the data which is transferred towards Item or Device (depends on where the transformation takes place). Channel type has to match the incoming transformation, i.e. if transforming a number to a string, the channel has to be of type string.
  2. Link (or profile). This will affect the data transferred towards Item or Channel (at least for scripts there is in and out). Item type has to match the incoming transformation, Channel type has to match the outgoing transformation.
  3. Display state. This will only affect the displayed data, but not the state of an Item. Setup the state description pattern for Main UI and Basic UI, or simply manipulate the label for sitemap only.
  4. within rules. this will only affect the target of a transformation in the rule, obviously.
Type string : myChannel "My channel" [ transformationPattern"MAP:mymapping.map" ]
                                       ^ ^ ^ ^ 1 transform inbound data ^ ^ ^ ^
String myItem "My Label [MAP(mymapping.map)]:%s" {channel="..."[profile="transform:MAP", function="mymapping.map"], stateDescription=""[pattern="MAP(mymapping.map):%s"]}
                        ^ ^ 3b sitemap only ^ ^                ^ ^ ^ ^  2 transform inbound data via map  ^ ^ ^ ^  |  ^ ^ ^ 3a display transformation for Main UI ^ ^ ^

Please do not set 3a and 3b at the same time, this may lead to unwanted effects.

Aaaand the Map transformation is case sensitive :slight_smile: so Capricorn is not the same as CAPRICORN.
Missed that detail, sorry…

Not 100% sure about state Description pattern, will have to check this detail later…

1 Like

Hi Udo,
That helps and was the solution!
Thx