[OH3] HTTP Binding , how to XPATH directly a number value

Hi guys,

I’m migrating to 3.0 and want to do my thing with the Web Interfaced wherever possible.

Till now I get it working if I create the channels as string types

If I try to use a number var type I get a type conversion error, even the XPATH result are always digits, expect the NaN case.

Is there a possibility to convert directly into a number ?

my steps yet:
.
STEPS:

  1. Add HTTP Thing, → Base Url: http://192.168.178.205/measurements.xml
  2. Add a Channel → Type: String; State Transformation: XPATH(number(//Measurements/Measurement[@Type=‘AC_Voltage’]/@Value))

if the Channel is defined as numer:

2021-02-04 22:27:34.508 [WARN ] [.profiles.XPathTransformationProfile] - Could not transform state ‘UNDEF’ with function ‘(number(//Measurements/Measurement[@Type=‘AC_Voltage’]/@Value))’ and format ‘%.1f’

Can you share the XML that this applies to?

see filemeasurements.xml (1.0 KB)

any idea?

It’s the profile feature that is currently broken, See your other thread

This forum had a hiccup, and some replies were lost.