Hi Deepak,
I found this thread 'cause I'm having exatly the same problem with node-red. I'm trying to write on the HTML page the humidity value from the sensor. It's clearly written on the debug console but on the HTML page all I get is [object Object].
This is my entire flow:
[{"id":"3fb7ef0.e635a12","type":"ibmiot","z":"d6e25523.a73f2","name":"Plant"},{"id":"3e77d543.c1882a","type":"ibmiot in","z":"d6e25523.a73f2","authentication":"quickstart","apiKey":"3fb7ef0.e635a12","inputType":"evt","deviceId":"27d58b2cc038","applicationId":"","deviceType":"+","eventType":"+","commandType":"","format":"json","name":"IBM IoT App In","service":"quickstart","allDevices":false,"allApplications":false,"allDeviceTypes":true,"allEvents":true,"allCommands":false,"allFormats":false,"x":251,"y":291,"wires":[["ae0082ac.51ff8","c0c482df.3f3b8"]]},{"id":"ae0082ac.51ff8","type":"function","z":"d6e25523.a73f2","name":"hum","func":"return {payload:msg.payload.d.humidity};","outputs":"1","noerr":0,"x":408.5,"y":353,"wires":[["ff6ad0d9.00953"]]},{"id":"ff6ad0d9.00953","type":"switch","z":"d6e25523.a73f2","name":"hum thresh","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"40","vt":"str"},{"t":"gt","v":"40","vt":"str"}],"checkall":"true","outputs":2,"x":594.5,"y":339,"wires":[["4eed0b45.1e1224"],["47c4c419.31d51c"]]},{"id":"5dad02b7.a252fc","type":"debug","z":"d6e25523.a73f2","name":"humidity level","active":true,"console":"true","complete":"payload","x":1080.5,"y":231,"wires":[]},{"id":"c0c482df.3f3b8","type":"debug","z":"d6e25523.a73f2","name":"device data","active":true,"console":"true","complete":"true","x":464.5,"y":273,"wires":[]},{"id":"9c34b7fe.066698","type":"http in","z":"d6e25523.a73f2","name":"","url":"/plant","method":"get","swaggerDoc":"","x":865,"y":509.5,"wires":[["5473cb9d.cadb0c"]]},{"id":"27f7302.15f295","type":"http response","z":"d6e25523.a73f2","name":"plant","x":1496,"y":461,"wires":[]},{"id":"f4e062d7.21044","type":"debug","z":"d6e25523.a73f2","name":"","active":true,"console":"false","complete":"payload","x":1525,"y":253,"wires":[]},{"id":"fe4e0b84.abec7","type":"template","z":"d6e25523.a73f2","name":"Page-Template","field":"payload","fieldType":"msg","template":"Hello there <br />\n\nHumidity: {{payload}}<br />","x":1270,"y":408,"wires":[["27f7302.15f295","f4e062d7.21044"]]},{"id":"4eed0b45.1e1224","type":"function","z":"d6e25523.a73f2","name":"ok","func":"\nreturn msg;","outputs":1,"noerr":0,"x":767,"y":266.5,"wires":[["5dad02b7.a252fc","5473cb9d.cadb0c"]]},{"id":"47c4c419.31d51c","type":"function","z":"d6e25523.a73f2","name":"not ok","func":"\nreturn msg;","outputs":1,"noerr":0,"x":765,"y":382.5,"wires":[["5dad02b7.a252fc","5473cb9d.cadb0c"]]},{"id":"5473cb9d.cadb0c","type":"function","z":"d6e25523.a73f2","name":"function","func":"\n//msg.payload = \"Pippo\";\n// with static 'Pippo' works!!\n\nvar mex = {payload : msg.payload};\nnode.warn(mex.payload);\n//return msg;\nreturn msg;","outputs":"1","noerr":0,"x":1056,"y":390.5,"wires":[["fe4e0b84.abec7"]]}]