Replace in Item Value

Hello I have a new washerdryer wich gives me Output that needs formatting.
For examle the temperature ist not 40° C it is “LaundryCare.Washer.EnumType.Temperature.GC40”
How do I coud replace the “LaundryCare.Washer.EnumType.Temperature.GC” so that only “40” appears?

items-file:


String                  BoschWaschtrockner_Temperature                      "Temperature"               {channel="homeconnect:WasherDryer:HomeConnect_CK:BOSCH-WD:laundry_care_washer_temperature"}       // This status describes the temperature of the washing program of the home appliance

Maybe have a look at regex transformations

I tried to google it but I could not find any working syntax to find any sample to stripe a string with the formater.

in a rule I could define a variable and manipulate it:
var String TEMP= BoschWaschtrockner_Temperature.state.toString
TEMP =TEMP.replace(“SomeThing”,“SomeThingOther”)

But this do not work in a items file

Have a look here into the docs. There is also an example on how to apply regex as a profile

1 Like