Hi Guys,
going crazy again over transforming values in a rule… Need additional Eyes to see my error, please.
I searched tzhe forum over and over, tried many solutions shown here, but none worked for me.
I am trying to format a value from a DateTime item.
in the end i would like to combine 2 Values into one item.
The string item ConditionID2 that is converted through a MAP conversion:
val trans = transform(“MAP”, “weather.map”, Condition_ID2.state.toString) Condition_ID2formatted.postUpdate(trans)
This works like a charm and gives me the term “Bedeckt” which shows perfect in the Basic UI.
The second item is the DateTime item LastUpdate which shows perfectly when displayed with the format options shown here:
DateTime LastUpdate “Last update [%1$td.%1$tm.%1$tY %1$tH:%1$tM]” {weather=“locationId=roedermark, type=condition, property=lastUpdate”}
When i insert this item to display in the Basic UI it shows perfectly formatted:
Text item=LastUpdate shows " 24.11.2019 15:34"
How can i format the DateTime item LastUpdate in a rule to display it in the format shown above?
This is the output string i have in my rule:
Wetter1OutputString.postUpdate(Condition_ID2formatted.state + " (" + LastUpdate.state.toString + “)”)
Condition_ID2formatted.state is allready converted and displays the right value. LastUpdate is in “raw” format as a DateTime item.
Bedeckt (2019-11-24T15:34:37.136+…)
I tried a lot of stuff, but none worked. Please spare a peek and point me in the right direction how to format the LastUpdate item in the rule like it does when displayed directly with formatting in BasicUI.
Cheers