Forums : HTTP regular expression for float value?
This page last changed on Jun 09, 2014 by mjm.
I'm pretty new to OpenRemote and could use some help with finding the proper regexp to use to extract a float value and show it as a sensor value. I've hit a wall with this.
The sensor in question is an Aeon Labs Multisensor. I want to read out the temperature value. The Z-Wave controller is a Razberry on a Raspberry. I've activated the Openremote helper functions. Everything works fine if the value returned is an integer (say 26). But if the value is a float (say 26.2) the UI shows "N/A".
I thought this might be solved by a regexp:
This regexp matches both the integer and float variants (test with http://java-regex-tester.appspot.com). But whatever I do, the float value is not parsed.
For those interested: the calls to the Z-wave controller are http calls (like: http://servername:8083/ZAutomation/OpenRemote/TemperatureLevel/4). These calls return a plain value, no quotes, text whatever (say: 26.2).
I even tried JSONPath instead (I used $ for the root element). No luck.
|Document generated by Confluence on Jun 05, 2016 09:37|