Hallo Andy,
ich glaube wir können in ner PM auf deutsch ausweichen
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?
Hallo Andreas,
deutsch gefällt mir besser… Hoffe mein Englisch war nicht zu schlecht
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
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.
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.
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?
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.
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.
itemState and itemValue are really supposed to be the same…
Morever, there’s a second parameter to ignore the transformation which is disabled by default. itemState('BerlingState', false) or itemState('BerlingState') should apply the transformation and itemState('BerlingState', true) return the raw value without applying the transformation.
Thanks @ysc
That’s really strange. Your definition above I understood (I guess).
So true as the second argument would return the raw state (not transformed)
Is there anything else which might be wrong in my syntax above?
I am using Habpanel on my iPhone with safari (iOS 10.3.2) and the Habpanel bundle which comes with the OH 2.1 release.
I guess I would blame iOS Safari since there have been several problems with it already.
Can you try the same dashboard in Chrome or Firefox on a computer to definitely blame the browser? It would help pinpointing a potential problem.
Thanks, I did not even think about this option, because I never had problems with Habpanel and safari so far.
I tried it on my computer (Firefox) and it worked right away as you suggested.
Thanks
Now I am going to find a better full screen browser for my phone!
Again, thanks a lot!
Usually I use Habpanel by safari as a link on my homescreen (I assume safari works in the background)
However, this link (as mentioned above) has problems displaying the itemState correctly, but shows my custom icons perfectly (copied into smartphone-set folder in assets and changed the smartphone-set file accordingly)
Running HABpanel directy in safari shows the itemState correctly but not the icons.
Do you have any idea why safari is not able to localize the icons?
I checked some posts and found out that I have done this (pretty long ago):
Clone all from the habpanel web folder from github into html/habpanel (you’ll have app, assets, fonts etc. then in the html/habpanel directory)
I did not remember, that my (old) habpanel placed on my homescreen hadhardcoded the static html liked.
That’s why it did not show the right itemState because I was actually running the old habpanel, not the one coming with OH 2.1.
After cloning the web folder from habpanel into my /etc/openhab2/html/habpanel including the icons I have added to my previous (old) habpanel, everything works as expected.