HABPanel in german using Map Transformation

Hi Guys,
i know HABPanel is not localized yet, but is there a chance to do this already manually?
I am using the Homematic binding and my window sensor is shown as closed, open, tilted.
So i want to see this as “geschlossen”, “geöffnet”, “gekippt”.
I have configured the Things and Items and HABPanel all via UI and not via config files.

Is this possible somehow?

Thanks
Andreas

Hi Andreas,

you can make it with the “Map transformation service”

in the folder Transformation is a file with the name "de.map"
In this file then:

closed=geschlossen
open=geöffnet
tilted=gekippt

In the item folder:

String FensterKüche "Status: [MAP(de.map):%s]"

Now the item FensterKüche has the german language…

Hi Andy,

thank you very much. This has worked perfectly.
I have documented my steps in a quick tutorial and attach it here.

Thanks
Andreas

EDIT: New pdf follows in next post

1 Like

I’m glad that it worked.
I just forgot to write, that you have to install the map transformation in the Paper UI.

Hey Andreas, thanks for sharing the tutorial! :slight_smile:

P.S. Which Widget did u use?! I can’t find a widget which displays the status. :frowning:

Localize HABPanel.pdf (490.5 KB)
I have updated the tutorial. I is a standard dummy widget :slight_smile:

1 Like

Andy, i guess i need your help again.
And i think i have not got it 100%.
I try to translate a switch (ON/OFF), but
String HMTerrasseLampeTR_1_State “Status: [MAP(de.map):%s]” did not work at all.
I tried it with Switch HMTerrasseLampeTR_1_State “Status: [MAP(de.map):%s]”.
This worked better, but the button flics between english and german and also the icon.
So it can happen that the switch is off but the icon is “glowing” as it does when the switch is on.
Can you guide me how to translate a switch created via paper ui so it’s fully working please?

Thanks

Hello Andy,
sorry for the late reply…

I have made this with a rule and it works:

rule "Status Licht Küche"
when
	Item LiKuecheOben received update
then
	if (LiKuecheOben.state == ON)
	{
		LiKuecheOben_State.postUpdate("ON")
	}
	else if (LiKuecheOben.state == OFF)
	{	
		LiKuecheOben_State.postUpdate("OFF")
	}
end

Ah ok, now I understand it. In Habpanel stands with me also ON and OFF,
but I use the function “Hide ON / OFF” because one sees the status of the switch.
In PaperUI it works with the translation.

Hallo Andy,
ich glaube wir können in ner PM auf deutsch ausweichen :slight_smile:
Hmm wenn ich also richtig verstehe, dann klappt die Übersetzung im HAPPanel bei Dir auch nicht.
Im offiziellen Wiki wird auch nur ein Beispiel für einen Fenstersensor gezeit, wie ich mittlerweile gefunden habe.
In der KNX sektion habe ich ein Beispiel für ein Switch mapping gefunden, aber das hat nicht funktioniert. Ich hab mir beim testen sogar den openhab service abgeschissen :(. Im GIT repository habe ich keinen passenden Bugeintrag gefunden. Oder hast Du mal was gefunden welche Widgets übersetzbar via map sein sollen?

Gruß
Andreas

Hallo Andreas,
deutsch gefällt mir besser… Hoffe mein Englisch war nicht zu schlecht :joy:
Ist dann aber leider nicht für alle ersichtlich.

Im HABPanel habe ich es auch noch nicht geschafft das Mapping anzuwenden.
Wenn ich es in deutsch haben will, habe ich mir bisher ein eigenes Widget gemacht, z.B. mein Wetter Forecast.

Einen Switch kann man auch selber schreiben, aber hatte ich bis jetzt noch nicht im Fokus.

Im BasicUI funktioniert das mapping einwandfrei, gefällt mir aber nicht aufm Tablet.

Habe noch kein übersetzbares Widget gefunden.

Wenn ich es überhaupt hier schreiben darf, bin ich eh noch hin und her gerissen zwischen Node-Red und OpenHAB :confounded:

Sorry guys, if you want to use German, switch to PM, otherwise use English as this is an international forum.

sorry hans-jörg. we will do so.

Ok, i give up.
I tried to use the official doc stuff:
http://docs.openhab.org/configuration/items.html#transforming


http://docs.openhab.org/configuration/sitemaps.html#element-type-text

But i don’t get it :frowning:

So first a basic question: Is HAPPanel supporting all these MAP and Transforming stuff or is only the BasicUI supporting it?

If HAPPanel supports it 100%, i got the Window Rotary Handle Status translated, but nothing else.

So this leads to my second basic question: Is a MAPping and Transformation working based on widgets, means a transformation “translates” a dummy widget, no matter what it shows

OR is the trasnformation “looking” into for example a dummy widget and sees if this is a status of a “switch” or a device status, for example if the battery of one of my actors reached it’s life.

Would be very nice if we can get here a few options and opinions and then get a good tutorial done to cover this translation section fully.

Thanks for any help
Andreas

For now displaying the transformed value in HABPanel is not supported, but I’ll try to come up with a workaround.

As a workaround I added another String Item and update it by a rule.
See my Weather example:

rule "Condition Changed"
when
	Item Weather_Condition2 changed
then
	Weather_Condition_Text.postUpdate(transform("MAP", "weather_de.map", Weather_Formatted_Condition2.state.toString()));
end

Perhaps not the best way to do it but it works for now.

Hi, transformed states will be considered by default from now on (next snapshot).
See:

Cheers

1 Like

Hi Yannick,

am I right, that the transform should be working in the recently released OH 2.1?
I have some transformations like
String BerlingState "Status [MAP(neato.map):%s]"
But I still get the unnmapped state.

My widget looks like this:
Do I need to adjust something I might have missed?

<button class="btn" style="width: 100%; height: 100%; padding: 0; background: inherit; outline: none">
<span>
<widget-icon iconset="'freepik-household'" icon="'vacuum-cleaner'" size="32" state="itemValue('Online_St')" />
</span>
<span style="color: #4CC417; font-size: 10pt; text-align:center">{{itemValue('BerlingState')}}<small style="font-size:8pt"></small></span>
</button>

The itemState (formerly itemValue) function in templates also now returns the transformed state by default, unless you set the new second parameter to true i.e. itemState(‘Item_With_Map’, true). Use the raw state in conditions like ng-if without the transformation if possible.

1 Like

@NCO open a browser to http://youropenhab:8080/rest/items/BerlingState

It should show a transformedState with your mapped value, and this will be used by HABPanel by default (as indicated by @sihui’s post above). If you don’t see a transformedState check your items config.

Thanks @ysc & @sihui
I will check it out