Habpanel Wind direction format

transform
habpanel
Tags: #<Tag:0x00007fd310571198> #<Tag:0x00007fd310570978>

(E. Gerland) #1

All,

I am running openhabian 1.4 with habpanel in a german environment.
The wind direction of wunderground is stored in my mariaDB persistence as E, NE, SSW, etc.
In my German Habpanel GUI i get Ost, Nord-Ost, … so no abbreviation.
my habpanel widget looks like:

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

(Yannick Schaus) #2

Not completely sure what your question is, but check

  • itemState(itemname, [ignoreTransform]): retrieves the state of an item by its name;
    ignoreTransform (optional, false by default) will return the raw state (e.g. ‘CLOSED’) instead of the transformed state (‘zu’);

You might want to set ignoreTransform to true.


(E. Gerland) #3

Thanks Yannick,
I didn’t actually know about the ignore option and will try it out.