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:

Hi - I have an addition issue so rather than creating a new thread I thought I would raise it here.

I took the solution above and use the excellent NRCHKB Homekit Nodes to create thermostats visible in Homekit. I take the array address and convert it into the value for homekit but I cannot seem to get the value displayed correctly or I get the wrong value from an adjacent location in the array. I know the homekit side works correctly as I use the inject flows which work correctly so the issue seems to be with the change node.

Also the entire array is fed to the Homekit node which pops up on the debug screen suggesting I use the data for homekit values.

Flow is below:-

[{"id":"9e2c5b1645baf0f0","type":"http request","z":"47ba1a0f00220633","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://192.168.1.230/quickview.htm","tls":"","persist":false,"proxy":"","authType":"basic","senderr":false,"x":610,"y":400,"wires":[["3f91382f.17e918"]]},{"id":"07b3ed46b4355073","type":"inject","z":"47ba1a0f00220633","d":true,"name":"Ten Second polling","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"30","crontab":"","once":true,"onceDelay":"1","topic":"","payload":"","payloadType":"date","x":400,"y":400,"wires":[["9e2c5b1645baf0f0"]]},{"id":"5ff97a88.a2b72c","type":"inject","z":"47ba1a0f00220633","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":400,"y":500,"wires":[["5c7fc6bb.dd1848"]]},{"id":"5c7fc6bb.dd1848","type":"template","z":"47ba1a0f00220633","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=\"201900191603211803211903211603\">\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":600,"y":500,"wires":[["3f91382f.17e918"]]},{"id":"3f91382f.17e918","type":"html","z":"47ba1a0f00220633","name":"","property":"payload","outproperty":"payload","tag":"input[name=quickview]","ret":"attr","as":"single","x":870,"y":400,"wires":[["d68e5b46.28ad3","141629de88486f01"]]},{"id":"d68e5b46.28ad3","type":"function","z":"47ba1a0f00220633","name":"","func":"msg.payload = msg.payload[0].value.match(/.{1,2}/g);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1100,"y":400,"wires":[["c87fe13cf22c30b3","d572efe0f6b1a88c","fde8072ecfaac2aa","19bb0b1b2d9692fd","9204d1d71e9e3aab","c7b0b3f8670f2237","2ac5c9d43a677131","0b825af80cbfa704","6c0457072aff829d","81b5e11a09f44052","3a4daf76245d6dcb","8a7428bad02bc17d"]]},{"id":"706b31661d218647","type":"inject","z":"47ba1a0f00220633","name":"CurrentHeatingCoolingState off","props":[{"p":"payload","v":"{\"CurrentHeatingCoolingState\":0}","vt":"json"},{"p":"topic","v":"","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"CurrentHeatingCoolingState\":0}","payloadType":"json","x":1050,"y":1140,"wires":[["f2db15d046e513cd"]]},{"id":"477f61a7667d05e1","type":"inject","z":"47ba1a0f00220633","name":"CurrentTemperature 10","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"CurrentTemperature\":10}","payloadType":"json","x":1020,"y":840,"wires":[["f2db15d046e513cd"]]},{"id":"f71fa27ce8a18093","type":"inject","z":"47ba1a0f00220633","name":"TargetTemperature 10","props":[{"p":"payload","v":"{\"TargetTemperature\":10}","vt":"json"},{"p":"topic","v":"","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"TargetTemperature\":10}","payloadType":"json","x":1020,"y":980,"wires":[["f2db15d046e513cd"]]},{"id":"33d9bdbb991c7b09","type":"inject","z":"47ba1a0f00220633","name":"CurrentHeatingCoolingState heat","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"CurrentHeatingCoolingState\":1}","payloadType":"json","x":1050,"y":1100,"wires":[["f2db15d046e513cd"]]},{"id":"f3edfe24fd4648d5","type":"inject","z":"47ba1a0f00220633","name":"CurrentTemperature 20","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"CurrentTemperature\":20}","payloadType":"json","x":1020,"y":880,"wires":[["f2db15d046e513cd"]]},{"id":"6b2687d8a54607ee","type":"inject","z":"47ba1a0f00220633","name":"CurrentTemperature 30","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"CurrentTemperature\":30}","payloadType":"json","x":1020,"y":920,"wires":[["f2db15d046e513cd"]]},{"id":"efe725a144d22e45","type":"inject","z":"47ba1a0f00220633","name":"TargetTemperature 30","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"TargetTemperature\":30}","payloadType":"json","x":1020,"y":1060,"wires":[["f2db15d046e513cd"]]},{"id":"f2db15d046e513cd","type":"homekit-service","z":"47ba1a0f00220633","d":true,"isParent":true,"hostType":"0","bridge":"530ed3d.064b6ac","accessoryId":"","parentService":"","name":"Office","serviceName":"Thermostat","topic":"","filter":false,"manufacturer":"Dick's Garage","model":"Default Model","serialNo":"Default Serial Number","firmwareRev":"","hardwareRev":"","softwareRev":"","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigSnapshotOutput":"disabled","cameraConfigInterfaceName":"","characteristicProperties":"{\"TargetHeatingCoolingState\":{\"validValues\":[0,1]},\"CurrentHeatingCoolingState\":{\"validValues\":[0,1]}}","waitForSetupMsg":false,"outputs":2,"x":1470,"y":600,"wires":[[],[]]},{"id":"ccd6f3af24aee4f2","type":"inject","z":"47ba1a0f00220633","name":"TargetTemperature 20","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"TargetTemperature\":20}","payloadType":"json","x":1020,"y":1020,"wires":[["f2db15d046e513cd"]]},{"id":"c87fe13cf22c30b3","type":"change","z":"47ba1a0f00220633","name":"Set payload to HkMsg Temperature","rules":[{"t":"move","p":"payload[0]","pt":"msg","to":"payload.CurrentTemperature","tot":"msg"},{"t":"move","p":"payload[1]","pt":"msg","to":"payload.TargetTemperature","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1060,"y":600,"wires":[["f2db15d046e513cd","839f15baad774adf"]]},{"id":"d572efe0f6b1a88c","type":"switch","z":"47ba1a0f00220633","name":"Office status","property":"payload[2]","propertyType":"msg","rules":[{"t":"eq","v":"00","vt":"str"},{"t":"eq","v":"01","vt":"str"},{"t":"eq","v":"10","vt":"str"},{"t":"eq","v":"11","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":730,"y":620,"wires":[["498500952a6b4b30"],["cbcd317563b9ba05"],["f65df23476921b26"],["163e7372e450ba73"]]},{"id":"498500952a6b4b30","type":"change","z":"47ba1a0f00220633","name":"CH/HW off","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"CurrentHeatingCoolingState\":0}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":660,"wires":[["f2db15d046e513cd"]]},{"id":"f65df23476921b26","type":"change","z":"47ba1a0f00220633","name":"CH on HW off","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"CurrentHeatingCoolingState\":1}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":740,"wires":[["f2db15d046e513cd"]]},{"id":"cbcd317563b9ba05","type":"change","z":"47ba1a0f00220633","name":"CH off HW on","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"CurrentHeatingCoolingState\":0}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":700,"wires":[["f2db15d046e513cd"]]},{"id":"163e7372e450ba73","type":"change","z":"47ba1a0f00220633","name":"CH on HW on","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"CurrentHeatingCoolingState\":1}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":780,"wires":[["f2db15d046e513cd"]]},{"id":"fde8072ecfaac2aa","type":"debug","z":"47ba1a0f00220633","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload[0]","targetType":"msg","statusVal":"","statusType":"auto","x":1840,"y":240,"wires":[]},{"id":"9204d1d71e9e3aab","type":"debug","z":"47ba1a0f00220633","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload[2]","targetType":"msg","statusVal":"","statusType":"auto","x":1840,"y":320,"wires":[]},{"id":"19bb0b1b2d9692fd","type":"debug","z":"47ba1a0f00220633","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload[1]","targetType":"msg","statusVal":"","statusType":"auto","x":1840,"y":280,"wires":[]},{"id":"0b825af80cbfa704","type":"debug","z":"47ba1a0f00220633","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload[5]","targetType":"msg","statusVal":"","statusType":"auto","x":1840,"y":440,"wires":[]},{"id":"81b5e11a09f44052","type":"debug","z":"47ba1a0f00220633","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload[7]","targetType":"msg","statusVal":"","statusType":"auto","x":1840,"y":520,"wires":[]},{"id":"6c0457072aff829d","type":"debug","z":"47ba1a0f00220633","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload[6]","targetType":"msg","statusVal":"","statusType":"auto","x":1840,"y":480,"wires":[]},{"id":"2ac5c9d43a677131","type":"debug","z":"47ba1a0f00220633","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload[4]","targetType":"msg","statusVal":"","statusType":"auto","x":1840,"y":400,"wires":[]},{"id":"c7b0b3f8670f2237","type":"debug","z":"47ba1a0f00220633","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload[3]","targetType":"msg","statusVal":"","statusType":"auto","x":1840,"y":360,"wires":[]},{"id":"94e842136cf1da15","type":"inject","z":"47ba1a0f00220633","name":"CurrentHeatingCoolingState off","props":[{"p":"payload","v":"{\"CurrentHeatingCoolingState\":0}","vt":"json"},{"p":"topic","v":"","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"CurrentHeatingCoolingState\":0}","payloadType":"json","x":1030,"y":1780,"wires":[["dd6dc0b0268b2883"]]},{"id":"59ab12093a52eb34","type":"inject","z":"47ba1a0f00220633","name":"CurrentTemperature 10","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"CurrentTemperature\":10}","payloadType":"json","x":1000,"y":1480,"wires":[["dd6dc0b0268b2883"]]},{"id":"daf393a52f2f6d42","type":"inject","z":"47ba1a0f00220633","name":"TargetTemperature 10","props":[{"p":"payload","v":"{\"TargetTemperature\":10}","vt":"json"},{"p":"topic","v":"","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"TargetTemperature\":10}","payloadType":"json","x":1000,"y":1620,"wires":[["dd6dc0b0268b2883"]]},{"id":"a321a694af8d4877","type":"inject","z":"47ba1a0f00220633","name":"CurrentHeatingCoolingState heat","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"CurrentHeatingCoolingState\":1}","payloadType":"json","x":1030,"y":1740,"wires":[["dd6dc0b0268b2883"]]},{"id":"22849530b6a71a2e","type":"inject","z":"47ba1a0f00220633","name":"CurrentTemperature 20","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"CurrentTemperature\":20}","payloadType":"json","x":1000,"y":1520,"wires":[["dd6dc0b0268b2883"]]},{"id":"feb007b1cbfb5355","type":"inject","z":"47ba1a0f00220633","name":"CurrentTemperature 30","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"CurrentTemperature\":30}","payloadType":"json","x":1000,"y":1560,"wires":[["dd6dc0b0268b2883"]]},{"id":"b5083faa2456726b","type":"inject","z":"47ba1a0f00220633","name":"TargetTemperature 30","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"TargetTemperature\":30}","payloadType":"json","x":1000,"y":1700,"wires":[["dd6dc0b0268b2883"]]},{"id":"dd6dc0b0268b2883","type":"homekit-service","z":"47ba1a0f00220633","d":true,"isParent":true,"hostType":"0","bridge":"530ed3d.064b6ac","accessoryId":"","parentService":"","name":"Lounge","serviceName":"Thermostat","topic":"","filter":false,"manufacturer":"Dick's Garage","model":"Default Model","serialNo":"Default Serial Number","firmwareRev":"","hardwareRev":"","softwareRev":"","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigSnapshotOutput":"disabled","cameraConfigInterfaceName":"","characteristicProperties":"{\"TargetHeatingCoolingState\":{\"validValues\":[0,1]},\"CurrentHeatingCoolingState\":{\"validValues\":[0,1]}}","waitForSetupMsg":false,"outputs":2,"x":1460,"y":1240,"wires":[[],[]]},{"id":"a89e86a0b2ee3f2b","type":"inject","z":"47ba1a0f00220633","name":"TargetTemperature 20","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"TargetTemperature\":20}","payloadType":"json","x":1000,"y":1660,"wires":[["dd6dc0b0268b2883"]]},{"id":"8a7428bad02bc17d","type":"change","z":"47ba1a0f00220633","name":"Set playload to HkMsg Temperature","rules":[{"t":"move","p":"payload[3]","pt":"msg","to":"payload.CurrentTemperature","tot":"msg"},{"t":"move","p":"payload[4]","pt":"msg","to":"payload.TargetTemperature","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":1240,"wires":[["dd6dc0b0268b2883"]]},{"id":"3a4daf76245d6dcb","type":"switch","z":"47ba1a0f00220633","name":"Lounge","property":"payload[5]","propertyType":"msg","rules":[{"t":"eq","v":"00","vt":"str"},{"t":"eq","v":"01","vt":"str"},{"t":"eq","v":"10","vt":"str"},{"t":"eq","v":"11","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":700,"y":1260,"wires":[["fec462f02be3504c"],["0337762b27744b24"],["e7819a604aefe17d"],["21ba47f1c080b63c"]]},{"id":"fec462f02be3504c","type":"change","z":"47ba1a0f00220633","name":"CH/HW off","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"CurrentHeatingCoolingState\":0}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":970,"y":1300,"wires":[["dd6dc0b0268b2883"]]},{"id":"e7819a604aefe17d","type":"change","z":"47ba1a0f00220633","name":"CH on HW off","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"CurrentHeatingCoolingState\":1}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":1380,"wires":[["dd6dc0b0268b2883"]]},{"id":"0337762b27744b24","type":"change","z":"47ba1a0f00220633","name":"CH off HW on","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"CurrentHeatingCoolingState\":0}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":1340,"wires":[["dd6dc0b0268b2883"]]},{"id":"21ba47f1c080b63c","type":"change","z":"47ba1a0f00220633","name":"CH on HW on","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"CurrentHeatingCoolingState\":1}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":1420,"wires":[["dd6dc0b0268b2883"]]},{"id":"839f15baad774adf","type":"debug","z":"47ba1a0f00220633","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1490,"y":660,"wires":[]},{"id":"141629de88486f01","type":"debug","z":"47ba1a0f00220633","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1110,"y":300,"wires":[]},{"id":"530ed3d.064b6ac","type":"homekit-bridge","bridgeName":"Nodered","pinCode":"111-11-111","port":"","allowInsecureRequest":false,"manufacturer":"NRCHKB","model":"1.2.0","serialNo":"Default Serial Number","firmwareRev":"1.2.0","hardwareRev":"1.2.0","softwareRev":"1.2.0","customMdnsConfig":false,"mdnsMulticast":true,"mdnsInterface":"","mdnsPort":"","mdnsIp":"","mdnsTtl":"","mdnsLoopback":true,"mdnsReuseAddr":true,"allowMessagePassthrough":true}]

Any help is greatly appreciated.

Thanks

It is corrupt (the forum does this unless you use the </> code button or surround your code with three backticks (also known as a left quote or backquote ```)

``` 
   code goes here 
```

You can edit and correct your post by clicking the pencil :pencil2: icon.

See this post for more details - How to share code or flow json

Apologies - Hopefully now correct.

Thanks

msg.payload is an array.
you then try to move msg.payload[0] to msg.payload.currentTemperature, which is an object. which then overwrites msg.payload the array, so next move msg.payload[1] the array no longer exists.
Try creating a hold/temp variable of the array, then moving the elements of hold variable to the new payload , at end delete hold/temp variable.

move msg.payload to msg.hold
move hold[0] to msg.payload.currentemp
etc
delete msg.hold

OK thanks - I will give it a try.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.