Obtaining 2 digit values from a string

Hi All

I have created a Node which gets HTML from a Heatmiser controller to give me the output below:-

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta http-equiv="Content-Language" content="en-gb">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate"> 
<script src="hmck.js" language="Javascript"></script>
</head>

<body topmargin=0 leftmargin=0 rightmargin=0 bgcolor=#6E6FB0 style="overflow-x:hidden;overflow-y:auto">
<form name="hidFrm">
	<input type="hidden" name="hmcookies" value="00000000">
<input type="hidden" name="quickview" value="201900191603211803211903211603NCNC22NCNC22NCNC22NCNC22NCNC22221800211703NCNC22201603201703201703201603NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22">
	<input type="hidden" name="statname" value="Office#Sitting room#Kitchen#Utility#Dining#West Bedroom#Kitchen#Utility#Dining#Room 10#Landing#West Bedroom#N/A#Ext Bedroom#Pink bedroom#Becca Bedroom #Becca Study#Room 18#Room 19#Room 20#Room 21#Room 22#Room 23#Room 24#Room 25#Room 26#Room 27#Room ...

The quickview value basically is the collection of 2 digit heat levels for actual and set point together with codes of heating on/off, water on/off - so I am looking for a way of extracting or parsing them to pass into another node or flow.

Does anyone have any suggestions on how to achieve this?

Many thanks

You can use the html node to extract the quickview value.
e.g.

[{"id":"5ff97a88.a2b72c","type":"inject","z":"bf9e1e33.030598","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":90,"y":80,"wires":[["5c7fc6bb.dd1848"]]},{"id":"5c7fc6bb.dd1848","type":"template","z":"bf9e1e33.030598","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=us-ascii\">\n<meta http-equiv=\"Content-Language\" content=\"en-gb\">\n<meta http-equiv=\"Cache-Control\" content=\"no-cache, must-revalidate\"> \n<script src=\"hmck.js\" language=\"Javascript\"></script>\n</head>\n\n<body topmargin=0 leftmargin=0 rightmargin=0 bgcolor=#6E6FB0 style=\"overflow-x:hidden;overflow-y:auto\">\n<form name=\"hidFrm\">\n\t<input type=\"hidden\" name=\"hmcookies\" value=\"00000000\">\n<input type=\"hidden\" name=\"quickview\" value=\"201900191603211803211903211603NCNC22NCNC22NCNC22NCNC22NCNC22221800211703NCNC22201603201703201703201603NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22\">\n\t<input type=\"hidden\" name=\"statname\" value=\"Office#Sitting room#Kitchen#Utility#Dining#West Bedroom#Kitchen#Utility#Dining#Room 10#Landing#West Bedroom#N/A#Ext Bedroom#Pink bedroom#Becca Bedroom #Becca Study#Room 18#Room 19#Room 20#Room 21#Room 22#Room 23#Room 24#Room 25#Room 26#Room 27#Room ...","output":"str","x":270,"y":80,"wires":[["3f91382f.17e918"]]},{"id":"3f91382f.17e918","type":"html","z":"bf9e1e33.030598","name":"","property":"payload","outproperty":"payload","tag":"input[name=quickview]","ret":"attr","as":"single","x":510,"y":100,"wires":[["d68e5b46.28ad3","8930b166.1d817"]]},{"id":"d68e5b46.28ad3","type":"function","z":"bf9e1e33.030598","name":"","func":"msg.payload = msg.payload[0].value.match(/.{1,2}/g);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":140,"wires":[["8930b166.1d817"]]},{"id":"8930b166.1d817","type":"debug","z":"bf9e1e33.030598","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":730,"y":200,"wires":[]}]

output from html node

[{"type":"hidden","name":"quickview","value":"201900191603211803211903211603NCNC22NCNC22NCNC22NCNC22NCNC22221800211703NCNC22201603201703201703201603NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22NCNC22"}]
1 Like

That is brilliant

Many thanks for the quick response :slight_smile: