This page last changed on Jan 22, 2014 by pjmm.

I am using HTTP Protocol to control an Insteon unit and can request the status which I know is working because it appears in the HTTP Log as

INFO 2014-01-22 20:52:12,684 (HTTP): received message: <?xml version="1.0" encoding="ISO-8859-1" ?>
<Xs>
<X D="21A2A9250000"/>
</Xs>

The information I am interested is the last 2 digits which are hexadecimal values from 0 to 255

00 = 0% FF=100% What I need help with is how can I extract this information to use with a
slide or a switch.

I see that HTTP supports Xpath, Regular or JSONPath Expressions can I use any of these
to convert this string?

Can anyone give me an example on how I would use one of the above?

From the top of my head (untested):

([0-9A-F]{2})"/>
Posted by pz1 at Jan 23, 2014 12:59

Hi Pieter

many thanks for your expression I managed to get the following working

(?<=\b21A2A92500)\w+\b

Do you know of any way to convert the output Hex FF to Decimal

Posted by pjmm at Jan 24, 2014 17:58

Afaik RegEx does not do that kind of conversion. You may have to use a rule to do this.

Posted by pz1 at Jan 24, 2014 18:12
Document generated by Confluence on Jun 05, 2016 09:37